Merge branch 'master' into medicalAdvanced

This commit is contained in:
Glowbal 2015-04-03 22:42:09 +02:00
commit 244bac8562
36 changed files with 566 additions and 103 deletions

View File

@ -27,7 +27,7 @@ if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
_listedItemClasses = [];
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", localize "STR_ACE_Captives_CancelSelection"] call ACE_Interaction_fnc_prepareSelectMenu;
_actions = [localize "STR_ACE_Captives_FriskMenuHeader", ""] call ACE_Interaction_fnc_prepareSelectMenu;
_allGear = [];

View File

@ -107,4 +107,21 @@ class CfgVehicles {
class TransportItems {};
class TransportBackpacks {};
};
class Item_Base_F;
class ACE_bananaItem: Item_Base_F {
scope = 2;
scopeCurator = 2;
displayName = "$STR_ACE_Common_bananaDisplayName";
author = "$STR_ACE_Common_ACETeam";
vehicleClass = "Items";
class TransportItems
{
class ACE_banana
{
name = "ACE_banana";
count = 1;
};
};
};
};

View File

@ -106,31 +106,60 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
// PFH to raise varios events
[{
if(!isNil "ACE_player" && { !isNull ACE_player }) then {
// "playerInventoryChanged" event
_newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
// Raise ACE event locally
GVAR(OldPlayerInventory) = _newPlayerInventory;
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
};
// "playerInventoryChanged" event
_newPlayerInventory = [ACE_player] call FUNC(getAllGear);
if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then {
// Raise ACE event locally
GVAR(OldPlayerInventory) = _newPlayerInventory;
["playerInventoryChanged", [ACE_player, _newPlayerInventory]] call FUNC(localEvent);
// "playerVisionModeChanged" event
_newPlayerVisionMode = currentVisionMode ACE_player;
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then {
// Raise ACE event locally
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
};
// "inventoryDisplayChanged" event
_newInventoryDisplayIsOpen = !(isNull findDisplay 602);
if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen;
["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent);
};
// "playerVehicleChanged" event
_newPlayerVehicle = vehicle ACE_player;
if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then {
// Raise ACE event locally
GVAR(OldPlayerVehicle) = _newPlayerVehicle;
["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent);
};
// "playerTurretChanged" event
_newPlayerTurret = [ACE_player] call FUNC(getTurretIndex);
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _newPlayerTurret;
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
};
// "playerWeaponChanged" event
_newPlayerWeapon = currentWeapon ACE_player;
if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then {
// Raise ACE event locally
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
};
};
// "playerVisionModeChanged" event
_newPlayerVisionMode = currentVisionMode ACE_player;
if !(_newPlayerVisionMode isEqualTo GVAR(OldPlayerVisionMode)) then {
// Raise ACE event locally
GVAR(OldPlayerVisionMode) = _newPlayerVisionMode;
["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent);
};
// "inventoryDisplayChanged" event
_newInventoryDisplayIsOpen = !(isNull findDisplay 602);
if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen;
["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent);
};
//
// These events can fire on a null player object
//
// "zeusDisplayChanged" event
_newZeusDisplayIsOpen = !(isNull findDisplay 312);
if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
@ -138,7 +167,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
GVAR(OldZeusDisplayIsOpen) = _newZeusDisplayIsOpen;
["zeusDisplayChanged", [ACE_player, _newZeusDisplayIsOpen]] call FUNC(localEvent);
};
// "cameraViewChanged" event
_newCameraView = cameraView;
if !(_newCameraView isEqualTo GVAR(OldCameraView)) then {
@ -146,31 +175,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
GVAR(OldCameraView) = _newCameraView;
["cameraViewChanged", [ACE_player, _newCameraView]] call FUNC(localEvent);
};
// "playerVehicleChanged" event
_newPlayerVehicle = vehicle ACE_player;
if !(_newPlayerVehicle isEqualTo GVAR(OldPlayerVehicle)) then {
// Raise ACE event locally
GVAR(OldPlayerVehicle) = _newPlayerVehicle;
["playerVehicleChanged", [ACE_player, _newPlayerVehicle]] call FUNC(localEvent);
};
// "playerTurretChanged" event
[ACE_player] call FUNC(getTurretIndex);
if !(_newPlayerTurret isEqualTo GVAR(OldPlayerTurret)) then {
// Raise ACE event locally
GVAR(OldPlayerTurret) = _newPlayerTurret;
["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent);
};
// "playerWeaponChanged" event
_newPlayerWeapon = currentWeapon ACE_player;
if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then {
// Raise ACE event locally
GVAR(OldPlayerWeapon) = _newPlayerWeapon;
["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent);
};
}, 0, []] call cba_fnc_addPerFrameHandler;
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);

View File

@ -4,13 +4,11 @@
ADDON = false;
// ACE Common Function
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addCanInteractWithCondition);
PREP(addLineToDebugDraw);
PREP(addMapMarkerCreatedEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addSetting);
PREP(addToInventory);
PREP(adminKick);
PREP(ambientBrightness);
PREP(applyForceWalkStatus);
@ -55,22 +53,15 @@ PREP(fixPosition);
PREP(getAllDefinedSetVariables);
PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getConfigType);
PREP(getConfigTypeObject);
PREP(getDeathAnim);
PREP(getDefaultAnim);
PREP(getDefinedVariable);
PREP(getDefinedVariableDefault);
PREP(getDefinedVariableInfo);
PREP(getDoorTurrets);
PREP(getFirstObjectIntersection);
PREP(getFirstTerrainIntersection);
PREP(getForceWalkStatus);
PREP(getGunner);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getInPosition);
PREP(getMarkerType);
PREP(getName);
@ -82,26 +73,15 @@ PREP(getStringFromMissionSQM);
PREP(getTargetAzimuthAndInclination);
PREP(getTargetDistance);
PREP(getTargetObject);
PREP(getTurretCommander);
PREP(getTurretConfigPath);
PREP(getTurretCopilot);
PREP(getTurretGunner);
PREP(getTurretIndex);
PREP(getTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
PREP(getUavControlPosition);
PREP(getVehicleCargo);
PREP(getVehicleCodriver);
PREP(getVehicleCrew);
PREP(getVersion);
PREP(getWeaponAzimuthAndInclination);
PREP(getWeaponIndex);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
PREP(getWeaponState);
PREP(getWeaponType);
PREP(getWindDirection);
PREP(getZoom);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(hasItem);
@ -143,11 +123,7 @@ PREP(progressBar);
PREP(queueAnimation);
PREP(readSettingFromModule);
PREP(receiveRequest);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeCanInteractWithCondition);
PREP(removeMapMarkerCreatedEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeSpecificMagazine);
PREP(requestCallback);
PREP(resetAllDefaults);
@ -190,6 +166,32 @@ PREP(useItem);
PREP(useMagazine);
PREP(waitAndExecute);
// config items
PREP(getConfigType);
PREP(getItemType);
PREP(getWeaponType);
PREP(getWeaponModes);
PREP(getWeaponMuzzles);
// config objects
PREP(getConfigTypeObject);
PREP(getConfigGunner);
PREP(getConfigCommander);
PREP(getHitPoints);
PREP(getHitPointsWithSelections);
PREP(getVehicleCrew);
// turrets
PREP(getTurrets);
PREP(getTurretIndex);
PREP(getTurretConfigPath);
PREP(getTurretGunner);
PREP(getTurretCommander);
PREP(getTurretCopilot);
PREP(getDoorTurrets);
PREP(getTurretsFFV);
PREP(getTurretsOther);
// ACE_Debug
PREP(exportConfig);
PREP(getChildren);
@ -197,6 +199,7 @@ PREP(getDisplayConfigName);
PREP(log);
PREP(logControls);
PREP(logDisplays);
PREP(logModEntries);
PREP(monitor);
PREP(showUser);
@ -219,6 +222,17 @@ PREP(localEvent);
PREP(removeEventHandler);
PREP(removeAlLEventHandlers);
// other eventhandlers
PREP(addActionEventHandler);
PREP(addActionMenuEventHandler);
PREP(addScrollWheelEventHandler);
PREP(addMapMarkerCreatedEventHandler);
PREP(removeActionEventHandler);
PREP(removeActionMenuEventHandler);
PREP(removeScrollWheelEventHandler);
PREP(removeMapMarkerCreatedEventHandler);
// hashes
PREP(hashCreate);
PREP(hashSet);

View File

@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
units[] = {"ACE_Box_Misc"};
units[] = {"ACE_Box_Misc", "ACE_bananaItem"};
weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_main"};

View File

@ -7,7 +7,6 @@ private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_ev
_eventType = _this select 0;
_event = _this select 1;
if(_eventType == "ACEg") then {
_eventName = _event select 0;
_eventArgs = _event select 1;
@ -16,9 +15,18 @@ if(_eventType == "ACEg") then {
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Net Event %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -0,0 +1,101 @@
/*
* Author: Garth 'L-H' de Wet
* Adds an item,weapon,magazine to the unit's inventory
* or places it in a weaponHolder if no space.
*
* Arguments:
* 0: Unit (OBJECT)
* 1: Classname (String)
* 2: Container (String, Optional) uniform, vest, backpack
*
* Return Value:
* Array:
* 0: Added to player (Bool)
* 1: weaponholder (OBJECT)
*
* Public: Yes
*/
//#define DEBUG_MODE_FULL
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_classname);
private "_addedToPlayer";
private "_container";
private "_canAdd";
private "_type";
_canAdd = false;
_addedToPlayer = true;
if((count _this) > 2) then {
_container = _this select 2;
} else {
_container = nil;
};
_type = [_classname] call EFUNC(common,getItemType);
if(!isNil "_container") then {
switch (_container) do {
case "vest": { _canAdd = _unit canAddItemToVest _classname; };
case "backpack": { _canAdd = _unit canAddItemToBackpack _classname; };
case "uniform": { _canAdd = _unit canAddItemToUniform _classname; };
};
} else {
_container = "";
_canAdd = _unit canAdd _classname;
};
switch ((_type select 0)) do {
case "weapon": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addWeaponCargoGlobal [_classname, 1]; };
default { _unit addWeaponGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addWeaponCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
case "magazine": {
if (_canAdd) then {
switch (_container) do {
case "vest": { (vestContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "backpack": { (backpackContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
case "uniform": { (uniformContainer _unit) addMagazineCargoGlobal [_classname, 1]; };
default { _unit addMagazineGlobal _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addMagazineCargoGlobal [_classname, 1];
_unit setPosATL _pos;
};
};
case "item": {
if (_canAdd) then {
switch (_container) do {
case "vest": { _unit addItemToVest _classname; };
case "backpack": { _unit addItemToBackpack _classname; };
case "uniform": { _unit addItemToUniform _classname; };
default { _unit addItem _classname; };
};
} else {
_addedToPlayer = false;
_pos = _unit modelToWorld [0,1,0.05];
_unit = createVehicle ["WeaponHolder_Single_F",_pos,[],0,"NONE"];
_unit addItemCargoGlobal [_classname,1];
_unit setPosATL _pos;
};
};
default {diag_log format ["ACE: Incorrect item type passed to %1, passed: %2",QFUNC(AddToInventory),_type];};
};
[_addedToPlayer,_unit]

View File

@ -2,16 +2,16 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
/*
diag_log text format["REGISTERED ACE PFH HANDLERS"];
diag_log text format["-------------------------------------------"];
if(!isNil "ACE_PFH") then {
if(!isNil "ACE_PFH_COUNTER") then {
{
private["_pfh"];
_pfh = _x select 0;
diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ];
} forEach ACE_PFH;
};*/
} forEach ACE_PFH_COUNTER;
};
diag_log text format["ACE COUNTER RESULTS"];
diag_log text format["-------------------------------------------"];

View File

@ -16,6 +16,8 @@ private ["_vehicle", "_weapon"];
_vehicle = _this select 0;
_weapon = _this select 1;
if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle}) exitWith {gunner _vehicle};
private "_gunner";
_gunner = objNull;
@ -23,6 +25,6 @@ _gunner = objNull;
if (_weapon in (_vehicle weaponsTurret _x)) exitWith {
_gunner = _vehicle turretUnit _x;
};
} forEach allTurrets _vehicle;
} forEach allTurrets [_vehicle, true];
_gunner

View File

@ -0,0 +1,83 @@
/*
* Author: commy2
*
* What kind of item is given classname
*
* Argument:
* 0: Classname of a item. (String)
*
* Return value:
* Item type. (Array)
* 0: "weapon", "item", "magazine" or "" (String)
* 1: A description of the item (e.g. "primary" for a weapon or "vest" for a vest item)
*
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
_cfgType = [_item] call FUNC(getConfigType);
if (_cfgType == "") exitWith {["",""]};
if (_cfgType == "CfgGlasses") exitWith {["item","glasses"]};
private ["_config", "_type"];
_config = configFile >> _cfgType >> _item;
_type = getNumber (_config >> "type");
if (isNumber (_config >> "ItemInfo" >> "type")) then {
_type = getNumber (_config >> "ItemInfo" >> "type");
};
private "_default";
_default = ["item", "magazine"] select (_cfgType == "CfgMagazines");
switch (true) do {
case (_type == 0): {[_default,"unknown"]};
case (_type == 2^0): {["weapon","primary"]};
case (_type == 2^1): {["weapon","handgun"]};
case (_type == 2^2): {["weapon","secondary"]};
case (_type < 2^4): {["weapon","unknown"]};
case (_type == 2^4): {["magazine","handgun"]}; // handgun
case (_type == 2^8): {["magazine","primary"]}; // rifle
case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines
//case (_type < 2^11): {["magazine","unknown"]};
case (_type == 101): {["item","muzzle"]};
case (_type == 201): {["item","optics"]};
case (_type == 301): {["item","flashlight"]};
case (_type == 302): {["item","under"]}; // czech for bipod item
case (_type == 401): {["item","first_aid_kit"]};
case (_type == 501): {["item","fins"]}; // not implemented
case (_type == 601): {["item","breathing_bomb"]}; // not implemented
case (_type == 603): {["item","goggles"]};
case (_type == 604): {["item","scuba"]}; // not implemented
case (_type == 605): {["item","headgear"]};
case (_type == 611): {["item","radio"]};
case (_type == 616): {["item","hmd"]};
case (_type == 617): {["item","binocular"]};
case (_type == 619): {["item","medikit"]};
case (_type == 620): {["item","toolkit"]};
case (_type == 621): {["item","uav_terminal"]};
case (_type == 701): {["item","vest"]};
case (_type == 801): {["item","uniform"]};
case (_type == 2^12): {
switch (toLower getText (_config >> "simulation")) do {
case ("weapon"): {["weapon","binocular"]};
case ("binocular"): {["weapon","binocular"]};
case ("nvgoggles"): {["item","nvgoggles"]};
case ("itemminedetector"): {["item","minedetector"]};
default {[_default,"unknown"]};
};
};
case (_type == 2^16): {["weapon","vehicle"]};
case (_type == 2^17): {[_default,"unknown"]}; // ???
default {[_default,"unknown"]};
};

View File

@ -0,0 +1,14 @@
/*
* Author: commy2
*
* Returns a value depending on current zoom level.
*
* Argument:
* None.
*
* Return value:
* Zoom. (Number)
*/
#include "script_component.hpp"
(0.5 - ((worldToScreen positionCameraToWorld [0,1,1]) select 1)) * (getResolution select 5)

View File

@ -19,9 +19,17 @@ _eventNames = GVAR(events) select 0;
_eventIndex = _eventNames find _eventName;
if(_eventIndex != -1) then {
_events = (GVAR(events) select 1) select _eventIndex;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Local Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
{
if(!isNil "_x") then {
_eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Local Event %1 ID: %2",_eventName,_forEachIndex)]);
#ifdef DEBUG_EVENTS_CALLSTACK
diag_log text format[ARR_2(" ID: %1",_forEachIndex)];
#endif
};
} forEach _events;
};

View File

@ -0,0 +1,17 @@
// by commy2
private ["_configs", "_entries"];
_configs = "true" configClasses (configFile >> _this);
_entries = [];
{
{
_name = toLower configName _x;
if !(_name in _entries) then {
diag_log text _name;
_entries pushBack _name;
};
} forEach configProperties [_x, "toLower configName _x find 'ace' == 0", false];
} forEach _configs;

View File

@ -16,6 +16,10 @@ private ["_eventName", "_eventArgs"];
_eventName = _this select 0;
_eventArgs = _this select 1;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_2("* Server Event: %1",_eventName)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEg = [_eventName, _eventArgs];
if(!isServer) then {

View File

@ -21,6 +21,11 @@ _eventName = _this select 0;
_eventTargets = _this select 1;
_eventArgs = _this select 2;
#ifdef DEBUG_EVENTS
diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)];
diag_log text format[ARR_2(" args=%1",_eventArgs)];
#endif
ACEc = [_eventName, _eventTargets, _eventArgs];
if(!isServer) then {
publicVariableServer "ACEc";

View File

@ -56,11 +56,12 @@ if (_target isKindOf "CAManBase") then {
[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus);
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
};
// prevent multiple players from accessing the same object
[_unit, _target, true] call EFUNC(common,claim);
// prevents draging and carrying at the same time
_unit setVariable [QGVAR(isCarrying), true, true];

View File

@ -1,6 +1,8 @@
//XEH_clientInit.sqf
#include "script_component.hpp"
if (!hasInterface) exitWith {};
// Install the render EH on the main display
addMissionEventHandler ["Draw3D", DFUNC(render)];
@ -10,17 +12,17 @@ addMissionEventHandler ["Draw3D", DFUNC(render)];
// Wait until the map display is detected
waitUntil {(!isNull findDisplay 12)};
// Install the render EH on the map screen
// Install the render EH on the map screen
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", DFUNC(render)];
};
["ACE3", QGVAR(InteractKey), "Interact Key",
["ACE3", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"),
{[0] call FUNC(keyDown)},
{[0] call FUNC(keyUp)},
[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key
["ACE3", QGVAR(SelfInteractKey), "Self Actions Key",
["ACE3", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"),
{[1] call FUNC(keyDown)},
{[1] call FUNC(keyUp)},
[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg

View File

@ -83,11 +83,19 @@ private ["_baseDisplayName", "_baseIcon"];
_baseDisplayName = "";
_baseIcon = "";
if (_objectType isKindOf "CAManBase") then {
_baseDisplayName = "Self Actions";
_baseDisplayName = localize "STR_ACE_Interact_Menu_SelfActionsRoot";
_baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
} else {
_baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName");
//Alt would be to just use a static text, if veh names end up being too long:
// _baseDisplayName = localize "STR_ACE_Interact_Menu_VehicleActionsRoot";
//Pull the icon from the vehicle's config:
_baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon");
//icon could be a CfgVehicleIcons
if isText (configFile >> "CfgVehicleIcons" >> _baseIcon) then {
_baseIcon = getText (configFile >> "CfgVehicleIcons" >> _baseIcon);
};
};
// Create a master action to base on self action

View File

@ -1,7 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2015-04-03 -->
<Project name="ACE">
<Package name="Interact_Menu">
<Key ID="STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction">
<English>Always display cursor for self interaction</English>
</Key>
</Project>
<Key ID="STR_ACE_Interact_Menu_InteractKey">
<English>Interact Key</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_SelfInteractKey">
<English>Self Interaction Key</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_SelfActionsRoot">
<English>Self Actions</English>
</Key>
<Key ID="STR_ACE_Interact_Menu_VehicleActionsRoot">
<English>Vehicle Actions</English>
</Key>
</Package>
</Project>

View File

@ -2,6 +2,8 @@
STACK TRACING
**/
//#define ENABLE_CALLSTACK
//#define ENABLE_PERFORMANCE_COUNTERS
//#define DEBUG_EVENTS
#ifdef ENABLE_CALLSTACK
@ -29,7 +31,7 @@ PERFORMANCE COUNTERS SECTION
//#define ENABLE_PERFORMANCE_COUNTERS
#ifdef ENABLE_PERFORMANCE_COUNTERS
#define ADDPFH(function, timing, args) call { _ret = [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add); if(isNil "ACE_PFH" ) then { ACE_PFH=[]; }; ACE_PFH pushBack [[_ret, __FILE__, __LINE__], [function, timing, args]]; _ret }
#define CBA_fnc_addPerFrameHandler { _ret = [(_this select 0), (_this select 1), (_this select 2), #function] call CBA_fnc_addPerFrameHandler; if(isNil "ACE_PFH_COUNTER" ) then { ACE_PFH_COUNTER=[]; }; ACE_PFH_COUNTER pushBack [[_ret, __FILE__, __LINE__], [(_this select 0), (_this select 1), (_this select 2)]]; _ret }
#define CREATE_COUNTER(x) if(isNil "ACE_COUNTERS" ) then { ACE_COUNTERS=[]; }; GVAR(DOUBLES(x,counter))=[]; GVAR(DOUBLES(x,counter)) set[0, QUOTE(GVAR(DOUBLES(x,counter)))]; GVAR(DOUBLES(x,counter)) set[1, diag_tickTime]; ACE_COUNTERS pushBack GVAR(DOUBLES(x,counter));
#define BEGIN_COUNTER(x) if(isNil QUOTE(GVAR(DOUBLES(x,counter)))) then { CREATE_COUNTER(x) }; GVAR(DOUBLES(x,counter)) set[2, diag_tickTime];
@ -37,8 +39,6 @@ PERFORMANCE COUNTERS SECTION
#define DUMP_COUNTERS ([__FILE__, __LINE__] call ACE_DUMPCOUNTERS_FNC)
#else
#define ADDPFH(function, timing, args) [function, timing, args, #function] call EFUNC(sys_sync,perFrame_add)
#define CREATE_COUNTER(x) /* disabled */
#define BEGIN_COUNTER(x) /* disabled */
#define END_COUNTER(x) /* disabled */

View File

@ -49,6 +49,8 @@ PREP(hasItems);
PREP(hasMedicalEnabled);
PREP(hasTourniquetAppliedTo);
PREP(init);
PREP(isBeingCarried);
PREP(isBeingDragged);
PREP(isInMedicalFacility);
PREP(isMedic);
PREP(isMedicalVehicle);

View File

@ -0,0 +1,26 @@
/*
* Author: PabstMirror
* Returns if a target is being carried. (from ace_dragging)
*
* Arguments:
* 0: Target Unit <OBJECT>
*
* Return Value:
* Is being carried <BOOL>
*
* Example:
* [bob] call ace_medical_fnc_isBeingCarried
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_target);
private "_owner";
_owner = _target getVariable [QEGVAR(common,owner), objNull];
if (isNull _owner) exitWith {false};
(_owner getVariable [QEGVAR(dragging,carriedObject), objNull]) == _target

View File

@ -0,0 +1,26 @@
/*
* Author: PabstMirror
* Returns if a target is being dragged. (from ace_dragging)
*
* Arguments:
* 0: Target Unit <OBJECT>
*
* Return Value:
* Is being dragged <BOOL>
*
* Example:
* [bob] call ace_medical_fnc_isBeingDragged
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_target);
private "_owner";
_owner = _target getVariable [QEGVAR(common,owner), objNull];
if (isNull _owner) exitWith {false};
(_owner getVariable [QEGVAR(dragging,draggedObject), objNull]) == _target

View File

@ -26,7 +26,6 @@ _waypoints = [] call FUNC(deviceGetWaypoints);
if ((_newWpIndex < 0) || (_newWpIndex > ((count _waypoints) - 1))) exitWith {
GVAR(currentWaypoint) = -1;
ERROR("out of bounds wp");
};
GVAR(currentWaypoint) = _newWpIndex;

View File

@ -43,7 +43,7 @@ class Extended_FiredBIS_EventHandlers {
firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)});
};
};
class StaticWeapons {
class StaticWeapon {
class ADDON {
firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)});
};

View File

@ -17,14 +17,16 @@ class CfgWeapons {
};
class launch_Titan_short_base: launch_Titan_base {
GVAR(angle) = 40;
GVAR(range) = 8;
// Titan is a soft-launch launcher
GVAR(angle) = 30;
GVAR(range) = 2;
GVAR(damage) = 0.5;
};
class launch_NLAW_F: Launcher_Base_F {
GVAR(angle) = 40;
GVAR(range) = 5;
// NLAW is a soft-launch launcher
GVAR(angle) = 30;
GVAR(range) = 2;
GVAR(damage) = 0.6;
};

View File

@ -18,7 +18,7 @@ class CfgVehicles {
class No { default = 1; name = "No"; value = 0; };
};
};
class RemoveDeadBodiesDisonncected {
class RemoveDeadBodiesDisconnected {
displayName = "Remove bodies?";
description = "Remove player bodies after disconnect?";
typeName = "BOOL";

View File

@ -40,4 +40,29 @@ class CfgWeapons {
};
};
};
class ACE_optic_DMS: optic_DMS {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_DMS";
displayName = "LOCALIZE ACE DMR";
//descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(ace_shortdot_optics.p3d));
class OpticsModes: OpticsModes {
class Snip: Snip {
opticsZoomMin = 0.05;
opticsZoomMax = 0.3;
opticsZoomInit = 0.3;
discretefov[] = {};
modelOptics[] = {};
};
};
};
};
};
class SlotInfo;
class CowsSlot: SlotInfo {
compatibleItems[] += {"ACE_optic_DMS"};
};

View File

@ -1,3 +1,6 @@
class RscText;
class RscTitles {
class ACE_Scopes_Zeroing {
idd = -1;
@ -65,6 +68,30 @@ class RscTitles {
};
};
};
class ACE_Shortdot_Reticle {
idd = -1;
onLoad = "uiNamespace setVariable ['ACE_ctrlShortdotReticle', (_this select 0) displayCtrl 1];";
duration = 999999;
fadeIn = 0;
fadeOut = 0;
name = "ACE_Shortdot_Reticle";
class controlsBackground {
class Debug_RscElement: RscText {
idc = 1;
style = 48;
size = 1;
sizeEx = 0;
font = "TahomaB";
text = "";
x = 0;
y = 0;
w = 0;
h = 0;
};
};
};
};
class RscInGameUI {

View File

@ -92,3 +92,30 @@ if !(hasInterface) exitWith {};
},
{false},
[201, [false, true, false]], false] call cba_fnc_addKeybind;
// init shortdot
GVAR(showShortdot) = false;
["playerInventoryChanged", {
if (_this select 1 isEqualTo []) exitWith {}; //@todo fix eh
private "_showShortdot";
_showShortdot = _this select 1 select 9 select 2 == "ACE_optic_DMS";
if (GVAR(showShortdot)) then {
if (!_showShortdot) then {
// hide control and turn onDraw handler off
(uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]) ctrlShow false;
GVAR(showShortdot) = false;
};
} else {
if (_showShortdot) then {
// create control and turn onDraw handler on
([QGVAR(reticle)] call BIS_fnc_rscLayer) cutRsc ["ACE_Shortdot_Reticle", "PLAIN", 0, false];
(uiNamespace getVariable "ACE_ctrlShortdotReticle") ctrlSetText QUOTE(PATHTOF(data\reticles\ace_shortdot_reticle_1.paa));
GVAR(showShortdot) = true;
};
};
}] call EFUNC(common,addEventHandler);
addMissionEventHandler ["Draw3D", {if (GVAR(showShortdot)) then {call FUNC(onDrawShortdot)};}];

View File

@ -7,6 +7,7 @@ PREP(canAdjustScope);
PREP(firedEH);
PREP(getOptics);
PREP(inventoryCheck);
PREP(onDrawShortdot);
PREP(showZeroing);
GVAR(fadeScript) = scriptNull;

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,25 @@
// by commy2
#include "script_component.hpp"
private "_control";
_control = uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull];
if (cameraView != "GUNNER" || {currentWeapon ACE_player != primaryWeapon ACE_player}) exitWith {
_control ctrlShow false;
};
private ["_size", "_sizeX", "_sizeY"];
_size = call EFUNC(common,getZoom);
_sizeX = _size/4;
_sizeY = _sizeX*safezoneW/safezoneH;
_control ctrlSetPosition [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
_control ctrlCommit 0;
_control ctrlShow true;

View File

@ -4,7 +4,7 @@ class CfgVehicles {
author = "$STR_ACE_Common_ACETeam";
category = "ACE";
displayName = "Wind Deflection";
function = FUNC(enableModule);
function = FUNC(initalizeModule);
scope = 2;
isGlobal = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa));