diff --git a/addons/captives/CfgEden.hpp b/addons/captives/CfgEden.hpp index 98757bd86c..9cb747c5ee 100644 --- a/addons/captives/CfgEden.hpp +++ b/addons/captives/CfgEden.hpp @@ -11,7 +11,7 @@ class Cfg3DEN { expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleHandcuffed)}); typeName = "BOOL"; condition = "objectBrain"; - defaultValue = false; + defaultValue = "(false)"; }; class ace_isSurrendered { property = QUOTE(ace_isSurrendered); @@ -21,7 +21,7 @@ class Cfg3DEN { expression = QUOTE(if (_value) then {[ARR_3(objNull,[_this],true)] call FUNC(moduleSurrender)}); typeName = "BOOL"; condition = "objectBrain"; - defaultValue = false; + defaultValue = "(false)"; }; }; }; diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index ff4a88693e..45f6d48997 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -67,4 +67,9 @@ class Extended_InitPost_EventHandlers { init = QUOTE(_this call DFUNC(initObject)); }; }; + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; }; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index ac2373eca8..d8b22a8198 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -62,12 +62,10 @@ PREP(getMapPosFromGrid); PREP(getMarkerType); PREP(getMGRSdata); PREP(getName); -PREP(getNumberFromMissionSQM); PREP(getNumberMagazinesIn); PREP(getPitchBankYaw); PREP(getSettingData); PREP(getStaminaBarControl); -PREP(getStringFromMissionSQM); PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); PREP(getTargetObject); @@ -95,7 +93,6 @@ PREP(hideUnit); PREP(insertionSort); PREP(interpolateFromArray); PREP(inTransitionAnim); -PREP(isAutoWind); PREP(isAwake); PREP(isEngineer); PREP(isEOD); @@ -264,8 +261,3 @@ PREP(hashSet); PREP(hashGet); PREP(hashHasKey); PREP(hashRem); -PREP(hashListCreateList); -PREP(hashListCreateHash); -PREP(hashListSelect); -PREP(hashListSet); -PREP(hashListPush); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 69244c0816..3f7b564811 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -266,8 +266,8 @@ enableCamShake true; //FUNC(showHud) needs to be refreshed if it was set during mission init ["ace_infoDisplayChanged", { - GVAR(showHudHash) params ["", "_masks"]; - if (!(_masks isEqualTo [])) then { + GVAR(showHudHash) params ["", "", "_masks"]; + if !(_masks isEqualTo []) then { [] call FUNC(showHud); }; }] call CBA_fnc_addEventHandler; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index db6be393d8..eca1aebf36 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -5,8 +5,8 @@ ADDON = false; #include "XEH_PREP.hpp" -GVAR(syncedEvents) = HASH_CREATE; -GVAR(showHudHash) = [] call FUNC(hashCreate); +GVAR(syncedEvents) = [] call CBA_fnc_hashCreate; +GVAR(showHudHash) = [] call CBA_fnc_hashCreate; GVAR(settingsInitFinished) = false; GVAR(runAtSettingsInitialized) = []; diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index 14d17ae118..763874de82 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -14,12 +14,11 @@ params ["_client"]; -{ - private _eventEntry = HASH_GET(GVAR(syncedEvents),_x); - _eventEntry params ["", "_eventLog"]; +[GVAR(syncedEvents), { + _value params ["", "_eventLog"]; - ["ACEs", [_x, _eventLog], _client] call CBA_fnc_targetEvent; + ["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent; false -} count (GVAR(syncedEvents) select 0); +}] call CBA_fnc_hashEachPair; true diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 2b239ea056..131ae56f7f 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -22,12 +22,12 @@ if (isServer) then { // Find the event name, and shovel out the events to the client params ["_eventName", "_client"]; - if (!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { + if !([GVAR(syncedEvents), _eventName] call CBA_fnc_hashHasKey) exitWith { ACE_LOGERROR_1("Request for synced event - key [%1] not found.", _eventName); false }; - private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + private _eventEntry = [GVAR(syncedEvents), _eventName] call CBA_fnc_hashGet; _eventEntry params ["", "_eventLog"]; ["ACEs", [_eventName, _eventLog], _client] call CBA_fnc_targetEvent; diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index d708178c4f..b818ed257c 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -16,22 +16,19 @@ params ["_name", "_args", "_ttl"]; -if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith { ACE_LOGERROR_1("Synced event key [%1] not found (_handleSyncedEvent).", _name); false }; -private _internalData = HASH_GET(GVAR(syncedEvents),_name); +private _internalData = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet; +_internalData params ["_eventCode", "_eventLog"]; if (isServer) then { // Server needs to internally log it for synchronization if (_ttl > -1) then { - _internalData = HASH_GET(GVAR(syncedEvents),_name); - - _internalData params ["", "_eventLog"]; _eventLog pushBack [diag_tickTime, _args, _ttl]; }; }; -_internalData params ["_eventCode"]; _args call _eventCode; diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 0481f7d11f..6499f96ff4 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -19,7 +19,7 @@ params ["_name", "_handler", ["_ttl", 0]]; -if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if ([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith { ACE_LOGERROR_1("Duplicate synced event [%1] creation.",_name); false }; @@ -27,4 +27,4 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { private _eventId = [_name, FUNC(_handleSyncedEvent)] call CBA_fnc_addEventHandler; private _data = [_handler, [], _ttl, _eventId]; -HASH_SET(GVAR(syncedEvents),_name,_data); +[GVAR(syncedEvents), _name, _data] call CBA_fnc_hashSet; diff --git a/addons/common/functions/fnc_disableAI.sqf b/addons/common/functions/fnc_disableAI.sqf index 75c59d1a9a..5dc3cdfbb2 100644 --- a/addons/common/functions/fnc_disableAI.sqf +++ b/addons/common/functions/fnc_disableAI.sqf @@ -30,7 +30,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then { } else { //Sanity check to make sure we don't enable unconsious AI if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith { - ERROR("Enabling AI for unconsious unit"); + ACE_LOGERROR("Enabling AI for unconsious unit"); }; _unit enableAI "MOVE"; diff --git a/addons/common/functions/fnc_getMapPosFromGrid.sqf b/addons/common/functions/fnc_getMapPosFromGrid.sqf index a148679fa9..96960a844d 100644 --- a/addons/common/functions/fnc_getMapPosFromGrid.sqf +++ b/addons/common/functions/fnc_getMapPosFromGrid.sqf @@ -19,7 +19,7 @@ params ["_inputString", ["_getCenterOfGrid", true]]; if (count GVAR(mapGridData) == 0) exitWith { - ERROR("Map has bad data, falling back to BIS_fnc_gridToPos"); + ACE_LOGERROR("Map has bad data, falling back to BIS_fnc_gridToPos"); (_this call BIS_fnc_gridToPos) select 0 }; diff --git a/addons/common/functions/fnc_getNumberFromMissionSQM.sqf b/addons/common/functions/fnc_getNumberFromMissionSQM.sqf deleted file mode 100644 index 6c381d4f54..0000000000 --- a/addons/common/functions/fnc_getNumberFromMissionSQM.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Author: commy2 - * Get a number from the mission.sqm file. Mission has to be saved in the Editor. - * On non-existing entries, it might return 0 or the value of an entry with the same name of another calss. - * - * Arguments: - * 0: Path of the entry in the mission.sqm - * - * Return Value: - * Entry value - * - * Public: No - */ -#include "script_component.hpp" - -parseNumber (_this call FUNC(getStringFromMissionSQM)) // return diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf deleted file mode 100644 index 0893b7bb0d..0000000000 --- a/addons/common/functions/fnc_getStringFromMissionSQM.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Author: commy2 - * Get a string from the mission.sqm file. Mission has to be saved in the Editor. - * The string cannot contain the ; character. - * If the entry does not exist, it might return an empty string or an entry with the same name of another class! - * - * Arguments: - * 0: Path of the entry in the mission.sqm - * - * Return Value: - * Value of the entry. - * - * Public: No - */ -#include "script_component.hpp" - -[_this] params ["_path", [], [[]]]; - -if (missionName == "") exitWith {""}; - -private _mission = toArray toLower loadFile "mission.sqm"; -_mission resize 65536; - -{ - if (_x < 33) then { - _mission set [_forEachIndex, -1]; - } -} forEach _mission; - -_mission = toString (_mission - [-1]); - -{_path set [_forEachIndex, toLower _x]} forEach _path; - -for "_a" from 0 to (count _path - 2) do { - private _class = format ["class%1{", _path select _a]; - private _index = _mission find _class; - private _array = toArray _mission; - - for "_b" from 0 to (_index + count toArray _class - 1) do { - _array set [_b, -1]; - }; - - _array = _array - [-1]; - - _mission = toString _array; -}; - -private _entry = format ["%1=", _path select (count _path - 1)]; -_index = _mission find _entry; - -if (_index == -1) exitWith {""}; - -_array = toArray _mission; - -for "_b" from 0 to (_index + count toArray _entry - 1) do { - _array set [_b, -1]; -}; - -_mission = toString (_array - [-1]); - -_index = _mission find ";"; - -_mission = toArray _mission; -_mission resize _index; - -format ["%1", toString _mission] // return diff --git a/addons/common/functions/fnc_hashCreate.sqf b/addons/common/functions/fnc_hashCreate.sqf index 532b2804fe..c3ff836573 100644 --- a/addons/common/functions/fnc_hashCreate.sqf +++ b/addons/common/functions/fnc_hashCreate.sqf @@ -12,4 +12,6 @@ */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(hashCreate),"3.8.0","CBA_fnc_hashCreate"); + [[],[]] diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index d0a5cdf22e..e7bee04eec 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(hashGet),"3.8.0","CBA_fnc_hashGet"); + params ["_hash", "_key"]; ERRORDATA(2); diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 97998c1298..65c1517e4f 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(hashHasKey),"3.8.0","CBA_fnc_hashHasKey"); + // diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this]; params ["_hash", "_key"]; diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf deleted file mode 100644 index d5cc323c8d..0000000000 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: ? - * ? - * - * Arguments: - * ? - * - * Return Value: - * ? - * - * Public: ? - */ -#include "script_component.hpp" - -params ["_hashList"]; - -ERRORDATA(1); -private _hashKeys = []; -try { - if(VALIDHASH(_hashList)) then { - _hashKeys = (_hashList select 0); - } else { - ERROR("Input hashlist is not valid"); - }; -} catch { - HANDLECATCH; -}; -[_hashKeys, []]; diff --git a/addons/common/functions/fnc_hashListCreateList.sqf b/addons/common/functions/fnc_hashListCreateList.sqf deleted file mode 100644 index 3d02b0cb0b..0000000000 --- a/addons/common/functions/fnc_hashListCreateList.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: ? - * ? - * - * Arguments: - * ? - * - * Return Value: - * ? - * - * Public: ? - */ -#include "script_component.hpp" - -params ["_keys"]; - -[_keys,[]]; diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf deleted file mode 100644 index 21651c2ed0..0000000000 --- a/addons/common/functions/fnc_hashListPush.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: ? - * ? - * - * Arguments: - * ? - * - * Return Value: - * ? - * - * Public: ? - */ -#include "script_component.hpp" - -params ["_hashList", "_value"]; - -ERRORDATA(2); -try { - if(VALIDHASH(_hashList)) then { - [_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet); - } else { - ERROR("Input hashlist in push not valid"); - }; -} catch { - HANDLECATCH; -}; diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf deleted file mode 100644 index f5e3d85b31..0000000000 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: ? - * ? - * - * Arguments: - * ? - * - * Return Value: - * ? - * - * Public: ? - */ -#include "script_component.hpp" - -params ["_hashList", "_index"]; - -ERRORDATA(2); -private _hash = nil; -try { - if(VALIDHASH(_hashList)) then { - _hashList params ["_keys", "_hashes"]; - - if(_index < (count _hashes)) then { - private _values = _hashes select _index; - - _hash = [_keys, _values, 1]; - } else { - ERROR("Index of hashlist is out of range"); - }; - } else { - ERROR("Input hashlist is not valid"); - }; -} catch { - HANDLECATCH; -}; - -if (isNil "_hash") exitWith { nil }; -_hash; diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf deleted file mode 100644 index ee0a8dc7eb..0000000000 --- a/addons/common/functions/fnc_hashListSet.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: ? - * ? - * - * Arguments: - * ? - * - * Return Value: - * ? - * - * Public: ? - */ -#include "script_component.hpp" - -params ["_hashList", "_index", "_value"]; - -ERRORDATA(3); -try { - if(VALIDHASH(_hashList)) then { - if(VALIDHASH(_value)) then { - _value params ["", "_vals"]; - - (_hashList select 1) set[_index, _vals]; - } else { - ERROR("Set hash in hashlist is not valid"); - }; - } else { - ERROR("Input hashlist is not valid"); - }; -} catch { - HANDLECATCH; -}; diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index bd0c8f2a2d..a09f87ee2e 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(hashRem),"3.8.0","CBA_fnc_hashRem"); + params ["_hash", "_key"]; ERRORDATA(2); diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 0890578857..8344b50f92 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED(QFUNC(hashSet),"3.8.0","CBA_fnc_hashSet"); + // diag_log text format["%1 HASH SET: %2", diag_tickTime, _this]; params ["_hash", "_key", "_val"]; diff --git a/addons/common/functions/fnc_isAutoWind.sqf b/addons/common/functions/fnc_isAutoWind.sqf deleted file mode 100644 index 04bb22a785..0000000000 --- a/addons/common/functions/fnc_isAutoWind.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Author: commy2 - * Check if wind is set on auto. - * - * Arguments - * None - * - * Return Value: - * This mission has automatic wind? - * - * Public: Yes - */ -#include "script_component.hpp" - -["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 // return diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index d3d94aa421..157b9699e4 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -14,13 +14,13 @@ params ["_name"]; -if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith { ACE_LOGERROR_1("Synced event key [%1] not found (removeSyncedEventHandler).", _name); false }; -private _data = HASH_GET(GVAR(syncedEvents),_name); +private _data = [GVAR(syncedEvents), _name] call CBA_fnc_hashGet; _data params ["", "", "", "_eventId"]; [_eventId] call CBA_fnc_removeEventHandler; -HASH_REM(GVAR(syncedEvents),_name); +[GVAR(syncedEvents), _name] call CBA_fnc_hashRem; diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 723c2436ed..98b9801b3f 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -40,14 +40,14 @@ if (_reason != "") then { _reason = toLower _reason; if (_mask isEqualTo []) then { TRACE_2("Setting", _reason, _mask); - [GVAR(showHudHash), _reason] call FUNC(hashRem); + [GVAR(showHudHash), _reason] call CBA_fnc_hashRem; } else { TRACE_2("Removing", _reason, _mask); - [GVAR(showHudHash), _reason, _mask] call FUNC(hashSet); + [GVAR(showHudHash), _reason, _mask] call CBA_fnc_hashSet; }; }; -GVAR(showHudHash) params ["_reasons", "_masks"]; +GVAR(showHudHash) params ["", "_reasons", "_masks"]; private _resultMask = []; for "_index" from 0 to 7 do { diff --git a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf index 2121f69ef4..47c9375d43 100644 --- a/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf +++ b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf @@ -1,13 +1,15 @@ /* * Author: Glowbal - * Removes white spaces from string + * Removes whitespace from a string. * * Arguments: - * 0: stringA - * 1: stringB + * 0: String * * Return Value: - * copy of string + * String Without Whitespace + * + * Example: + * _stringWithoutWhitespace = ["String with whitespace"] call ace_common_fnc_stringRemoveWhiteSpace * * Public: Yes */ diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index e6c7b43361..7b7a0094cf 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -16,7 +16,7 @@ params ["_name", "_args", ["_ttl", 0]]; -if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +if !([GVAR(syncedEvents), _name] call CBA_fnc_hashHasKey) exitWith { ACE_LOGERROR_1("Synced event key [%1] not found (syncedEvent).", _name); false }; diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index c0c840c894..8fcd143536 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -18,11 +18,8 @@ if (!isServer) exitWith {false}; // Walk through the local synced events and clean up anything thats already EOL // @TODO: This should be iteration limited to prevent FPS lag -{ - private _name = _x; - - private _data = HASH_GET(GVAR(syncedEvents),_name); - _data params ["_eventTime", "_eventLog", "_globalEventTTL"]; +[GVAR(syncedEvents), { + _value params ["_eventTime", "_eventLog", "_globalEventTTL"]; private _newEventLog = []; @@ -55,8 +52,8 @@ if (!isServer) exitWith {false}; false } count _eventLog; - _data set [1, _newEventLog]; + _value set [1, _newEventLog]; false -} count (GVAR(syncedEvents) select 0); +}] call CBA_fnc_hashEachPair; // @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events diff --git a/addons/dogtags/$PBOPREFIX$ b/addons/dogtags/$PBOPREFIX$ new file mode 100644 index 0000000000..475914e9b1 --- /dev/null +++ b/addons/dogtags/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\dogtags diff --git a/addons/dogtags/Dogtag.hpp b/addons/dogtags/Dogtag.hpp index 937432d2a8..d783ec15b0 100644 --- a/addons/dogtags/Dogtag.hpp +++ b/addons/dogtags/Dogtag.hpp @@ -4,8 +4,8 @@ class RscStructuredText; class RscTitles { class GVAR(singleTag) { idd = -1; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]); movingEnable = false; duration = 5; fadeIn = 0.2; @@ -49,8 +49,8 @@ class RscTitles { }; class GVAR(doubleTag): GVAR(singleTag) { idd = -1; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),_this select 0)]); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(tag)),nil)]); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),_this select 0)]); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(tag),nil)]); class controls: controls { class background: background { diff --git a/addons/dogtags/README.md b/addons/dogtags/README.md index e3bf6caf73..176b60750d 100644 --- a/addons/dogtags/README.md +++ b/addons/dogtags/README.md @@ -9,3 +9,4 @@ Adds options to check and take dog tag from dead or unconscious units The people responsible for merging changes to this component or answering potential questions. - [SzwedzikPL](https://github.com/SzwedzikPL) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/dogtags/config.cpp b/addons/dogtags/config.cpp index de66b2a087..a3ad6b7cf0 100644 --- a/addons/dogtags/config.cpp +++ b/addons/dogtags/config.cpp @@ -2,12 +2,14 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"SzwedzikPL"}; - authorUrl = "https://github.com/SzwedzikPL/"; + author = ECSTRING(common,ACETeam); + authors[] = {"SzwedzikPL"}; + url = ECSTRING(main,URL); VERSION_CONFIG; }; }; diff --git a/addons/dogtags/functions/fnc_addDogtagActions.sqf b/addons/dogtags/functions/fnc_addDogtagActions.sqf index ffc45532e9..05f136830c 100644 --- a/addons/dogtags/functions/fnc_addDogtagActions.sqf +++ b/addons/dogtags/functions/fnc_addDogtagActions.sqf @@ -9,6 +9,9 @@ * Return Value: * Children actions * + * Example: + * _childrenActions = [unit, player] call ace_dogtags_fnc_addDogtagActions + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_addDogtagItem.sqf b/addons/dogtags/functions/fnc_addDogtagItem.sqf index f4890782b0..e734b6f38f 100644 --- a/addons/dogtags/functions/fnc_addDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_addDogtagItem.sqf @@ -1,6 +1,6 @@ /* * Author: SzwedzikPL - * Adds dogtag item to unit (triggered by server) + * Adds dogtag item to unit (triggered by server). * * Arguments: * 0: Item class @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * ["itemClass", ["name", "610-27-5955", "A POS"]] call ace_dogtags_fnc_addDogtagItem + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_bloodType.sqf b/addons/dogtags/functions/fnc_bloodType.sqf index 2111e16ccf..a7cafbd1fd 100644 --- a/addons/dogtags/functions/fnc_bloodType.sqf +++ b/addons/dogtags/functions/fnc_bloodType.sqf @@ -8,6 +8,9 @@ * Return Value: * A random blood type * + * Example: + * _bloodType = ["name"] call ace_dogtags_fnc_bloodType + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index a05629c72f..66a25c94b0 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -9,6 +9,9 @@ * Return Value: * True if dogtag can be checked * + * Example: + * _canCheck = [player, unit] call ace_dogtags_fnc_canCheckDogtag + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index b8279144bb..33a3ef055f 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -9,6 +9,9 @@ * Return Value: * True if dogtag can be taken * + * Example: + * _canTake = [player, unit] call ace_dogtags_fnc_canTakeDogtag + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_checkDogtag.sqf b/addons/dogtags/functions/fnc_checkDogtag.sqf index 6345871f02..7b703b995c 100644 --- a/addons/dogtags/functions/fnc_checkDogtag.sqf +++ b/addons/dogtags/functions/fnc_checkDogtag.sqf @@ -1,6 +1,6 @@ /* * Author: SzwedzikPL - * Checks unit dogtag + * Checks unit dogtag. * * Arguments: * 0: Player @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [player, unit] call ace_dogtags_fnc_checkDogtag + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_checkDogtagItem.sqf b/addons/dogtags/functions/fnc_checkDogtagItem.sqf index 930532a0d9..237c4cf4b1 100644 --- a/addons/dogtags/functions/fnc_checkDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_checkDogtagItem.sqf @@ -1,6 +1,6 @@ /* * Author: SzwedzikPL - * Check dogtag self menu action + * Check dogtag self menu action. * * Arguments: * 0: Player @@ -8,7 +8,10 @@ * 2: Item class * * Return Value: - * Mone + * None + * + * Example: + * [player, unit, "itemClass"] call ace_dogtags_fnc_checkDogtagItem * * Public: No */ diff --git a/addons/dogtags/functions/fnc_getDogtagData.sqf b/addons/dogtags/functions/fnc_getDogtagData.sqf index 485e09789e..607426fda4 100644 --- a/addons/dogtags/functions/fnc_getDogtagData.sqf +++ b/addons/dogtags/functions/fnc_getDogtagData.sqf @@ -1,12 +1,18 @@ /* * Author: esteldunedain - * Get unit dogtag data + * Get unit dogtag data. * * Arguments: * 0: Target * * Return Value: - * None + * Dogtag Data + * 0: Name + * 1: SSN + * 2: Blood Type + * + * Example: + * _dogtagData = [unit, player] call ace_dogtags_fnc_getDogtagData * * Public: No */ diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index aee57b31e3..9c21ce0c54 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -1,6 +1,6 @@ /* * Author: SzwedzikPL - * Server: creates new dogtag item and send it to client + * Server: creates new dogtag item and send it to client. * * Arguments: * 0: Player @@ -9,6 +9,9 @@ * Return Value: * None * + * Example: + * [player, unit] call ace_dogtags_fnc_getDogtagItem + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_sendDogtagData.sqf b/addons/dogtags/functions/fnc_sendDogtagData.sqf index cadb343796..34665fdfee 100644 --- a/addons/dogtags/functions/fnc_sendDogtagData.sqf +++ b/addons/dogtags/functions/fnc_sendDogtagData.sqf @@ -1,6 +1,6 @@ /* * Author: SzwedzikPL - * Server: returns to client data on given dogtag + * Server: returns to client data on given dogtag. * * Arguments: * 0: Player @@ -9,11 +9,14 @@ * Return Value: * None * + * Example: + * [player, unit] call ace_dogtags_fnc_sendDogtagData + * * Public: No */ #include "script_component.hpp" -if(!isServer) exitWith {}; +if (!isServer) exitWith {}; params ["_target", "_item"]; TRACE_2("sendDogtagData",_target,_item); diff --git a/addons/dogtags/functions/fnc_showDogtag.sqf b/addons/dogtags/functions/fnc_showDogtag.sqf index 119a2de773..aac4557f64 100644 --- a/addons/dogtags/functions/fnc_showDogtag.sqf +++ b/addons/dogtags/functions/fnc_showDogtag.sqf @@ -1,14 +1,17 @@ /* * Author: SzwedzikPL - * Shows dogtag + * Shows dogtag. * * Arguments: - * 0: Dog tag data + * 0: Dogtag data * 1: Display as double tag * * Return Value: * None * + * Example: + * [["name", "610-27-5955", "A POS"], true] call ace_dogtags_fnc_showDogtag + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/functions/fnc_ssn.sqf b/addons/dogtags/functions/fnc_ssn.sqf index bb79ddca9a..330d4c00d2 100644 --- a/addons/dogtags/functions/fnc_ssn.sqf +++ b/addons/dogtags/functions/fnc_ssn.sqf @@ -9,7 +9,7 @@ * A random three/two/four format social security number * * Example: - * ["AAA"] call ace_dogtags_fnc_ssn + * _ssn = ["AAA"] call ace_dogtags_fnc_ssn * * Public: No */ diff --git a/addons/dogtags/functions/fnc_takeDogtag.sqf b/addons/dogtags/functions/fnc_takeDogtag.sqf index e8c93a985d..0b779c029b 100644 --- a/addons/dogtags/functions/fnc_takeDogtag.sqf +++ b/addons/dogtags/functions/fnc_takeDogtag.sqf @@ -1,7 +1,7 @@ /* * Author: SzwedzikPL - * If dogtag is not already taken triggers event on server - * If dogtag already taken displays info about it + * If dogtag is not already taken triggers event on server. + * If dogtag already taken displays info about it. * * Arguments: * 0: Player @@ -10,6 +10,9 @@ * Return Value: * None * + * Example: + * [player, unit] call ace_dogtags_fnc_takeDogtag + * * Public: No */ #include "script_component.hpp" diff --git a/addons/dogtags/script_component.hpp b/addons/dogtags/script_component.hpp index 980222c8da..c5912f2d2c 100644 --- a/addons/dogtags/script_component.hpp +++ b/addons/dogtags/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT dogtags +#define COMPONENT_BEAUTIFIED Dogtags #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index 226efc5ef7..6b8f0004b9 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -48,14 +48,6 @@ class Extended_Killed_EventHandlers { }; }; -class Extended_AnimChanged_EventHandlers { - class CAManBase { - class ADDON { - animChanged = QUOTE(_this call DFUNC(handleAnimChanged)); - }; - }; -}; - class Extended_DisplayLoad_EventHandlers { class RscDisplayMission { ADDON = QUOTE(_this call COMPILE_FILE(XEH_missionDisplayLoad)); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 0d8e7757eb..2dbf47f3cc 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -20,9 +20,9 @@ if (isNil "ACE_maxWeightCarry") then { ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); // release object on player change. This does work when returning to lobby, but not when hard disconnecting. -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addEventHandler; -["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler; -["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addEventHandler; +["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call CBA_fnc_addPlayerEventHandler; +["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addPlayerEventHandler; // handle waking up dragged unit and falling unconscious while dragging ["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 9fb198e02c..985f3ddab6 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -56,6 +56,9 @@ _unit setVariable [QGVAR(ReleaseActionID), [ {[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)} ] call EFUNC(common,addActionEventHandler)]; +// add anim changed EH +[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; + // show mouse hint if (_target isKindOf "CAManBase") then { [localize LSTRING(Drop), "", ""] call EFUNC(interaction,showMouseHint); diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 4672aa89c4..77b4fc703b 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -49,6 +49,9 @@ _unit setVariable [QGVAR(ReleaseActionID), [ {[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)} ] call EFUNC(common,addActionEventHandler)]; +// add anim changed EH +[_unit, "AnimChanged", FUNC(handleAnimChanged), [_unit]] call CBA_fnc_addBISEventHandler; + // show mouse hint [localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint); diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index e186370e55..935a6d3652 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -17,6 +17,13 @@ #include "script_component.hpp" params ["_unit", "_anim"]; +_thisArgs params ["_realUnit"]; +TRACE_4("params",_unit,_anim,_realUnit,_thisID); + +if (_unit != _realUnit) exitWith { + TRACE_2("respawn (unit changed) - remove EH",_unit,_realUnit); + _unit removeEventHandler ["AnimChanged", _thisID]; +}; if (_unit getVariable [QGVAR(isDragging), false]) then { @@ -25,19 +32,25 @@ if (_unit getVariable [QGVAR(isDragging), false]) then { private _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; if (!isNull _draggedObject) then { + TRACE_2("stop drag",_unit,_draggedObject); [_unit, _draggedObject] call FUNC(dropObject); }; }; -}; +} else { -if (_unit getVariable [QGVAR(isCarrying), false]) then { + if (_unit getVariable [QGVAR(isCarrying), false]) then { - // drop carried object when not standing; also some exceptions when picking up crate - if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then { - private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + // drop carried object when not standing; also some exceptions when picking up crate + if (stance _unit != "STAND" && {_anim != "amovpercmstpsnonwnondnon"}) then { + private _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; - if (!isNull _carriedObject) then { - [_unit, _carriedObject] call FUNC(dropObject_carry); + if (!isNull _carriedObject) then { + TRACE_2("stop carry",_unit,_carriedObject); + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; }; + } else { + TRACE_1("not drag/carry - remove EH",_unit); + _unit removeEventHandler ["AnimChanged", _thisID]; }; }; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index a4a331aa26..b5cd201d7a 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -60,6 +60,13 @@ class CfgVehicles { icon = QPATHTOF(UI\Defuse_ca.paa); }; }; + }; + class ACE_DefuseObject_Large: ACE_DefuseObject { + class ACE_Actions: ACE_Actions { + class ACE_Defuse: ACE_Defuse { + distance = 1.5; + }; + }; }; class ACE_Explosives_Place: Items_base_F { diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index da5e5ec149..c8486adc09 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -35,7 +35,6 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; {deleteVehicle _x;} forEach _addedDefuseHelpers; [_pfID] call CBA_fnc_removePerFrameHandler; } else { - private ["_defuseHelper"]; // Prevent Rare Error when ending mission with interact key down: if (isNull ace_player) exitWith {}; @@ -43,8 +42,12 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; if (((getPosASL ace_player) distance _setPosition) > 5) then { { if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then { - TRACE_2("Making Defuse Helper",(_x),(typeOf _x)); - _defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x); + TRACE_3("Making Defuse Helper",(_x),(typeOf _x),(_x isKindOf "UnderwaterMine_Range_Ammo")); + private _defuseHelper = if (_x isKindOf "UnderwaterMine_Range_Ammo") then { + "ACE_DefuseObject_Large" createVehicleLocal (getPos _x); + } else { + "ACE_DefuseObject" createVehicleLocal (getPos _x); + }; private _config = configFile >> "CfgAmmo" >> typeOf _x; diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index a1b7ebb9f0..ba4e5a99fc 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -2,14 +2,15 @@ if (!hasInterface) exitWith {}; -GVAR(lastFPTime) = -1; -GVAR(fingersHash) = HASH_CREATE; -GVAR(pfeh_id) = -1; - ["ace_settingsInitialized", { //If not enabled, dont't bother adding eventhandler TRACE_1("ace_settingsInitialized eh", GVAR(enabled)); if (!GVAR(enabled)) exitWith {}; + + GVAR(lastFPTime) = -1; + GVAR(fingersHash) = [] call CBA_fnc_hashCreate; + GVAR(pfeh_id) = -1; + [QGVAR(fingered), {_this call FUNC(incomingFinger)}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index 0f34f3f215..df9fbefe8f 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -28,8 +28,9 @@ private _fingerPos = if (_sourceUnit == ACE_player) then { TRACE_3("incoming finger:", _sourceUnit, _fingerPosPrecise, _fingerPos); private _data = [diag_tickTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName))]; -HASH_SET(GVAR(fingersHash), _sourceUnit, _data); +[GVAR(fingersHash), _sourceUnit, _data] call CBA_fnc_hashSet; if (GVAR(pfeh_id) == -1) then { GVAR(pfeh_id) = [DFUNC(perFrameEH), 0, []] call CBA_fnc_addPerFrameHandler; + TRACE_1("Started PFEH", GVAR(pfeh_id)); }; diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 0263462d04..94ea4fe067 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -15,20 +15,19 @@ */ #include "script_component.hpp" -if (!alive ACE_player) then {GVAR(fingersHash) = HASH_CREATE;}; +if (!alive ACE_player) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; // Conditions: canInteract -if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = HASH_CREATE;}; +if !([ACE_player, ACE_player, ["isNotInside"]] call EFUNC(common,canInteractWith)) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; // Make sure player is dismounted or in a static weapon: -if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = HASH_CREATE;}; +if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "StaticWeapon")}) then {GVAR(fingersHash) = [] call CBA_fnc_hashCreate;}; private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom)); -{ - private _data = HASH_GET(GVAR(fingersHash), _x); - _data params ["_lastTime", "_pos", "_name"]; +[+GVAR(fingersHash), { + _value params ["_lastTime", "_pos", "_name"]; private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime; if (_timeLeftToShow <= 0) then { - HASH_REM(GVAR(fingersHash), _x); + [GVAR(fingersHash), _key] call CBA_fnc_hashRem; } else { private _drawColor = + GVAR(indicatorColor); // Fade out: @@ -36,9 +35,10 @@ private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom)); drawIcon3D [QPATHTOF(UI\fp_icon2.paa), _drawColor, ASLtoAGL _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "RobotoCondensed"]; }; -} count (GVAR(fingersHash) select 0); +}] call CBA_fnc_hashEachPair; -if ((count (GVAR(fingersHash) select 0)) == 0) then { +if ((GVAR(fingersHash) select 1) isEqualTo []) then { + TRACE_1("Ending PFEH", GVAR(pfeh_id)); [GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_id) = -1; }; diff --git a/addons/interact_menu/XEH_PREP.hpp b/addons/interact_menu/XEH_PREP.hpp index b571b19162..0c1a6842fc 100644 --- a/addons/interact_menu/XEH_PREP.hpp +++ b/addons/interact_menu/XEH_PREP.hpp @@ -9,7 +9,6 @@ PREP(collectActiveActionTree); PREP(createAction); PREP(ctrlSetParsedTextCached); PREP(findActionNode); -PREP(handlePlayerChanged); PREP(isSubPath); PREP(keyDown); PREP(keyUp); diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index e4b7655efc..0d280506b3 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -3,6 +3,8 @@ if (!hasInterface) exitWith {}; +GVAR(blockDefaultActions) = []; + GVAR(cachedBuildingTypes) = []; GVAR(cachedBuildingActionPairs) = []; @@ -53,9 +55,6 @@ GVAR(ParsedTextCached) = []; [GVAR(openedMenuType), false] call FUNC(keyUp); }] call CBA_fnc_addEventHandler; -// disable firing while the interact menu is is is opened -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; - // background options ["ace_interactMenuOpened", { if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);}; diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf deleted file mode 100644 index f995ffa454..0000000000 --- a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * Disables firing while the menu is opened. Called from playerChanged eh. - * - * Arguments: - * 0: New unit to add the addAction eh - * 1: Old unit to remove the addAction eh - * - * Return Value: - * None - */ -#include "script_component.hpp" - -params ["_newUnit", "_oldUnit"]; - -// add to new unit -private _ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, { - if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then { - [GVAR(openedMenuType),true] call FUNC(keyUp); - }; -}] call EFUNC(common,addActionEventHandler); - -_newUnit setVariable [QGVAR(AAEHID), _ehid]; - -// remove from old unit -_ehid = _oldUnit getVariable [QGVAR(AAEHID), -1]; - -[_oldUnit, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler); - -_oldUnit setVariable [QGVAR(AAEHID), -1]; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 1aa9b4c653..58286a65bb 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -104,4 +104,22 @@ if (GVAR(openedMenuType) == 0) then { ["ace_interactMenuOpened", [_menuType]] call CBA_fnc_localEvent; +//Remove the old "DefaultAction" action event handler if it already exists +GVAR(blockDefaultActions) params [["_player", objNull], ["_ehid", -1]]; +TRACE_2("blockDefaultActions",_player,_ehid); +if (!isNull _player) then { + [_player, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler); + GVAR(blockDefaultActions) = []; +}; +//Add the "DefaultAction" action event handler +if (alive ACE_player) then { + private _ehid = [ACE_player, "DefaultAction", {GVAR(openedMenuType) >= 0}, { + if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; + }] call EFUNC(common,addActionEventHandler); + TRACE_2("Added",ACE_player,_ehid); + GVAR(blockDefaultActions) = [ACE_player, _ehid]; +}; + true diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index ce96250552..aae9a370c1 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -46,6 +46,14 @@ if(GVAR(actionSelected)) then { ["ace_interactMenuClosed", [GVAR(openedMenuType)]] call CBA_fnc_localEvent; +//Remove the "DefaultAction" action event handler +GVAR(blockDefaultActions) params [["_player", objNull], ["_ehid", -1]]; +TRACE_2("blockDefaultActions",_player,_ehid); +if (!isNull _player) then { + [_player, "DefaultAction", _ehid] call EFUNC(common,removeActionEventHandler); + GVAR(blockDefaultActions) = []; +}; + GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(openedMenuType) = -1; diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index b13ea4b665..410df488f5 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -11,6 +11,6 @@ ACE_DEFAULT_LASER_CODE = 1001; ACE_DEFAULT_LASER_WAVELENGTH = 1550; ACE_DEFAULT_LASER_BEAMSPREAD = 1; -GVAR(laserEmitters) = HASH_CREATE; +GVAR(laserEmitters) = [] call CBA_fnc_hashCreate; ADDON = true; diff --git a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf index 2f73236454..1e03b168fd 100644 --- a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf @@ -5,5 +5,5 @@ ACE_LOGINFO("Laser Emitter Dump"); { ACE_LOGINFO_1(" %1", _x); - ACE_LOGINFO_1(" %1",HASH_GET(GVAR(laserEmitters),_x)); -} forEach GVAR(laserEmitters) select 0; + ACE_LOGINFO_1(" %1",[ARR_2(GVAR(laserEmitters),_x)] call CBA_fnc_hashGet); +} forEach (GVAR(laserEmitters) select 1); diff --git a/addons/laser/functions/fnc_handleLaserOff.sqf b/addons/laser/functions/fnc_handleLaserOff.sqf index 73235592a1..7abc84e665 100644 --- a/addons/laser/functions/fnc_handleLaserOff.sqf +++ b/addons/laser/functions/fnc_handleLaserOff.sqf @@ -3,6 +3,6 @@ private ["_uuid"]; _uuid = _this select 0; -if(HASH_HASKEY(GVAR(laserEmitters), _uuid)) then { - HASH_REM(GVAR(laserEmitters), _uuid); +if ([GVAR(laserEmitters), _uuid] call CBA_fnc_hashHasKey) then { + [GVAR(laserEmitters), _uuid] call CBA_fnc_hashRem; }; diff --git a/addons/laser/functions/fnc_handleLaserOn.sqf b/addons/laser/functions/fnc_handleLaserOn.sqf index 0fe2b0fa44..da0487c21e 100644 --- a/addons/laser/functions/fnc_handleLaserOn.sqf +++ b/addons/laser/functions/fnc_handleLaserOn.sqf @@ -4,4 +4,4 @@ private ["_uuid", "_args"]; _uuid = _this select 0; _args = _this select 1; -HASH_SET(GVAR(laserEmitters), _uuid, _args); +[GVAR(laserEmitters), _uuid, _args] call CBA_fnc_hashSet; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 05e4a50dcf..6b878ea8e4 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -76,7 +76,7 @@ _finalOwner = nil; } forEach (_res select 2); }; }; -} forEach (GVAR(laserEmitters) select 1); +} forEach (GVAR(laserEmitters) select 2); if((count _spots) > 0) then { _bucketPos = nil; @@ -123,7 +123,7 @@ if((count _spots) > 0) then { } forEach _buckets; _finalBucket = _finalBuckets select _largestIndex; - _owners = HASH_CREATE; + _owners = [] call CBA_fnc_hashCreate; if(count _finalBucket > 0) then { _avgX = 0; @@ -135,11 +135,11 @@ if((count _spots) > 0) then { _avgY = _avgY + ((_x select 0) select 1); _avgZ = _avgZ + ((_x select 0) select 2); _owner = _x select 1; - if(HASH_HASKEY(_owners, _owner)) then { - _count = HASH_GET(_owners, _owner); - HASH_SET(_owners, _owner, _count+1); + if ([_owners, _owner] call CBA_fnc_hashHasKey) then { + private _count = [_owners, _owner] call CBA_fnc_hashGet; + [_owners, _owner, _count + 1] call CBA_fnc_hashSet; } else { - HASH_SET(_owners, _owner, 1); + [_owners, _owner, 1] call CBA_fnc_hashSet; }; } forEach _finalBucket; _count = count _finalBucket; diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 0674c44f1a..2cb7e7b7b1 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -10,7 +10,7 @@ class CfgWeapons { picture = QPATHTOF(ui\item_wirecutter_ca.paa); scope = 2; class ItemInfo: InventoryItem_Base_F { - mass = 65; + mass = 25; }; }; }; diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 57c1869851..3d1426ffe4 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -93,18 +93,6 @@ #define PREP_MODULE(folder) [] call compile preprocessFileLineNumbers QPATHTOF(folder\__PREP__.sqf) -#define HASH_CREATE ([] call EFUNC(common,hashCreate)) -#define HASH_SET(hash, key, val) ([hash, key, val, __FILE__, __LINE__] call EFUNC(common,hashSet)) -#define HASH_GET(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashGet)) -#define HASH_REM(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashRem)) -#define HASH_HASKEY(hash, key) ([hash, key, __FILE__, __LINE__] call EFUNC(common,hashHasKey)) - -#define HASHLIST_CREATELIST(keys) ([keys] call EFUNC(common,hashListCreateList)) -#define HASHLIST_CREATEHASH(hashList) ([hashList] call EFUNC(common,hashListCreateHash)) -#define HASHLIST_SELECT(hashList, index) ([hashList, index, __FILE__, __LINE__] call EFUNC(common,hashListSelect)) -#define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) -#define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) - #define ACE_isHC (!hasInterface && !isDedicated) #define IDC_STAMINA_BAR 193 diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 13c08a03fc..ef0f08b24c 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -46,8 +46,8 @@ params ["_mapHandle"]; _grpName = groupID _group; // If color settings for the group exist, then use those, otherwise fall back to the default colors - _color = if (HASH_HASKEY(GVAR(GroupColorConfigurationMapping),_grpName)) then { - (GVAR(GroupColorConfigurations) select (HASH_GET(GVAR(GroupColorConfigurationMapping),_grpName))) select (_x != leader _group) + _color = if ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashHasKey) then { + (GVAR(GroupColorConfigurations) select ([GVAR(GroupColorConfigurationMapping), _grpName] call CBA_fnc_hashGet)) select (_x != leader _group) } else { if (_x == leader _group) then {GVAR(defaultLeadColor)} else {GVAR(defaultColor)}; }; diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 9c21bf867d..52ae6d0a49 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -31,15 +31,15 @@ if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a va // If we already have color configurations from another source, use those, otherwise use default. _configurations = if (isNil QGVAR(GroupColorConfigurations)) then { [] } else { +GVAR(GroupColorConfigurations) }; -_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { HASH_CREATE } else { +GVAR(GroupColorConfigurationMapping) }; +_configurationGroupMappings = if(isNil QGVAR(GroupColorConfigurationMapping)) then { [] call CBA_fnc_hashCreate } else { +GVAR(GroupColorConfigurationMapping) }; // Save custom color configuration and keep the index of the entry. _configurationIndex = _configurations pushBack [_leadColor, _color]; // Add all synchronized groups and reference custom configuration for them { - HASH_SET(_configurationGroupMappings,groupID (group _x),_configurationIndex); -} count _units; + [_configurationGroupMappings, groupID group _x, _configurationIndex] call CBA_fnc_hashSet; +} forEach _units; [QGVAR(GroupColorConfigurations), _configurations, false, true] call EFUNC(common,setSetting); [QGVAR(GroupColorConfigurationMapping), _configurationGroupMappings, false, true] call EFUNC(common,setSetting); diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 0081529c5a..4d0db7af34 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -28,7 +28,7 @@ private _bloodLossOnSelection = 0; }; } forEach (_target getvariable [QGVAR(openWounds), []]); -if (_bloodLossOnSelection >=1 ) then { +if (_bloodLossOnSelection >= 0.15) then { _actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)]; } else { if (_bloodLossOnSelection > 0 ) then { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 0ad6d854f5..d7d19d6e53 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -57,7 +57,10 @@ private _exit = false; _woundEffectiveness = getNumber (_woundTreatmentConfig >> "effectiveness"); }; } else { - ACE_LOGWARNING_2("No config for wound type [%1] config base [%2]", _className, _config); + //Basic medical bandage just has a base level config (same effectivenes for all wound types) + if (_bandage != "Bandage") then { + ACE_LOGWARNING_2("No config for wound type [%1] config base [%2]", _className, _config); + }; }; TRACE_2("Wound classes: ", _specificClass, _classID); @@ -105,8 +108,10 @@ if (GVAR(healHitPointAfterAdvBandage) || {GVAR(level) < 2}) then { // Tally of unbandaged wounds to each body part. private _headWounds = 0; private _bodyWounds = 0; - private _legsWounds = 0; - private _armWounds = 0; + private _leftArmWounds = 0; + private _leftLegWounds = 0; + private _rightArmWounds = 0; + private _rightLegWounds = 0; // Loop through all current wounds and add up the number of unbandaged wounds on each body part. { @@ -129,42 +134,52 @@ if (GVAR(healHitPointAfterAdvBandage) || {GVAR(level) < 2}) then { // Left Arm case 2: { - _armWounds = _armWounds + (_numOpenWounds * _bloodLoss); + _leftArmWounds = _leftArmWounds + (_numOpenWounds * _bloodLoss); }; // Right Arm case 3: { - _armWounds = _armWounds + (_numOpenWounds * _bloodLoss); + _rightArmWounds = _rightArmWounds + (_numOpenWounds * _bloodLoss); }; // Left Leg case 4: { - _legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); + _leftLegWounds = _leftLegWounds + (_numOpenWounds * _bloodLoss); }; // Right Leg case 5: { - _legsWounds = _legsWounds + (_numOpenWounds * _bloodLoss); + _rightLegWounds = _rightLegWounds + (_numOpenWounds * _bloodLoss); }; }; } forEach _currentWounds; + // ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] + private _bodyStatus = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; + // Any body part that has no wounds is healed to full health if (_headWounds == 0) then { - _target setHitPointDamage ["hitHead", 0.0]; + _bodyStatus set [0, 0]; }; - if (_bodyWounds == 0) then { - _target setHitPointDamage ["hitBody", 0.0]; + _bodyStatus set [1, 0]; + }; + if (_leftArmWounds == 0) then { + _bodyStatus set [2, 0]; + }; + if (_rightArmWounds == 0) then { + _bodyStatus set [3, 0]; + }; + if (_leftLegWounds == 0) then { + _bodyStatus set [4, 0]; + }; + if (_rightLegWounds == 0) then { + _bodyStatus set [5, 0]; }; - if (_armWounds == 0) then { - _target setHitPointDamage ["hitHands", 0.0]; - }; + _target setVariable [QGVAR(bodyPartStatus), _bodyStatus, true]; - if (_legsWounds == 0) then { - _target setHitPointDamage ["hitLegs", 0.0]; - }; + [_target] call FUNC(handleDamage_advancedSetDamage); }; true; diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 94d7d7ea45..559d2d4d7e 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -22,13 +22,11 @@ class Extended_InitPost_EventHandlers { class Car { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); - serverInit = QUOTE([ARR_3(_this select 0,1,'ACE_Wheel')] call DFUNC(addSpareParts)); }; }; class Tank { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); - serverInit = QUOTE([ARR_3(_this select 0,1,'ACE_Track')] call DFUNC(addSpareParts)); }; }; class Motorcycle { diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf index 2f0bbe7869..5c94924a5c 100644 --- a/addons/repair/XEH_postInit.sqf +++ b/addons/repair/XEH_postInit.sqf @@ -5,3 +5,14 @@ // wheels [QGVAR(setWheelHitPointDamage), {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; + +if (isServer) then { + ["ace_settingsInitialized", { + TRACE_1("ace_settingsInitialized eh", GVAR(addSpareParts)); + if (!GVAR(addSpareParts)) exitWith {}; + if (!(["ace_cargo"] call EFUNC(common,isModLoaded))) exitWith {}; + + ["Car", "Init", {[_this select 0, 1, "ACE_Wheel"] call FUNC(addSpareParts)}, true, [], true] call CBA_fnc_addClassEventHandler; + ["Tank", "Init", {[_this select 0, 1, "ACE_Track"] call FUNC(addSpareParts)}, true, [], true] call CBA_fnc_addClassEventHandler; + }] call CBA_fnc_addEventHandler; +}; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 1a9055d3e2..9739adedfe 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -132,9 +132,9 @@ _processedHitpoints = []; // Tracks should always be unique if (_hitpoint in _processedHitpoints) exitWith {TRACE_3("Duplicate Track",_hitpoint,_forEachIndex,_selection);}; if (_hitpoint == "HitLTrack") then { - _position = [-1.75, 0, -1.75]; + _position = compile format ["private _return = _target selectionPosition ['%1', 'HitPoints']; _return set [1, 0]; _return", _selection]; } else { - _position = [1.75, 0, -1.75]; + _position = compile format ["private _return = _target selectionPosition ['%1', 'HitPoints']; _return set [1, 0]; _return", _selection]; }; TRACE_4("Adding RepairTrack",_hitpoint,_forEachIndex,_selection,_text); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(canRepair)}; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index 971abb571a..63fe11fb6d 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -33,4 +33,6 @@ if (!EGVAR(common,settingsInitFinished)) exitWith { if (!_force && !GVAR(addSpareParts)) exitWith {}; // Load -["ace_addCargo", [_part, _vehicle, _amount]] call CBA_fnc_localEvent; +[{ + ["ace_addCargo", _this] call CBA_fnc_localEvent; +}, [_part, _vehicle, _amount]] call CBA_fnc_execNextFrame; diff --git a/addons/tagging/ACE_Settings.hpp b/addons/tagging/ACE_Settings.hpp new file mode 100644 index 0000000000..a536718795 --- /dev/null +++ b/addons/tagging/ACE_Settings.hpp @@ -0,0 +1,11 @@ +class ACE_Settings { + class GVAR(quickTag) { + category = CSTRING(Tagging); + displayName = CSTRING(QuickTag); + description = CSTRING(QuickTagDesc); + typeName = "SCALAR"; + value = 1; + values[] = {ECSTRING(Common,Disabled), CSTRING(LastUsed), CSTRING(RandomX), CSTRING(Random)}; + isClientSettable = 1; + }; +}; diff --git a/addons/tagging/ACE_Tags.hpp b/addons/tagging/ACE_Tags.hpp new file mode 100644 index 0000000000..78762cf888 --- /dev/null +++ b/addons/tagging/ACE_Tags.hpp @@ -0,0 +1,26 @@ +class ACE_Tags { + class ACE_XBlack { + displayName = CSTRING(XBlack); + requiredItem = "ACE_SpraypaintBlack"; + textures[] = {QPATHTOF(UI\tags\black\0.paa), QPATHTOF(UI\tags\black\1.paa), QPATHTOF(UI\tags\black\2.paa)}; + icon = QPATHTOF(UI\icons\iconTaggingBlack.paa); + }; + class ACE_XRed { + displayName = CSTRING(XRed); + requiredItem = "ACE_SpraypaintRed"; + textures[] = {QPATHTOF(UI\tags\red\0.paa), QPATHTOF(UI\tags\red\1.paa), QPATHTOF(UI\tags\red\2.paa)}; + icon = QPATHTOF(UI\icons\iconTaggingRed.paa); + }; + class ACE_XGreen { + displayName = CSTRING(XGreen); + requiredItem = "ACE_SpraypaintGreen"; + textures[] = {QPATHTOF(UI\tags\green\0.paa), QPATHTOF(UI\tags\green\1.paa), QPATHTOF(UI\tags\green\2.paa)}; + icon = QPATHTOF(UI\icons\iconTaggingGreen.paa); + }; + class ACE_XBlue { + displayName = CSTRING(XBlue); + requiredItem = "ACE_SpraypaintBlue"; + textures[] = {QPATHTOF(UI\tags\blue\0.paa), QPATHTOF(UI\tags\blue\1.paa), QPATHTOF(UI\tags\blue\2.paa)}; + icon = QPATHTOF(UI\icons\iconTaggingBlue.paa); + }; +}; diff --git a/addons/tagging/CfgVehicles.hpp b/addons/tagging/CfgVehicles.hpp index 2a71c773a0..80072ab1fc 100644 --- a/addons/tagging/CfgVehicles.hpp +++ b/addons/tagging/CfgVehicles.hpp @@ -1,38 +1,59 @@ class CfgVehicles { - class Man; - class CAManBase: Man { - class ACE_SelfActions { - class ACE_Equipment { - class ACE_TagBlack { - displayName = CSTRING(TagBlack); - condition = QUOTE(('ACE_SpraypaintBlack' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'black' call FUNC(getTexture))] call FUNC(tag)); - showDisabled = 0; - priority = 3; - icon = QPATHTOF(UI\icons\iconTaggingBlack.paa); - }; - class ACE_TagRed: ACE_TagBlack { - displayName = CSTRING(TagRed); - condition = QUOTE(('ACE_SpraypaintRed' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'red' call FUNC(getTexture))] call FUNC(tag)); - icon = QPATHTOF(UI\icons\iconTaggingRed.paa); - }; - class ACE_TagGreen: ACE_TagBlack { - displayName = CSTRING(TagGreen); - condition = QUOTE(('ACE_SpraypaintGreen' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'green' call FUNC(getTexture))] call FUNC(tag)); - icon = QPATHTOF(UI\icons\iconTaggingGreen.paa); - }; - class ACE_TagBlue: ACE_TagBlack { - displayName = CSTRING(TagBlue); - condition = QUOTE(('ACE_SpraypaintBlue' in items ACE_player) && {[] call FUNC(checkTaggable)}); - statement = QUOTE([ARR_2(ACE_player,'blue' call FUNC(getTexture))] call FUNC(tag)); - icon = QPATHTOF(UI\icons\iconTaggingBlue.paa); + class ACE_Module; + class ACE_ModuleTagging: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Tagging); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + icon = QPATHTOF(UI\Icon_Module_Tagging_ca.paa); + class Arguments { + class quickTag { + displayName = CSTRING(QuickTag); + description = CSTRING(QuickTagDesc); + typeName = "NUMBER"; + class values { + class disabled { + name = ECSTRING(Common,Disabled); + value = 0; + }; + class lastUsed { + name = CSTRING(LastUsed); + value = 1; + default = 1; + }; + class randomX { + name = CSTRING(RandomX); + value = 2; + }; + class random { + name = CSTRING(Random); + value = 3; + }; }; }; }; + class ModuleDescription { + description = CSTRING(ModuleDescription); + }; }; + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Tags { + displayName = CSTRING(Tag); + condition = QUOTE(_player call FUNC(checkTaggable)); + statement = QUOTE(_player call FUNC(quickTag)); + icon = QPATHTOF(UI\icons\iconTaggingBlack.paa); + insertChildren = QUOTE(_player call FUNC(addTagActions)); + }; + }; + }; + + class Item_Base_F; class ACE_Item_SpraypaintBlack: Item_Base_F { author = "jokoho48"; diff --git a/addons/tagging/UI/Icon_Module_Tagging_ca.paa b/addons/tagging/UI/Icon_Module_Tagging_ca.paa new file mode 100644 index 0000000000..6f3a4a3552 Binary files /dev/null and b/addons/tagging/UI/Icon_Module_Tagging_ca.paa differ diff --git a/addons/tagging/XEH_PREP.hpp b/addons/tagging/XEH_PREP.hpp index f8a8598cd7..44bd74b992 100644 --- a/addons/tagging/XEH_PREP.hpp +++ b/addons/tagging/XEH_PREP.hpp @@ -1,5 +1,10 @@ +PREP(addCustomTag); +PREP(addTagActions); +PREP(applyCustomTag); PREP(checkTaggable); +PREP(compileConfigTags); PREP(createTag); -PREP(getTexture); +PREP(moduleInit); +PREP(quickTag); PREP(tag); PREP(tagTestingThread); diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index 055cb59cfd..ddac9b9ab9 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -39,6 +39,24 @@ for "_index" from 0 to (_countOptions - 1) do { }; }; +if (hasInterface) then { + // Compile and cache config tags + call FUNC(compileConfigTags); + + // Scripted tag adding EH + [QGVAR(applyCustomTag), FUNC(applyCustomTag)] call CBA_fnc_addEventHandler; + + // Keybind + ["ACE3 Equipment", QGVAR(quickTag), localize LSTRING(QuickTag), { + // Conditions + if !(ACE_player call FUNC(checkTaggable)) exitWith {false}; + + // Statement + ACE_player call FUNC(quickTag); + true + }, {false}, [0, [false, false, false]], false] call CBA_fnc_addKeybind; // Unbound +}; + if (!isServer) exitWith {}; GVAR(testingThread) = false; diff --git a/addons/tagging/XEH_preInit.sqf b/addons/tagging/XEH_preInit.sqf index a7feade1c3..66458c6995 100644 --- a/addons/tagging/XEH_preInit.sqf +++ b/addons/tagging/XEH_preInit.sqf @@ -4,4 +4,7 @@ ADDON = false; #include "XEH_PREP.hpp" +GVAR(cachedTags) = []; +GVAR(cachedRequiredItems) = []; + ADDON = true; diff --git a/addons/tagging/config.cpp b/addons/tagging/config.cpp index 634f7c57af..e066bcafe5 100644 --- a/addons/tagging/config.cpp +++ b/addons/tagging/config.cpp @@ -8,12 +8,14 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author = ECSTRING(common,ACETeam); - authors[] = {"BaerMitUmlaut","esteldunedain"}; + authors[] = {"BaerMitUmlaut", "esteldunedain", "Jonpas"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; }; +#include "ACE_Settings.hpp" +#include "ACE_Tags.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/tagging/functions/fnc_addCustomTag.sqf b/addons/tagging/functions/fnc_addCustomTag.sqf new file mode 100644 index 0000000000..455b33ffd8 --- /dev/null +++ b/addons/tagging/functions/fnc_addCustomTag.sqf @@ -0,0 +1,54 @@ +/* + * Author: Jonpas + * Adds custom tag. Has to be executed on one machine only. + * + * Arguments: + * 0: Unique Identifier + * 1: Display Name + * 2: Required Item + * 3: Textures Paths + * 4: Icon Path (default: "") + * + * Return Value: + * Sucessfully Added Tag + * + * Example: + * ["ace_victoryRed", "Victory Red", "ACE_SpraypaintRed", ["path\to\texture1.paa", "path\to\texture2.paa"], "path\to\icon.paa"] call ace_tagging_fnc_addCustomTag + * + * Public: Yes + */ +#include "script_component.hpp" + +params [ + ["_identifier", "", [""]], + ["_displayName", "", [""]], + ["_requiredItem", "", [""]], + ["_textures", [], [[]]], + ["_icon", "", [""]] +]; + +// Verify +if (_identifier == "") exitWith { + ACE_LOGERROR("Failed adding custom tag - missing identifier"); +}; + +if (_displayName == "") exitWith { + ACE_LOGERROR_1("Failed adding custom tag: %1 - missing displayName",_identifier); +}; + +if (_requiredItem == "") exitWith { + ACE_LOGERROR_1("Failed adding custom tag: %1 - missing requiredItem",_identifier); +}; +if (!isClass (configFile >> "CfgWeapons" >> _requiredItem)) exitWith { + ACE_LOGERROR_2("Failed adding custom tag: %1 - requiredItem %2 does not exist",_identifier,_requiredItem); +}; + +if (_textures isEqualTo []) exitWith { + ACE_LOGERROR_1("Failed adding custom tag: %1 - missing textures",_identifier); +}; + +_identifier = [_identifier] call EFUNC(common,stringRemoveWhiteSpace); +_requiredItem = toLower _requiredItem; + +// Add +[QGVAR(applyCustomTag), [_identifier, _displayName, _requiredItem, _textures, _icon]] call CBA_fnc_globalEventJIP; diff --git a/addons/tagging/functions/fnc_addTagActions.sqf b/addons/tagging/functions/fnc_addTagActions.sqf new file mode 100644 index 0000000000..82acf253ad --- /dev/null +++ b/addons/tagging/functions/fnc_addTagActions.sqf @@ -0,0 +1,46 @@ +/* + * Author: Jonpas + * Compiles tags from ACE_Tags and returns children actions. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [unit] call ace_tagging_fnc_addTagActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _actions = []; +{ + _x params ["_class", "_displayName", "_requiredItem", "_textures", "_icon"]; + + _actions pushBack [ + [ + format ["ACE_ConfigTag_%1", _class], + _displayName, + _icon, + { + (_this select 2) params ["_unit", "_class", "_textures"]; + [_unit, selectRandom _textures] call FUNC(tag); + _unit setVariable [QGVAR(lastUsedTag), _class]; + }, + { + (_this select 2) params ["_unit", "", "", "_requiredItem"]; + _requiredItem in ((items _unit) apply {toLower _x}) + }, + {}, + [_unit, _class, _textures, _requiredItem] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; +} forEach GVAR(cachedTags); + +_actions diff --git a/addons/tagging/functions/fnc_applyCustomTag.sqf b/addons/tagging/functions/fnc_applyCustomTag.sqf new file mode 100644 index 0000000000..2dd694c7d8 --- /dev/null +++ b/addons/tagging/functions/fnc_applyCustomTag.sqf @@ -0,0 +1,33 @@ +/* + * Author: Jonpas + * Applies custom tag to the cache. + * + * Arguments: + * 0: Unique Identifier + * 1: Display Name + * 2: Required Item + * 3: Textures Paths + * 4: Icon Path (default: "") + * + * Return Value: + * None + * + * Example: + * ["ace_victoryRed", "Victory Red", "ACE_SpraypaintRed", ["path\to\texture1.paa", "path\to\texture2.paa"], "path\to\icon.paa"] call ace_tagging_fnc_addCustomTagLocal + * + * Public: No + */ +#include "script_component.hpp" + +params ["_identifier", "_displayName", "_requiredItem"]; + +// Add only if tag not already added (compare identifiers) +if (GVAR(cachedTags) select {_x select 0 == _identifier} isEqualTo []) then { + GVAR(cachedTags) pushBack _this; + if !(_requiredItem in GVAR(cachedRequiredItems)) then { + GVAR(cachedRequiredItems) pushBack _requiredItem; + }; + TRACE_1("Added custom script tag",_this); +} else { + ACE_LOGINFO_2("Tag with selected identifier already exists: %1 (%2)",_identifier,_displayName) +}; diff --git a/addons/tagging/functions/fnc_checkTaggable.sqf b/addons/tagging/functions/fnc_checkTaggable.sqf index b77473f25b..d739bbfec5 100644 --- a/addons/tagging/functions/fnc_checkTaggable.sqf +++ b/addons/tagging/functions/fnc_checkTaggable.sqf @@ -3,26 +3,33 @@ * Checks if there is a taggable surface within 2.5m in front of the player. * * Arguments: - * None + * 0: Unit * * Return Value: - * Is wall taggable + * Is surface taggable * * Example: - * [] call ace_tagging_fnc_checkTaggable + * [unit] call ace_tagging_fnc_checkTaggable * * Public: No */ #include "script_component.hpp" -[[], { - private _startPosASL = eyePos ACE_player; +params ["_unit"]; + +[[_unit], { + params ["_unit"]; + + // Exit if no required item in inventory + if ((GVAR(cachedRequiredItems) arrayIntersect ((items _unit) apply {toLower _x})) isEqualTo []) exitWith {false}; + + private _startPosASL = eyePos _unit; private _cameraPosASL = AGLToASL positionCameraToWorld [0, 0, 0]; private _cameraDir = (AGLToASL positionCameraToWorld [0, 0, 1]) vectorDiff _cameraPosASL; private _endPosASL = _startPosASL vectorAdd (_cameraDir vectorMultiply 2.5); - private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, ACE_player, objNull, true, 1, "FIRE", "GEOM"]; + private _intersections = lineIntersectsSurfaces [_startPosASL, _endPosASL, _unit, objNull, true, 1, "FIRE", "GEOM"]; // If there's no intersections if (_intersections isEqualTo []) exitWith {false}; diff --git a/addons/tagging/functions/fnc_compileConfigTags.sqf b/addons/tagging/functions/fnc_compileConfigTags.sqf new file mode 100644 index 0000000000..cfc90ba413 --- /dev/null +++ b/addons/tagging/functions/fnc_compileConfigTags.sqf @@ -0,0 +1,53 @@ +/* + * Author: Jonpas + * Compiles and caches tags from ACE_Tags config. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_tagging_fnc_compileConfigTags + * + * Public: No + */ +#include "script_component.hpp" + +{ + private _failure = false; + private _class = configName _x; + + private _displayName = getText (_x >> "displayName"); + if (_displayName == "") then { + ACE_LOGERROR_1("Failed compiling ACE_Tags for tag: %1 - missing displayName",_class); + _failure = true; + }; + + private _requiredItem = toLower (getText (_x >> "requiredItem")); + if (_requiredItem == "") then { + ACE_LOGERROR_1("Failed compiling ACE_Tags for tag: %1 - missing requiredItem",_class); + _failure = true; + } else { + if (!isClass (configFile >> "CfgWeapons" >> _requiredItem)) then { + ACE_LOGERROR_2("Failed compiling ACE_Tags for tag: %1 - requiredItem %2 does not exist",_class,_requiredItem); + _failure = true; + }; + }; + + private _textures = getArray (_x >> "textures"); + if (_textures isEqualTo []) then { + ACE_LOGERROR_1("Failed compiling ACE_Tags for tag: %1 - missing textures",_class); + _failure = true; + }; + + private _icon = getText (_x >> "icon"); + + if (!_failure) then { + GVAR(cachedTags) pushBack [_class, _displayName, _requiredItem, _textures, _icon]; + if !(_requiredItem in GVAR(cachedRequiredItems)) then { + GVAR(cachedRequiredItems) pushBack _requiredItem; + }; + }; +} forEach ("true" configClasses (configFile >> "ACE_Tags")); diff --git a/addons/tagging/functions/fnc_getTexture.sqf b/addons/tagging/functions/fnc_getTexture.sqf deleted file mode 100644 index f7f6d7e5e2..0000000000 --- a/addons/tagging/functions/fnc_getTexture.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Author: BaerMitUmlaut, esteldunedain, Jonpas - * Puts together a full path to the given tag color texture. Internal ACE3 textures only. - * - * Arguments: - * 0: The colour of the tag (valid colours are black, red, green and blue) - * - * Return Value: - * Texture (full path), "" if not found - * - * Example: - * texture = ["blue"] call ace_tagging_fnc_getTexture - * - * Public: No - */ - -#include "script_component.hpp" - -params ["_color"]; - -if !((toLower _color) in ["black", "red", "green", "blue"]) exitWith { - ACE_LOGERROR_1("%1 is not a valid tag colour.",_color); - "" -}; - -QUOTE(PATHTOF(UI)) + "\tags\" + _color + "\" + str (floor (random 3)) + ".paa" diff --git a/addons/tagging/functions/fnc_moduleInit.sqf b/addons/tagging/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..c9d3172d57 --- /dev/null +++ b/addons/tagging/functions/fnc_moduleInit.sqf @@ -0,0 +1,25 @@ +/* + * Author: Jonpas + * Initializes the Tagging module. + * + * Arguments: + * 0: The module logic + * 1: Units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(quickTag), "quickTag"] call EFUNC(common,readSettingFromModule); + +ACE_LOGINFO("Tagging Module Initialized."); diff --git a/addons/tagging/functions/fnc_quickTag.sqf b/addons/tagging/functions/fnc_quickTag.sqf new file mode 100644 index 0000000000..7f0a1d706e --- /dev/null +++ b/addons/tagging/functions/fnc_quickTag.sqf @@ -0,0 +1,51 @@ +/* + * Author: Jonpas + * Selects random tag and applies it. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_tagging_fnc_quickTag + * + * Public: No + */ + +#include "script_component.hpp" + +// Exit if Quick Tag disabled +if (GVAR(quickTag) == 0) exitWith {}; + +params ["_unit"]; + +private _possibleTags = []; + +// Last Used +if (GVAR(quickTag) == 1) then { + private _lastUsedTagClass = _unit getVariable [QGVAR(lastUsedTag), nil]; + + if (!isNil "_lastUsedTagClass") then { + private _lastUsedTag = GVAR(cachedTags) select {(_x select 0) == _lastUsedTagClass}; + _possibleTags = _lastUsedTag; + }; +}; + +// Random X +if (GVAR(quickTag == 2)) then { + private _xTags = GVAR(cachedTags) select {(_x select 0) in ["ACE_XBlack", "ACE_XRed", "ACE_XGreen", "ACE_XBlue"]}; + _possibleTags = _xTags; +}; + +// Random +if (GVAR(quickTag) == 3) then { + _possibleTags = GVAR(cachedTags); +}; + +// Tag +if !(_possibleTags isEqualTo []) then { + private _availableTags = _possibleTags select {(_x select 2) in ((items _unit) apply {toLower _x})}; + [_unit, selectRandom ((selectRandom _availableTags) select 3)] call FUNC(tag); +}; diff --git a/addons/tagging/script_component.hpp b/addons/tagging/script_component.hpp index 18066d4c0d..5eca5d92d7 100644 --- a/addons/tagging/script_component.hpp +++ b/addons/tagging/script_component.hpp @@ -7,12 +7,12 @@ // #define CBA_DEBUG_SYNCHRONOUS // #define ENABLE_PERFORMANCE_COUNTERS -#ifdef DEBUG_ENABLED_BLANK +#ifdef DEBUG_ENABLED_TAGGING #define DEBUG_MODE_FULL #endif -#ifdef DEBUG_SETTINGS_BLANK - #define DEBUG_SETTINGS DEBUG_SETTINGS_BLANK +#ifdef DEBUG_SETTINGS_TAGGING + #define DEBUG_SETTINGS DEBUG_SETTINGS_TAGGING #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/tagging/stringtable.xml b/addons/tagging/stringtable.xml index 43f6a1e2d4..29eee8771f 100644 --- a/addons/tagging/stringtable.xml +++ b/addons/tagging/stringtable.xml @@ -1,45 +1,76 @@  - - Tag black - Schwarz markieren - Marcar en negro - Oznakuj na czarno - Tag noir - Marca nero - Označit černě - Marcar em preto + + Tagging - - Tag red - Rot markieren - Marcar en rojo - Oznakuj na czerwono - Tag rouge - Marca rosso - Označit červeně - Marcar em vermelho + + Configure how the tagging system will operate by default. - - Tag green - Grün markieren - Marcar en verde - Oznakuj na zielono - Tag vert - Marca verde - Označit zeleně - Marcar em verde + + Quick Tag - - Tag blue - Blau markieren - Marcar en azul - Oznakuj na niebiesko - Tag bleu - Marca blu - Označit modře - Marcar em azul + + Action performed on main tag interaction point. + + + Last Used + + + Random X + + + Random + + + Tag + Markieren + Marcar + Oznakuj + Tag + Marca + Označit + Marcar + + + X black + Schwarz X + X en negro + X na czarno + X noir + X nero + X černě + X em preto + + + X red + Rot X + X en rojo + X na czerwono + X rouge + X rosso + X červeně + X em vermelho + + + X green + Grün X + X en verde + X na zielono + X vert + X verde + X zeleně + X em verde + + + X blue + Blau X + X en azul + X na niebiesko + X bleu + X blu + X modře + X em azul Black spray paint @@ -92,4 +123,4 @@ Uma lata de tinta spray para marcar paredes. - \ No newline at end of file + diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Tagging_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Tagging_ca.png new file mode 100644 index 0000000000..653fe60f46 Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Tagging_ca.png differ diff --git a/extras/assets/icons/Icons_Modules.psd b/extras/assets/icons/Icons_Modules.psd index 0da44ea681..ac07ae7c77 100644 Binary files a/extras/assets/icons/Icons_Modules.psd and b/extras/assets/icons/Icons_Modules.psd differ diff --git a/optionals/compat_rhs_afrf3/CfgVehicles.hpp b/optionals/compat_rhs_afrf3/CfgVehicles.hpp index 2437f8cd2d..0cff8ac680 100644 --- a/optionals/compat_rhs_afrf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_afrf3/CfgVehicles.hpp @@ -31,13 +31,13 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 300; class Turrets: Turrets { class CommanderOptics: NewTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class GPMGTurret1: NewTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -45,10 +45,10 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 460; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class Com_BMP1: NewTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -59,7 +59,7 @@ class CfgVehicles { class MainTurret: MainTurret { class Turrets: Turrets { class CommanderOptics : CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -69,15 +69,15 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 460; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; class Turrets: Turrets { class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; class GPMGTurret1: NewTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -85,10 +85,10 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 300; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -96,11 +96,11 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 400; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; class Turrets: Turrets { class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -114,7 +114,7 @@ class CfgVehicles { }; }; class GPMGTurret1: NewTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -127,7 +127,7 @@ class CfgVehicles { }; class GPMGTurret1: GPMGTurret1 {}; class GPMGTurret2: GPMGTurret1 { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -135,13 +135,13 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 1200; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; class Turrets: Turrets { class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class CommanderMG: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -164,10 +164,10 @@ class CfgVehicles { class rhs_t90_tv: rhs_t72bd_tv { class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; class Turrets: Turrets { class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -177,13 +177,13 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 1200; class Turrets: Turrets { class MainTurret: MainTurret { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; class Turrets: Turrets { class CommanderOptics: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; class CommanderMG: CommanderOptics { - ace_fcs_Enabled = 0; + EGVAR(fcs,enabled) = 0; }; }; }; @@ -294,9 +294,20 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 78; }; - class APC_Tracked_02_base_F; + class APC_Tracked_02_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class rhs_zsutank_base : APC_Tracked_02_base_F { EGVAR(refuel,fuelCapacity) = 515; + + class Turrets: Turrets { + class MainTurret: MainTurret { + EGVAR(fcs,enabled) = 0; + }; + }; }; class rhs_btr60_base : rhs_btr_base {