diff --git a/.travis.yml b/.travis.yml index 313b0a11c7..1d2a49e2e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ branches: only: - - master + - master + - release language: python python: - '3.4' @@ -19,12 +20,10 @@ env: - secure: KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg= notifications: slack: - secure: aWYF/YX7vxEdXJ5w1jhYJQ2TtTP2NRdnXzJDMYXTv2dlXYhO9qp2qjxDGW3dezuPY7B1mPBgebfSKRx3Robkt1rAfEwPWivOiEztL30rwzOy+5Q1wpORv1JkvTC/q2wqQzxQCU/FPVjD2GkF1wtq1Rnx3ESWD8gbvzYoMNdIw1g= - on_success: change - on_failure: always - on_start: never rooms: - secure: MvxmqL1NGwiGTVv6uIVTM7jeNLQH95KYtTgSWlXaSw4jdjnf4cmrb/ofHQ3FHhhNVdhRN6W8n0cJfTC3DBZ90bionVh+528qw2mDnDbKljVdIwmoFSexBcH7H1uTLF3gsEz0tbrHtLcnAyTMxdjsdIXDLZ5hwxABNmW5/03jOgs= + - secure: byZMNBl8PMlgjT9NA1WmhgCdGfX4b3g1kA0vEiwfm+IFNlx7BiM4J/5rp6zV/jV470xl/epAejx2tsa5SdTyFbO87NH63ILJSt5QnjUZjRuGKSutFs9WE671DtZkPRSJXHS4N6x802PRkyBz/84/lsc34FWvHvjwOuYAtOcJRFk= + - secure: V22TNaLWV+yUNWqR7c6HVvIxkRDz7Dyz9xqa43FY8iFgvNL4Q/X69h5DYHU/ILNFM00tx8OBjtPRbcjWQ+F6eY8Sje/A2axJAU+qNurAvoyiTahXUprdUUpPdkgXWuSRTZ9kALxOq5e11RC8XUietghoMcl8zPcqdrZCOOKgoEM= + on_success: change email: on_success: never on_failure: change diff --git a/AUTHORS.txt b/AUTHORS.txt index f4ebd317eb..5eee93a7f6 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE3 CONTRIBUTOR LIST +# ACE3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -37,6 +37,7 @@ alef Aleksey EpMAK Yermakov Alganthe Anthariel +Arkhir Asgar Serran Bamse Bla1337 @@ -53,7 +54,7 @@ Crusty Dharma Bellamkonda Dimaslg Drill -Dudakov +Dudakov aka [OMCB]Kaban Dslyecxi eRazeri evromalarkey @@ -108,6 +109,7 @@ Toaster Tonic Tourorist Valentin Torikian +voiper VyMajoris(W-Cephei) Winter zGuba diff --git a/README.md b/README.md index a407f5a299..d95c152904 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@

- ACE3 Version + ACE3 Version - - ACE3 Download + + ACE3 Download ACE3 Issues diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 41e0533991..a35dcbd2da 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 9debec1dc8..1f7e2ecde7 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -36,7 +36,7 @@ GVAR(Protractor) = true; if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith { GVAR(Protractor) = false; 1 cutText ["", "PLAIN"]; - [_idPFH] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; 1 cutRsc ["RscProtractor", "PLAIN", 1, false]; diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index 7a432831ad..fc8dc1b8a2 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -12,11 +12,7 @@ */ #include "script_component.hpp" -private "_deleted"; - -_deleted = 0; - -_aceTimeSecond = floor ACE_time; +private _aceTimeSecond = floor ACE_time; { private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; @@ -26,19 +22,19 @@ _aceTimeSecond = floor ACE_time; _bulletSpeed = vectorMagnitude _bulletVelocity; - if (!alive _bullet || _bulletSpeed < 100) exitWith { - GVAR(allBullets) deleteAt (_forEachIndex - _deleted); - _deleted = _deleted + 1; + if (!alive _bullet || _bulletSpeed < 100) then { + GVAR(allBullets) deleteAt (GVAR(allBullets) find _x); + } else { + _bulletPosition = getPosASL _bullet; + + if (_bulletTraceVisible && _bulletSpeed > 500) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; + }; + + call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]); }; - - _bulletPosition = getPosASL _bullet; - - if (_bulletTraceVisible && _bulletSpeed > 500) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; - }; - - call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]); -} forEach GVAR(allBullets); + nil +} count +GVAR(allBullets); if (GVAR(allBullets) isEqualTo []) then { [_this select 1] call CBA_fnc_removePerFrameHandler; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 8d9cb73509..90eacf2928 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -54,7 +54,7 @@ if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _wea if (_abort || !(GVAR(extensionAvailable))) exitWith { if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { - EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; + EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; }; }; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 53ac6aa874..02468d0349 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -40,7 +40,7 @@ GVAR(currentGrid) = 0; #ifdef DEBUG_MODE_FULL systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; #endif - [_idPFH] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; for "_i" from 1 to 50 do { diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index aad591581a..07b93eb2da 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -54,7 +54,7 @@ GVAR(active) = true; GVAR(DialogPFH) = [{ if (!GVAR(active)) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; }; __ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))]; }, 60, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/atragmx/functions/fnc_on_close_dialog.sqf b/addons/atragmx/functions/fnc_on_close_dialog.sqf index 46cbbfc146..1f254c646a 100644 --- a/addons/atragmx/functions/fnc_on_close_dialog.sqf +++ b/addons/atragmx/functions/fnc_on_close_dialog.sqf @@ -2,4 +2,4 @@ uiNamespace setVariable ['ATragMX_Display', nil]; GVAR(active) = false; -[GVAR(DialogPFH)] call cba_fnc_removePerFrameHandler; \ No newline at end of file +[GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 9bc5b7e34f..0f42f9637c 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -37,7 +37,7 @@ if !(ctrlVisible 9000) then { false call FUNC(show_target_speed_assist_timer); true call FUNC(show_target_speed_assist); - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; }; ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)]; diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index daf91a43df..e462c0cefa 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -61,7 +61,6 @@ class CfgVehicles { showDisabled = 0; priority = 5; icon = PATHTOF(UI\attach_ca.paa); - // hotkey = "T"; }; class GVAR(Detach) { displayName = CSTRING(Detach); @@ -71,7 +70,6 @@ class CfgVehicles { showDisabled = 0; priority = 5; icon = PATHTOF(UI\detach_ca.paa); - hotkey = "T"; }; }; }; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index b8e2cc17fb..922136107e 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -10,7 +10,7 @@ * Arguments: * 0: Unit (player) * 1: attachToVehicle - * 2: Item Classname (cfgWeapon/cfgMagazine) + * 2: Item Classname (CfgWeapon/CfgMagazine) * 3: Light Vehicle Classname * 4: On Attach Text * 5: Starting Pos of dummy item diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 4e61e8fbcc..b7ab4cd1f4 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -17,24 +17,17 @@ params ["_target", "_backpack"]; // do cam shake if the target is the player -if ([_target] call EFUNC(common,isPlayer)) then { +if (_target call EFUNC(common,isPlayer)) then { addCamShake [4, 0.5, 5]; }; // play a zipper sound effect -private ["_sounds", "_position"]; - -_sounds = [ - /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss", - "a3\sounds_f\characters\ingame\AinvPknlMstpSlayWrflDnon_medic.wss", - "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWpstDnon_medic.wss", - "a3\sounds_f\characters\ingame\AinvPpneMstpSlayWrflDnon_medic.wss"*/ - +private _sounds = [ QUOTE(PATHTO_R(sounds\zip_in.wav)), QUOTE(PATHTO_R(sounds\zip_out.wav)) ]; -_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3")); +private _position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3")); playSound3D [ _sounds select floor random count _sounds, diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index fab82c505f..d6b0fb1071 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -12,13 +12,12 @@ */ #include "script_component.hpp" -params ["_backpack"]; +params [["_backpack", objNull, [objNull]]]; -if (typeName _backpack == "OBJECT") then { +if (_backpack isEqualType objNull) then { _backpack = typeOf _backpack; }; -private "_config"; -_config = configFile >> "CfgVehicles" >> _backpack; +private _config = configFile >> "CfgVehicles" >> _backpack; getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index 154000202d..d9a99535eb 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -16,11 +16,10 @@ params ["_unit", "_backpack"]; // exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. -if !([_backpack] call FUNC(isBackpack)) exitWith {false}; +if !(_backpack call FUNC(isBackpack)) exitWith {false}; // get the unit that wears the backpack object -private "_target"; -_target = objectParent _backpack; +private _target = objectParent _backpack; if (isNull _target) exitWith {false}; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 0cfda46128..a8215c0cdc 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -32,7 +32,6 @@ class CfgVehicles { showDisabled = 0; icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.3; - hotkey = "E"; }; class ACE_StopEscorting { displayName = CSTRING(StopEscorting); @@ -43,7 +42,6 @@ class CfgVehicles { showDisabled = 0; icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.3; - hotkey = "E"; }; class ACE_LoadCaptive { displayName = CSTRING(LoadCaptive); @@ -54,7 +52,6 @@ class CfgVehicles { showDisabled = 0; icon = QUOTE(PATHTOF(UI\captive_ca.paa)); priority = 2.2; - hotkey = "L"; }; class GVAR(UnloadCaptive) { displayName = CSTRING(UnloadCaptive); @@ -74,7 +71,6 @@ class CfgVehicles { exceptions[] = {"isNotEscorting"}; showDisabled = 0; priority = 2.3; - hotkey = "C"; }; class ACE_StartSurrenderingSelf { displayName = CSTRING(StartSurrendering); @@ -165,7 +161,7 @@ class CfgVehicles { description = CSTRING(ModuleSurrender_Description); sync[] = {"AnyAI"}; }; - }; + }; class GVAR(ModuleHandcuffed): Module_F { author = ECSTRING(common,ACETeam); category = "ACE"; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 08b64195f3..484151853b 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -45,7 +45,7 @@ if (_state) then { }; if (!(_unit getVariable [QGVAR(isEscorting), false])) then { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; [objNull, _target, false] call EFUNC(common,claim); detach _target; _unit removeAction _actionID; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index aea91b5e11..3ff0e00752 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -21,10 +21,10 @@ params ["_newUnit","_oldUnit"]; //set showHUD based on new unit status: if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { TRACE_1("Player Change (showHUD false)",_newUnit); - showHUD false; + ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); } else { TRACE_1("Player Change (showHUD true)",_newUnit); - showHUD true; + ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; //If old player was escorting, stop diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 7b30199caf..ef8aedbbe1 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -23,9 +23,9 @@ params ["_unit","_zeusIsOpen"]; if (!_zeusIsOpen) then { if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then { TRACE_1("Player Change (showHUD false)",_unit); - showHUD false; + ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); } else { TRACE_1("Player Change (showHUD true)",_unit); - showHUD true; + ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; }; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index a4788db057..1e686ea849 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -19,7 +19,7 @@ params ["_unit","_state"]; TRACE_2("params",_unit,_state); -if (!local _unit) exitwith { +if (!local _unit) exitWith { ERROR("running setHandcuffed on remote unit"); }; if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith { @@ -38,7 +38,7 @@ if (_state) then { _unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true]; if (_unit == ACE_player) then { - showHUD false; + ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); }; // fix anim on mission start (should work on dedicated servers) @@ -107,7 +107,7 @@ if (_state) then { }; if (_unit == ACE_player) then { - showHUD true; + ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 5af4454472..aa65c1273d 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -19,7 +19,7 @@ params ["_unit","_state"]; TRACE_2("params",_unit,_state); -if (!local _unit) exitwith { +if (!local _unit) exitWith { ERROR("running surrender on remote unit"); }; @@ -36,7 +36,7 @@ if (_state) then { [_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus); if (_unit == ACE_player) then { - showHUD false; + ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud); }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); @@ -75,7 +75,7 @@ if (_state) then { if (_unit == ACE_player) then { //only re-enable HUD if not handcuffed if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then { - showHUD true; + ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; }; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 8465588fb5..17b44bc8fe 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -181,13 +181,17 @@ Make Unit Handcuffed + Skuj jednostkę Fazer unidade algemada Связать юнита + Spoutat jednotku Sync a unit to make them handcuffed.<br />Source: ace_captives + Zsynchronizuj z jednostką, aby została skuta.<br />Źródło: ace_captives Sincronizar uma unidade para deixá-la algemada.<br/>Source: ace_captives Синхронизируйте с юнитами, чтобы сделать их связанными.<br />Источник: ace_captives + Synchronizovat s jednotkou, která má být v poutech.<br />Zdroj: ace_captives Captives Settings @@ -262,6 +266,7 @@ Requer rendição Требовать пленения Requiere rendición + Vzdávání vyžadováno Require Players to surrender before they can be arrested @@ -270,6 +275,7 @@ Requer que jogadores se rendam antes de poderem ser presos Требуется, чтобы игрок сдался в плен прежде, чем его можно будет связать Requiere que los Jugadores se rindan antes de arrestarlos + Vyžaduje, aby se hráč nejdříve vzdal, poté může být spoután Surrendering only @@ -278,6 +284,7 @@ Somente rendição Только сдавшийся в плен Solo rendición + Pouze vzdávání Surrendering or No weapon @@ -286,6 +293,7 @@ Rendição ou desarmado Сдавшийся или безоружный Rendición o desarme + Vzdávání nebo beze zbraně - \ No newline at end of file + diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 689ba5f19e..5dadfb322c 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -48,6 +48,11 @@ class Extended_InitPost_EventHandlers { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; + class RoadCone_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); + }; + }; class Car { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 1204c35496..6565b7f4c5 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -237,7 +237,15 @@ class CfgVehicles { GVAR(size) = 6; }; - + // objects + class RoadCone_F: ThingX { + GVAR(size) = 1; + GVAR(canLoad) = 1; + }; + class RoadBarrier_F: RoadCone_F { + GVAR(size) = 2; + }; + class Scrapyard_base_F; class Land_PaperBox_closed_F: Scrapyard_base_F { diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 2aeb3ab630..064c941d37 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -27,7 +27,7 @@ _unloaded = [_item, _vehicle] call FUNC(unloadItem); - _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; // Show hint as feedback _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded; diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index fda60aaf65..b446c4b589 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -23,7 +23,7 @@ if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; private ["_itemSize", "_validItem"]; _itemSize = [_item] call FUNC(getSizeItem); -if (typeName _item == "STRING") then { +if (_item isEqualType "") then { _validItem = isClass (configFile >> "CfgVehicles" >> _item) && {getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1}; diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf index 8c741a5448..5c6acc44cc 100644 --- a/addons/cargo/functions/fnc_canUnloadItem.sqf +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -22,7 +22,7 @@ private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; if !(_item in _loaded) exitWith {false}; -_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; +_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; _validVehiclestate = true; _emptyPos = []; diff --git a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf index cae27a2d58..b858ebfddc 100644 --- a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf +++ b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf @@ -17,4 +17,4 @@ params ["_object"]; -_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _object >> QGVAR(space))] +_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))] diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index 807251365c..bf5e76dcdb 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -19,7 +19,7 @@ params ["_item"]; private ["_isVirtual","_itemClass","_config"]; scopeName "return"; -_isVirtual = (typeName _item == "STRING"); +_isVirtual = (_item isEqualType ""); _itemClass = if (_isVirtual) then {_item} else {typeOf _item}; _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf index 1022497719..8ddf59b21b 100644 --- a/addons/cargo/functions/fnc_handleDestroyed.sqf +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -24,7 +24,7 @@ if (_loaded isEqualTo []) exitWith {}; { // TODO Do we want to be able to recover destroyed equipment? - if (typeName _x == "OBJECT") then { + if (_x isEqualType objNull) then { deleteVehicle _x; }; } count _loaded; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 45746a93fd..22c78c4304 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -24,7 +24,7 @@ private ["_loaded", "_space", "_itemSize"]; if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; -_loaded pushback _item; +_loaded pushBack _item; _vehicle setVariable [QGVAR(loaded), _loaded, true]; TRACE_1("added to loaded array",_loaded); @@ -33,7 +33,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; -if (typeName _item == "OBJECT") then { +if (_item isEqualType objNull) then { detach _item; _item attachTo [_vehicle,[0,0,-100]]; ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 85557835bf..f2abf79100 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -40,7 +40,7 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display]; lbClear _ctrl; { - _class = if (typeName _x == "STRING") then {_x} else {typeOf _x}; + _class = if (_x isEqualType "") then {_x} else {typeOf _x}; _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName")); true } count _loaded; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 1ce5d62407..091c817f1e 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -23,7 +23,7 @@ _vehicle = [_player] call FUNC(findNearestVehicle); if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then { { if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; - } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); + } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); }; if (isNull _vehicle) exitWith {false}; diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 013de1dc64..dc49e9d34b 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -41,7 +41,7 @@ if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then { [5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar); } else { - _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); ["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 81cca7154b..d9e8bf34be 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -23,7 +23,7 @@ if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { false }; -_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; +_itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; _validVehiclestate = true; _emptyPos = []; @@ -57,7 +57,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; -if (typeName _item == "OBJECT") then { +if (_item isEqualType objNull) then { detach _item; _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); diff --git a/addons/cargo/functions/fnc_validateCargoSpace.sqf b/addons/cargo/functions/fnc_validateCargoSpace.sqf index 7634b131e6..d5781067d1 100644 --- a/addons/cargo/functions/fnc_validateCargoSpace.sqf +++ b/addons/cargo/functions/fnc_validateCargoSpace.sqf @@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []]; _newLoaded = []; _totalSpaceOccupied = 0; { - if ((typeName _x == "STRING") || {!isNull _x}) then { + if ((_x isEqualType "") || {!isNull _x}) then { _newLoaded pushback _x; _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); }; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 4b33f9826b..65c0ceb433 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -3,6 +3,7 @@ Load + Beladen Załaduj Carregar Загрузить @@ -11,6 +12,7 @@ Unload + Entladen Wyładuj Descarregar Выгрузить @@ -19,6 +21,7 @@ Cargo + Fracht Ładunek Carga Грузовой отсек @@ -27,6 +30,7 @@ Cargo Menu + Frachtmenü Menu ładunku Menu de carga Грузовой отсек @@ -35,6 +39,7 @@ Cargo space left: %1 + Frachtplätze frei: %1 Pozostałe miejsce: %1 Espaço de carga restante: %1 Осталось мест: %1 @@ -43,6 +48,7 @@ Enable Cargo + Aktiviere Fracht Aktywuj cargo Ativar carga Включить модуль перевозки грузов @@ -51,6 +57,7 @@ Enable the load in cargo module + Aktiviere das Frachtmodul Aktywuj możliwość załadunku skrzyń i przedmiotów do pojazdów. Ativar o módulo de carregamento de carga Включает модуль погрузки и перевозки грузов @@ -58,6 +65,7 @@ Cargo Settings + Frachteinstellungen Ustawienia cargo Preferências de carregamento Перевозка грузов @@ -66,10 +74,12 @@ Configure the cargo module settings + Konfiguriere das Frachtmodul Skonfiguruj ustawienia modułu cargo. Configura as preferências do módulo de carga Конфигурирует настройки модуля перевозки грузов Configure los ajustes del módulo de carga + Konfigurace nákladního modulu %1<br/>loaded into<br/>%2 @@ -89,7 +99,7 @@ Descargado/a<br/>%1 de<br/>%2 Déchargé<br/>%1 de<br/>%2 %1<br/>rozładowano z<br/>%2 - Nezatížený<br/>%1 do<br/>%2 + %1<br/>vyloženo z<br/>%2 %1<br/>descarregado de<br/>%2 Hai scaricato<br/>%1 da<br/>%2 1%<br/>kirakodva ebből:<br/>%2 @@ -98,18 +108,30 @@ Loading Cargo Carregando carga + Ładowanie cargo + Nakládám + Погрузка Unloading Cargo Descarregando carga + Rozładowywanie cargo + Vykládám + Выгрузка %1<br/>could not be loaded %1<br/>não pode ser carregado + %1<br/>nie mógł zostać załadowany + %1<br/>nemůže být naloženo + %1<br/>не может быть погружен %1<br/>could not be unloaded %1<br/>não pode ser descarregado + %1<br/>nie mógł zostać rozładowany + %1<br/>nemůže být vyloženo + %1<br/>не может быть выгружен \ No newline at end of file diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index ab624669cf..57454dec78 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -41,7 +41,7 @@ class GVAR(ProgressBar_Dialog) { w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; colorFrame[] = {1,1,1,0.5}; - colorBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; + colorBar[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getVariable ['GUI_BCG_RGB_A',0.8])"}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; }; class TitleText: TitleBackground { diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index bad8a2b427..4d94f8ae2c 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -107,6 +107,10 @@ class RscInGameUI { class RscOptics_LaserDesignator_02 { onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent);); }; + + class RscStaminaBar { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStaminaBar"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgStaminaBar)),_this select 0)]); + }; }; class RscDisplayInventory { @@ -115,18 +119,18 @@ class RscDisplayInventory { // map class RscDisplayMainMap { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); }; class RscDisplayGetReady: RscDisplayMainMap { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); }; class RscDisplayServerGetReady: RscDisplayGetReady { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); }; class RscDisplayClientGetReady: RscDisplayGetReady { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 615222678b..22cf7a944e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,7 +1,7 @@ // ACE - Common +// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" -// #define ENABLE_PERFORMANCE_COUNTERS ////////////////////////////////////////////////// // PFHs @@ -29,17 +29,16 @@ GVAR(nextFrameNo) = diag_frameno + 1; //Handle the waitUntilAndExec array: - private _deleted = 0; { // if condition is satisifed call statement if ((_x select 2) call (_x select 0)) then { // make sure to delete the correct handle when multiple conditions are met in one frame - GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex - _deleted); - _deleted = _deleted + 1; + GVAR(waitUntilAndExecArray) deleteAt (GVAR(waitUntilAndExecArray) find _x); (_x select 2) call (_x select 1); }; - } forEach GVAR(waitUntilAndExecArray); - + nil + } count +GVAR(waitUntilAndExecArray); + END_COUNTER(waitAndExec); }, 0, []] call CBA_fnc_addPerFrameHandler; @@ -58,13 +57,30 @@ // Eventhandlers ////////////////////////////////////////////////// +//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit +//This variable is used for isPlayer checks +if (isServer) then { + addMissionEventHandler ["HandleDisconnect", { + params ["_dcPlayer"]; + private _zeusLogic = getAssignedCuratorLogic _dcPlayer; + if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then { + { + if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith { + ACE_LOGINFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x); + _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; + }; + nil + } count (curatorEditableObjects _zeusLogic); + }; + }]; +}; + // Listens for global "SettingChanged" events, to update the force status locally ["SettingChanged", { params ["_name", "_value", "_force"]; if (_force) then { - private "_settingData"; - _settingData = [_name] call FUNC(getSettingData); + private _settingData = [_name] call FUNC(getSettingData); if (_settingData isEqualTo []) exitWith {}; @@ -98,7 +114,6 @@ ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); ["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); -["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler); ["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); if (isServer) then { @@ -146,10 +161,8 @@ QGVAR(remoteFnc) addPublicVariableEventHandler { // Check files, previous installed version etc. ////////////////////////////////////////////////// -private ["_currentVersion", "_previousVersion"]; - -_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); -_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; +private _currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); +private _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; // check previous version number from profile if (_currentVersion != _previousVersion) then { @@ -169,7 +182,7 @@ call FUNC(checkFiles); [ GVAR(checkPBOsAction), GVAR(checkPBOsCheckAll), - call compile GVAR(checkPBOsWhitelist) + GVAR(checkPBOsWhitelist) ] call FUNC(checkPBOs) }] call FUNC(addEventHandler); @@ -253,8 +266,7 @@ GVAR(ScrollWheelFrame) = diag_frameno; }] call FUNC(addEventHandler); // add PFH to execute event that fires when the main display (46) is created -private "_fnc_initMainDisplayCheck"; -_fnc_initMainDisplayCheck = { +private _fnc_initMainDisplayCheck = { [{ if !(isNull findDisplay 46) then { // Raise ACE event locally @@ -295,6 +307,17 @@ enableCamShake true; // Set up numerous eventhanders for player controlled units ////////////////////////////////////////////////// +//CBA has events for zeus's display onLoad and onUnload (Need to delay a frame for display to be ready) +private _zeusDisplayChangedFNC = { + [{ + private _data = !(isNull findDisplay 312); + ["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); + }, []] call FUNC(execNextFrame); +}; +["CBA_curatorOpened", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler; +["CBA_curatorClosed", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler; + + // default variables GVAR(OldPlayerVehicle) = vehicle objNull; GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex); @@ -304,7 +327,6 @@ GVAR(OldPlayerVisionMode) = currentVisionMode objNull; GVAR(OldCameraView) = ""; GVAR(OldVisibleMap) = false; GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this -GVAR(OldZeusDisplayIsOpen) = false; GVAR(OldIsCamera) = false; // clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order @@ -316,13 +338,11 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { // PFH to raise varios events [{ BEGIN_COUNTER(stateChecker); - private "_data"; // reuse one variable to reduce number of variables that have to be set to private each frame // "playerChanged" event - _data = call FUNC(player); + private _data = call FUNC(player); if !(_data isEqualTo ACE_player) then { - private "_oldPlayer"; - _oldPlayer = ACE_player; + private _oldPlayer = ACE_player; ACE_player = _data; uiNamespace setVariable ["ACE_player", _data]; @@ -395,14 +415,6 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { ["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); }; - // "zeusDisplayChanged" event - _data = !(isNull findDisplay 312); - if !(_data isEqualTo GVAR(OldZeusDisplayIsOpen)) then { - // Raise ACE event locally - GVAR(OldZeusDisplayIsOpen) = _data; - ["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent); - }; - // "activeCameraChanged" event _data = call FUNC(isfeatureCameraActive); if !(_data isEqualTo GVAR(OldIsCamera)) then { @@ -451,6 +463,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then { {_unit != _target && {vehicle _unit == vehicle _target}} }] call FUNC(addCanInteractWithCondition); +["isNotInZeus", {isNull curatorCamera}] call FUNC(addCanInteractWithCondition); ////////////////////////////////////////////////// // Set up PlayerJIP eventhandler diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index cedc27cfee..1b7bdc624c 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -74,6 +74,7 @@ PREP(getNumberFromMissionSQM); PREP(getNumberMagazinesIn); PREP(getPitchBankYaw); PREP(getSettingData); +PREP(getStaminaBarControl); PREP(getStringFromMissionSQM); PREP(getTargetAzimuthAndInclination); PREP(getTargetDistance); @@ -168,6 +169,7 @@ PREP(setVariableJIP); PREP(setVariablePublic); PREP(setVolume); PREP(sortAlphabeticallyBy); +PREP(showHud); PREP(stringCompare); PREP(stringToColoredText); PREP(stringRemoveWhiteSpace); @@ -292,6 +294,7 @@ PREP(hashListSet); PREP(hashListPush); GVAR(syncedEvents) = HASH_CREATE; +GVAR(showHudHash) = [] call FUNC(hashCreate); //GVARS for execNextFrame and waitAndExec and waitUntilAndExecute GVAR(waitAndExecArray) = []; @@ -326,8 +329,7 @@ if (hasInterface) then { // PFH to update the ACE_player variable GVAR(PreInit_playerChanged_PFHID) = [{ if !(ACE_player isEqualTo (call FUNC(player))) then { - private ["_oldPlayer"]; - _oldPlayer = ACE_player; + private _oldPlayer = ACE_player; ACE_player = call FUNC(player); uiNamespace setVariable ["ACE_player", ACE_player]; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index f1bca395f8..c38c3fd3e7 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -88,7 +88,7 @@ class CfgUIGrids { // check dll class RscStandardDisplay; class RscDisplayMain: RscStandardDisplay { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); }; */ diff --git a/addons/common/define.hpp b/addons/common/define.hpp index f1cc009864..98367e72ae 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -116,9 +116,9 @@ class ACE_gui_editBase }; colorSelection[] = { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", + "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", + "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", + "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", 1 }; autocomplete = ""; @@ -249,7 +249,7 @@ class ACE_gui_listBoxBase : RscListBox{ colorSelect2[] = {0.95, 0.95, 0.95, 1}; colorSelectBackground[] = {0, 0, 0, 1}; colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; + colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; period = 1.2; rowHeight = 0.03; colorBackground[] = {0, 0, 0, 1}; @@ -505,7 +505,7 @@ onMouseButtonDblClick = ""; iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; - color[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"}; + color[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])"}; colorCreated[] = {1,1,1,1}; colorCanceled[] = {0.7,0.7,0.7,1}; colorDone[] = {0.7,1,0.3,1}; diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index e409afe6a3..e3b2ac609c 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -16,15 +16,12 @@ params ["_eventType", "_event"]; if (_eventType == "ACEg") then { _event params ["_eventName", "_eventArgs"]; + GVAR(events) params ["_eventNames"]; - private ["_eventNames", "_eventIndex"]; - - _eventNames = GVAR(events) select 0; - _eventIndex = _eventNames find _eventName; + private _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { - private "_events"; - _events = (GVAR(events) select 1) select _eventIndex; + private _events = (GVAR(events) select 1) select _eventIndex; #ifdef DEBUG_EVENTS ACE_LOGINFO_1("* Net Event %1",_eventName); @@ -46,9 +43,8 @@ if (_eventType == "ACEc") then { if (isServer) then { _event params ["_eventName", "_eventTargets", "_eventArgs"]; - private ["_sentEvents", "_owner", "_serverFlagged"]; + private _sentEvents = []; - _sentEvents = []; if (!IS_ARRAY(_eventTargets)) then { _eventTargets = [_eventTargets]; }; @@ -59,9 +55,11 @@ if (_eventType == "ACEc") then { ["ACEg", ACEg] call FUNC(_handleNetEvent); }; - _serverFlagged = false; + private _serverFlagged = false; + { - _owner = _x; + private _owner = _x; + if (IS_OBJECT(_x)) then { _owner = owner _x; }; diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index 4e755562b5..8c8cbd1486 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -15,10 +15,8 @@ params ["_client"]; { - private ["_eventEntry", "_eventLog"]; - - _eventEntry = HASH_GET(GVAR(syncedEvents),_x); - _eventLog = _eventEntry select 1; + private _eventEntry = HASH_GET(GVAR(syncedEvents),_x); + _eventEntry params ["", "_eventLog"]; ["SEH_s", _client, [_x, _eventLog]] call FUNC(targetEvent); false diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index d4d9b2cf76..605af2fa85 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -27,10 +27,8 @@ if (isServer) then { false }; - private ["_eventEntry", "_eventLog"]; - - _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); - _eventLog = _eventEntry select 1; + private _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + _eventEntry params ["", "_eventLog"]; ["SEH_s", _client, [_eventName, _eventLog]] call FUNC(targetEvent); } else { diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index 3ea516513f..41f7ed429c 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -21,20 +21,17 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { false }; -private ["_internalData", "_eventCode"]; - -_internalData = HASH_GET(GVAR(syncedEvents),_name); +private _internalData = HASH_GET(GVAR(syncedEvents),_name); if (isServer) then { // Server needs to internally log it for synchronization if (_ttl > -1) then { _internalData = HASH_GET(GVAR(syncedEvents),_name); - private "_eventLog"; - _eventLog = _internalData select 1; - _eventLog pushback [ACE_diagTime, _args, _ttl]; + _internalData params ["", "_eventLog"]; + _eventLog pushBack [ACE_diagTime, _args, _ttl]; }; }; -_eventCode = _internalData select 0; +_internalData params ["_eventCode"]; _args call _eventCode; diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index 4d7d96bd44..fe641010e4 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -17,18 +17,16 @@ params ["_unit", "_action", "_condition", "_statement"]; -if (typeName _condition == "STRING") then { +if (_condition isEqualType "") then { _condition = compile _condition; }; -if (typeName _statement == "STRING") then { +if (_statement isEqualType "") then { _statement = compile _statement; }; -private ["_name", "_actionsVar"]; - -_name = format ["ACE_Action_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; +private _name = format ["ACE_Action_%1", _action]; +private _actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; if (_unit != _actionsVar select 2) then { // check if the unit is still valid, fixes respawn issues _actionsVar = [-1, [-1, [], []], objNull]; @@ -44,8 +42,7 @@ _actions pushBack [_condition, _statement]; // first action to add, unit needs addAction command if (_actionID == -1) then { - private "_addAction"; - _addAction = call compile format [ + private _addAction = call compile format [ "[ '', {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index 279842ae5c..e68507ae7b 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -21,39 +21,35 @@ params ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", ["_priority", 0]]; -if (typeName _condition == "STRING") then { +if (_condition isEqualType "") then { _condition = compile _condition; }; -if (typeName _statement == "STRING") then { +if (_statement isEqualType "") then { _statement = compile _statement; }; -if (typeName _condition2 == "STRING") then { +if (_condition2 isEqualType "") then { _condition2 = compile _condition2; }; -if (typeName _statement2 == "STRING") then { +if (_statement2 isEqualType "") then { _statement2 = compile _statement2; }; -private ["_name", "_actionsVar"]; - -_name = format ["ACE_ActionMenu_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [], []]]; +private _name = format ["ACE_ActionMenu_%1", _action]; +private _actionsVar = _unit getVariable [_name, [-1, [], []]]; _actionsVar params ["_id", "_actionIDs", "_actions"]; _id = _id + 1; -private ["_nameVar", "_addAction", "_actionID"]; - -_nameVar = format ["%1_ID%2", _name, _id]; +private _nameVar = format ["%1_ID%2", _name, _id]; missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]]; _actionIDs pushBack _id; -_addAction = call compile format [ +private _addAction = call compile format [ "[ '%2', {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, @@ -70,7 +66,7 @@ _addAction = call compile format [ _priority ]; -_actionID = _unit addAction _addAction; +private _actionID = _unit addAction _addAction; _actions pushBack [_actionID, _nameVar]; diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 740fa9bb9f..294dac1c72 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -17,12 +17,10 @@ params ["_conditionName", "_conditionFunc"]; _conditionName = toLower _conditionName; -private ["_conditions", "_index"]; - -_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; +private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; _conditions params ["_conditionNames", "_conditionFuncs"]; -_index = _conditionNames find _conditionName; +private _index = _conditionNames find _conditionName; if (_index == -1) then { _index = count _conditionNames; diff --git a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf index 95cce02e41..1bb92130bc 100644 --- a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf +++ b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf @@ -13,11 +13,10 @@ disableSerialization; -private "_dlg"; -_dlg = ctrlParent _this; +private _dlg = ctrlParent _this; _dlg displayAddEventHandler ["unload", { if (_this select 1 == 1) then { - [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); + [missionnamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); }; }]; diff --git a/addons/common/functions/fnc_addEventHandler.sqf b/addons/common/functions/fnc_addEventHandler.sqf index 599e937918..128f489701 100644 --- a/addons/common/functions/fnc_addEventHandler.sqf +++ b/addons/common/functions/fnc_addEventHandler.sqf @@ -15,17 +15,15 @@ params ["_eventName", "_eventCode"]; -private ["_eventNames", "_eventFunctions", "_eventIndex"]; +GVAR(events) params ["_eventNames"]; -_eventNames = GVAR(events) select 0; -_eventFunctions = []; -_eventIndex = _eventNames find _eventName; +private _eventFunctions = []; +private _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; } else { - private "_eventNameCount"; - _eventNameCount = count _eventNames; + private _eventNameCount = count _eventNames; _eventNames set [_eventNameCount, _eventName]; (GVAR(events) select 1) set [_eventNameCount, _eventFunctions]; diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf index 1e060f056a..2201426e48 100644 --- a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -14,12 +14,11 @@ params ["_statement"]; -if (typeName _statement == "STRING") then { +if (_statement isEqualType "") then { _statement = compile _statement; }; -private "_actionsVar"; -_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; +private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; _actionsVar params ["_id", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf index df1601c95a..aef88543be 100644 --- a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -15,12 +15,11 @@ params ["_statement"]; -if (typeName _statement == "STRING") then { +if (_statement isEqualType "") then { _statement = compile _statement; }; -private "_actionsVar"; -_actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; +private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; _actionsVar params ["_id", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index 06162de6b1..0cf25b860a 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -22,8 +22,7 @@ params ["_name", "", "", "", "", "", "", "_value"]; //["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_isForced", "_value"]; -private "_settingData"; -_settingData = [_name] call FUNC(getSettingData); +private _settingData = [_name] call FUNC(getSettingData); // Exit if the setting already exists if (count _settingData > 0) exitWith {}; diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 801a915dc5..0964e419bc 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -21,9 +21,7 @@ if (HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { false }; -private ["_eventId", "_data"]; - -_eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); -_data = [_handler, [], _ttl, _eventId]; +private _eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +private _data = [_handler, [], _ttl, _eventId]; HASH_SET(GVAR(syncedEvents),_name,_data); diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 4019de93ac..9d796d6018 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -18,9 +18,9 @@ params ["_unit", "_classname", ["_container", ""], ["_ammoCount", -1]]; -private ["_type", "_canAdd", "_addedToUnit"]; +private _type = _classname call FUNC(getItemType); -_type = [_classname] call FUNC(getItemType); +private ["_canAdd", "_addedToUnit"]; switch (_container) do { case "vest": { @@ -59,8 +59,7 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private "_pos"; - _pos = _unit modelToWorldVisual [0,1,0.05]; + private _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit addWeaponCargoGlobal [_classname, 1]; @@ -93,8 +92,7 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private "_pos"; - _pos = _unit modelToWorldVisual [0,1,0.05]; + private _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit addMagazineCargoGlobal [_classname, 1/*_ammoCount*/]; //@todo Bug! This isn't really the ammo, but magazine count. No such command. @@ -123,8 +121,7 @@ switch (_type select 0) do { } else { _addedToUnit = false; - private "_pos"; - _pos = _unit modelToWorldVisual [0,1,0.05]; + private _pos = _unit modelToWorldVisual [0,1,0.05]; _unit = createVehicle ["WeaponHolder_Single_F", _pos, [], 0, "NONE"]; _unit addItemCargoGlobal [_classname, 1]; diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf index d3b58a25a4..656e4a6d25 100644 --- a/addons/common/functions/fnc_applyForceWalkStatus.sqf +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -17,7 +17,6 @@ params ["_unit"]; -private "_forceWalkNumber"; -_forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; +private _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf index a09447a43a..5724521a7b 100644 --- a/addons/common/functions/fnc_assignObjectsInList.sqf +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -22,14 +22,14 @@ params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]]; -if (typeName _list == "STRING") then { +if (_list isEqualType "") then { _list = [_list, true, true] call FUNC(parseList); TRACE_1("Parsed",_list) }; { if (!isNil "_x") then { - if (typeName _x == typeName objNull) then { + if (_x isEqualType objNull) then { if (local _x) then { if (_vehicle) then { (vehicle _x) setVariable [_variable, _setting, _global]; @@ -41,4 +41,5 @@ if (typeName _list == "STRING") then { }; }; }; + false } count _list; diff --git a/addons/common/functions/fnc_assignedItemFix.sqf b/addons/common/functions/fnc_assignedItemFix.sqf index 9f804eaa4d..d93409ce7c 100644 --- a/addons/common/functions/fnc_assignedItemFix.sqf +++ b/addons/common/functions/fnc_assignedItemFix.sqf @@ -12,13 +12,11 @@ */ #include "script_component.hpp" -private "_config"; - -ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first -ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; -ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; -ACE_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; -ACE_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; +ACE_isMapEnabled = call {private _config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first +ACE_isCompassEnabled = call {private _config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; +ACE_isWatchEnabled = call {private _config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; +ACE_isRadioEnabled = call {private _config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; +ACE_isGPSEnabled = call {private _config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; GVAR(AssignedItems) = []; GVAR(AssignedItemsInfo) = []; diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf index aff2f9dc17..0945afa770 100644 --- a/addons/common/functions/fnc_binarizeNumber.sqf +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -17,19 +17,17 @@ params ["_number", ["_minLength", 8]]; _number = round _number; -private ["_array", "_index", "_rest"]; - -_array = []; +private _array = []; _array resize _minLength; for "_index" from 0 to (_minLength - 1) do { _array set [_index, false]; }; -_index = 0; +private _index = 0; while {_number > 0} do { - _rest = _number mod 2; + private _rest = _number mod 2; _number = floor (_number / 2); _array set [_index, _rest == 1]; diff --git a/addons/common/functions/fnc_binocularMagazine.sqf b/addons/common/functions/fnc_binocularMagazine.sqf index f097b90841..b5f4f0558e 100644 --- a/addons/common/functions/fnc_binocularMagazine.sqf +++ b/addons/common/functions/fnc_binocularMagazine.sqf @@ -9,32 +9,24 @@ * Magazine of the units binocular * * Example: - * [player] call ace_common_fnc_binocularMagazine + * player call ace_common_fnc_binocularMagazine * * Public: Yes - * - * Note: Doesn't work on dead units */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private ["_binocular", "_muzzle", "_mode", "_magazine"]; +private _binocular = binocular _unit; -_binocular = binocular _unit; +scopeName "main"; -if (_binocular == "") exitWith {""}; +{ + if ((_x select 0) isEqualTo _binocular) then { + // note: if there is no magazine, _x(4,0) will be nil, which skips the breakOut. + (_x select 4 select 0) breakOut "main"; + }; + false +} count weaponsitems _unit; -_muzzle = currentMuzzle _unit; -_mode = currentWeaponMode _unit; - -_unit selectWeapon _binocular; - -// didn't select the binocular (unit probably dead or not local). function won't work. quit with empty string -if (currentWeapon _unit != _binocular) exitWith {""}; - -_magazine = currentMagazine _unit; - -[_unit, _muzzle, _mode] call FUNC(selectWeaponMode); - -_magazine +"" diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index a3394a1fbf..2c6a17cbe3 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -16,7 +16,7 @@ if (!hasInterface) exitWith {}; params ["_id", ["_show", false]]; -if (typeName _show == "SCALAR") then { +if (_show isEqualType 0) then { _show = _show == 1; }; @@ -28,7 +28,7 @@ if (_show) then { GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id; // show blur - if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + if (isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index 59350d0483..2c7cdd4b27 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -24,10 +24,8 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then { // Does the cache needs to be cleared on an event? if (!isNil "_event") then { - private ["_varName", "_cacheList"]; - - _varName = format [QGVAR(clearCache_%1), _event]; - _cacheList = missionNamespace getVariable _varName; + private _varName = format [QGVAR(clearCache_%1), _event]; + private _cacheList = missionNamespace getVariable _varName; // If there was no EH to clear these caches, add one if (isNil "_cacheList") then { @@ -35,14 +33,13 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < ACE_diagTime) then { missionNamespace setVariable [_varName, _cacheList]; [_event, { - private ["_varName", "_cacheList"]; // _eventName is defined on the function that calls the event #ifdef DEBUG_MODE_FULL ACE_LOGINFO_1("Clear cached variables on event: %1",_eventName); #endif // Get the list of caches to clear - _varName = format [QGVAR(clearCache_%1), _eventName]; - _cacheList = missionNamespace getVariable [_varName, []]; + private _varName = format [QGVAR(clearCache_%1), _eventName]; + private _cacheList = missionNamespace getVariable [_varName, []]; // Erase all the cached results { _x call FUNC(eraseCache); diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 45a2642655..c470337d6a 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -27,19 +27,19 @@ _position = toLower _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; -private ["_config", "_turret", "_radius", "_selectionPosition", "_selectionPosition2", "_enemiesInVehicle", "_return"]; +private ["_selectionPosition", "_selectionPosition2"]; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = []; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _turret = []; -_radius = 0; +private _radius = 0; -_enemiesInVehicle = false; //Possible Side Restriction +private _enemiesInVehicle = false; //Possible Side Restriction { if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; -_return = false; +private _return = false; switch (_position) do { case "driver" : { _radius = getNumber (_config >> "getInRadius"); @@ -60,11 +60,10 @@ switch (_position) do { }; case "gunner" : { - private "_turretConfig"; _turret = [_vehicle] call FUNC(getTurretGunner); if (_turret isEqualTo []) exitWith {false}; - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -73,11 +72,10 @@ switch (_position) do { }; case "commander" : { - private "_turretConfig"; _turret = [_vehicle] call FUNC(getTurretCommander); if (_turret isEqualTo []) exitWith {false}; - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -86,11 +84,10 @@ switch (_position) do { }; case "copilot" : { - private "_turretConfig"; _turret = [_vehicle] call FUNC(getTurretCopilot); if (_turret isEqualTo []) exitWith {false}; - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -99,13 +96,12 @@ switch (_position) do { }; case "turret" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsOther); + private _turrets = [_vehicle] call FUNC(getTurretsOther); if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -115,7 +111,7 @@ switch (_position) do { for "_index" from 0 to (count _turrets - 1) do { _turret = _turrets select _index; if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -127,13 +123,12 @@ switch (_position) do { }; case "ffv" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsFFV); + private _turrets = [_vehicle] call FUNC(getTurretsFFV); if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -143,7 +138,7 @@ switch (_position) do { for "_index" from 0 to (count _turrets - 1) do { _turret = _turrets select _index; if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); _radius = getNumber (_config >> "getInRadius"); _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); @@ -155,8 +150,7 @@ switch (_position) do { }; case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + private _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); { if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; @@ -189,8 +183,7 @@ switch (_position) do { }; case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + private _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); { if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; @@ -226,14 +219,11 @@ switch (_position) do { default {}; }; -private "_fnc_isInRange"; -_fnc_isInRange = { +private _fnc_isInRange = { if (_radius == 0) exitWith {true}; - private ["_unitPosition", "_distance"]; - _unitPosition = getPos _unit; - - _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); + private _unitPosition = getPos _unit; + private _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); if (!isNil "_selectionPosition2") then { _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 31ebf6b89f..4b4382a14e 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -18,20 +18,17 @@ params ["_unit", "_target", ["_exceptions", []]]; _exceptions = [_exceptions, {toLower _this}] call FUNC(map); -private "_owner"; -_owner = _target getVariable [QGVAR(owner), objNull]; +private _owner = _target getVariable [QGVAR(owner), objNull]; // exit if the target is not free to interact if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions -private ["_conditions", "_canInteract"]; - -_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; - +private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; _conditions params ["_conditionNames", "_conditionFuncs"]; -_canInteract = true; +private _canInteract = true; + { if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { _canInteract = false; diff --git a/addons/common/functions/fnc_canUseWeapon.sqf b/addons/common/functions/fnc_canUseWeapon.sqf index 31aaba17a2..a92d0a2b97 100644 --- a/addons/common/functions/fnc_canUseWeapon.sqf +++ b/addons/common/functions/fnc_canUseWeapon.sqf @@ -13,12 +13,11 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; if (_unit == vehicle _unit) exitWith {true}; -private "_config"; -_config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit; +private _config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit; isClass _config && {getNumber (_config >> "canPullTrigger") == 1} diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 79b8c8aeea..89a8988306 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -17,14 +17,12 @@ params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]]; -private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"]; - // get old direction vector -_vdir = vectorNormalized velocity _projectile; +private _vdir = vectorNormalized velocity _projectile; // get azimuth and inclination and apply corrections -_dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; -_up = asin (_vdir select 2) + _adjustUp; +private _dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; +private _up = asin (_vdir select 2) + _adjustUp; // get new direction vector (this is a unit vector) _vdir = [ @@ -34,11 +32,11 @@ _vdir = [ ]; // get best up vector -_vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]); -_vup = _vlat vectorCrossProduct _vdir; +private _vlat = vectorNormalized (_vdir vectorCrossProduct [0,0,1]); +private _vup = _vlat vectorCrossProduct _vdir; // get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. -_vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile); +private _vel = _vdir vectorMultiply (_adjustSpeed + vectorMagnitude velocity _projectile); // set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. _projectile setVectorDirAndUp [_vdir, _vup]; diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 2c8976f042..cdf5cb3d93 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -15,21 +15,18 @@ /////////////// // check addons /////////////// -private "_version"; -_version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); +private _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); ACE_LOGINFO_1("ACE is version %1.",_version); -private "_addons"; -//_addons = activatedAddons; // broken with High-Command module, see #2134 -_addons = "true" configClasses (configFile >> "CfgPatches");// +//private _addons = activatedAddons; // broken with High-Command module, see #2134 +private _addons = "true" configClasses (configFile >> "CfgPatches");// _addons = [_addons, {toLower configName _this}] call FUNC(map);// _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); { if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then { - private "_errorMsg"; - _errorMsg = format ["File %1.pbo is outdated.", _x]; + private _errorMsg = format ["File %1.pbo is outdated.", _x]; ACE_LOGERROR(_errorMsg); @@ -44,12 +41,10 @@ _addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); // check dlls /////////////// { - private "_versionEx"; - _versionEx = _x callExtension "version"; + private _versionEx = _x callExtension "version"; if (_versionEx == "") then { - private "_errorMsg"; - _errorMsg = format ["Extension %1.dll not installed.", _x]; + private _errorMsg = format ["Extension %1.dll not installed.", _x]; ACE_LOGERROR(_errorMsg); @@ -84,8 +79,7 @@ if (isMultiplayer) then { (_this select 0) params ["_version", "_addons"]; if (_version != GVAR(ServerVersion)) then { - private "_errorMsg"; - _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version]; + private _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version]; ACE_LOGERROR(_errorMsg); diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 9cb5ed4d61..f447d126af 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -9,7 +9,7 @@ * 1 = Warn permanently * 2 = Kick * 1: Check all PBOs? (default: false) - * 2: Whitelist (default: "[]") + * 2: Whitelist (default: "") * * Return Value: * None @@ -18,9 +18,13 @@ */ #include "script_component.hpp" -params ["_mode", ["_checkAll", false], ["_whitelist", "[]"]]; +params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]]; +TRACE_3("params",_mode,_checkAll,_whitelist); -_whitelist = [_whitelist, {toLower _this}] call FUNC(map); +//lowercase and convert whiteList String into array of strings: +_whitelist = toLower _whitelist; +_whitelist = _whitelist splitString "[,""']"; +TRACE_1("Array",_whitelist); ACE_Version_CheckAll = _checkAll; ACE_Version_Whitelist = _whitelist; @@ -37,10 +41,8 @@ if (!isServer) then { // Display error message. if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { - private ["_text", "_error"]; - - _text = "[ACE] Version mismatch:

"; - _error = format ["ACE version mismatch: %1: ", profileName]; + private _text = "[ACE] Version mismatch:

"; + private _error = format ["ACE version mismatch: %1: ", profileName]; if (_missingAddon) then { _text = _text + "Detected missing addon on client
"; @@ -65,25 +67,29 @@ if (!isServer) then { if (_mode < 2) then { _text = composeText [lineBreak, parseText format ["%1", _text]]; - private ["_rscLayer", "_ctrlHint"]; - - _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; + private _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; disableSerialization; - _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; + private _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; _ctrlHint ctrlSetStructuredText _text; if (_mode == 0) then { - sleep 10; - _rscLayer cutFadeOut 0.2; + [{ + params ["_rscLayer"]; + TRACE_2("Hiding Error message after 10 seconds",time,_rscLayer); + _rscLayer cutFadeOut 0.2; + }, [_rscLayer], 10] call FUNC(waitAndExecute); }; }; if (_mode == 2) then { - waitUntil {alive player}; // To be able to show list if using checkAll - _text = composeText [parseText format ["%1", _text]]; - ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + [{alive player}, { // To be able to show list if using checkAll + params ["_text"]; + TRACE_2("Player is alive, showing msg and exiting",time,_text); + _text = composeText [parseText format ["%1", _text]]; + ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }, [_text]] call FUNC(waitUntilAndExecute); }; }; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index ac89a80172..cc514a2a6f 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -16,8 +16,7 @@ params ["_unit", "_target", ["_lockTarget", false]]; -private "_owner"; -_owner = _target getVariable [QGVAR(owner), objNull]; +private _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { ACE_LOGERROR("Claiming already owned object."); diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 4a1b158f21..b2817cd2b8 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -14,7 +14,7 @@ params ["_function"]; -if (typeName _function == "STRING") exitWith {_function}; +if (_function isEqualType "") exitWith {_function}; _function = toArray str _function; _function deleteAt 0; diff --git a/addons/common/functions/fnc_createOrthonormalReference.sqf b/addons/common/functions/fnc_createOrthonormalReference.sqf index 4a8db8bba1..e45bf269aa 100644 --- a/addons/common/functions/fnc_createOrthonormalReference.sqf +++ b/addons/common/functions/fnc_createOrthonormalReference.sqf @@ -14,10 +14,10 @@ */ #include "script_component.hpp" -private ["_v1", "_v2", "_v3"]; +[_this] params [["_vector", [0,0,1], [[]], 3]]; -_v1 = vectorNormalized _this; -_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); -_v3 = _v2 vectorCrossProduct _v1; +private _v1 = vectorNormalized _this; +private _v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); +private _v3 = _v2 vectorCrossProduct _v1; -[_v1,_v2,_v3] +[_v1, _v2, _v3] diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index 82dd66b485..a78e2b0204 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -15,8 +15,7 @@ #define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"] #define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"] -private "_currentChannel"; -_currentChannel = currentChannel; +private _currentChannel = currentChannel; if (_currentChannel < count CHANNELS) then { _currentChannel = CHANNELS select _currentChannel; diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 6430a7bb11..019ce2abff 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -18,20 +18,15 @@ params ["_msg", ["_level", 2, [0]]]; -private ["_defaultLoglevel", "_defaultLogDisplayLevel"]; +private _defaultLoglevel = missionNamespace getVariable [QGVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL]; -_defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL); +if (_defaultLoglevel < 0) exitWith {false}; -if (_defaultLoglevel < 0) exitwith {false}; - -_defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); +private _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); if (_level <= _defaultLoglevel) then { - private ["_prefix", "_message"]; - - _prefix = ["Unknown", "Error", "Warn", "Debug", "Info"] select ([0, 1, 2, 3] find _level + 1); - - _message = format ["[ACE %1] %2", _prefix, _msg]; + private _prefix = ["Unknown", "Error", "Warn", "Debug", "Info"] select ([0, 1, 2, 3] find _level + 1); + private _message = format ["[ACE %1] %2", _prefix, _msg]; if (_level <= _defaultLogDisplayLevel) then { systemChat _message; diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index 4f3da4d7cb..125887183e 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -14,5 +14,5 @@ params ["_entity"]; -GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); -GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); +GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getVariable ["logDisplayLevel","4"]); +GVAR(LOGLEVEL) = call compile (_entity getVariable ["logLevel","4"]); diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 6ea15adc43..35a1e96d31 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -21,7 +21,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi if (isNil "_defaultGlobal") exitWith {}; -if (typeName _name != "STRING") exitwith { +if (!(_name isEqualType "")) exitwith { [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; diff --git a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf index 681ab946e0..02135e59db 100644 --- a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf +++ b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf @@ -18,11 +18,9 @@ params [["_searchOffsetOrName", 0]]; -private ["_validIndex", "_realIndex"]; +private _validIndex = -1; -_validIndex = -1; - -if (typeName _searchOffsetOrName == "STRING") then { +if (_searchOffsetOrName isEqualType "") then { { if (_x select 0 == _searchOffsetOrName) exitWith { _validIndex = _forEachIndex; @@ -33,7 +31,7 @@ if (typeName _searchOffsetOrName == "STRING") then { _baseIndex = [GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName, 0] select (GVAR(deviceKeyCurrentIndex) == -1); for "_offset" from _baseIndex to (count GVAR(deviceKeyHandlingArray) - 1 + _baseIndex) do { - _realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); + private _realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); if ([] call ((GVAR(deviceKeyHandlingArray) select _realIndex) select 2)) exitWith { _validIndex = _realIndex; diff --git a/addons/common/functions/fnc_disableAI.sqf b/addons/common/functions/fnc_disableAI.sqf index 1a66628ffb..75c59d1a9a 100644 --- a/addons/common/functions/fnc_disableAI.sqf +++ b/addons/common/functions/fnc_disableAI.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -params ["_unit", "_disable"]; +params [["_unit", objNull, [objNull]], ["_disable", true, [false]]]; if (!local _unit) exitWith {}; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 8b00cedeac..8e28edc5f0 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -31,8 +31,7 @@ if (_state) then { closeDialog 0; createDialog QGVAR(DisableMouse_Dialog); - private "_dlg"; - _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); + private _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); _dlg displayAddEventHandler ["KeyDown", { params ["", "_key"]; @@ -42,15 +41,13 @@ if (_state) then { disableSerialization; - private ["_dlg", "_ctrl"]; - - _dlg = findDisplay 49; + private _dlg = findDisplay 49; for "_index" from 100 to 2000 do { (_dlg displayCtrl _index) ctrlEnable false; }; - _ctrl = _dlg displayctrl 103; + private _ctrl = _dlg displayctrl 103; _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(while {!isNull (uiNamespace getVariable [ARR_2(QUOTE(QGVAR(dlgDisableMouse)),displayNull)])} do {closeDialog 0}; failMission 'LOSER'; [false] call DFUNC(disableUserInput);)]; _ctrl ctrlEnable true; _ctrl ctrlSetText "ABORT"; @@ -58,7 +55,7 @@ if (_state) then { _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); _ctrl ctrlSetEventHandler ["buttonClick", QUOTE(closeDialog 0; player setDamage 1; [false] call DFUNC(disableUserInput);)]; - _ctrl ctrlEnable (call {private "_config"; _config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); + _ctrl ctrlEnable (call {private _config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); _ctrl ctrlSetText "RESPAWN"; _ctrl ctrlSetTooltip "Respawn."; }; @@ -66,8 +63,7 @@ if (_state) then { if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then { (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; - private "_acc"; - _acc = accTime; + private _acc = accTime; teamSwitch; setAccTime _acc; }; diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 8421f5be7e..c51b3bd454 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -45,14 +45,11 @@ disableSerialization; params ["_iconId", "_show", "_icon", "_color", ["_timeAlive", DEFAULT_TIME]]; -private ["_list", "_refresh"]; +private _list = missionNamespace getVariable [QGVAR(displayIconList), []]; -_list = missionNamespace getVariable [QGVAR(displayIconList), []]; - -_refresh = { +private _refresh = { // Refreshing of all icons.. - private "_allControls"; - _allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []]; + private _allControls = missionNamespace getVariable [QGVAR(displayIconListControls), []]; { ctrlDelete _x; @@ -61,23 +58,21 @@ _refresh = { _allControls = []; - private ["_setting", "_ctrl", "_position"]; - - _setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0]; + private _setting = missionNamespace getVariable [QGVAR(settingFeedbackIcons), 0]; if (_setting > 0) then { { _x params ["", "_xicon", "_xcolor"]; // +19000 because we want to make certain we are using free IDCs.. - _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000]; + private _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000]; - _position = switch (_setting) do { - case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; - case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; - default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + private _position = switch (_setting) do { + case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; + default {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; }; _ctrl ctrlSetPosition _position; @@ -97,7 +92,7 @@ if (_show) then { _list pushBack [_iconId, _icon, _color, ACE_time]; } else { { - if (_x select 0 == _iconId) exitwith { + if (_x select 0 == _iconId) exitWith { _list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]]; }; } forEach _list; @@ -115,8 +110,7 @@ if (_show) then { } else { if ({_x select 0 == _iconId} count _list == 1) then { - private "_newList"; - _newList = []; + private _newList = []; { if (_x select 0 != _iconId) then { diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index fce8fdd832..3c68327535 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -23,12 +23,9 @@ if (isNil QGVAR(lastHint)) then { if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; -private ["_lastHintTime", "_lastHintPriority", "_time"]; +GVAR(lastHint) params ["_lastHintTime", "_lastHintPriority"]; -_lastHintTime = GVAR(lastHint) select 0; -_lastHintPriority = GVAR(lastHint) select 1; - -_time = ACE_time; +private _time = ACE_time; if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { hintSilent _text; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index 3bdf908d16..a0bcb47e11 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -20,10 +20,10 @@ params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]]; if (_target != ACE_player) exitWith {}; if (typeName _text != "TEXT") then { - if (typeName _text == "ARRAY") then { + if (_text isEqualType []) then { if (count _text > 0) then { { - if (typeName _x == "STRING" && {isLocalized _x}) then { + if (_x isEqualType "" && {isLocalized _x}) then { _text set [_forEachIndex, localize _x]; }; } forEach _text; @@ -32,7 +32,7 @@ if (typeName _text != "TEXT") then { }; }; - if (typeName _text == "STRING" && {isLocalized _text}) then { + if (_text isEqualType "" && {isLocalized _text}) then { _text = localize _text; }; diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index 255a014b6f..9fff7bb056 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -19,52 +19,50 @@ params ["_text", ["_size", 1.5], ["_target", ACE_player]]; if (_target != ACE_player) exitWith {}; if (typeName _text != "TEXT") then { - if (typeName _text == "ARRAY") then { + if (_text isEqualType []) then { if (count _text > 0) then { { - if (typeName _x == "STRING" && {isLocalized _x}) then { + if (_x isEqualType "" && {isLocalized _x}) then { _text set [_foreachIndex, localize _x]; }; }foreach _text; _text = format _text; }; }; - if (typeName _text == "STRING" && {isLocalized _text}) then { + if (_text isEqualType "" && {isLocalized _text}) then { _text = localize _text; }; _text = composeText [lineBreak, parseText format ["%1", _text]]; }; -private ["_isShown", "_ctrlHint", "_xPos", "_yPos", "_wPos", "_hPos", "_position"]; - -_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); +private _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); ("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true]; disableSerialization; -_ctrlHint = uiNamespace getVariable "ACE_ctrlHint"; +private _ctrlHint = uiNamespace getVariable "ACE_ctrlHint"; _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); /* // This does not function at the moment. Has been disabled until it fixed. -_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; -_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; -_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))]; -_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; +private _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; +private _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; +private _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))]; +private _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; */ -_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); -_yPos = safeZoneY + 0.175 * safezoneH; -_wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); -_hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); +private _xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); +private _yPos = safeZoneY + 0.175 * safezoneH; +private _wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); +private _hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); // Zeus Interface Open and Display would be under the "CREATE" list if (!isNull curatorCamera) then { _xPos = _xPos min ((safezoneX + safezoneW - 12.5 * (((safezoneW / safezoneH) min 1.2) / 40)) - _wPos); }; -_position = [_xPos, _yPos, _wPos, _size * _hPos]; +private _position = [_xPos, _yPos, _wPos, _size * _hPos]; _ctrlHint ctrlSetPosition _position; _ctrlHint ctrlCommit 0; diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index 26c902a057..7b7ee5765e 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -12,11 +12,9 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private ["_backpackObject", "_holder"]; - -_backpackObject = backpackContainer _unit; +private _backpackObject = backpackContainer _unit; _unit addBackpack "ACE_FakeBackpack"; removeBackpack _unit; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index e076831c6f..bdc4588b05 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -19,8 +19,7 @@ if (!isNil "ACE_PFH_COUNTER") then { { _x params ["_pfh", "_parameters"]; - private "_isActive"; - _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)}; + private _isActive = ["ACTIVE", "REMOVED"] select isNil {CBA_common_PFHhandles select (_pfh select 0)}; diag_log text format ["Registered PFH: id=%1 [%2, delay %3], %4:%5", _pfh select 0, _isActive, _parameters select 1, _pfh select 1, _pfh select 2]; false @@ -31,20 +30,18 @@ diag_log text format ["ACE COUNTER RESULTS"]; diag_log text format ["-------------------------------------------"]; { - private ["_counterEntry", "_iter", "_total", "_count", "_averageResult", "_delta"]; - - _counterEntry = _x; - _iter = 0; - _total = 0; - _count = 0; - _averageResult = 0; + private _counterEntry = _x; + private _iter = 0; + private _total = 0; + private _count = 0; + private _averageResult = 0; if (count _counterEntry > 3) then { // calc { if (_iter > 2) then { _count = _count + 1; - _delta = (_x select 1) - (_x select 0); + private _delta = (_x select 1) - (_x select 0); _total = _total + _delta; }; @@ -69,8 +66,7 @@ diag_log text format ["-------------------------------------------"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_STEP_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delay"]; - _delay = _x select 2; + private _delay = _x select 2; //if(_delay > 0) then { _delay = _delay / 1000; }; diag_log text format["%1: %2s, delay=%3, handle=%4",(_x select 0), _delay, (_x select 3), (_x select 4)]; @@ -80,8 +76,7 @@ diag_log text format["-------------------------------------------"]; diag_log text format["ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER"]; diag_log text format["-------------------------------------------"]; { - private["_delta"]; - _delta = _x select 1; + private _delta = _x select 1; //if(_delta > 0) then { _delta = _delta / 1000; }; diag_log text format[" DELTA: %1s", _delta]; } forEach ACE_PERFORMANCE_EXCESSIVE_FRAME_TRACKER; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index f06aa2d30d..88e0a3b90f 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -31,41 +31,35 @@ if (isNull (call BIS_fnc_displayMission)) exitWith { params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]]; -if (typeName _textMessage == "STRING") then { +if (_textMessage isEqualType "") then { _textMessage = parseText _textMessage; }; (ARR_SELECT(_this,4,call BIS_fnc_displayMission)) createDisplay "RscDisplayCommonMessagePause"; -private ["_display", "_ctrlRscMessageBox", "_ctrlBcgCommonTop", "_ctrlBcgCommon", "_ctrlText", "_ctrlBackgroundButtonOK", "_ctrlBackgroundButtonMiddle", "_ctrlBackgroundButtonCancel", "_ctrlButtonOK", "_ctrlButtonCancel"]; - -_display = uiNamespace getVariable "RscDisplayCommonMessage_display"; -_ctrlRscMessageBox = _display displayCtrl 2351; -_ctrlBcgCommonTop = _display displayCtrl 235100; -_ctrlBcgCommon = _display displayCtrl 235101; -_ctrlText = _display displayCtrl 235102; -_ctrlBackgroundButtonOK = _display displayCtrl 235103; -_ctrlBackgroundButtonMiddle = _display displayCtrl 235104; -_ctrlBackgroundButtonCancel = _display displayCtrl 235105; -_ctrlButtonOK = _display displayCtrl 235106; -_ctrlButtonCancel = _display displayCtrl 235107; +private _display = uiNamespace getVariable "RscDisplayCommonMessage_display"; +private _ctrlRscMessageBox = _display displayCtrl 2351; +private _ctrlBcgCommonTop = _display displayCtrl 235100; +private _ctrlBcgCommon = _display displayCtrl 235101; +private _ctrlText = _display displayCtrl 235102; +private _ctrlBackgroundButtonOK = _display displayCtrl 235103; +private _ctrlBackgroundButtonMiddle = _display displayCtrl 235104; +private _ctrlBackgroundButtonCancel = _display displayCtrl 235105; +private _ctrlButtonOK = _display displayCtrl 235106; +private _ctrlButtonCancel = _display displayCtrl 235107; _ctrlBcgCommonTop ctrlSetText _textHeader; -private ["_ctrlButtonOKPos", "_ctrlBcgCommonPos", "_bottomSpaceY", "_ctrlTextPos", "_marginX", "_marginY"]; +private _ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; +private _ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; +private _bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); -_ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; -_ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; -_bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); - -_ctrlTextPos = ctrlPosition _ctrlText; -_marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); -_marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); - -private ["_ctrlTextPosH", "_bottomPosY"]; +private _ctrlTextPos = ctrlPosition _ctrlText; +private _marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); +private _marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); _ctrlText ctrlSetStructuredText _textMessage; -_ctrlTextPosH = ctrlTextHeight _ctrlText; +private _ctrlTextPosH = ctrlTextHeight _ctrlText; _ctrlBcgCommon ctrlSetPosition [ _ctrlBcgCommonPos select 0, @@ -83,16 +77,15 @@ _ctrlText ctrlSetPosition [ ]; _ctrlText ctrlCommit 0; -_bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; +private _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; { - private "_xPos"; - _xPos = ctrlPosition _x; + private _xPos = ctrlPosition _x; _xPos set [1, _bottomPosY]; _x ctrlSetPosition _xPos; _x ctrlCommit 0; -} foreach [ +} forEach [ _ctrlBackgroundButtonOK, _ctrlBackgroundButtonMiddle, _ctrlBackgroundButtonCancel, @@ -100,10 +93,8 @@ _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _b _ctrlButtonCancel ]; -private ["_ctrlRscMessageBoxPos", "_ctrlRscMessageBoxPosH"]; - -_ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; -_ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); +private _ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; +private _ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); _ctrlRscMessageBox ctrlSetPosition [ 0.5 - (_ctrlBcgCommonPos select 2) / 2, diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index 0b7bccb69a..06e1397f01 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -28,12 +28,11 @@ _function = call compile _function; [[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); // save persistent function for JIP -private ["_persistentFunctions", "_index"]; - -_persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []]; +private _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []]; // find index to overwrite function with the same name, add to end otherwise -_index = count _persistentFunctions; +private _index = count _persistentFunctions; + { if (_x select 2 == _name) exitWith { _index = _forEachIndex; diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 0dd0653a33..02f957b501 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -27,7 +27,7 @@ TRACE_3("params", _arguments, _function, _unit); _function = call compile _function; -if (typeName _unit == "SCALAR") exitWith { +if (_unit isEqualType 0) exitWith { switch (_unit) do { case 0 : { _arguments call _function; diff --git a/addons/common/functions/fnc_executePersistent.sqf b/addons/common/functions/fnc_executePersistent.sqf index 3763d1bb58..d8f54995bd 100644 --- a/addons/common/functions/fnc_executePersistent.sqf +++ b/addons/common/functions/fnc_executePersistent.sqf @@ -18,7 +18,7 @@ params ["_target"]; if (isNil "_x") then { ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex); } else { - if (typeName _x == "ARRAY") then { + if (_x isEqualType []) then { [_x select 0, _target] call (_x select 1); }; }; diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index 9b28786e43..c175254e5a 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -15,34 +15,30 @@ */ #include "script_component.hpp" -private "_fnc_logEntries"; -_fnc_logEntries = { +private _fnc_logEntries = { params ["_c", "_d"]; - private ["_p", "_t", "_e", "_a", "_i"]; + private _p = inheritsFrom _c; - _p = inheritsFrom _c; - - _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; + private _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; for "_a" from 1 to _d do { _t = " " + _t; }; diag_log text _t; - _e = []; + private _e = []; for "_i" from 0 to (count _c - 1) do { - private ["_e1, _e2"]; - _e1 = _c select _i; + private _e1 = _c select _i; - _e2 = switch (true) do { + private _e2 = switch (true) do { case (isNumber _e1): {getNumber _e1}; case (isText _e1): {getText _e1}; case (isArray _e1): {getArray _e1}; case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; }; - if (typeName _e2 != "BOOL") then { - if (typeName _e2 == "ARRAY") then { + if (!(_e2 isEqualType false)) then { + if (_e2 isEqualType []) then { _e2 = toArray str _e2; { if (_x == toArray "[" select 0) then { diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf index 0b30e59cf9..36ff328ef0 100644 --- a/addons/common/functions/fnc_filter.sqf +++ b/addons/common/functions/fnc_filter.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -params ["_array", "_code"]; +params [["_array", [], [[]]], ["_code", {}, [{}]]]; -private "_result"; -_result = []; +private _result = []; { if (_x call _code) then { diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf index a067c29c63..06d73c39b1 100644 --- a/addons/common/functions/fnc_fixCrateContent.sqf +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -14,11 +14,9 @@ params ["_crate"]; -private ["_weapons", "_items"]; - // get all weapons inside the crate -_weapons = weaponCargo _crate; -_items = []; +private _weapons = weaponCargo _crate; +private _items = []; // if the "weapon" is supposed to be an item, move those from the weapon array to the item array { diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 24084d2c11..5391402ca4 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -12,19 +12,17 @@ */ #include "script_component.hpp" -private "_object"; -_object = _this; +params ["_object"]; // setHitPointDamage requires local object if (!local _object) exitWith {}; // save and restore hitpoints, see below why -private "_hitPointDamages"; -_hitPointDamages = getAllHitPointsDamage _object; +private _hitPointDamages = getAllHitPointsDamage _object; // get correct format for objects without hitpoints if (_hitPointDamages isEqualTo []) then { - _hitPointDamages = [[],[],[]]; + _hitPointDamages = [[],[],[]]; }; // this prevents physx objects from floating when near other physx objects with allowDamage false diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf index 54d0cdfbf6..e2e2d71059 100644 --- a/addons/common/functions/fnc_fixPosition.sqf +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -16,8 +16,7 @@ // setVectorUp requires local object if (!local _this) exitWith {}; -private "_position"; -_position = getPos _this; +private _position = getPos _this; // don't place the object below the ground if (_position select 2 < -0.1) then { diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 18c8a18c72..a5d973767f 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -20,14 +20,12 @@ params ["_object", ["_category", ""]]; -if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith {[]}; +if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitWith {[]}; -private ["_return", "_val"]; - -_return = []; +private _return = []; { - _val = _object getvariable (_x select 0); + private _val = _object getVariable (_x select 0); if (!isNil "_val") then { if (_category == "" || _category == _x select 3) then { diff --git a/addons/common/functions/fnc_getCaptivityStatus.sqf b/addons/common/functions/fnc_getCaptivityStatus.sqf index 36bf0ff183..e2663a892e 100644 --- a/addons/common/functions/fnc_getCaptivityStatus.sqf +++ b/addons/common/functions/fnc_getCaptivityStatus.sqf @@ -14,13 +14,10 @@ params ["_unit"]; -private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; +private _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; +private _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber); -_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; - -_unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber); - -_unitCaptivityReasons = []; +private _unitCaptivityReasons = []; { if (_unitCaptivityStatus select _forEachIndex) then { diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf index d5212dd9a5..19fdf287fe 100644 --- a/addons/common/functions/fnc_getChildren.sqf +++ b/addons/common/functions/fnc_getChildren.sqf @@ -14,7 +14,6 @@ params ["_name", "_cfgClass"]; -private "_classes"; -_classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); +private _classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); [_classes, {configName _this}] call FUNC(map) // return diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf index bfa5fbc379..d4a53905b8 100644 --- a/addons/common/functions/fnc_getConfigCommander.sqf +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -14,9 +14,7 @@ params ["_vehicle"]; -private ["_config", "_turret"]; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = [_vehicle] call FUNC(getTurretCommander); +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _turret = _vehicle call FUNC(getTurretCommander); [_config, _turret] call FUNC(getTurretConfigPath) // return diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf index bc3131d798..abbbd5f014 100644 --- a/addons/common/functions/fnc_getConfigGunner.sqf +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -14,9 +14,7 @@ params ["_vehicle"]; -private ["_config", "_turret"]; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = [_vehicle] call FUNC(getTurretGunner); +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _turret = _vehicle call FUNC(getTurretGunner); [_config, _turret] call FUNC(getTurretConfigPath) // return diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 590418bf25..60aaf3bc0c 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -17,25 +17,23 @@ params ["_unit"]; -private ["_returnAnimation", "_animationState", "_unitAnimationCfg", "_unitActionsCfg", "_interpolateArray", "_indexAnimation"]; +private _returnAnimation = ""; -_returnAnimation = ""; - -_animationState = animationState _unit; -_unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState; +private _animationState = animationState _unit; +private _unitAnimationCfg = configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState; //If we're already in a terminal animation just return current if (getNumber (_unitAnimationCfg >> "terminal") == 1) exitWith {_animationState}; -_unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); +private _unitActionsCfg = configFile >> "CfgMovesBasic" >> "Actions" >> getText (_unitAnimationCfg >> "actions"); TRACE_2("Animation/Action", configName _unitAnimationCfg, configName _unitActionsCfg); if (vehicle _unit != _unit) then { - _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); + private _interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo"); for "_index" from 0 to (count _interpolateArray - 1) step 2 do { - _indexAnimation = _interpolateArray select _index; + private _indexAnimation = _interpolateArray select _index; //No guarentee that first animation will be right so scan for the first "terminal" animation //E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1}; diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf index 372a2424eb..c2c0e1e7c4 100644 --- a/addons/common/functions/fnc_getDefaultAnim.sqf +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -17,12 +17,10 @@ params ["_unit"]; -private ["_anim", "_stance"]; - -_anim = toLower animationState _unit; +private _anim = toLower animationState _unit; // stance is broken for some animations. -_stance = stance _unit; +private _stance = stance _unit; if (_anim find "ppne" == 4) then { _stance = "PRONE"; diff --git a/addons/common/functions/fnc_getDefinedVariable.sqf b/addons/common/functions/fnc_getDefinedVariable.sqf index c0d7ce8d83..32a75edb5e 100644 --- a/addons/common/functions/fnc_getDefinedVariable.sqf +++ b/addons/common/functions/fnc_getDefinedVariable.sqf @@ -15,15 +15,13 @@ params ["_unit", "_variable", "_defaultValue"]; -private "_value"; -_value = _unit getvariable _variable; +private _value = _unit getVariable _variable; if (isNil "_value") then { if (!isNil "_defaultValue") then { _value = _defaultValue; } else { - private "_definedVariable"; - _definedVariable = [_variable] call FUNC(getDefinedVariableInfo); + private _definedVariable = _variable call FUNC(getDefinedVariableInfo); if (count _definedVariable > 1) then { _value = _definedVariable select 1; diff --git a/addons/common/functions/fnc_getDefinedVariableDefault.sqf b/addons/common/functions/fnc_getDefinedVariableDefault.sqf index 4bb4b12253..c6f4f7711c 100644 --- a/addons/common/functions/fnc_getDefinedVariableDefault.sqf +++ b/addons/common/functions/fnc_getDefinedVariableDefault.sqf @@ -14,10 +14,9 @@ params ["_varName"]; -private "_variableDefinition"; -_variableDefinition = [_varName] call FUNC(getDefinedVariableInfo); +private _variableDefinition = _varName call FUNC(getDefinedVariableInfo); -if !(_variableDefinition isEqualTo []) exitwith { +if !(_variableDefinition isEqualTo []) exitWith { _variableDefinition select 1; }; diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 7a0d9ffa95..1660bbf804 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -16,12 +16,10 @@ params ["_idd"]; -private ["_configNames", "_config"]; - -_configNames = []; +private _configNames = []; for "_index" from 0 to (count configFile - 1) do { - _config = configFile select _index; + private _config = configFile select _index; if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _idd}) then { _configNames pushBack configName _config; diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index cab259a214..533e2a7489 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -14,14 +14,12 @@ params ["_vehicle"]; -private ["_turrets", "_doorTurrets", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_doorTurrets = []; +private _doorTurrets = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index 1111094ed0..c4cc46ab9b 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -17,20 +17,16 @@ params ["_source", "_destination", "_accuracy"]; -private ["_result", "_distance"]; +private _result = [false, [0, 0, 0]]; -_result = [false, [0, 0, 0]]; - -_distance = _source vectorDistance _destination; +private _distance = _source vectorDistance _destination; if !(lineIntersectsWith [_source, _destination] isEqualTo []) then { - private ["_lower", "_upper", "_mid", "_dir"]; + private _lower = 0; + private _upper = 1; + private _mid = 0.5; - _lower = 0; - _upper = 1; - _mid = 0.5; - - _dir = _source vectorFromTo _destination; + private _dir = _source vectorFromTo _destination; while {(_upper - _lower) * _distance > _accuracy} do { _mid = _lower + (_upper - _lower) / 2; diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index a5065413d9..27a6f3c613 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -17,20 +17,16 @@ params ["_source", "_destination", "_accuracy"]; -private ["_result", "_distance"]; +private _result = [false, [0, 0, 0]]; -_result = [false, [0, 0, 0]]; - -_distance = _source vectorDistance _destination; +private _distance = _source vectorDistance _destination; if (terrainIntersectASL [_source, _destination]) then { - private ["_lower", "_upper", "_mid", "_dir"]; + private _lower = 0; + private _upper = 1; + private _mid = 0.5; - _lower = 0; - _upper = 1; - _mid = 0.5; - - _dir = _source vectorFromTo _destination; + private _dir = _source vectorFromTo _destination; while {(_upper - _lower) * _distance > _accuracy} do { _mid = _lower + (_upper - _lower) / 2; diff --git a/addons/common/functions/fnc_getForceWalkStatus.sqf b/addons/common/functions/fnc_getForceWalkStatus.sqf index acdc2f1a05..16eca5ccc7 100644 --- a/addons/common/functions/fnc_getForceWalkStatus.sqf +++ b/addons/common/functions/fnc_getForceWalkStatus.sqf @@ -17,15 +17,11 @@ params ["_unit"]; -private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; +private _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; +private _unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; +private _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber); -_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; - -_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; - -_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber); - -_unitForceWalkReasons = []; +private _unitForceWalkReasons = []; { if (_unitForceWalkStatus select _forEachIndex) then { diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index dac42ce535..fb8c19ce45 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -13,14 +13,13 @@ */ #include "script_component.hpp" -params ["_vehicle", "_weapon"]; +params [["_vehicle", objNull, [objNull]], ["_weapon", "", [""]]]; // on foot if (gunner _vehicle == _vehicle && {_weapon in weapons _vehicle || {toLower _weapon in ["throw", "put"]}}) exitWith {gunner _vehicle}; // inside vehicle -private "_gunner"; -_gunner = objNull; +private _gunner = objNull; { if (_weapon in (_vehicle weaponsTurret _x)) exitWith { diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 84099b659a..9fb69dd50c 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -18,8 +18,7 @@ ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); params ["_vehicle"]; -private "_hitPointsWithSelections"; -_hitPointsWithSelections = getAllHitPointsDamage _vehicle; +private _hitPointsWithSelections = getAllHitPointsDamage _vehicle; // get correct format on vehicles without any hitpoints if (_hitPointsWithSelections isEqualTo []) then { diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index b0b9867cf7..d1c81ad3a6 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -19,12 +19,11 @@ ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPoi params ["_vehicle"]; -private "_hitPointsWithSelections"; -_hitPointsWithSelections = getAllHitPointsDamage _vehicle; +private _hitPointsWithSelections = getAllHitPointsDamage _vehicle; // get correct format on vehicles without any hitpoints if (_hitPointsWithSelections isEqualTo []) then { - _hitPointsWithSelections = [[],[],[]]; + _hitPointsWithSelections = [[],[],[]]; }; _hitPointsWithSelections resize 2; diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index dc3ad38cde..9ab15bacd5 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -25,15 +25,13 @@ _position = toLower _position; // general if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; -private ["_config", "_turret", "_isInside", "_script", "_enemiesInVehicle"]; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; +private _turret = []; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = []; +private _isInside = vehicle _unit == _vehicle; -_isInside = vehicle _unit == _vehicle; - -_script = {}; -_enemiesInVehicle = false; //Possible Side Restriction +private _script = {}; +private _enemiesInVehicle = false; //Possible Side Restriction { if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; @@ -96,8 +94,7 @@ switch (_position) do { }; case "turret" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsOther); + private _turrets = [_vehicle] call FUNC(getTurretsOther); if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { _script = [ @@ -122,8 +119,7 @@ switch (_position) do { }; case "ffv" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsFFV); + private _turrets = [_vehicle] call FUNC(getTurretsFFV); if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { _script = [ @@ -148,8 +144,7 @@ switch (_position) do { }; case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + private _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); { if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; @@ -207,11 +202,9 @@ switch (_position) do { }; // this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. -private "_fnc_getInEH"; -_fnc_getInEH = { - private "_config"; +private _fnc_getInEH = { // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? - _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; + private _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; if (isClass _config) then { //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index ec20b46f74..d3eb511949 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -15,23 +15,21 @@ params ["_item"]; -private ["_cfgType", "_config", "_type", "_simulation", "_default"]; - -_cfgType = [_item] call FUNC(getConfigType); +private _cfgType = [_item] call FUNC(getConfigType); if (_cfgType == "") exitWith {["", ""]}; if (_cfgType == "CfgGlasses") exitWith {["item", "glasses"]}; -_config = configFile >> _cfgType >> _item; -_type = getNumber (_config >> "type"); -_simulation = getText (_config >> "simulation"); +private _config = configFile >> _cfgType >> _item; +private _type = getNumber (_config >> "type"); +private _simulation = getText (_config >> "simulation"); if (isNumber (_config >> "ItemInfo" >> "type")) then { _type = getNumber (_config >> "ItemInfo" >> "type"); }; -_default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); +private _default = ["item", "magazine"] select (_cfgType == "CfgMagazines"); switch (true) do { case (_type == 0): {[_default, "unknown"]}; diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf index bbaf955a8b..a376dff841 100644 --- a/addons/common/functions/fnc_getLightProperties.sqf +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -19,14 +19,12 @@ params ["_vehicle", "_light"]; -private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; - -_intensity = getNumber (_config >> "intensity"); -_position = getText (_config >> "position"); -_direction = getText (_config >> "direction"); -_innerAngle = getNumber (_config >> "innerAngle"); -_outerAngle = getNumber (_config >> "outerAngle"); +private _intensity = getNumber (_config >> "intensity"); +private _position = getText (_config >> "position"); +private _direction = getText (_config >> "direction"); +private _innerAngle = getNumber (_config >> "innerAngle"); +private _outerAngle = getNumber (_config >> "outerAngle"); [_intensity, _position, _direction, _innerAngle, _outerAngle] diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf index 01567fee58..44c866e67f 100644 --- a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -18,16 +18,12 @@ params ["_weapon"]; -// @todo: Can weapons themselves still have flashlights (no attachment)? +private _config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; -private ["_config", "_intensity", "_position", "_direction", "_innerAngle", "_outerAngle"]; - -_config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; - -_intensity = getNumber (_config >> "intensity"); -_position = getText (_config >> "position"); -_direction = getText (_config >> "direction"); -_innerAngle = getNumber (_config >> "innerAngle"); -_outerAngle = getNumber (_config >> "outerAngle"); +private _intensity = getNumber (_config >> "intensity"); +private _position = getText (_config >> "position"); +private _direction = getText (_config >> "direction"); +private _innerAngle = getNumber (_config >> "innerAngle"); +private _outerAngle = getNumber (_config >> "outerAngle"); [_intensity, _position, _direction, _innerAngle, _outerAngle] diff --git a/addons/common/functions/fnc_getMGRSdata.sqf b/addons/common/functions/fnc_getMGRSdata.sqf index b4f10db8a4..ee6d1e11dc 100644 --- a/addons/common/functions/fnc_getMGRSdata.sqf +++ b/addons/common/functions/fnc_getMGRSdata.sqf @@ -18,11 +18,9 @@ params [["_map", worldName]]; -private ["_long", "_lat", "_altitude", "_UTM", "_easting", "_northing", "_zone", "_band", "_GZD"]; - -_long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude"); -_lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude"); -_altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset"); +private _long = getNumber (configFile >> "CfgWorlds" >> _map >> "longitude"); +private _lat = getNumber (configFile >> "CfgWorlds" >> _map >> "latitude"); +private _altitude = getNumber (configFile >> "CfgWorlds" >> _map >> "elevationOffset"); if (_map in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { _lat = 50; _altitude = 0; }; if (_map in ["Altis", "Stratis"]) then { _lat = 40; _altitude = 0; }; @@ -46,14 +44,14 @@ if (_map in ["lingor"]) then { _lat = -4; _altitude = 0; }; if (_map in ["Panthera3"]) then { _lat = 46; _altitude = 0; }; if (_map in ["Kunduz"]) then { _lat = 37; _altitude = 400; }; -_UTM = [_long,_lat] call BIS_fnc_posDegToUTM; -_easting = _UTM select 0; -_northing = _UTM select 1; -//_zone = _UTM select 2; +private _UTM = [_long,_lat] call BIS_fnc_posDegToUTM; +private _easting = _UTM select 0; +private _northing = _UTM select 1; +//private _zone = _UTM select 2; TRACE_4("",_UTM,_easting,_northing,_zone); /* -_band = switch (true) do { +private _band = switch (true) do { case (_lat<-72): {"C"}; case (_lat<-64): {"D"}; case (_lat<-56): {"E"}; @@ -77,8 +75,8 @@ _band = switch (true) do { }; */ -_zone = 1 + (floor ((_long + 180) / 6)); -_band = "Z"; +private _zone = 1 + (floor ((_long + 180) / 6)); +private _band = "Z"; if (_lat <= -80) then { _band = "A"; @@ -90,17 +88,17 @@ if (_lat <= -80) then { if (_map == "VR") then {_zone = 0; _band = "RV";}; -_GZD = format ["%1%2",_zone,_band]; +private _GZD = format ["%1%2",_zone,_band]; TRACE_3("",_zone,_band,_GZD); -private ["_set1", "_set2", "_set3", "_set4", "_set5", "_set6", "_metaE", "_metaN", "_letterE", "_letterN", "_grid100km"]; +private ["_metaE", "_metaN", "_letterE", "_letterN"]; -_set1 = [1,7,13,19,25,31,37,43,49,55]; -_set2 = [2,8,14,20,26,32,38,44,50,56]; -_set3 = [3,9,15,21,27,33,39,45,51,57]; -_set4 = [4,10,16,22,28,34,40,46,52,58]; -_set5 = [5,11,17,23,29,35,41,47,53,59]; -_set6 = [6,12,18,24,30,36,42,48,54,60]; +private _set1 = [1,7,13,19,25,31,37,43,49,55]; +private _set2 = [2,8,14,20,26,32,38,44,50,56]; +private _set3 = [3,9,15,21,27,33,39,45,51,57]; +private _set4 = [4,10,16,22,28,34,40,46,52,58]; +private _set5 = [5,11,17,23,29,35,41,47,53,59]; +private _set6 = [6,12,18,24,30,36,42,48,54,60]; switch (true) do { case (_zone in _set1): {_metaE = 1; _metaN = 1;}; @@ -154,7 +152,7 @@ switch (true) do { }; TRACE_1("",_letterN); -_grid100km = _letterE + _letterN; +private _grid100km = _letterE + _letterN; TRACE_1("",_grid100km); if (_map == worldName) then { diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index c74f378d75..be87a8585b 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -19,20 +19,18 @@ GVAR(mapGridData) = []; -private ["_cfgGrid", "_offsetX", "_offsetY", "_zoomMax", "_formatX", "_formatY", "_stepX", "_stepY", "_zoom", "_letterGrid", "_heightOffset", "_startGrid", "_originGrid", "_realOffsetY"]; - //--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos) -_cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid"; -_offsetX = getNumber (_cfgGrid >> "offsetX"); -_offsetY = getNumber (_cfgGrid >> "offsetY"); -_zoomMax = 1e99; -_formatX = ""; -_formatY = ""; -_stepX = 1e10; -_stepY = 1e10; +private _cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid"; +private _offsetX = getNumber (_cfgGrid >> "offsetX"); +private _offsetY = getNumber (_cfgGrid >> "offsetY"); +private _zoomMax = 1e99; +private _formatX = ""; +private _formatY = ""; +private _stepX = 1e10; +private _stepY = 1e10; { - _zoom = getnumber (_x >> "zoomMax"); + private _zoom = getnumber (_x >> "zoomMax"); if (_zoom < _zoomMax) then { _zoomMax = _zoom; _formatX = getText (_x >> "formatX"); @@ -43,7 +41,7 @@ _stepY = 1e10; false } count configProperties [_cfgGrid, "isClass _x", false]; -_letterGrid = false; +private _letterGrid = false; if (toLower _formatX find "a" != -1) then {_letterGrid = true}; if (toLower _formatY find "a" != -1) then {_letterGrid = true}; @@ -53,9 +51,9 @@ if (_letterGrid) exitWith { }; //Start at [0, 500] and move north until we get a change in grid -_heightOffset = 500; -_startGrid = mapGridPosition [0, _heightOffset]; -_originGrid = _startGrid; +private _heightOffset = 500; +private _startGrid = mapGridPosition [0, _heightOffset]; +private _originGrid = _startGrid; while {_startGrid == _originGrid} do { _heightOffset = _heightOffset + 1; @@ -63,7 +61,7 @@ while {_startGrid == _originGrid} do { }; //Calculate the real y offset -_realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1; +private _realOffsetY = (parseNumber (_originGrid select [count _formatX, count _formatY])) * _stepY + _heightOffset - 1; //Calculate MGRS 10digit step - they should both be 1 meter: _stepXat5 = _stepX * 10 ^ ((count _formatX) - 5); diff --git a/addons/common/functions/fnc_getMapGridFromPos.sqf b/addons/common/functions/fnc_getMapGridFromPos.sqf index 1f946a6e80..8604d68fa6 100644 --- a/addons/common/functions/fnc_getMapGridFromPos.sqf +++ b/addons/common/functions/fnc_getMapGridFromPos.sqf @@ -19,24 +19,22 @@ params ["_pos", ["_returnSingleString", false]]; -private ["_nativeGrid", "_count", "_easting", "_northing"]; - //Fallback, when map data is weird (letters) if (GVAR(mapGridData) isEqualTo []) exitWith { - _nativeGrid = mapGridPosition _pos; + private _nativeGrid = mapGridPosition _pos; if (_returnSingleString) then { _nativeGrid } else { - _count = floor ((count _nativeGrid) / 2); + private _count = floor ((count _nativeGrid) / 2); [_nativeGrid select [0, _count], _nativeGrid select [_count, _count]] }; }; GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; -_easting = floor (((_pos select 0) - _offsetX) / _stepXat5); -_northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5); +private _easting = floor (((_pos select 0) - _offsetX) / _stepXat5); +private _northing = floor (((_pos select 1) - _realOffsetY) / _stepYat5); //Attempt to handle negative east/north (e.g.: moving west of map bounds) if (_easting > 0) then { diff --git a/addons/common/functions/fnc_getMapPosFromGrid.sqf b/addons/common/functions/fnc_getMapPosFromGrid.sqf index 5ba67a40bf..a148679fa9 100644 --- a/addons/common/functions/fnc_getMapPosFromGrid.sqf +++ b/addons/common/functions/fnc_getMapPosFromGrid.sqf @@ -25,17 +25,15 @@ if (count GVAR(mapGridData) == 0) exitWith { GVAR(mapGridData) params ["_offsetX", "_realOffsetY", "_stepXat5", "_stepYat5"]; -private ["_countInput", "_countInputHalf", "_xPart", "_yPart", "_xPos", "_yPos"]; - -_countInput = count _inputString; -_countInputHalf = floor (_countInput / 2); +private _countInput = count _inputString; +private _countInputHalf = floor (_countInput / 2); //Split string, ignoring middle -_xPart = _inputString select [0, _countInputHalf]; -_yPart = _inputString select [ceil (_countInput / 2), _countInputHalf]; +private _xPart = _inputString select [0, _countInputHalf]; +private _yPart = _inputString select [ceil (_countInput / 2), _countInputHalf]; -_xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX; -_yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY; +private _xPos = ((parseNumber _xPart) * _stepXat5 * 10 ^ (5 - _countInputHalf)) + _offsetX; +private _yPos = ((parseNumber _yPart) * _stepYat5 * 10 ^ (5 - _countInputHalf)) + _realOffsetY; if (_getCenterOfGrid) then { _xPos = _xPos + 0.5 * _stepXat5 * 10 ^ (5 - _countInputHalf); diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf index 7c99302d8f..0da7f1a46e 100644 --- a/addons/common/functions/fnc_getMarkerType.sqf +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -14,11 +14,9 @@ params ["_group"]; -private ["_leader", "_vehicle", "_side"]; - -_leader = leader _group; -_vehicle = vehicle _leader; -_side = side _leader; +private _leader = leader _group; +private _vehicle = vehicle _leader; +private _side = side _leader; if (_vehicle == _leader) exitWith { if ( diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf index a7facd2c6d..4c49e8dc11 100644 --- a/addons/common/functions/fnc_getName.sqf +++ b/addons/common/functions/fnc_getName.sqf @@ -5,24 +5,27 @@ * Arguments: * 0: Object * 1: Use effective commander name when used on vehicles (default: false) + * 2: Get Raw Name (Don't sanatize HTML tags ``) (default: false) * * Return Value: * Object Name * + * Example: + * [player, false, true] call ace_common_fnc_getName; + * * Public: Yes */ #include "script_component.hpp" -params ["_unit", ["_showEffective", false]]; +params ["_unit", ["_showEffective", false], ["_useRaw", false]]; -private "_name"; -_name = ""; +private _name = ""; if (_unit isKindOf "CAManBase") then { - _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; + _name = _unit getVariable [(["ACE_Name", "ACE_NameRaw"] select _useRaw), localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; } else { if (_showEffective) then { - _name = [effectiveCommander _unit] call FUNC(getName); + _name = [effectiveCommander _unit, false, _useRaw] call FUNC(getName); } else { _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); }; diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index df1f7ed64b..87f92979eb 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -15,8 +15,7 @@ params ["_unit", "_magazine"]; -private "_return"; -_return = 0; +private _return = 0; if (_unit isKindOf "CAManBase") then { _return = {_x == _magazine} count magazines _unit; diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index ef2b908bde..248050486c 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -18,23 +18,18 @@ params ["_vehicle"]; -private ["_config", "_hitpoints", "_selections"]; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; - -_hitpoints = []; -_selections = []; +private _hitpoints = []; +private _selections = []; // iterate through all parents while {isClass _config} do { - private "_class"; - _class = _config >> "Reflectors"; + private _class = _config >> "Reflectors"; for "_i" from 0 to (count _class - 1) do { - private ["_entry", "_selection"]; - - _entry = _class select _i; - _selection = getText (_entry >> "hitpoint"); + private _entry = _class select _i; + private _selection = getText (_entry >> "hitpoint"); if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { _hitpoints pushBack configName _entry; diff --git a/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf index 277155108a..b46ec308ec 100644 --- a/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf +++ b/addons/common/functions/fnc_getSelectionsWithoutHitPoints.sqf @@ -13,11 +13,9 @@ params ["_vehicle"]; -private ["_hitPointsFull", "_allSelectionsWithoutHitpoints"]; +private _hitPointsFull = getAllHitPointsDamage _vehicle; -_hitPointsFull = getAllHitPointsDamage _vehicle; - -_allSelectionsWithoutHitpoints = []; +private _allSelectionsWithoutHitpoints = []; { if (_x == "") then { diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index de9ef40447..ae9dd5351e 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -23,12 +23,13 @@ params ["_name"]; -private "_value"; -_value = []; +scopeName "main"; { - if (_x select 0 == _name) exitWith {_value = _x}; + if (_x select 0 == _name) then { + _x breakOut "main"; + }; false } count GVAR(settings); -_value +[] diff --git a/addons/common/functions/fnc_getStaminaBarControl.sqf b/addons/common/functions/fnc_getStaminaBarControl.sqf new file mode 100644 index 0000000000..1fa747fef6 --- /dev/null +++ b/addons/common/functions/fnc_getStaminaBarControl.sqf @@ -0,0 +1,15 @@ +/* + * Author: commy2 + * Returns the control of the Stamina Bar from Arma 1.54. + * + * Arguments: + * None + * + * Return Value: + * Stamina Bar control + * + * Public: No + */ +#include "script_component.hpp" + +(uiNamespace getVariable [QGVAR(dlgStaminaBar), displayNull]) displayCtrl IDC_STAMINA_BAR diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf index 6b6a34cfb7..0893b7bb0d 100644 --- a/addons/common/functions/fnc_getStringFromMissionSQM.sqf +++ b/addons/common/functions/fnc_getStringFromMissionSQM.sqf @@ -14,13 +14,11 @@ */ #include "script_component.hpp" -private ["_path", "_mission", "_class", "_index", "_array", "_entry"]; - -_path = _this; +[_this] params ["_path", [], [[]]]; if (missionName == "") exitWith {""}; -_mission = toArray toLower loadFile "mission.sqm"; +private _mission = toArray toLower loadFile "mission.sqm"; _mission resize 65536; { @@ -34,11 +32,9 @@ _mission = toString (_mission - [-1]); {_path set [_forEachIndex, toLower _x]} forEach _path; for "_a" from 0 to (count _path - 2) do { - _class = format ["class%1{", _path select _a]; - - _index = _mission find _class; - - _array = toArray _mission; + 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]; @@ -49,7 +45,7 @@ for "_a" from 0 to (count _path - 2) do { _mission = toString _array; }; -_entry = format ["%1=", _path select (count _path - 1)]; +private _entry = format ["%1=", _path select (count _path - 1)]; _index = _mission find _entry; if (_index == -1) exitWith {""}; diff --git a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf index da23e600aa..0d2343bec9 100644 --- a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf @@ -13,13 +13,11 @@ */ #include "script_component.hpp" -private ["_position", "_direction", "_azimuth", "_inclination"]; +private _position = ATLToASL positionCameraToWorld [0, 0, 0]; +private _direction = ATLToASL positionCameraToWorld [0, 0, 1]; -_position = ATLToASL positionCameraToWorld [0, 0, 0]; -_direction = ATLToASL positionCameraToWorld [0, 0, 1]; - -_azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); -_inclination = asin ((_direction select 2) - (_position select 2)); +private _azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); +private _inclination = asin ((_direction select 2) - (_position select 2)); if (_azimuth < 0) then {_azimuth = _azimuth + 360}; diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf index fe75268cea..4bd050a2c5 100644 --- a/addons/common/functions/fnc_getTargetDistance.sqf +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -16,16 +16,14 @@ params ["_interval", "_maxDistance", "_minDistance"]; -private ["_position", "_laser", "_line", "_distance", "_iteration"]; - -_position = ATLToASL positionCameraToWorld [0, 0, 0]; +private _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; -_laser = + _position; -_line = [_position, _laser]; +private _laser = + _position; +private _line = [_position, _laser]; -_distance = _maxDistance; -_iteration = _distance; +private _distance = _maxDistance; +private _iteration = _distance; while { _iteration > _interval / 2 diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf index adaaa3e344..ed757dedf4 100644 --- a/addons/common/functions/fnc_getTargetObject.sqf +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -14,15 +14,13 @@ params ["_maxDistance"]; -private ["_position", "_laser", "_intersects"]; - -_position = ATLToASL positionCameraToWorld [0, 0, 0]; +private _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; -_laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance]; +private _laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance]; _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; -_intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; +private _intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; if (_intersects isEqualTo []) exitWith {objNull}; diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index 0d71a3362e..a996e146d2 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -16,15 +16,12 @@ params ["_vehicle"]; if (!isLightOn _vehicle) exitWith {[]}; -private ["_reflectorsWithSelections", "_lights", "_hitpoints", "_turnedOnLights"]; - -_reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall); +private _reflectorsWithSelections = [[_vehicle], FUNC(getReflectorsWithSelections), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getReflectorsWithSelections)), typeOf _vehicle], 1E11] call FUNC(cachedCall); //_reflectorsWithSelections = [_vehicle] call FUNC(getReflectorsWithSelections); -_lights = _reflectorsWithSelections select 0; -_hitpoints = _reflectorsWithSelections select 1; +_reflectorsWithSelections params ["_lights", "_hitpoints"]; -_turnedOnLights = []; +private _turnedOnLights = []; { if (_vehicle getHit _x <= 0.9) then { diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index e045c2d46f..e73795e148 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -12,16 +12,14 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_turrets", "_turret", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_turret = []; +private _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index 07d7ac4e0c..95d0773fd3 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -15,14 +15,12 @@ params ["_config", "_turretIndex"]; -private ["_offset", "_config2", "_foundClasses"]; - for "_index" from 0 to (count _turretIndex - 1) do { _config = _config >> "Turrets"; - _offset = 0; - _config2 = _config select 0; - _foundClasses = 0; + private _offset = 0; + private _config2 = _config select 0; + private _foundClasses = 0; for "_a" from 0 to (count _config - 1) do { if (isClass _config2) then { diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index 94a30b7697..6161f5c4cc 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -12,16 +12,14 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_turrets", "_turret", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_turret = []; +private _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index ced29a9a85..92c84cdca9 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -16,30 +16,25 @@ params ["_vehicle", "_position"]; -private ["_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir"]; +private _turret = [_vehicle, _position] call CBA_fnc_getTurret; -_turret = [_vehicle, _position] call CBA_fnc_getTurret; - -_pov = getText (_turret >> "memoryPointGunnerOptics"); -_gunBeg = getText (_turret >> "gunBeg"); -_gunEnd = getText (_turret >> "gunEnd"); +private _pov = getText (_turret >> "memoryPointGunnerOptics"); +private _gunBeg = getText (_turret >> "gunBeg"); +private _gunEnd = getText (_turret >> "gunEnd"); TRACE_3("", _pov, _gunBeg, _gunEnd); // Pull the PIP pov or barrel direction, depending on how the model is set up -_povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ? -_povDir = [0,0,0]; +private _povPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _pov)); //@todo AGLToASL ? +private _povDir = [0,0,0]; if (_pov == "pip0_pos") then { - private "_pipDir"; - _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir")); + private _pipDir = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir")); _povDir = _pipDir vectorDiff _povPos; } else { - private ["_gunBeginPos", "_gunEndPos"]; - - _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg)); - _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd)); + private _gunBeginPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunBeg)); + private _gunEndPos = ATLtoASL (_vehicle modelToWorldVisual (_vehicle selectionPosition _gunEnd)); _povDir = _gunBeginPos vectorDiff _gunEndPos; }; diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index 9a71d292bd..6f59798cc6 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -12,16 +12,14 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_turrets", "_turret", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_turret = []; +private _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index 20ee178bf1..df2d540873 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; private _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index 9a1a48e2bd..229f3ab1f7 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -16,33 +16,25 @@ params ["_type"]; -private ["_varName", "_turrets"]; - -_varName = format [QGVAR(CachedTurrets_%1), _type]; -_turrets = + (uiNamespace getVariable _varName); +private _varName = format [QGVAR(CachedTurrets_%1), _type]; +private _turrets = + (uiNamespace getVariable _varName); if (!isNil "_turrets") exitWith {_turrets}; -private ["_config", "_fnc_addTurret"]; - -_config = configFile >> "CfgVehicles" >> _type; +private _config = configFile >> "CfgVehicles" >> _type; _turrets = []; -_fnc_addTurret = { +private _fnc_addTurret = { params ["_config", "_path"]; _config = _config >> "Turrets"; - private ["_count", "_offset", "_path2", "_config2"]; + private _offset = 0; - _count = count _config; - - _offset = 0; - - for "_index" from 0 to (_count - 1) do { - _path2 = _path + [_index - _offset]; - _config2 = _config select _index; + for "_index" from 0 to (count _config - 1) do { + private _path2 = _path + [_index - _offset]; + private _config2 = _config select _index; if (isClass _config2) then { _turrets pushBack _path2; diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index ff7726d1be..8c471824cf 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -12,16 +12,14 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_turrets", "_turret", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_turret = []; +private _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index 93ab3f2321..408a5529d5 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -12,23 +12,22 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_turrets", "_turret", "_config"]; +private _turrets = allTurrets [_vehicle, true]; -_turrets = allTurrets [_vehicle, true]; - -_turret = []; +private _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + private _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _config = [_config, _x] call FUNC(getTurretConfigPath); - if ( getNumber (_config >> "isCopilot") != 1 - && {getNumber (_config >> "primaryGunner") != 1} - && {getNumber (_config >> "primaryObserver") != 1} - && {getNumber (_config >> "isPersonTurret") != 1} + if ( + getNumber (_config >> "isCopilot") != 1 + && {getNumber (_config >> "primaryGunner") != 1} + && {getNumber (_config >> "primaryObserver") != 1} + && {getNumber (_config >> "isPersonTurret") != 1} ) then { _turret pushBack _x; }; diff --git a/addons/common/functions/fnc_getUavControlPosition.sqf b/addons/common/functions/fnc_getUavControlPosition.sqf index a9b5340eb2..c98004c7e7 100644 --- a/addons/common/functions/fnc_getUavControlPosition.sqf +++ b/addons/common/functions/fnc_getUavControlPosition.sqf @@ -18,16 +18,14 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private ["_uav", "_positionArray", "_playerIndex"]; - -_uav = getConnectedUAV _unit; +private _uav = getConnectedUAV _unit; if (isNull _uav) exitWith {""}; -_positionArray = UAVControl _uav; -_playerIndex = _positionArray find _unit; +private _positionArray = UAVControl _uav; +private _playerIndex = _positionArray find _unit; if (_playerIndex == -1) exitWith {""}; diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index 5be213aa68..68599c919b 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -12,14 +12,12 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_config", "_cargo", "_codrivers"]; +private _config = configFile >> "CfgVehicles" >> _vehicle; -_config = configFile >> "CfgVehicles" >> _vehicle; - -_cargo = []; -_codrivers = getArray (_config >> "cargoIsCoDriver"); +private _cargo = []; +private _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index e23cfcd0d4..a1cc5814e1 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -12,14 +12,12 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; -private ["_config", "_cargo", "_codrivers"]; +private _config = configFile >> "CfgVehicles" >> _vehicle; -_config = configFile >> "CfgVehicles" >> _vehicle; - -_cargo = []; -_codrivers = getArray (_config >> "cargoIsCoDriver"); +private _cargo = []; +private _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index 58d0067b85..adb0e9701a 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -15,8 +15,7 @@ params ["_vehicle", ["_types", ["driver", "commander", "gunner", "turret", "cargo", "ffv"]]]; -private "_crew"; -_crew = []; +private _crew = []; // iterate through all crew members { diff --git a/addons/common/functions/fnc_getVehicleUAVCrew.sqf b/addons/common/functions/fnc_getVehicleUAVCrew.sqf index 8d9156810a..fcb48ee216 100644 --- a/addons/common/functions/fnc_getVehicleUAVCrew.sqf +++ b/addons/common/functions/fnc_getVehicleUAVCrew.sqf @@ -12,6 +12,6 @@ */ #include "script_component.hpp" -params ["_vehicle"]; +params [["_vehicle", objNull, [objNull]]]; [crew _vehicle, {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "UAVPilot"}] call FUNC(filter) // return diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf index 09968d8e39..f7c7909e01 100644 --- a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -15,12 +15,10 @@ params ["_weapon"]; -private ["_direction", "_azimuth", "_inclination"]; +private _direction = ACE_player weaponDirection _weapon; -_direction = ACE_player weaponDirection _weapon; - -_azimuth = (_direction select 0) atan2 (_direction select 1); -_inclination = asin (_direction select 2); +private _azimuth = (_direction select 0) atan2 (_direction select 1); +private _inclination = asin (_direction select 2); if (_azimuth < 0) then {_azimuth = _azimuth + 360}; diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index a2bb9c3205..48755d3a9b 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -12,13 +12,11 @@ */ #include "script_component.hpp" -params ["_weapon"]; +params [["_weapon", "", [""]]]; -private ["_config", "_modes"]; +private _config = configFile >> "CfgWeapons" >> _weapon; -_config = configFile >> "CfgWeapons" >> _weapon; - -_modes = []; +private _modes = []; { if (getNumber (_config >> _x >> "showToPlayer") == 1) then { diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index cdfd58f238..d75a01f2e3 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -12,13 +12,14 @@ */ #include "script_component.hpp" -params ["_weapon"]; +params [["_weapon", "", [""]]]; -private "_muzzles"; -_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); +private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); -if ("this" in _muzzles) then { - _muzzles set [_muzzles find "this", _weapon]; -}; +{ + if (_x == "this") then { + _muzzles set [_forEachIndex, _weapon]; + }; +} forEach _muzzles; _muzzles diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 8ee1610f4e..e7b7bb80ec 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -18,17 +18,13 @@ params ["_unit", "_weapon"]; -private ["_muzzles", "_weaponInfo"]; +private _muzzles = _weapon call FUNC(getWeaponMuzzles); -_muzzles = [_weapon] call FUNC(getWeaponMuzzles); - -_weaponInfo = [["","","",""], primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] find _weapon) max 0); +private _weaponInfo = [["","","",""], primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit] select ((["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit] find _weapon) max 0); // get loaded magazines and ammo -private ["_magazines", "_ammo"]; - -_magazines = []; -_ammo = []; +private _magazines = []; +private _ammo = []; { _magazines pushBack ""; @@ -38,8 +34,7 @@ _ammo = []; { if (_x select 2) then { - private "_index"; - _index = _muzzles find (_x select 4); + private _index = _muzzles find (_x select 4); if (_index != -1) then { _magazines set [_index, _x select 0]; diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf index f8ee7f9fe4..5666ea5bc0 100644 --- a/addons/common/functions/fnc_getWeaponType.sqf +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -18,11 +18,9 @@ params ["_weapon"]; -private ["_type", "_index"]; +private _type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); -_type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); - -_index = 0; +private _index = 0; while {!(_type select _index) && {_index < 16}} do { _index = _index + 1; diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index b4ed7f9be1..cdaf707395 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -16,8 +16,7 @@ params ["_vector1", "_vector2"]; -private "_newVector"; -_newVector = []; +private _newVector = []; for "_i" from 0 to ((count _vector1 min count _vector2) - 1) do { _newVector pushBack ((_vector1 select _i) * (_vector2 select _i)); diff --git a/addons/common/functions/fnc_hasHatch.sqf b/addons/common/functions/fnc_hasHatch.sqf index a67ad0b0d3..e39c52f897 100644 --- a/addons/common/functions/fnc_hasHatch.sqf +++ b/addons/common/functions/fnc_hasHatch.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; private _vehicle = vehicle _unit; diff --git a/addons/common/functions/fnc_hasItem.sqf b/addons/common/functions/fnc_hasItem.sqf index 526f5a46f2..8ca785d78e 100644 --- a/addons/common/functions/fnc_hasItem.sqf +++ b/addons/common/functions/fnc_hasItem.sqf @@ -10,9 +10,11 @@ * has Item * * Public: yes + * + * Note: Case sensitive */ #include "script_component.hpp" -params ["_unit", "_item"]; +params [["_unit", objNull, [objNull]], ["_item", "", [""]]]; _item in items _unit // return diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 27150ea5d5..eaa9bc0556 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -10,9 +10,11 @@ * has Magazine * * Public: yes + * + * Note: Case sensitive */ #include "script_component.hpp" -params ["_unit", "_magazine"]; +params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]]; _magazine in magazines _unit // return diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index df5d294beb..d0a5cdf22e 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -13,15 +13,13 @@ */ #include "script_component.hpp" -private ["_val", "_index"]; - params ["_hash", "_key"]; ERRORDATA(2); -_val = nil; +private _val = nil; try { if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; + private _index = (_hash select 0) find _key; if(_index != -1) then { _val = (_hash select 1) select _index; if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then { diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 5c6293fc85..b2978f9cc4 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -12,16 +12,15 @@ */ #include "script_component.hpp" -private ["_val", "_index"]; // diag_log text format["%1 HASH HAS KEY: %2", ACE_diagTime, _this]; params ["_hash", "_key"]; ERRORDATA(2); -_val = false; +private _val = false; try { if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; + private _index = (_hash select 0) find _key; if(_index != -1) then { _val = true; }; diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index d6a94445eb..d5cc323c8d 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -12,12 +12,10 @@ */ #include "script_component.hpp" -private ["_hashKeys"]; - params ["_hashList"]; ERRORDATA(1); -_hashKeys = []; +private _hashKeys = []; try { if(VALIDHASH(_hashList)) then { _hashKeys = (_hashList select 0); diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index df072d55bd..f5e3d85b31 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -12,18 +12,16 @@ */ #include "script_component.hpp" -private ["_hash", "_keys", "_hashes", "_values"]; - params ["_hashList", "_index"]; ERRORDATA(2); -_hash = nil; +private _hash = nil; try { if(VALIDHASH(_hashList)) then { - _keys = _hashList select 0; - _hashes = _hashList select 1; + _hashList params ["_keys", "_hashes"]; + if(_index < (count _hashes)) then { - _values = _hashes select _index; + private _values = _hashes select _index; _hash = [_keys, _values, 1]; } else { diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index 5fea048327..ee0a8dc7eb 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -12,15 +12,13 @@ */ #include "script_component.hpp" -private ["_vals"]; - params ["_hashList", "_index", "_value"]; ERRORDATA(3); try { if(VALIDHASH(_hashList)) then { if(VALIDHASH(_value)) then { - _vals = _value select 1; + _value params ["", "_vals"]; (_hashList select 1) set[_index, _vals]; } else { diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 4346a509cf..bd0c8f2a2d 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -12,15 +12,13 @@ */ #include "script_component.hpp" -private ["_val", "_index"]; - params ["_hash", "_key"]; ERRORDATA(2); -_val = nil; +private _val = nil; try { if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; + private _index = (_hash select 0) find _key; if(_index != -1) then { (_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"]; // is this hash is not part of a hash list? diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index af7a361dd6..10e2881c10 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -12,7 +12,6 @@ */ #include "script_component.hpp" -private ["_index"]; // diag_log text format["%1 HASH SET: %2", ACE_diagTime, _this]; params ["_hash", "_key", "_val"]; @@ -20,7 +19,7 @@ params ["_hash", "_key", "_val"]; ERRORDATA(3); try { if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; + private _index = (_hash select 0) find _key; if(_index == -1) then { _index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL"; if(_index == -1) then { diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 78b1a602df..dffb28ff4b 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -14,24 +14,22 @@ */ #include "script_component.hpp" -private ["_unit", "_anim", "_pos", "_dir", "_dummy"]; - -_unit = ACE_player; -_anim = animationState _unit; +private _unit = ACE_player; +private _anim = animationState _unit; ["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent); ["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent); if (_unit != vehicle _unit || {!([_unit, objNull, ["isNotSitting"]] call FUNC(canInteractWith))}) exitWith {false}; -_pos = getPosATL _unit; -_dir = getDir _unit; +private _pos = getPosATL _unit; +private _dir = getDir _unit; titleCut ["", "BLACK"]; [_unit, "headBugFix"] call FUNC(hideUnit); // create invisible headbug fix vehicle -_dummy = createVehicle ["ACE_Headbug_Fix", _pos, [], 0, "NONE"]; +private _dummy = createVehicle ["ACE_Headbug_Fix", _pos, [], 0, "NONE"]; _dummy setDir _dir; _unit moveInAny _dummy; sleep 0.1; // @todo diff --git a/addons/common/functions/fnc_hideUnit.sqf b/addons/common/functions/fnc_hideUnit.sqf index 7fdd901848..85636a08f7 100644 --- a/addons/common/functions/fnc_hideUnit.sqf +++ b/addons/common/functions/fnc_hideUnit.sqf @@ -12,7 +12,7 @@ * Example: * [ACE_Player, "SpectatorMode"] call ace_common_fnc_hideUnit * - * Public: No + * Public: Yes */ #include "script_component.hpp" @@ -20,8 +20,7 @@ params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; -private "_setHiddenReasons"; -_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; +private _setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; if !(_reason in _setHiddenReasons) then { _setHiddenReasons pushBack _reason; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 7f881ff746..4ec39d8cc3 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -24,8 +24,7 @@ params ["_configEntry", "_configMatch"]; if (configName _configEntry == _configMatch) exitWith {true}; if (configName _configEntry == ",") exitWith {false}; -private "_match"; -_match = false; +private _match = false; while {configName _configEntry != ""} do { if (configName _configEntry == _configMatch) exitWith { diff --git a/addons/common/functions/fnc_insertionSort.sqf b/addons/common/functions/fnc_insertionSort.sqf index 9f8c95e095..d2f89a039e 100644 --- a/addons/common/functions/fnc_insertionSort.sqf +++ b/addons/common/functions/fnc_insertionSort.sqf @@ -17,10 +17,8 @@ params ["_list", ["_ascending", true]]; _list = + _list; // copy array to not alter the original one -private "_tmp"; - for "_i" from 1 to (count _list - 1) do { - _tmp = _list select _i; + private _tmp = _list select _i; _j = _i; while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf index 5ce59bde62..07207071e7 100644 --- a/addons/common/functions/fnc_interpolateFromArray.sqf +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -15,9 +15,7 @@ params ["_array", "_value"]; -private ["_min", "_max"]; - -_min = _array select floor _value; -_max = _array select ceil _value; +private _min = _array select floor _value; +private _max = _array select ceil _value; _min + (_max - _min) * (_value % 1) // return diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index 8a123cfec9..1179ced02f 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -14,4 +14,4 @@ params ["_unit"]; -!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]) // return +!(_unit getVariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getVariable ["ACE_isDead", false]) // return diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 9018149c27..01eabfc0b3 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -8,10 +8,17 @@ * Return Value: * is the unit an engineer * + * Example: + * [player] call ace_common_fnc_isEngineer + * * Public: Yes */ #include "script_component.hpp" params ["_unit"]; -_unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] // return +private _isEngineer = _unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1]; +//Handle ace_repair modules setting this to a number +if (_isEngineer isEqualType 0) then {_isEngineer = _isEngineer > 0}; + +_isEngineer diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf index 577b865aee..e5234b9200 100644 --- a/addons/common/functions/fnc_isInBuilding.sqf +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -14,13 +14,11 @@ #define CHECK_DISTANCE 10 -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private ["_position", "_intersections"]; +private _position = eyePos _unit; -_position = eyePos _unit; - -_intersections = 0; +private _intersections = 0; if (lineIntersects [_position, _position vectorAdd [0, 0, +CHECK_DISTANCE]]) then { _intersections = _intersections + 1; diff --git a/addons/common/functions/fnc_isModLoaded.sqf b/addons/common/functions/fnc_isModLoaded.sqf index e5f94b202d..46e1bc03a8 100644 --- a/addons/common/functions/fnc_isModLoaded.sqf +++ b/addons/common/functions/fnc_isModLoaded.sqf @@ -12,6 +12,6 @@ */ #include "script_component.hpp" -params ["_modName"]; +params [["_modName", "", [""]]]; -isClass (configFile >> "cfgPatches" >> _modName) // return +isClass (configFile >> "CfgPatches" >> _modName) // return diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf index 8bea7e9771..fe265bd925 100644 --- a/addons/common/functions/fnc_isPlayer.sqf +++ b/addons/common/functions/fnc_isPlayer.sqf @@ -1,7 +1,7 @@ /* * Author: bux578, commy2, akalegman * Checks if a unit is a player / curator controlled unit. - * Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine) + * This now includes both local and non-local remote controlled zeus units. (Remotes from another zeus machine) * * Arguments: * 0: unit to be checked @@ -10,10 +10,13 @@ * Return Value: * Is unit a player? * + * Example: + * [cursorTarget, false] call ace_common_fnc_isPlayer; + * * Public: Yes */ #include "script_component.hpp" params ["_unit", ["_excludeRemoteControlled", false]]; -isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) // return +(isPlayer _unit) || {(!_excludeRemoteControlled) && {!isNull (_unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull])}} diff --git a/addons/common/functions/fnc_isUnderwater.sqf b/addons/common/functions/fnc_isUnderwater.sqf index d2f399b770..637ed49f3d 100644 --- a/addons/common/functions/fnc_isUnderwater.sqf +++ b/addons/common/functions/fnc_isUnderwater.sqf @@ -12,14 +12,12 @@ */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private "_return"; -_return = false; +private _return = false; if (surfaceIsWater getPosASL _unit) then { - private "_pos"; - _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); + private _pos = _unit modelToWorldVisual (_unit selectionPosition "head"); if (_pos select 2 < 0) then { _return = true; diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index df88671405..a495897dea 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -15,79 +15,60 @@ params ["_unit", "_lightSource"]; -private ["_unitPos", "_lightLevel"]; - -_unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); -_lightLevel = 0; +private _unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); +private _lightLevel = 0; if (_lightSource isKindOf "CAManBase") then { // handle persons with flashlights - private "_weapon"; - _weapon = currentWeapon _lightSource; + private _weapon = currentWeapon _lightSource; if !(_lightSource isFlashlightOn _weapon) exitWith {}; - private ["_flashlight", "_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; - - _flashlight = switch (_weapon) do { - case (primaryWeapon _lightSource): { - primaryWeaponItems _lightSource select 1 - }; - case (secondaryWeapon _lightSource): { - secondaryWeaponItems _lightSource select 1 - }; - case (handgunWeapon _lightSource): { - handgunItems _lightSource select 1 - }; - default {""}; - }; + private _flashlight = (_lightSource weaponAccessories _weapon) select 1; if (getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ACE_laserpointer") == 1) exitWith {_lightLevel = 0}; - _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall); + private _properties = [[_flashlight], FUNC(getLightPropertiesWeapon), uiNamespace, format [QEGVAR(cache,%1_%2), QUOTE(DFUNC(getLightPropertiesWeapon)), _flashlight], 1E11] call FUNC(cachedCall); //_properties = [_flashlight] call FUNC(getLightPropertiesWeapon); - _innerAngle = (_properties select 3) / 2; - _outerAngle = (_properties select 4) / 2; + private _innerAngle = (_properties select 3) / 2; + private _outerAngle = (_properties select 4) / 2; - _position = _lightSource modelToWorld (_lightSource selectionPosition "rightHand"); - _direction = _lightSource weaponDirection _weapon; + private _position = _lightSource modelToWorld (_lightSource selectionPosition "rightHand"); + private _direction = _lightSource weaponDirection _weapon; - _directionToUnit = _position vectorFromTo _unitPos; + private _directionToUnit = _position vectorFromTo _unitPos; - _distance = _unitPos distance _position; - _angle = acos (_direction vectorDotProduct _directionToUnit); + private _distance = _unitPos distance _position; + private _angle = acos (_direction vectorDotProduct _directionToUnit); _lightLevel = (linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]); } else { // handle any object, strcutures, cars, tanks, etc. @todo campfires, burning vehicles - private "_lights"; - _lights = [_lightSource] call FUNC(getTurnedOnLights); + private _lights = _lightSource call FUNC(getTurnedOnLights); { - private ["_properties", "_intensity", "_innerAngle", "_outerAngle", "_position", "_direction", "_directionToUnit", "_distance", "_angle"]; - - _properties = [[_lightSource, _x], FUNC(getLightProperties), uiNamespace, format [QEGVAR(cache,%1_%2_%3), QUOTE(DFUNC(getLightProperties)), typeOf _lightSource, _x], 1E11] call FUNC(cachedCall); + private _properties = [[_lightSource, _x], FUNC(getLightProperties), uiNamespace, format [QEGVAR(cache,%1_%2_%3), QUOTE(DFUNC(getLightProperties)), typeOf _lightSource, _x], 1E11] call FUNC(cachedCall); //_properties = [_lightSource, _x] call FUNC(getLightProperties); // @todo intensity affects range? - //_intensity = _properties select 0; + //_properties params ["_intensity"]; - _innerAngle = (_properties select 3) / 2; - _outerAngle = (_properties select 4) / 2; + private _innerAngle = (_properties select 3) / 2; + private _outerAngle = (_properties select 4) / 2; // get world position and direction - _position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1)); - _direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2)); + private _position = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 1)); + private _direction = _lightSource modelToWorld (_lightSource selectionPosition (_properties select 2)); _direction = _position vectorFromTo _direction; - _directionToUnit = _position vectorFromTo _unitPos; + private _directionToUnit = _position vectorFromTo _unitPos; - _distance = _unitPos distance _position; - _angle = acos (_direction vectorDotProduct _directionToUnit); + private _distance = _unitPos distance _position; + private _angle = acos (_direction vectorDotProduct _directionToUnit); _lightLevel = _lightLevel max ((linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true])); @@ -97,8 +78,7 @@ if (_lightSource isKindOf "CAManBase") then { // handle campfires if (inflamed _lightSource) then { - private "_distance"; - _distance = _unitPos distance position _lightSource; + private _distance = _unitPos distance position _lightSource; _lightLevel = _lightLevel max linearConversion [0, 30, _distance, 0.5, 0, true]; }; diff --git a/addons/common/functions/fnc_loadPerson.sqf b/addons/common/functions/fnc_loadPerson.sqf index da729ed0d7..3071ffbd47 100644 --- a/addons/common/functions/fnc_loadPerson.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -17,28 +17,26 @@ params ["_caller", "_unit"]; -private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"]; +private _vehicle = objNull; -_vehicle = objNull; +if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle}; -if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle}; - -_loadcar = nearestObject [_unit, "Car"]; +private _loadcar = nearestObject [_unit, "Car"]; if (_unit distance _loadcar <= 10) then { _vehicle = _loadcar; } else { - _loadair = nearestObject [_unit, "Air"]; + private _loadair = nearestObject [_unit, "Air"]; if (_unit distance _loadair <= 10) then { _vehicle = _loadair; } else { - _loadtank = nearestObject [_unit, "Tank"]; + private _loadtank = nearestObject [_unit, "Tank"]; if (_unit distance _loadtank <= 10) then { _vehicle = _loadtank; } else { - _loadboat = nearestObject [_unit, "Ship_F"]; + private _loadboat = nearestObject [_unit, "Ship_F"]; if (_unit distance _loadboat <= 10) then { _vehicle = _loadboat; diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 5b52b38b05..db0248a901 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -20,9 +20,7 @@ if (!alive _unit) then { // _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist }; -private "_slotsOpen"; - -_slotsOpen = false; +private _slotsOpen = false; if (_vehicle emptyPositions "cargo" > 0) then { _unit moveInCargo _vehicle; @@ -35,8 +33,7 @@ if (_vehicle emptyPositions "cargo" > 0) then { }; if (_slotsOpen) then { - private "_loaded"; - _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]]; + private _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]]; _loaded pushBack _unit; _vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf index d4806d0c54..46b0134740 100644 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf @@ -21,13 +21,12 @@ if (_isClientSetable) then { // If setting is not forced if !(_isForced) then { - private "_profileValue"; - _profileValue = profileNamespace getVariable _name; + private _profileValue = profileNamespace getVariable _name; // If the setting is stored on the profile if !(isNil "_profileValue") then { // If the profile variable has the correct type - if (typeName _profileValue == typeName (missionNamespace getVariable _name)) then { + if (_profileValue isEqualType (missionNamespace getVariable _name)) then { // Load the setting from the profile missionNamespace setVariable [_name, _profileValue]; }; diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 7b05902862..f846fa9354 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -12,14 +12,12 @@ */ #include "script_component.hpp" -private "_fnc_parseConfigForDisplayNames"; -_fnc_parseConfigForDisplayNames = { +private _fnc_parseConfigForDisplayNames = { params ["_optionEntry"]; - if !(isClass _optionEntry) exitwith {false}; + if !(isClass _optionEntry) exitWith {false}; - private "_values"; - _values = getArray (_optionEntry >> "values"); + private _values = getArray (_optionEntry >> "values"); _x set [3, getText (_optionEntry >> "displayName")]; _x set [4, getText (_optionEntry >> "description")]; @@ -27,10 +25,9 @@ _fnc_parseConfigForDisplayNames = { _x set [8, getText (_optionEntry >> "category")]; { - private "_text"; - _text = _x; + private _text = _x; - if (typeName _text == "STRING" && {count _text > 1} && {_text select [0, 1] == "$"}) then { + if (_text isEqualType "" && {count _text > 1} && {_text select [0, 1] == "$"}) then { _text = localize (_text select [1]); //chop off the leading $ _values set [_forEachIndex, _text]; }; diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index cdf8b48041..4498c9d058 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -15,15 +15,13 @@ GVAR(settings) = []; -private "_fnc_parseConfigForSettings"; -_fnc_parseConfigForSettings = { - private ["_config", "_countOptions", "_optionEntry"]; +private _fnc_parseConfigForSettings = { + params ["_config"]; - _config = _this select 0; - _countOptions = count _config; + private _countOptions = count _config; for "_index" from 0 to (_countOptions - 1) do { - _optionEntry = _config select _index; + private _optionEntry = _config select _index; [_optionEntry] call FUNC(setSettingFromConfig); }; diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index f5a121c088..43f6209d0d 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -17,12 +17,10 @@ params ["_eventName", "_eventArgs"]; GVAR(events) params ["_eventNames", "_eventArray"]; -private "_eventIndex"; -_eventIndex = _eventNames find _eventName; +private _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { - private "_events"; - _events = _eventArray select _eventIndex; + private _events = _eventArray select _eventIndex; #ifdef DEBUG_EVENTS ACE_LOGINFO_1("* Local Event: %1",_eventName); diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index a727de08bf..5d24e13b38 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -params ["_array", "_code"]; +params [["_array", [], [[]]], ["_code", {}, [{}]]]; // copy array to not alter the original one _array = + _array; diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index 84d56f92bd..d4648155b6 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -17,17 +17,15 @@ params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; -private ["_muteUnitReasons", "_speaker"]; - // add reason to mute to the unit -_muteUnitReasons = _unit getVariable [QGVAR(muteUnitReasons), []]; +private _muteUnitReasons = _unit getVariable [QGVAR(muteUnitReasons), []]; if !(_reason in _muteUnitReasons) then { _muteUnitReasons pushBack _reason; _unit setVariable [QGVAR(muteUnitReasons), _muteUnitReasons, true]; }; -_speaker = speaker _unit; +private _speaker = speaker _unit; if (_speaker == "ACE_NoVoice") exitWith {}; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index c5e1b6d7b6..b90f0eefd7 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -18,8 +18,7 @@ params ["_number", "_minLength"]; _number = _number min 999999; _number = str _number; -private "_length"; -_length = count _number; +private _length = count _number; if (isNil "_minLength") then {_minLength = _length}; @@ -30,8 +29,7 @@ while {_length < _minLength} do { _length = _length + 1; }; -private "_digits"; -_digits = []; +private _digits = []; for "_x" from 0 to (_length - 1) do { _digits pushBack parseNumber (_number select [_x, 1]); diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index f8f192e0e3..7e2c78f8b4 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -18,8 +18,7 @@ params ["_number", "_minLength"]; _number = _number min 999999; _number = str _number; -private "_length"; -_length = count _number; +private _length = count _number; if (isNil "_minLength") then {_minLength = _length}; diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index 4dd810607c..1cb2f521f8 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -14,8 +14,7 @@ params ["_number"]; -private "_decimals"; -_decimals = str (abs _number mod 1); +private _decimals = str (abs _number mod 1); _decimals = toArray _decimals; _decimals deleteAt 0; diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index b1639eb970..d88969b059 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -14,28 +14,23 @@ params ["_unit", "_id", "_accepted"]; -private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; +private _info = _unit getVariable _id; -_info = _unit getvariable _id; +if (!isNil "_info") then { + _info params ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -if (!isnil "_info") then { - _caller = _info select 0; - _target = _info select 1; - _requestID = _info select 2; - _requestMessage = _info select 3; - _callBack = _info select 4; - _replyParams = [_info, _accepted]; + private _replyParams = [_info, _accepted]; [_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc); - _unit setvariable [_id, nil]; + _unit setVariable [_id, nil]; }; GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; -if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { +if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; }; -if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { +if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; diff --git a/addons/common/functions/fnc_parseList.sqf b/addons/common/functions/fnc_parseList.sqf index ef7eaae92a..fc92605682 100644 --- a/addons/common/functions/fnc_parseList.sqf +++ b/addons/common/functions/fnc_parseList.sqf @@ -19,36 +19,34 @@ params ["_list", ["_removeWhitespace", false], ["_checkNil", false]]; -private ["_whitespaceList", "_nilCheckedList"]; - // Split using comma delimiter _list = _list splitString ","; TRACE_1("Splitted List",_list); - // Remove or Trim Whitespace -_whitespaceList = []; +private _whitespaceList = []; + { if (_removeWhitespace) then { _whitespaceList pushBack ([_x] call FUNC(stringRemoveWhiteSpace)); } else { _whitespaceList pushBack ([_x] call CBA_fnc_trim); }; - nil + false } count _list; _list = _whitespaceList; TRACE_1("Whitespace List",_list); - // Check for object existence if (_checkNil) then { - _nilCheckedList = []; + private _nilCheckedList = []; + { if !(isNil _x) then { _nilCheckedList pushBack (missionNamespace getVariable _x); }; - nil + false } count _list; _list = _nilCheckedList; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index d93273a0c3..e842590f35 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -24,9 +24,7 @@ params ["_totalTime", "_args", "_onFinish", "_onFail", ["_localizedTitle", ""], ["_condition", {true}], ["_exceptions", []]]; -private ["_player", "_ctrlPos", "_fnc_perFrameFunction"]; - -_player = ACE_player; +private _player = ACE_player; //Open Dialog and set the title closeDialog 0; @@ -35,7 +33,7 @@ createDialog QGVAR(ProgressBar_Dialog); (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; //Adjust position based on user setting: -_ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); +private _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; (uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlSetPosition _ctrlPos; @@ -45,13 +43,11 @@ _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; -_fnc_perFrameFunction = { +[{ (_this select 0) params ["_args", "_onFinish", "_onFail", "_condition", "_player", "_startTime", "_totalTime", "_exceptions"]; - private ["_elapsedTime", "_errorCode"]; - - _elapsedTime = ACE_time - _startTime; - _errorCode = -1; + private _elapsedTime = ACE_time - _startTime; + private _errorCode = -1; // this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all. if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then { @@ -85,13 +81,13 @@ _fnc_perFrameFunction = { [_this select 1] call CBA_fnc_removePerFrameHandler; if (_errorCode == 0) then { - if (typeName _onFinish == "STRING") then { + if (_onFinish isEqualType "") then { [_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); } else { [_args, _elapsedTime, _totalTime, _errorCode] call _onFinish; }; } else { - if (typeName _onFail == "STRING") then { + if (_onFail isEqualType "") then { [_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); } else { [_args, _elapsedTime, _totalTime, _errorCode] call _onFail; @@ -101,6 +97,4 @@ _fnc_perFrameFunction = { //Update Progress Bar (ratio of elepased:total) (uiNamespace getVariable QGVAR(ctrlProgressBar)) progressSetPosition (_elapsedTime / _totalTime); }; -}; - -[_fnc_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; +}, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf index d1fdb30b29..e158ae5c81 100644 --- a/addons/common/functions/fnc_readSettingsFromParamsArray.sqf +++ b/addons/common/functions/fnc_readSettingsFromParamsArray.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" //paramsArray is a normal variable not a command -private _paramsArray = missionnamespace getvariable ["paramsArray", []]; +private _paramsArray = missionnamespace getVariable ["paramsArray", []]; TRACE_1("Reading missionConfigFile params",_paramsArray); @@ -60,4 +60,4 @@ TRACE_1("Reading missionConfigFile params",_paramsArray); // Update the variable globaly and Force [_settingName, _settingValue, true, true] call FUNC(setSetting); }; -} foreach _paramsArray; +} forEach _paramsArray; diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index 1377f4ec35..75f684f5dd 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -19,9 +19,9 @@ _requestID = ("ace_recieveRequest_f_id_"+_requestID); _target setVariable [_requestID, _this]; if (isLocalized _requestMessage) then { - _requestMessage = format [localize _requestMessage, [_caller] call FUNC(getName)]; + _requestMessage = format [localize _requestMessage, [_caller, false, true] call FUNC(getName)]; } else { - _requestMessage = format [_requestMessage, [_caller] call FUNC(getName)]; + _requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)]; }; hint format ["%1", _requestMessage]; // @todo ? @@ -50,10 +50,9 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn { _time = _time + 40; - private "_id"; - _id = _target getVariable _requestID; + private _id = _target getVariable _requestID; - waituntil { + waitUntil { _id = _target getVariable _requestID; (ACE_time > _time || isNil "_id") diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index b22ed0f152..60e551590d 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -18,10 +18,8 @@ params ["_unit", "_action", "_id"]; if (_id == -1) exitWith {}; -private ["_name", "_actionsVar"]; - -_name = format ["ACE_Action_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; +private _name = format ["ACE_Action_%1", _action]; +private _actionsVar = _unit getVariable [_name, [-1, [-1, [], []], objNull]]; _actionsVar params ["_actionID", "_actionsArray"]; _actionsArray params ["_currentID", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf index e5adbe0c01..943e3b4e22 100644 --- a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -18,10 +18,8 @@ params ["_unit", "_action", "_id"]; if (_id == -1) exitWith {}; -private ["_name", "_actionsVar"]; - -_name = format ["ACE_ActionMenu_%1", _action]; -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; +private _name = format ["ACE_ActionMenu_%1", _action]; +private _actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; _actionsVar params ["_currentID", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_removeAllEventHandlers.sqf b/addons/common/functions/fnc_removeAllEventHandlers.sqf index 1a1a6e255f..a309d18d02 100644 --- a/addons/common/functions/fnc_removeAllEventHandlers.sqf +++ b/addons/common/functions/fnc_removeAllEventHandlers.sqf @@ -16,10 +16,8 @@ params ["_eventName"]; GVAR(events) params ["_eventNames", "_events"]; -private ["_eventFunctions", "_eventIndex"]; - -_eventFunctions = []; -_eventIndex = _eventNames find _eventName; +private _eventFunctions = []; +private _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { _events set [_eventIndex, []]; diff --git a/addons/common/functions/fnc_removeBinocularMagazine.sqf b/addons/common/functions/fnc_removeBinocularMagazine.sqf index 3d2252390a..487295ccc3 100644 --- a/addons/common/functions/fnc_removeBinocularMagazine.sqf +++ b/addons/common/functions/fnc_removeBinocularMagazine.sqf @@ -9,22 +9,19 @@ * None * * Example: - * [player] call ace_common_fnc_removeBinocularMagazine + * player call ace_common_fnc_removeBinocularMagazine * * Public: Yes */ #include "script_component.hpp" -params ["_unit"]; +params [["_unit", objNull, [objNull]]]; -private ["_binocular", "_selectBinocular"]; - -_binocular = binocular _unit; - -_selectBinocular = currentWeapon _unit == _binocular; +private _binocular = binocular _unit; +private _selectBinocular = currentWeapon _unit == _binocular; _unit addWeapon _binocular; if (_selectBinocular) then { - _unit selectWeapon _binocular; + _unit selectWeapon _binocular; }; diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 6c3fa8354b..b267e84557 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -16,13 +16,11 @@ params ["_conditionName"]; _conditionName = toLower _conditionName; -private "_conditions"; -_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; +private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; _conditions params ["_conditionNames", "_conditionFuncs"]; -private "_index"; -_index = _conditionNames find _conditionName; +private _index = _conditionNames find _conditionName; if (_index == -1) exitWith {}; diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index 0c70046706..5e307ad896 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -17,10 +17,8 @@ params ["_eventName", "_eventCodeIndex"]; GVAR(events) params ["_eventNames", "_events"]; -private ["_eventFunctions", "_eventIndex"]; - -_eventFunctions = []; -_eventIndex = _eventNames find _eventName; +private _eventFunctions = []; +private _eventIndex = _eventNames find _eventName; if (_eventIndex != -1) then { _eventFunctions = _events select _eventIndex; diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf index d156359ebf..825281c3e0 100644 --- a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -14,8 +14,7 @@ params ["_id"]; -private "_actionsVar"; -_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; +private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; _actionsVar params ["_currentId", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf index b277467cce..d7a8ae28cc 100644 --- a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf @@ -14,8 +14,7 @@ params ["_id"]; -private "_actionsVar"; -_actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; +private _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; _actionsVar params ["_currentId", "_actionIDs", "_actions"]; diff --git a/addons/common/functions/fnc_removeSpecificMagazine.sqf b/addons/common/functions/fnc_removeSpecificMagazine.sqf index 46950cc1d8..e703a56296 100644 --- a/addons/common/functions/fnc_removeSpecificMagazine.sqf +++ b/addons/common/functions/fnc_removeSpecificMagazine.sqf @@ -14,15 +14,14 @@ */ #include "script_component.hpp" -params ["_unit", "_magazineType", "_ammoCount"]; +params [["_unit", objNull, [objNull]], ["_magazineType", "", [""]], ["_ammoCount", 0, [0]]]; -private ["_isRemoved", "_magazines", "_index"]; - -_isRemoved = false; +private _isRemoved = false; // Check uniform -_magazines = [magazinesAmmoCargo uniformContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); -_index = _magazines find [_magazineType, _ammoCount]; +private _magazines = [magazinesAmmoCargo uniformContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); +private _index = _magazines find [_magazineType, _ammoCount]; + if (_index > -1) exitWith { { _unit removeItemFromUniform (_x select 0); @@ -41,7 +40,8 @@ if (_index > -1) exitWith { // Check vest _magazines = [magazinesAmmoCargo vestContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); -_index = _magazines find [_magazineType,_ammoCount]; +_index = _magazines find [_magazineType, _ammoCount]; + if (_index > -1) exitWith { { _unit removeItemFromVest (_x select 0); @@ -60,7 +60,8 @@ if (_index > -1) exitWith { // Check backpack _magazines = [magazinesAmmoCargo backpackContainer _unit, {_this select 0 == _magazineType}] call FUNC(filter); -_index = _magazines find [_magazineType,_ammoCount]; +_index = _magazines find [_magazineType, _ammoCount]; + if (_index > -1) exitWith { { _unit removeItemFromBackpack (_x select 0); diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index ffc4a364f3..126bf0b70f 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -19,10 +19,8 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { false }; -private ["_data", "_eventId"]; - -_data = HASH_GET(GVAR(syncedEvents),_name); -_eventId = _data select 3; +private _data = HASH_GET(GVAR(syncedEvents),_name); +_data params ["", "", "", "_eventId"]; [_eventId] call FUNC(removeEventHandler); HASH_REM(GVAR(syncedEvents),_name); diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index c2ba1bee18..d9850ffd5b 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -14,8 +14,8 @@ params ["_unit"]; -_unit setvariable ["ACE_isDead", nil, true]; -_unit setvariable ["ACE_isUnconscious", nil, true]; +_unit setVariable ["ACE_isDead", nil, true]; +_unit setVariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); @@ -36,7 +36,7 @@ if (isPlayer _unit) then { { if !(_x select 4) then { - _unit setvariable [_x select 0, nil, _x select 3]; + _unit setVariable [_x select 0, nil, _x select 3]; }; false } count ([_unit] call FUNC(getAllDefinedSetVariables)); diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index 491ce89bb4..39626514bb 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -14,8 +14,7 @@ params ["_unit"]; -private "_respawnVariables"; -_respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; +private _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; // yes those _respawnVariables pushBack "ACE_PersistentFunctions"; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index fff3288db6..6e0db2cda2 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -7,7 +7,10 @@ * 1: Remove html tags (default: false) * * Return Value: - * Sanitized string + * Sanitized string + * + * Example: + * ["CoolGuy", true] call ace_common_fnc_sanitizeString; * * Public: Yes */ @@ -15,19 +18,18 @@ params ["_string", ["_removeTags", false]]; -private "_array"; -_array = []; +private _array = []; { switch _x do { - case 60 : { + case 60 : { // less than symbol: `<` if (_removeTags) then { _array append toArray "<"; } else { _array pushBack _x; }; }; - case 62 : { + case 62 : { // greater than symbol: `>` if (_removeTags) then { _array append toArray ">"; } else { diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf index 45ab03891c..2525f81c95 100644 --- a/addons/common/functions/fnc_serverLog.sqf +++ b/addons/common/functions/fnc_serverLog.sqf @@ -1,19 +1,24 @@ /* * Author: esteldunedain - * ? + * Log a RPT messaged on just the server * * Arguments: - * ? + * 0: Text to display * * Return Value: * None * + * Example: + * ["x happened"] call ace_common_fnc_serverLog; + * * Public: no */ #include "script_component.hpp" +params [["_msg", "", [""]]]; + if (isServer) then { - diag_log _this; + diag_log text _msg; } else { [_this, QFUNC(serverLog), 1] call FUNC(execRemoteFnc); }; diff --git a/addons/common/functions/fnc_setCaptivityStatus.sqf b/addons/common/functions/fnc_setCaptivityStatus.sqf index ecb7b3152a..3e84c1753d 100644 --- a/addons/common/functions/fnc_setCaptivityStatus.sqf +++ b/addons/common/functions/fnc_setCaptivityStatus.sqf @@ -10,15 +10,13 @@ * Return Value: * None * - * Public: No + * Public: Yes */ #include "script_component.hpp" params ["_unit", "_reason", "_status"]; -private ["_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; - -_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; +private _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; // register new reason (these reasons are shared publicly, since units can change ownership, but keep their captivity status) if !(_reason in _captivityReasons) then { @@ -29,16 +27,17 @@ if !(_reason in _captivityReasons) then { }; // get reasons why the unit is captive already and update to the new status -_unitCaptivityReasons = [_unit] call FUNC(getCaptivityStatus); +private _unitCaptivityReasons = _unit call FUNC(getCaptivityStatus); + +private _captivityReasonsBooleans = []; -_captivityReasonsBooleans = []; { _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; } forEach _captivityReasons; _captivityReasonsBooleans set [_captivityReasons find _reason, _status]; -_bitmask = _captivityReasonsBooleans call FUNC(toBitmask); +private _bitmask = _captivityReasonsBooleans call FUNC(toBitmask); // actually apply the setCaptive command globaly [[_unit, _bitmask], "{(_this select 0) setCaptive (_this select 1)}", _unit] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index 480632394c..6f1f0c2e58 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal - * Setvariable value + * setVariable value * * Arguments: * 0: Unit @@ -17,13 +17,12 @@ params ["_unit", "_variable", "_value", "_global"]; if (isNil "_global") then { - private "_definedVariable"; - _definedVariable = [_variable] call FUNC(getDefinedVariableInfo); + private _definedVariable = [_variable] call FUNC(getDefinedVariableInfo); _definedVariable params ["", "", ["_global", false]]; }; -if (!isNil "_value") exitwith { +if (!isNil "_value") exitWith { _unit setVariable [_variable, _value, _global]; }; diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf index aaa594b9a9..3842457395 100644 --- a/addons/common/functions/fnc_setForceWalkStatus.sqf +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -14,15 +14,13 @@ * Example: * [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus) * - * Public: No + * Public: Yes */ #include "script_component.hpp" params ["_unit", "_reason", "_status"]; -private ["_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; - -_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; +private _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; // register new reason (these reasons are shared publicly, since units can change ownership, but keep their forceWalk status) if !(_reason in _forceWalkReasons) then { @@ -32,16 +30,17 @@ if !(_reason in _forceWalkReasons) then { }; // get reasons why the unit is forceWalking already and update to the new status -_unitForceWalkReasons = [_unit] call FUNC(getForceWalkStatus); +private _unitForceWalkReasons = [_unit] call FUNC(getForceWalkStatus); + +private _forceWalkReasonsBooleans = []; -_forceWalkReasonsBooleans = []; { _forceWalkReasonsBooleans set [_forEachIndex, (_forceWalkReasons select _forEachIndex) in _unitForceWalkReasons]; } forEach _forceWalkReasons; _forceWalkReasonsBooleans set [_forceWalkReasons find _reason, _status]; -_bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); +private _bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); _unit setVariable ["ACE_forceWalkStatusNumber", _bitmaskNumber, true]; diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index d24f8d0d9d..7bd375a58b 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -18,11 +18,10 @@ params ["_id", "_settings", ["_add", true]]; -private ["_map", "_exists", "_lowestVolume"]; +private _map = missionNamespace getVariable [QGVAR(setHearingCapabilityMap),[]]; -_map = missionNamespace getVariable [QGVAR(setHearingCapabilityMap),[]]; +private _exists = false; -_exists = false; { if (_id == _x select 0) exitWith { _exists = true; @@ -42,7 +41,8 @@ if (!_exists && _add) then { missionNamespace setVariable [QGVAR(setHearingCapabilityMap), _map]; // find lowest volume -_lowestVolume = 1; +private _lowestVolume = 1; + { _lowestVolume = (_x select 1) min _lowestVolume; false diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index 117445b561..b9ecbdc3a6 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -17,9 +17,15 @@ params ["_unit"]; if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { - _name = [name _unit, true] call FUNC(sanitizeString); - + private _sanitizedName = [name _unit, true] call FUNC(sanitizeString); + private _rawName = [name _unit, false] call FUNC(sanitizeString); + + //Debug Testing Code (with html tags): + // private _sanitizedName = ["Name", true] call FUNC(sanitizeString); + // private _rawName = ["Name", false] call FUNC(sanitizeString); + //if (_name != _unit getVariable ["ACE_Name", ""]) then { - _unit setVariable ["ACE_Name", _name, true]; + _unit setVariable ["ACE_Name", _sanitizedName, true]; + _unit setVariable ["ACE_NameRaw", _rawName, true]; //}; }; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index dd946f7bc5..b24e2506b5 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -19,7 +19,7 @@ params ["_name", "_value"]; // Hack to keep backward compatibility for the moment if (typeName (missionNamespace getVariable _name) == "BOOL") then { - if (typeName _value == "SCALAR") then { + if (_value isEqualType 0) then { _value = _value > 0; }; }; diff --git a/addons/common/functions/fnc_setPitchBankYaw.sqf b/addons/common/functions/fnc_setPitchBankYaw.sqf index ea7f27a906..fecc16208c 100644 --- a/addons/common/functions/fnc_setPitchBankYaw.sqf +++ b/addons/common/functions/fnc_setPitchBankYaw.sqf @@ -19,14 +19,12 @@ params ["_object", "_aroundX", "_aroundY", "_aroundZ"]; _aroundZ = - _aroundZ; -private ["_dirX", "_dirY", "_dirZ", "_upX", "_upY", "_upZ", "_dir", "_up"]; - -_dirX = 0; -_dirY = 1; -_dirZ = 0; -_upX = 0; -_upY = 0; -_upZ = 1; +private _dirX = 0; +private _dirY = 1; +private _dirZ = 0; +private _upX = 0; +private _upY = 0; +private _upZ = 1; if (_aroundX != 0) then { _dirY = cos _aroundX; @@ -43,18 +41,16 @@ if (_aroundY != 0) then { }; if (_aroundZ != 0) then { - private ["_dirXTemp", "_upXTemp"]; - - _dirXTemp = _dirX; + private _dirXTemp = _dirX; _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); - _upXTemp = _upX; + private _upXTemp = _upX; _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); }; -_dir = [_dirX, _dirY, _dirZ]; -_up = [_upX, _upY, _upZ]; +private _dir = [_dirX, _dirY, _dirZ]; +private _up = [_upX, _upY, _upZ]; _object setVectorDirAndUp [_dir,_up]; diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index 9d3a42326c..a2bd9e700e 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -45,7 +45,7 @@ if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && private _failed = false; if (typeName _value != _settingData select 1) then { _failed = true; - if ((_typeName == "BOOL") && {typeName _value == "SCALAR"}) then { + if ((_typeName == "BOOL") && {_value isEqualType 0}) then { // If value is not 0 or 1 consider it invalid and don't set anything if (_value isEqualTo 0) then { _value = false; @@ -56,7 +56,7 @@ if (typeName _value != _settingData select 1) then { _failed = false; }; }; - if ((_typeName == "COLOR") && {typeName _value == "ARRAY"}) then { + if ((_typeName == "COLOR") && {_value isEqualType []}) then { _failed = false; }; }; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 5dc55f51f7..ac7a0f4875 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -14,13 +14,11 @@ params ["_optionEntry"]; -private ["_fnc_getValueWithType", "_value", "_name", "_typeName", "_settingData", "_valueConfig", "_text"]; - -_fnc_getValueWithType = { +private _fnc_getValueWithType = { params ["_optionEntry", "_typeName"]; - _valueConfig = (_optionEntry >> "value"); - _value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0}; + private _valueConfig = (_optionEntry >> "value"); + private _value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0}; TRACE_3("_fnc_getValueWithType:", configName _optionEntry, _typeName, _value); if (_typeName == "BOOL") exitWith { _value > 0 @@ -37,27 +35,27 @@ _fnc_getValueWithType = { _value }; -_name = configName _optionEntry; +private _name = configName _optionEntry; // Check if the variable is already defined if (isNil _name) then { // That setting was not loaded yet // Get type from config - _typeName = getText (_optionEntry >> "typeName"); + private _typeName = getText (_optionEntry >> "typeName"); if (_typeName == "") then { _typeName = "SCALAR"; }; // Read entry and cast it to the correct type - _value = [_optionEntry, _typeName] call _fnc_getValueWithType; + private _value = [_optionEntry, _typeName] call _fnc_getValueWithType; // Init the variable missionNamespace setVariable [_name, _value]; // Add the setting to a list on the server // Set the variable to not forced - /*_settingData = [ + /*private _settingData = [ name, typeName, isClientSettable, @@ -68,7 +66,7 @@ if (isNil _name) then { defaultValue, category ];*/ - _settingData = [ + private _settingData = [ _name, _typeName, (getNumber (_optionEntry >> "isClientSettable")) > 0, @@ -81,10 +79,10 @@ if (isNil _name) then { ]; //Strings in the values array won't be localized from the config, so just do that now: - /*private "_values"; - _values = _settingData select 5; + /*private _values = _settingData select 5; + { - _text = _x; + private _text = _x; if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ _values set [_forEachIndex, _text]; @@ -98,13 +96,13 @@ if (isNil _name) then { // The setting already exists. // Check if it's already forced and quit - _settingData = [_name] call FUNC(getSettingData); + private _settingData = [_name] call FUNC(getSettingData); if (_settingData select 6) exitWith {}; // The setting is not forced, so update the value // Read entry and cast it to the correct type from the existing variable - _value = [_optionEntry, _settingData select 1] call _fnc_getValueWithType; + private _value = [_optionEntry, _settingData select 1] call _fnc_getValueWithType; // Update the variable missionNamespace setVariable [_name, _value]; diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index d1bd27ea4e..35e8c0d116 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -16,8 +16,7 @@ params ["_unit", "_varName", "_value"]; -private "_respawnVariables"; -_respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; +private _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; if !(_varName in _respawnVariables) then { _respawnVariables pushBack _varName; diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 67dbd5fd2f..31d1d23014 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -23,13 +23,11 @@ _object setVariable [_varName, _value]; // Exit if in SP if (!isMultiplayer) exitWith {}; -private ["_idName", "_syncTime"]; - -_idName = format ["ACE_setVariablePublic_%1", _varName]; +private _idName = format ["ACE_setVariablePublic_%1", _varName]; if (_idName in GVAR(setVariableNames)) exitWith {}; -_syncTime = ACE_diagTime + _sync; +private _syncTime = ACE_diagTime + _sync; GVAR(setVariableNames) pushBack _idName; @@ -38,19 +36,16 @@ GVAR(setVariablePublicArray) pushBack [_object, _varName, _syncTime, _idName]; if (isNil QGVAR(setVariablePublicPFH)) exitWith {}; GVAR(setVariablePublicPFH) = [{ - private "_delete"; - _delete = 0; - { _x params ["_object", "_varName", "_syncTime", "_idName"]; if (ACE_diagTime > _syncTime) then { // set value public _object setVariable [_varName, _object getVariable _varName, true]; - GVAR(setVariablePublicArray) deleteAt _forEachIndex - _delete; - GVAR(setVariableNames) deleteAt _forEachIndex - _delete; - _delete = _delete + 1; + GVAR(setVariablePublicArray) deleteAt (GVAR(setVariablePublicArray) find _x); + GVAR(setVariableNames) deleteAt (GVAR(setVariableNames) find _x); }; - } forEach GVAR(setVariablePublicArray); + nil + } count +GVAR(setVariablePublicArray); if (GVAR(setVariablePublicArray) isEqualTo []) then { [GVAR(setVariablePublicPFH)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf new file mode 100644 index 0000000000..723c2436ed --- /dev/null +++ b/addons/common/functions/fnc_showHud.sqf @@ -0,0 +1,66 @@ +/* + * Author: PabstMirror + * Allows multiple sources to not overwrite showHud command + * Bitwise AND Logic (a single false in a mask will make it false) + * + * Arguments: + * 0: Source ID + * 1: Show Hud Bool Array (8 to set, empty to remove) + * - [hud, info, radar, compass, direction, menu, group, cursors] + * - hud: Boolean - show scripted HUD (same as normal showHUD true/false) + * - info: Boolean - show vehicle + soldier info (hides weapon info from the HUD as well) + * - radar: Boolean - show vehicle radar + * - compass: Boolean - show vehicle compass + * - direction: Boolean - show tank direction indicator (not present in vanilla Arma 3) + * - menu: Boolean - show commanding menu (hides HC related menus) + * - group: Boolean - show group info bar (hides squad leader info bar) + * - cursors: Boolean - show HUD weapon cursors (connected with scripted HUD) + * + * Return Value: + * Resulting ShowHud Array + * + * Example: + * ["hideHud", [false, true, true, true, true, true, true, false]] call ace_common_fnc_showHud; //This is equivalent to the old showHud false + * [] call ace_common_fnc_showHud; //sets `showHud` and returns the result array used + * + * Public: Yes + */ +#include "script_component.hpp" + +if (!hasInterface) exitWith {[-1]}; + +params [["_reason", "", [""]], ["_mask", [], [[]], [0,8]]]; + +if (isArray (missionConfigFile >> "showHUD")) then { + //(showHud = 0;) is fine - the array is the problem + ACE_LOGWARNING("showHUD[] in Description.ext breaks the showHud command"); +}; + +if (_reason != "") then { + _reason = toLower _reason; + if (_mask isEqualTo []) then { + TRACE_2("Setting", _reason, _mask); + [GVAR(showHudHash), _reason] call FUNC(hashRem); + } else { + TRACE_2("Removing", _reason, _mask); + [GVAR(showHudHash), _reason, _mask] call FUNC(hashSet); + }; +}; + +GVAR(showHudHash) params ["_reasons", "_masks"]; +private _resultMask = []; + +for "_index" from 0 to 7 do { + private _set = true; //Default to true + { + if (!(_x select _index)) exitWith { + _set = false; //Any false will make it false + }; + } forEach _masks; + _resultMask pushBack _set; +}; + +TRACE_2("showHud", _resultMask, _reasons); +showHud _resultMask; + +_resultMask diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 287c4566d5..0bf0c6432f 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -18,34 +18,32 @@ ACE_DEPRECATED("ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); params ["_array", "_elementN"]; -private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"]; - -_indexes = []; -_elements = []; +private _indices = []; +private _elements = []; { - _theElement = toArray (_x select _elementN); - _indexes pushback _foreachIndex; - _elements pushback _theElement; + private _theElement = toArray (_x select _elementN); + _indices pushBack _forEachIndex; + _elements pushBack _theElement; } forEach _array; for "_i" from 1 to (count _elements) - 1 do { - _tmp = _elements select _i; - _tempIndex = _indexes select _i; + private _tmp = _elements select _i; + private _tempIndex = _indices select _i; _j = _i; while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { _elements set [_j, _elements select (_j - 1)]; - _indexes set [_j, _indexes select (_j - 1)]; + _indices set [_j, _indices select (_j - 1)]; _j = _j - 1; }; _elements set[_j, _tmp]; - _indexes set [_j, _tempIndex]; + _indices set [_j, _tempIndex]; }; -_returnArray = []; +private _returnArray = []; { - _returnArray pushback (_array select _x); -} forEach _indexes; + _returnArray pushBack (_array select _x); +} forEach _indices; _returnArray diff --git a/addons/common/functions/fnc_stringCompare.sqf b/addons/common/functions/fnc_stringCompare.sqf index da65c676f8..ad3073eb1e 100644 --- a/addons/common/functions/fnc_stringCompare.sqf +++ b/addons/common/functions/fnc_stringCompare.sqf @@ -18,16 +18,14 @@ params ["_string", "_searchTerm"]; _string = toLower _string; // removes case sensitivity _searchTerm = toLower _searchTerm; -private ["_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; +private _arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals +private _arrayString = toArray _string; +private _sizeSearchTerm = count _arraySearchTerm; // We only measure the array once +private _sizeString = count _arrayString; -_arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals -_arrayString = toArray _string; -_sizeSearchTerm = count _arraySearchTerm; // We only measure the array once -_sizeString = count _arrayString; - -_matchingCharacters = 0; -_searchIterator = 0; -_targetIterator = 0; +private _matchingCharacters = 0; +private _searchIterator = 0; +private _targetIterator = 0; while {_searchIterator < _sizeSearchTerm && _targetIterator < _sizeString} do { // Prevents us from going out of bounds if (_arraySearchTerm select _searchIterator == _arrayString select _targetIterator) then { // If we have a match, start looking for the next character in the search term diff --git a/addons/common/functions/fnc_switchToGroupSide.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf index 95f17a9c7b..3a559a7a65 100644 --- a/addons/common/functions/fnc_switchToGroupSide.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -17,31 +17,26 @@ params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]]; -private "_previousGroupsList"; -_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo), []]; +private _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []]; if (_switch) then { // go forward - private ["_previousGroup", "_originalSide", "_newGroup"]; + private _previousGroup = group _unit; + private _originalSide = side group _unit; - _previousGroup = group _unit; - _originalSide = side group _unit; - - if (count units _previousGroup == 1 && _originalSide == _side) exitwith { + if (count units _previousGroup == 1 && _originalSide == _side) exitWith { [format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); }; - _newGroup = createGroup _side; + private _newGroup = createGroup _side; [_unit] joinSilent _newGroup; _previousGroupsList pushBack [_previousGroup, _originalSide, _id, true]; _unit setVariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; } else { // go one back - private ["_currentGroup", "_newGroup"]; - { - if (_id == (_x select 2)) exitwith { + if (_id == (_x select 2)) exitWith { _x set [ 3, false]; _previousGroupsList set [_forEachIndex, _x]; [format["found group with ID: %1", _id]] call FUNC(debug); @@ -51,13 +46,13 @@ if (_switch) then { reverse _previousGroupsList; { - if (_x select 3) exitwith {}; // stop at first id set to true + if (_x select 3) exitWith {}; // stop at first id set to true if !(_x select 3) then { - _currentGroup = group _unit; + private _currentGroup = group _unit; if (!isNull (_x select 0)) then { [_unit] joinSilent (_x select 0); } else { - _newGroup = createGroup (_x select 1); + private _newGroup = createGroup (_x select 1); [_unit] joinSilent _newGroup; }; if (count units _currentGroup == 0) then { diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 34043fa8ae..4ed8107330 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -21,7 +21,6 @@ if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { false }; -private "_eventData"; -_eventData = [_name, _args, _ttl]; +private _eventData = [_name, _args, _ttl]; ["SEH", _eventData] call FUNC(globalEvent); diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index 923e445839..62df8f10a7 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -19,23 +19,19 @@ if (!isServer) exitWith {false}; // @TODO: This should be iteration limited to prevent FPS lag { - private ["_name", "_data", "_newEventLog"]; + private _name = _x; - _name = _x; - - _data = HASH_GET(GVAR(syncedEvents),_name); + private _data = HASH_GET(GVAR(syncedEvents),_name); _data params ["_eventTime", "_eventLog", "_globalEventTTL"]; - _newEventLog = []; + private _newEventLog = []; // @TODO: This should be iteration limited to prevent FPS lag { - private ["_eventEntry", "_ttlReturn"]; + private _eventEntry = _x; + private _ttlReturn = true; - _eventEntry = _x; - _ttlReturn = true; - - if (typeName _globalEventTTL == "CODE") then { + if (_globalEventTTL isEqualType {}) then { _ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL; } else { _ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}}; @@ -45,7 +41,7 @@ if (!isServer) exitWith {false}; // Do event based TTL check _eventEntry params ["_time", "", "_eventTTL"]; - if (typeName _eventTTL == "CODE") then { + if (_eventTTL isEqualType {}) then { _ttlReturn = [_eventTime, _eventEntry] call _eventTTL; } else { _ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}}; diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index 9f3296597d..f8ec0bac68 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -14,15 +14,13 @@ params ["_number", ["_minLength", 1]]; -private ["_sign", "_bin", "_rest"]; - -_sign = ["", "-"] select (_number < 0); +private _sign = ["", "-"] select (_number < 0); _number = round abs _number; -_bin = ["", "0"] select (_number == 0); +private _bin = ["", "0"] select (_number == 0); while {_number > 0} do { - _rest = str (_number mod 2); + private _rest = str (_number mod 2); _number = floor (_number / 2); _bin = _rest + _bin; }; diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index 35b1e06f9f..333e5c737b 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -private "_result"; -_result = 0; +private _result = 0; { if (_x) then {_result = _result + 2 ^ _forEachIndex}; diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf index 80d8757b80..c558aab04b 100644 --- a/addons/common/functions/fnc_toHex.sqf +++ b/addons/common/functions/fnc_toHex.sqf @@ -19,16 +19,14 @@ _number = ((round abs _number) max 0) min 255; if (isNil QGVAR(hexArray)) then { GVAR(hexArray) = []; - private ["_minLength", "_num", "_hex", "_rest"]; - - _minLength = 2; + private _minLength = 2; for [{_i = 0;}, {_i < 256}, {_i = _i + 1}] do { - _num = _i; - _hex = ["", "0"] select (_i == 0); + private _num = _i; + private _hex = ["", "0"] select (_i == 0); while {_num > 0} do { - _rest = _num mod 16; + private _rest = _num mod 16; _rest = switch _rest do { case 10 : {"A"}; case 11 : {"B"}; diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index 6b1aacde1e..c375dfb02e 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -17,6 +17,6 @@ params ["_value"]; -if (typeName _value == "SCALAR") exitWith {_value}; +if (_value isEqualType 0) exitWith {_value}; parseNumber _value // return diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index b05a19bed6..b9fa35243a 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -14,8 +14,7 @@ params ["_object", "_matrix", "_offset"]; -private "_origin"; -_origin = getPosASL _object; +private _origin = getPosASL _object; _matrix params ["_xVec", "_yVec", "_zVec"]; diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index db3a5eaf37..cd360bd874 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -14,8 +14,7 @@ params ["_object", "_matrix", "_offset"]; -private "_origin"; -_origin = getPosASL _object; +private _origin = getPosASL _object; _matrix params ["_xVec", "_yVec", "_zVec"]; diff --git a/addons/common/functions/fnc_unhideUnit.sqf b/addons/common/functions/fnc_unhideUnit.sqf index 5bcafc3509..908dbf3dc8 100644 --- a/addons/common/functions/fnc_unhideUnit.sqf +++ b/addons/common/functions/fnc_unhideUnit.sqf @@ -20,8 +20,7 @@ params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; -private "_setHiddenReasons"; -_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; +private _setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; if (_reason in _setHiddenReasons) then { _setHiddenReasons deleteAt (_setHiddenReasons find _reason); diff --git a/addons/common/functions/fnc_uniqueElements.sqf b/addons/common/functions/fnc_uniqueElements.sqf index 55d8c4ef5f..471ba47457 100644 --- a/addons/common/functions/fnc_uniqueElements.sqf +++ b/addons/common/functions/fnc_uniqueElements.sqf @@ -12,6 +12,6 @@ */ #include "script_component.hpp" -params ["_array"]; +params [["_array", [], [[]]]]; _array arrayIntersect _array // return diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index 0ab65a5983..0c1b53bc61 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -16,15 +16,13 @@ params ["_unit"]; -private "_vehicle"; -_vehicle = vehicle _unit; +private _vehicle = vehicle _unit; if (_vehicle == _unit) exitWith {false}; if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false}; -private "_emptyPos"; -_emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]; // @todo to small? +private _emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeOf _unit]; // @todo to small? if (count _emptyPos == 0) exitWith {false}; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 67d104a9e4..5e8300c139 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -15,10 +15,10 @@ #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) params ["_unit", "_vehicle"]; +TRACE_2("params",_unit,_vehicle); -private ["_validVehiclestate", "_emptyPos", "_loaded"]; - -_validVehiclestate = true; +private _validVehiclestate = true; +private _emptyPos = []; if (_vehicle isKindOf "Ship") then { if (speed _vehicle > 1 || {getPos _vehicle select 2 > 2}) then { @@ -27,10 +27,10 @@ if (_vehicle isKindOf "Ship") then { TRACE_1("SHIP Ground Check",getPos _vehicle); - _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; // TODO: if spot is underwater pick another spot. + _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit]; // TODO: if spot is underwater pick another spot. } else { if (_vehicle isKindOf "Air") then { - if (speed _vehicle > 1 || {isTouchingGround _vehicle}) then { + if (speed _vehicle > 1 || {!isTouchingGround _vehicle}) then { _validVehiclestate = false; }; @@ -45,18 +45,18 @@ if (_vehicle isKindOf "Ship") then { TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; + _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit]; }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); -if !(_validVehiclestate) exitwith { +if !(_validVehiclestate) exitWith { ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle); false }; -if (count _emptyPos == 0) exitwith { +if (count _emptyPos == 0) exitWith { ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos); false }; //consider displaying text saying there are no safe places to exit the vehicle @@ -77,8 +77,7 @@ _unit action ["Eject", vehicle _unit]; TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); if (driver _unit == _unit) then { - private "_anim"; - _anim = [_unit] call FUNC(getDeathAnim); + private _anim = [_unit] call FUNC(getDeathAnim); [_unit, _anim, 1, true] call FUNC(doAnimation); @@ -95,9 +94,9 @@ _unit action ["Eject", vehicle _unit]; [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); -_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; +private _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]]; _loaded deleteAt (_loaded find _unit); -_vehicle setvariable [QGVAR(loaded_persons), _loaded, true]; +_vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; true diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index bf02fe676f..a995eed244 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -18,8 +18,7 @@ params ["_unit", "_reason"]; if (isNull _unit) exitWith {}; // remove reason to mute to the unit -private "_muteUnitReasons"; -_muteUnitReasons = _unit getVariable [QGVAR(muteUnitReasons), []]; +private _muteUnitReasons = _unit getVariable [QGVAR(muteUnitReasons), []]; if (_reason in _muteUnitReasons) then { _muteUnitReasons deleteAt (_muteUnitReasons find _reason); @@ -29,8 +28,7 @@ if (_reason in _muteUnitReasons) then { // don't unmute if there is another mute reason! if (count _muteUnitReasons > 0) exitWith {}; -private "_speaker"; -_speaker = _unit getVariable ["ACE_OriginalSpeaker", ""]; +private _speaker = _unit getVariable ["ACE_OriginalSpeaker", ""]; if (_speaker == "") exitWith {}; diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index acf359813c..2d2116b38f 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -15,8 +15,7 @@ params ["_unit", "_item", ["_vehicleUsage", false]]; -private "_return"; -_return = false; +private _return = false; if !(_vehicleUsage) then { if (_item != "") then { diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index 1a77d0b3f3..4dc6136fa6 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -15,8 +15,7 @@ params ["_unit", "_magazine", ["_vehicleUsage", false]]; -private "_return"; -_return = false; +private _return = false; if !(_vehicleUsage) then { if (_magazine != "") then { diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf index a3f2447729..bc278a9b70 100644 --- a/addons/common/functions/fnc_waveHeightAt.sqf +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -1,6 +1,5 @@ /* * Author: jaynus - * * Gets the wave height at a specific location. Uses a logic, so may be performance iffy * * Arguments: diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index 2de07c7bbd..c9e5551d19 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -1,6 +1,5 @@ /* * Author: zGuba 2011 - * * Function helper for framing objects on screen. * * Arguments: @@ -26,14 +25,12 @@ params ["_object", "_margins", "_offsets"]; -private ["_minX", "_minY", "_maxX", "_maxY", "_bounds", "_boundsCorners"]; +private _minX = 10; +private _minY = 10; +private _maxX = -10; +private _maxY = -10; -_minX = 10; -_minY = 10; -_maxX = -10; -_maxY = -10; - -_bounds = boundingBox _object; +private _bounds = boundingBox _object; _margins params ["_marginsX", "_marginsY", "_marginsZ"]; _offsets params ["_offsetsX", "_offsetsY", "_offsetsZ"]; @@ -49,22 +46,23 @@ _boundsMaxX = _boundsMaxX + _marginsX + _offsetsX; _boundsMaxY = _boundsMaxY + _marginsY + _offsetsY; _boundsMaxZ = _boundsMaxZ + _marginsZ + _offsetsZ; -_boundsCorners = [ - [_boundsMinX,_boundsMinY,_boundsMinZ], - [_boundsMinX,_boundsMinY,_boundsMaxZ], - [_boundsMinX,_boundsMaxY,_boundsMinZ], - [_boundsMinX,_boundsMaxY,_boundsMaxZ], - [_boundsMaxX,_boundsMinY,_boundsMinZ], - [_boundsMaxX,_boundsMinY,_boundsMaxZ], - [_boundsMaxX,_boundsMaxY,_boundsMinZ], - [_boundsMaxX,_boundsMaxY,_boundsMaxZ] +private _boundsCorners = [ + [_boundsMinX, _boundsMinY, _boundsMinZ], + [_boundsMinX, _boundsMinY, _boundsMaxZ], + [_boundsMinX, _boundsMaxY, _boundsMinZ], + [_boundsMinX, _boundsMaxY, _boundsMaxZ], + [_boundsMaxX, _boundsMinY, _boundsMinZ], + [_boundsMaxX, _boundsMinY, _boundsMaxZ], + [_boundsMaxX, _boundsMaxY, _boundsMinZ], + [_boundsMaxX, _boundsMaxY, _boundsMaxZ] ]; { - private "_ppos"; - _ppos = worldToScreen (_object modelToWorld _x); + private _ppos = worldToScreen (_object modelToWorld _x); + if (count _ppos >= 2) then { _ppos params ["_pposX", "_pposY"]; + if (_pposX < _minX) then {_minX = _pposX}; if (_pposX > _maxX) then {_maxX = _pposX}; if (_pposY < _minY) then {_minY = _pposY}; @@ -73,4 +71,4 @@ _boundsCorners = [ false } count _boundsCorners; -[_minX,_minY,_maxX,_maxY] +[_minX, _minY, _maxX, _maxY] diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 8973d1d3e6..111300e87c 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -42,7 +42,7 @@ ACE-Optionen Opciones ACE Ustawienia ACE - Nastavení ACE + ACE Nastavení Options ACE ACE Настройки Opções do ACE @@ -485,7 +485,7 @@ Check addon integrity with server and do selected action if an addon is missing. Sprawdzaj spójność addonów z serwerem i wykonuj stosowną akcję jeżeli zostanie wykryty brak addonu. Este módulo verifica la integridad de los addons con los que iniciamos el simulador - Dieses Modul überprüft ob jeder Spieler die richtigen PBO-Dateien hat. + Dieses Modul überprüft, ob jeder Spieler die richtigen PBO-Dateien mitgeladen hat. Zjistit addon který je v souladu se serverem Este módulo verifica a integridade dos addons quando iniciamos a simulação Выполняет проверку версий аддонов ACE у подключаемых игроков @@ -506,7 +506,7 @@ What to do with people who do not have the right PBOs? Co zrobić z graczami, którzy nie mają właściwych PBO? ¿Qué hacer con la gente que no tiene correctamente los PBOs? - Was soll mit Leuten passieren, die nicht die richtigen PBOs haben? + Was soll mit Leuten geschehen, die nicht die richtigen PBO-Dateien geladen haben? Co udělat s lidmi, co nemají správné addony? O que fazer com pessoas que não tem os PBOs corretos? Que faire avec les personnes n'ayant pas les bon PBOs @@ -528,7 +528,7 @@ Warn (permanent) Ostrzeżenie (permanentne) Avisar (permanente) - Immer verwarnen + Verwarnen (permanent) Upozornit (permanentně) Avisar (permanente) Avertir (permanent) @@ -693,6 +693,7 @@ Vehicles only + Nur Fahrzeuge Tylko pojazdy Somente veículos Только в транспорте @@ -701,9 +702,9 @@ Do Not Force + Nicht erzwingen Nie wymuszaj No forzar - Nicht erzwingen Nevynucovat Não forçar Не обязывать @@ -718,13 +719,16 @@ ACE3 Common + ACE3 Allgemein ACE3 Ogólne Comum ACE3 ACE3 Общие ACE3 Común + ACE3 Obecné ACE3 Weapons + ACE3 Waffen ACE3 Broń Armamento ACE3 ACE3 Оружие @@ -733,13 +737,16 @@ ACE3 Movement + ACE3 Bewegung ACE3 Ruch Movimento ACE3 ACE3 Перемещение ACE3 Movimiento + ACE3 Pohyb ACE3 Scope Adjustment + ACE3 Visiereinstellung ACE3 Regulacja optyki Ajuste de luneta ACE3 ACE3 Прицелы @@ -748,6 +755,7 @@ ACE3 Vehicles + ACE3 Fahrzeuge ACE3 Pojazdy Veículos ACE3 ACE3 Транспорт diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp index 81304da853..2a0b8cead2 100644 --- a/addons/concertina_wire/CfgVehicles.hpp +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -1,7 +1,7 @@ class CfgVehicles { class Fence; - class thingX; + class ThingX; class NonStrategic; class ACE_ConcertinaWireNoGeo: Fence { @@ -94,7 +94,7 @@ class CfgVehicles { }; }; }; - class ACE_ConcertinaWireCoil: thingX { + class ACE_ConcertinaWireCoil: ThingX { XEH_ENABLED; scope = 2; displayName = $STR_ACE_CONCERTINA_WIRECOIL; diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index c7ba3f50b1..6e8ae8f4f5 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -15,7 +15,7 @@ #include "script_component.hpp" // If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine -if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { +if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith { [{ _this call FUNC(dismount); }, _this] call EFUNC(common,execNextFrame); diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index 41050eb9b9..dffa15b609 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -52,12 +52,12 @@ if (_mode == 0) then { ]; { _found = false; - _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log "....."; - _no = _no - [_wire]; //diag_log _no; + _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log "....."; + _no = _no - [_wire]; //diag_log _no; if (count _no > 0) exitWith { - _found = true; //diag_log "found"; + _found = true; //diag_log "found"; }; - } foreach _wireCheckPosAr; + } forEach _wireCheckPosAr; // Double coil found! if (_found) then { _mode = 1; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 7f36facae8..ef93a53d8a 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -29,7 +29,7 @@ private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevati __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); -if (GVAR(noVectorData)) exitwith {}; +if (GVAR(noVectorData)) exitWith {}; GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"]; // Incase grids go neg due to 99-00 boundry diff --git a/addons/dagr/initKeybinds.sqf b/addons/dagr/initKeybinds.sqf index 4575401feb..66bd08190e 100644 --- a/addons/dagr/initKeybinds.sqf +++ b/addons/dagr/initKeybinds.sqf @@ -14,7 +14,7 @@ true }, {false}, -[0, [false, true, false]], false] call cba_fnc_addKeybind; // (empty default key) +[0, [false, true, false]], false] call CBA_fnc_addKeybind; // (empty default key) ["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR", { @@ -27,7 +27,7 @@ true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; // (empty default key) +[0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key) //Add deviceKey entry: private ["_conditonCode", "_toggleCode", "_closeCode"]; diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index a164ac51f3..61d226377d 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -3,31 +3,39 @@ DAGR + DAGR DAGR DAGR DAGR DAGR + DAGR Configure DAGR + DAGR konfigurien Konfiguruj DAGR Configurar DAGR Настроить DAGR Configurar DAGR + Konfigurovat DAGR Toggle DAGR + DAGR umschalten Przełącz DAGR Mostrar DAGR Вкл./выкл. DAGR Mostrar DAGR + Přepnout DAGR Defense Advanced GPS Receiver + Defense Advanced GPS Receiver Defense Advanced GPS Receiver Defense Advanced GPS Receiver Военный многофункциональный GPS-приёмник Defense Advanced GPS Receiver + Defense Advanced GPS Receiver - \ No newline at end of file + diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index c2a3a6396e..92f98a0756 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -20,7 +20,7 @@ params ["_caller", "_target"]; private "_display"; #define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" //Sanity Checks -if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; +if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");}; if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");}; if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;}; @@ -72,7 +72,7 @@ GVAR(disarmTarget) = _target; _icon = format [DEFUALTPATH, toLower (rank _target)]; if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; _rankPicture ctrlSetText _icon; - _playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName)); + _playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName)); //Clear both inventory lists: lbClear _groundContainer; diff --git a/addons/disarming/gui_disarm.hpp b/addons/disarming/gui_disarm.hpp index 0961b809ed..1863eb9b0b 100644 --- a/addons/disarming/gui_disarm.hpp +++ b/addons/disarming/gui_disarm.hpp @@ -33,13 +33,13 @@ class GVAR(remoteInventory) { fadeout = 0; class Colors { - dragValidBgr[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",0.5}; - dragInvalidBgr[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; - dragValidBar[] = {"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])",0.5}; - dragInvalidBar[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; - progressBar[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",1}; - progressBarBgr[] = {"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])","(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])","(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])",0.75}; - highlight[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",0.5}; + dragValidBgr[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",0.5}; + dragInvalidBgr[] = {"(profilenamespace getVariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getVariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; + dragValidBar[] = {"(profilenamespace getVariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getVariable ['IGUI_WARNING_RGB_B',0.0])",0.5}; + dragInvalidBar[] = {"(profilenamespace getVariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getVariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; + progressBar[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",1}; + progressBarBgr[] = {"(profilenamespace getVariable ['IGUI_BCG_RGB_R',0])","(profilenamespace getVariable ['IGUI_BCG_RGB_G',1])","(profilenamespace getVariable ['IGUI_BCG_RGB_B',1])",0.75}; + highlight[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",0.5}; }; class controlsBackground {}; diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf index ec56f42ff4..88e27190ed 100644 --- a/addons/disposable/functions/fnc_replaceATWeapon.sqf +++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf @@ -24,15 +24,13 @@ params ["_unit", "_weapon", "", "", "", "", "_projectile"]; TRACE_3("params",_unit,_weapon,_projectile); -if ((!local _unit) || {_weapon != (secondaryWeapon _unit)}) exitWith {}; +if (!local _unit || {_weapon != secondaryWeapon _unit}) exitWith {}; -private ["_replacementTube", "_items"]; -_replacementTube = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_UsedTube"); +private _replacementTube = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_UsedTube"); if (_replacementTube == "") exitWith {}; //If no replacement defined just exit - //Save array of items attached to launcher -_items = secondaryWeaponItems _unit; +private _items = secondaryWeaponItems _unit; //Replace the orginal weapon with the 'usedTube' weapon _unit addWeapon _replacementTube; //Makes sure the used tube is still equiped @@ -52,15 +50,13 @@ if !([_unit] call EFUNC(common,isPlayer)) then { //don't do anything until projectile is null (exploded/max range) if (isNull _projectile) then { //Remove PFEH: - [_idPFH] call cba_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; //If (tube is dropped) OR (is dead) OR (is player) just exit - if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {}; + if (secondaryWeapon _unit != _tube || {!alive _unit} || {[_unit] call EFUNC(common,isPlayer)}) exitWith {}; - private ["_items", "_container"]; - - // _items = secondaryWeaponItems _unit; - _container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"]; + //private _items = secondaryWeaponItems _unit; + private _container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"]; _container setPosAsl (getPosAsl _unit); _container addWeaponCargoGlobal [_tube, 1]; diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf index c371c8d5a5..bd6dec057c 100644 --- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf +++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf @@ -20,17 +20,12 @@ TRACE_1("params",_unit); if (!local _unit) exitWith {}; -private ["_launcher", "_config"]; - -_launcher = secondaryWeapon _unit; -_config = configFile >> "CfgWeapons" >> _launcher; +private _launcher = secondaryWeapon _unit; +private _config = configFile >> "CfgWeapons" >> _launcher; if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber (_config >> "ACE_isUsedLauncher") != 1} && {count secondaryWeaponMagazine _unit == 0}) then { - private ["_magazine", "_isLauncherSelected", "_didAdd"]; - - _magazine = getArray (_config >> "magazines") select 0; - - _isLauncherSelected = currentWeapon _unit == _launcher; + private _magazine = getArray (_config >> "magazines") select 0; + private _isLauncherSelected = currentWeapon _unit == _launcher; _unit removeMagazines _magazine; @@ -38,8 +33,9 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber _unit addBackpack "ACE_FakeBackpack"; _unit removeWeapon _launcher; _unit addMagazine _magazine; - _didAdd = _magazine in (magazines _unit); + private _didAdd = _magazine in magazines _unit; _unit addWeapon _launcher; + if (!_didAdd) then { TRACE_1("Failed To Add Disposable Magazine Normally, doing backup method (no backpack)",_unit); _unit addSecondaryWeaponItem _magazine; @@ -48,8 +44,9 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber } else { _unit removeWeapon _launcher; _unit addMagazine _magazine; - _didAdd = _magazine in (magazines _unit); + private _didAdd = _magazine in magazines _unit; _unit addWeapon _launcher; + if (!_didAdd) then { TRACE_2("Failed To Add Disposable Magazine Normally, doing backup method",_unit,(backpack _unit)); _unit addSecondaryWeaponItem _magazine; diff --git a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf index 7f50e45089..9908c86186 100644 --- a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf +++ b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf @@ -24,13 +24,11 @@ _player removeMagazines "ACE_FiredMissileDummy"; if (isNull _display) exitWith {}; -private ["_launcher", "_control", "_config"]; - -_launcher = secondaryWeapon _player; +private _launcher = secondaryWeapon _player; if (_launcher == "" || {getText (configFile >> "CfgWeapons" >> _launcher >> "ACE_UsedTube") == ""}) then { - _control = _display displayCtrl 627; - _config = configFile >> "RscDisplayInventory" >> "controls" >> "SlotSecondaryMagazine"; + private _control = _display displayCtrl 627; + private _config = configFile >> "RscDisplayInventory" >> "controls" >> "SlotSecondaryMagazine"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; _control ctrlCommit 0; @@ -39,7 +37,7 @@ if (_launcher == "" || {getText (configFile >> "CfgWeapons" >> _launcher >> "ACE _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; _control ctrlCommit 0; } else { - _control = _display displayCtrl 627; + private _control = _display displayCtrl 627; _control ctrlSetPosition [0, 0, 0, 0]; _control ctrlCommit 0; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index d4d791724b..bbd362f758 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -84,6 +84,22 @@ class CfgVehicles { GVAR(canDrag) = 0; }; + // Barrier + class RoadCone_F: ThingX { + XEH_ENABLED; + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + class RoadBarrier_F: RoadCone_F { + GVAR(carryPosition[]) = {0,1,0.300671}; + }; + class ACE_RepairItem_Base: ThingX {}; class ACE_Track: ACE_RepairItem_Base { diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 6ee28edff3..1f5e9f68aa 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -21,4 +21,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging (ignore UAV AI) if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; -alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})} +alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getVariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 58c4718407..d96c0dd5da 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -24,4 +24,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging (ignore UAV AI) if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; -alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; +alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getVariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 9da1656b8b..5e5687db8a 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -22,9 +22,9 @@ params ["_unit", "_target"]; private "_inBuilding"; _inBuilding = [_unit] call FUNC(isObjectOnObject); -if !(_unit getvariable ["ACE_isUnconscious", false]) then { - // play release animation - _unit playAction "released"; +if !(_unit getVariable ["ACE_isUnconscious", false]) then { + // play release animation + _unit playAction "released"; }; // prevent collision damage @@ -63,7 +63,7 @@ if !(_target isKindOf "CAManBase") then { ["fixFloating", _target, _target] call EFUNC(common,targetEvent); }; -if (_unit getvariable ["ACE_isUnconscious", false]) then { +if (_unit getVariable ["ACE_isUnconscious", false]) then { [_unit, "unconscious", 2, true] call EFUNC(common,doAnimation); }; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 300846bc6c..c9c34c82a0 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -31,7 +31,7 @@ detach _target; // fix anim when aborting carrying persons if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { - if (vehicle _unit == _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { + if (vehicle _unit == _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { [_unit, "", 2, true] call EFUNC(common,doAnimation); }; diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index dcdcbbf3fe..0fbee19d41 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -39,7 +39,7 @@ _totalWeight = 0; ]; // add Weight of create to totalWeight -_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> typeof _object >> "mass")); +_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> "mass")); // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). _totalWeight * 0.5 diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index be80801e57..0e105f60ce 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -55,6 +55,7 @@ Wyżej/Niżej Levantar/Abaixar Поднять/Опустить + Zvýšit/Snížit \ No newline at end of file diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index 8299a979b3..843ecdb8e3 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -21,7 +21,6 @@ class CfgAmmo { class DirectionalBombCore: TimeBombCore; class DirectionalBombBase: DirectionalBombCore; - class APERSTripMine_Wire_Ammo: DirectionalBombBase; class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase; @@ -31,11 +30,16 @@ class CfgAmmo { class DirectionalBombBase; class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; + GVAR(defuseObjectPosition[]) = {0, 0, 0.038}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; }; //class ClaymoreDirectionalMine_Remote_Ammo_Scripted: ClaymoreDirectionalMine_Remote_Ammo; + class APERSTripMine_Wire_Ammo: DirectionalBombBase { + GVAR(defuseObjectPosition[]) = {-1.415, 0, 0.12}; + }; + class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { indirectHitRange = 20; ACE_explodeOnDefuse = 1; @@ -55,6 +59,7 @@ class CfgAmmo { class PipeBombBase; class DemoCharge_Remote_Ammo: PipeBombBase { ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted"; + GVAR(defuseObjectPosition[]) = {0.07, 0, 0.055}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; hit = 500; @@ -63,17 +68,18 @@ class CfgAmmo { }; class SatchelCharge_Remote_Ammo: PipeBombBase { ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted"; + GVAR(defuseObjectPosition[]) = {0.1, 0.1, 0.05}; soundActivation[] = {"", 0, 0, 0}; soundDeactivation[] = {"", 0, 0, 0}; }; - + /*class DemoCharge_Remote_Ammo_Scripted: DemoCharge_Remote_Ammo; class SatchelCharge_Remote_Ammo_Scripted: SatchelCharge_Remote_Ammo;*/ - + class IEDUrbanBig_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; ACE_explodeOnDefuse = 0.02; - soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; + soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; }; class IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo { mineTrigger = "RemoteTrigger"; @@ -81,19 +87,19 @@ class CfgAmmo { class IEDUrbanBig_Range_Ammo: IEDUrbanBig_Remote_Ammo { mineTrigger = "RangeTrigger"; }; - + class IEDUrbanSmall_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; ACE_explodeOnDefuse = 0.02; soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; - }; - class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo { + }; + class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo { mineTrigger = "RemoteTrigger"; }; class IEDUrbanSmall_Range_Ammo: IEDUrbanSmall_Remote_Ammo { mineTrigger = "RangeTrigger"; }; - + class IEDLandBig_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; ACE_explodeOnDefuse = 0.02; @@ -105,7 +111,7 @@ class CfgAmmo { class IEDLandBig_Range_Ammo: IEDLandBig_Remote_Ammo { mineTrigger = "RangeTrigger"; }; - + class IEDLandSmall_Remote_Ammo: PipeBombBase { triggerWhenDestroyed = 1; ACE_explodeOnDefuse = 0.02; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 7a51a7d765..24de2f5a44 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -10,7 +10,6 @@ class CfgVehicles { showDisabled = 1; priority = 4; icon = PATHTOF(UI\Explosives_Menu_ca.paa); - hotkey = "X"; //Sub-menu items class ACE_Detonate { displayName = CSTRING(Detonate); @@ -21,7 +20,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\Explosives_Menu_ca.paa); priority = 2; - hotkey = "T"; }; class ACE_Place { displayName = CSTRING(Place); @@ -32,7 +30,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\Place_Explosive_ca.paa); priority = 1; - hotkey = "P"; }; class ACE_Cellphone { displayName = CSTRING(cellphone_displayName); @@ -62,7 +59,7 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { selection = ""; - distance = 5; + distance = 1; condition = "true"; class ACE_Defuse { displayName = CSTRING(Defuse); @@ -72,8 +69,7 @@ class CfgVehicles { showDisabled = 0; icon = PATHTOF(UI\Defuse_ca.paa); priority = 0.8; - hotkey = "F"; - distance = 5; + distance = 1; }; }; }; @@ -89,16 +85,15 @@ class CfgVehicles { scope = 2; scopeCurator = 1; vehicleClass = "Cargo"; - ACE_offset[] = {0,0,0}; class ACE_Actions { class ACE_MainActions { selection = ""; - distance = 5; + distance = 1; condition = "true"; class ACE_SetTrigger { selection = ""; displayName = CSTRING(TriggerMenu); - distance = 4; + distance = 1; condition = "true"; statement = ""; insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions);); @@ -110,7 +105,7 @@ class CfgVehicles { class ACE_PickUp { selection = ""; displayName = CSTRING(Pickup); - distance = 4; + distance = 1; condition = "true"; statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;); showDisabled = 0; @@ -125,6 +120,11 @@ class CfgVehicles { class ACE_Explosives_Place_DemoCharge:ACE_Explosives_Place { displayName = "Demo Charge"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[-0.07,0,0.055]"; + }; + }; }; class ACE_Explosives_Place_APERSBoundingMine:ACE_Explosives_Place { displayName = "APERS Bounding Mine"; @@ -137,7 +137,11 @@ class CfgVehicles { class ACE_Explosives_Place_APERSTripwireMine:ACE_Explosives_Place { displayName = "APERS Tripwire Mine"; model = "\A3\Weapons_F\explosives\mine_AP_tripwire"; - ACE_offset[] = {1,0,0}; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[1.415,0,0.12]"; + }; + }; }; class ACE_Explosives_Place_ATMine:ACE_Explosives_Place { @@ -148,11 +152,21 @@ class CfgVehicles { class ACE_Explosives_Place_Claymore:ACE_Explosives_Place { displayName = "Claymore"; model = "\A3\Weapons_F\explosives\mine_AP_miniclaymore"; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0,0.038]"; + }; + }; }; class ACE_Explosives_Place_SatchelCharge:ACE_Explosives_Place { displayName = "Satchel Charge"; model = "\A3\Weapons_F\Explosives\satchel"; + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[-0.1,-0.1,0.05]"; + }; + }; }; class ACE_Explosives_Place_SLAM:ACE_Explosives_Place { diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index 6e6374af12..45582a8564 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -19,9 +19,9 @@ class Rsc_ACE_CallScreen_Edit:RscEdit { colorText[] = {0,0,0,1}; colorDisabled[] = {1,1,1,0.25}; colorSelection[] = { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", + "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", + "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", + "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 1 }; text = ""; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index b6dc5049d9..af105b5879 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -43,7 +43,7 @@ GVAR(CurrentSpeedDial) = 0; GVAR(placeAction) = PLACE_CANCEL; }; - //Show defuse actions on cfgAmmos (allMines): + //Show defuse actions on CfgAmmos (allMines): _this call FUNC(interactEH); }] call EFUNC(common,addEventHandler); diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index bf409d5462..7ad0fe76da 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -29,7 +29,7 @@ if ((_code) == "") exitWith { }; { if ((_x select 0) == _name) exitWith { - _speedDial set [_foreachindex, _this]; + _speedDial set [_forEachIndex, _this]; _found = true; }; } forEach _speedDial; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 74e4dfca11..d204ad7bad 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -30,10 +30,10 @@ _result = true; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false}; -if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { +if (getNumber (ConfigFile >> "CfgAmmo" >> typeOf (_item select 0) >> "TriggerWhenDestroyed") == 0) then { private ["_exp", "_previousExp"]; _previousExp = _item select 0; - _exp = getText (ConfigFile >> "CfgAmmo" >> typeof (_previousExp) >> "ACE_Explosive"); + _exp = getText (ConfigFile >> "CfgAmmo" >> typeOf (_previousExp) >> "ACE_Explosive"); if (_exp != "") then { _exp = createVehicle [_exp, [0,0,15001], [], 0, "NONE"]; _exp setDir (getDir _previousExp); diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index cb9d7f5450..bc57ddd4b2 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -30,7 +30,7 @@ private "_explosive"; _explosive = [_code] call FUNC(getSpeedDialExplosive); if (_i >= (count _arr + 2)) then { - [_pfID] call CALLSTACK(cba_fnc_removePerFrameHandler); + [_pfID] call CALLSTACK(CBA_fnc_removePerFrameHandler); if ((count _explosive) > 0) then { [_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive); }; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 56334af65b..e2e56824ec 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -44,9 +44,9 @@ _list = []; if (_adjustedList) then { _clackerList = _clackerList - ["X"]; if (count _clackerList == 0) then { - _unit SetVariable [QGVAR(Clackers), nil, true]; + _unit setVariable [QGVAR(Clackers), nil, true]; } else { - _unit SetVariable [QGVAR(Clackers), _clackerList, true]; + _unit setVariable [QGVAR(Clackers), _clackerList, true]; }; }; diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index 9be7568530..da5e5ec149 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -45,7 +45,17 @@ if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then { TRACE_2("Making Defuse Helper",(_x),(typeOf _x)); _defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x); - _defuseHelper attachTo [_x, [0,0,0]]; + + private _config = configFile >> "CfgAmmo" >> typeOf _x; + + private _defuseObjectPosition = getArray (_config >> QGVAR(defuseObjectPosition)); + if (_defuseObjectPosition isEqualTo []) then { + _defuseObjectPosition = [0,0,0]; + }; + + TRACE_1("DefuseObjectPosition",(_defuseObjectPosition)); + + _defuseHelper attachTo [_x, _defuseObjectPosition]; _defuseHelper setVariable [QGVAR(Explosive),_x]; _addedDefuseHelpers pushBack _defuseHelper; _minesHelped pushBack _x; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 3e3e1b96d3..127cd8c105 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -29,7 +29,7 @@ _config = ConfigFile >> "CfgWeapons" >> _item; if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { private ["_clackerItems"]; _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _receiver SetVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + _receiver setVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; _detonators = [_giver] call FUNC(getDetonators); if (count _detonators == 0) then { diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 5e4999b1f4..e1cdbcd80c 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -62,8 +62,8 @@ if (isNumber (_magazineTrigger >> "digDistance")) then { _canDigDown = true; _surfaceType = surfaceType _pos; if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];}; - if ((_surfaceType != "") || {isClass (configfile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then { - _soundEnviron = getText (configfile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron"); + if ((_surfaceType != "") || {isClass (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then { + _soundEnviron = getText (configFile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron"); TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron); _canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]); }; diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index f23cb2fc00..6cf03d7be2 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -582,6 +582,7 @@ Explode on defusal? + Explodieren beim Entschärfen? Explosão no desarmamento? Eksplozja przy rozbrajaniu? Explodovat při zneškodňování? @@ -592,6 +593,7 @@ Enable certain explosives to explode on defusal? Default: Yes + Sollen bestimmte Sprengladungen beim Entschärfen explodieren? Standard: Ja Ativa certos explosivos para detonar no desarmamento? Padrão: Sim Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp index a03ca847ea..ab41fa904b 100644 --- a/addons/fcs/CfgEventHandlers.hpp +++ b/addons/fcs/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -6,7 +7,7 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 53b279ef88..f1b896c612 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -26,7 +26,7 @@ class CfgVehicles { class ACE_SelfActions { class ResetFCS { displayName = CSTRING(ResetFCS); - condition = QUOTE(call FUNC(canResetFCS)); + condition = QUOTE(_player call FUNC(canResetFCS)); statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; priority = 1; @@ -39,7 +39,7 @@ class CfgVehicles { class ACE_SelfActions { class ResetFCS { displayName = CSTRING(ResetFCS); - condition = QUOTE(call FUNC(canResetFCS)); + condition = QUOTE(_player call FUNC(canResetFCS)); statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; priority = 1; @@ -321,9 +321,13 @@ class CfgVehicles { discreteDistance[] = {}; discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ + class Turrets: Turrets { + class CommanderOptics: CommanderOptics { + GVAR(Enabled) = 1; + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; }; }; }; @@ -346,9 +350,13 @@ class CfgVehicles { discreteDistance[] = {}; discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ + class Turrets: Turrets { + class CommanderOptics: CommanderOptics { + GVAR(Enabled) = 1; + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; }; }; }; @@ -362,6 +370,8 @@ class CfgVehicles { class Turrets: Turrets { class CommanderOptics: CommanderOptics { GVAR(Enabled) = 1; + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; }; }; }; diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_postInit.sqf similarity index 83% rename from addons/fcs/XEH_clientInit.sqf rename to addons/fcs/XEH_postInit.sqf index 3338e739e1..8a8b379318 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_postInit.sqf @@ -16,4 +16,4 @@ if (!hasInterface) exitWith {}; }] call EFUNC(common,addEventHandler); // Register event for global updates -[QGVAR(forceUpdate), FUNC(onForceUpdate)] call EFUNC(common,addEventHandler); +[QGVAR(forceUpdate), {ACE_player call FUNC(onForceUpdate)}] call EFUNC(common,addEventHandler); diff --git a/addons/fcs/XEH_preInit.sqf b/addons/fcs/XEH_preInit.sqf index 8fdc43df11..2bcda4f464 100644 --- a/addons/fcs/XEH_preInit.sqf +++ b/addons/fcs/XEH_preInit.sqf @@ -14,6 +14,7 @@ PREP(onForceUpdate); PREP(keyDown); PREP(keyUp); PREP(reset); +PREP(updateRangeHUD); PREP(vehicleInit); ADDON = true; diff --git a/addons/fcs/functions/fnc_adjustRange.sqf b/addons/fcs/functions/fnc_adjustRange.sqf index 4b7f4b6b88..f6f543d35a 100644 --- a/addons/fcs/functions/fnc_adjustRange.sqf +++ b/addons/fcs/functions/fnc_adjustRange.sqf @@ -1,29 +1,27 @@ /* * Author: KoffeinFlummi - * * Adjusts the currently zeroed distance. * * Arguments: - * 0: The vehicle in question - * 1: The amount to add to the distance (can be negative) + * 0: The vehicle in question + * 1: The Turrets that the Vehicle has + * 2: The amount to add to the distance (can be negative) * * Return Value: * None + * + * Public: No */ - #include "script_component.hpp" -private ["_vehicle", "_turret", "_delta", "_turretConfig", "_min", "_max", "_distance"]; +params ["_vehicle", "_turret", "_delta"]; -_vehicle = _this select 0; -_turret = _this select 1; -_delta = _this select 2; +private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); -_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); +private _min = getNumber (_turretConfig >> QGVAR(MinDistance)); +private _max = getNumber (_turretConfig >> QGVAR(MaxDistance)); -_min = getNumber (_turretConfig >> QGVAR(MinDistance)); -_max = getNumber (_turretConfig >> QGVAR(MaxDistance)); -_distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min]; +private _distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min]; _distance = _distance + _delta; _distance = _distance min _max; diff --git a/addons/fcs/functions/fnc_canResetFCS.sqf b/addons/fcs/functions/fnc_canResetFCS.sqf index 488f1eebf4..b57435f388 100644 --- a/addons/fcs/functions/fnc_canResetFCS.sqf +++ b/addons/fcs/functions/fnc_canResetFCS.sqf @@ -1,15 +1,17 @@ /* * Author: KoffeinFlummi - * * Called from config. Can player reset FCS? * * Argument: * Nothing * - * Return value: - * Boolean (Bool) + * Return Value: + * Boolean + * + * Public: No */ - #include "script_component.hpp" -count ((vehicle ACE_player) getVariable [format ["%1_%2", QGVAR(Magazines), [ACE_player] call EFUNC(common,getTurretIndex)], []]) > 1 +params ["_unit"]; + +count ((vehicle _unit) getVariable [format ["%1_%2", QGVAR(Magazines), [_unit] call EFUNC(common,getTurretIndex)], []]) > 1 // return diff --git a/addons/fcs/functions/fnc_canUseFCS.sqf b/addons/fcs/functions/fnc_canUseFCS.sqf index cb4a1b608d..91b49554c2 100644 --- a/addons/fcs/functions/fnc_canUseFCS.sqf +++ b/addons/fcs/functions/fnc_canUseFCS.sqf @@ -1,16 +1,16 @@ /* * Author: commy2 - * * Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS. * - * Argument: - * Nothing + * Arguments: + * None * - * Return value: - * Boolean (Bool) + * Return Value: + * Boolean + * + * Public: No */ - #include "script_component.hpp" getNumber ([configFile >> "CfgVehicles" >> typeOf vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call EFUNC(common,getTurretConfigPath) >> QGVAR(Enabled)) == 1 -&& {cameraView == "GUNNER"} +&& {cameraView == "GUNNER"} // return diff --git a/addons/fcs/functions/fnc_canUseRangefinder.sqf b/addons/fcs/functions/fnc_canUseRangefinder.sqf index f6bb3b2e52..7403c74ac1 100644 --- a/addons/fcs/functions/fnc_canUseRangefinder.sqf +++ b/addons/fcs/functions/fnc_canUseRangefinder.sqf @@ -1,16 +1,16 @@ /* * Author: commy2 - * * Returns true if the laser distance measurement can be read from the engine. * - * Argument: - * Nothing + * Arguments: + * None * - * Return value: - * Boolean (Bool) + * Return Value: + * Boolean + * + * Public: No */ - #include "script_component.hpp" !isNull ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) -&& {cameraView == "GUNNER"} +&& {cameraView == "GUNNER"} // return diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 31fe38335d..237aed8ac1 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi - * * Adjusts the direction of a shell. * * Arguments: @@ -8,58 +7,48 @@ * * Return Value: * None + * + * Public: No */ - #include "script_component.hpp" -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile", "_sumVelocity"]; +params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine", "_projectile"]; -_vehicle = _this select 0; -_weapon = _this select 1; -_ammo = _this select 4; -_magazine = _this select 5; -_projectile = _this select 6; - -private ["_gunner", "_turret"]; - -_gunner = [_vehicle, _weapon] call EFUNC(common,getGunner); -_turret = [_gunner] call EFUNC(common,getTurretIndex); +private _gunner = [_vehicle, _weapon] call EFUNC(common,getGunner); +private _turret = _gunner call EFUNC(common,getTurretIndex); // Exit if the unit isn't a player if !([_gunner] call EFUNC(common,isPlayer)) exitWith {}; -private ["_FCSMagazines", "_FCSElevation", "_offset"]; - -_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []]; -_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret]; +private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []]; +private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret]; if !(_magazine in _FCSMagazines) exitWith {}; // GET ELEVATION OFFSET OF CURRENT MAGAZINE -_offset = 0; +private _offset = 0; + { if (_x == _magazine) exitWith { _offset = _FCSElevation select _forEachIndex; }; } forEach _FCSMagazines; - [_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); // Remove the platform velocity -if( (vectorMagnitude velocity _vehicle) > 2) then { - _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle); +if (vectorMagnitude velocity _vehicle > 2) then { + private _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle); + _projectile setVelocity _sumVelocity; }; // Air burst missile - // handle locally only if (!local _gunner) exitWith {}; if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(Airburst)) == 1) then { - private "_zeroing"; - _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle]; + private _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle]; if (_zeroing < 50) exitWith {}; if (_zeroing > 1500) exitWith {}; diff --git a/addons/fcs/functions/fnc_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf index 91150c110d..d2c51a9542 100644 --- a/addons/fcs/functions/fnc_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -1,91 +1,82 @@ /* * Author: KoffeinFlummi - * * Calculates the angle offset necessary to hit the current target. * * Arguments: - * 0: distance to target in meters - * 1: current angle of the turret - * 2: maximum elevation of the turret - * 3: initSpeed of the projectile - * 4: airFriction of the projectile - * 5: maximum timeToLive of the projectile - * 6: simulationStep of the projectile + * 0: distance to target in meters + * 1: current angle of the turret + * 2: maximum elevation of the turret + * 3: initSpeed of the projectile + * 4: airFriction of the projectile + * 5: maximum timeToLive of the projectile + * 6: simulationStep of the projectile * * Return Value: - * offset from the current angle necessary to hit the target + * offset from the current angle necessary to hit the target + * + * Public: No */ - #include "script_component.hpp" + #define PRECISION 0.1 -private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle1", "_angle2", "_it2", "_f1", "_f2", "_temp", "_it1", "_angle"]; - -_distance = _this select 0; -_angleTarget = _this select 1; -_maxElev = _this select 2; -_initSpeed = _this select 3; -_airFriction = _this select 4; -_timeToLive = _this select 5; -_simulationStep = _this select 6; +params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"]; if (_simulationStep == 0) exitWith {_angleTarget}; -FUNC(traceBullet) = { - private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude", "_i"]; - - _distance = _this select 0; - _angleTarget = _this select 1; - _maxElev = _this select 2; - _initSpeed = _this select 3; - _airFriction = _this select 4; - _timeToLive = _this select 5; - _simulationStep = _this select 6; - _angle = _this select 7; +private _fnc_traceBullet = { + params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle"]; _angle = _angle - _angleTarget; _angleTarget = 0; - _posTargetX = (cos _angleTarget) * _distance; - _posTargetY = (sin _angleTarget) * _distance; + private _posTargetX = (cos _angleTarget) * _distance; + private _posTargetY = (sin _angleTarget) * _distance; - _posX = 0; - _posY = 0; + private _posX = 0; + private _posY = 0; - _velocityX = (cos _angle) * _initSpeed; - _velocityY = (sin _angle) * _initSpeed; + private _velocityX = (cos _angle) * _initSpeed; + private _velocityY = (sin _angle) * _initSpeed; // trace the path of the bullet for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do { - _velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2); + private _velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2); + _velocityX = _velocityX + _simulationStep * (_velocityX * _velocityMagnitude * _airFriction); _velocityY = _velocityY + _simulationStep * (_velocityY * _velocityMagnitude * _airFriction - 9.81); + _posX = _posX + _velocityX * _simulationStep; _posY = _posY + _velocityY * _simulationStep; + if (_posX >= _posTargetX) exitWith {}; // bullet passed the target }; - _posY - _posTargetY }; -if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget}; +private _data = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep, _maxElev]; + +if (_data call _fnc_traceBullet < 0) exitWith {_maxElev - _angleTarget}; // Newton Method / Secand Method -_angle1 = _angleTarget; -_angle2 = _maxElev; -_it2 = 0; -_f1 = (_this + [_angle1]) call FUNC(traceBullet); +private _angle1 = _angleTarget; +private _angle2 = _maxElev; +private _it2 = 0; + +_data set [7, _maxElev]; +private _f1 = _data call _fnc_traceBullet; + +if (abs _f1 <= PRECISION) exitWith {0}; + +while {abs _f1 > PRECISION} do { + _data set [7, _angle2]; + private _f2 = _data call _fnc_traceBullet; -if ((abs _f1) <= PRECISION) exitWith {0}; -while {(abs _f1) > PRECISION} do { - _f2 = (_this + [_angle2]) call FUNC(traceBullet); - _temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1); _angle1 = _angle2; - _angle2 = _temp; - _f1 = _f2; - _it2 = _it2+1; -}; -//player globalChat format ["it1: %1 | _angle1: %2 | it2: %3 | _angle2: %4",_it1, _angle-_angleTarget, _it2, _angle2-_angleTarget]; + _angle2 = _angle2 - _f2 * (_angle2 - _angle1) / (_f2 - _f1); -_angle=_angle2; -_angle - _angleTarget + _f1 = _f2; + _it2 = _it2 + 1; +}; + +_angle2 - _angleTarget diff --git a/addons/fcs/functions/fnc_getRange.sqf b/addons/fcs/functions/fnc_getRange.sqf index 3618fa446e..51cdf564df 100644 --- a/addons/fcs/functions/fnc_getRange.sqf +++ b/addons/fcs/functions/fnc_getRange.sqf @@ -1,23 +1,18 @@ /* * Author: commy2 - * - * Read laser distance measurement from engine and update compatible info elements. + * Read laser distance measurement from engine. * * Argument: - * Nothing + * None * * Return value: - * Measured distance (Number) + * Measured distance + * + * Public: No */ - #include "script_component.hpp" -private ["_dlgRangefinder", "_range"]; - disableSerialization; -_dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]; +private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]; -_range = ctrlText (_dlgRangefinder displayCtrl 151); -(_dlgRangefinder displayCtrl 1713151) ctrlSetText _range; - -parseNumber _range +parseNumber ctrlText (_dlgRangefinder displayCtrl 151); diff --git a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf index 899cf0da76..aa166ece12 100644 --- a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf +++ b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf @@ -1,21 +1,32 @@ -// by commy2 +/* + * Author: commy2 + * Handle Air burst ammunition. Called from per frame handler. + * + * Arguments: + * - + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_vehicle", "_projectile", "_zeroing", "_position", "_subMunition"]; - -_vehicle = _this select 0 select 0; -_projectile = _this select 0 select 1; -_zeroing = _this select 0 select 2; +(_this select 0) params ["_vehicle", "_projectile", "_zeroing"]; +// remove pfh if the projectile died before arriving if (isNull _projectile || {!alive _projectile}) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; +// wait if not there if (_projectile distance _vehicle < _zeroing) exitWith {}; -_position = getPosATL _projectile; +// explode +private _position = getPosATL _projectile; + +private _subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"]; -_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"]; _subMunition setPosATL _position; _subMunition setVelocity [0, 0, -10]; diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index cea7196570..a34233bc91 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -1,23 +1,22 @@ /* * Author: KoffeinFlummi - * * Starts watching the target for sideways correction. * * Arguments: - * 0: Vehicle + * 0: Vehicle + * 1: Turret * * Return Value: - * none + * None + * + * Public: No */ - #include "script_component.hpp" -private ["_vehicle", "_turret", "_distance", "_weaponDirection"]; +params ["_vehicle", "_turret"]; -_vehicle = _this select 0; -_turret = _this select 1; - -_distance = call FUNC(getRange); +private _distance = call FUNC(getRange); +call (updateRangeHUD); if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; @@ -28,7 +27,7 @@ if (_distance == 0) then { _distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision }; -_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets +private _weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then { _weaponDirection = eyeDirection _vehicle; @@ -38,8 +37,4 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr _weaponDirection = [1,0,0]; }; -GVAR(Position) = [ - (getPos _vehicle select 0) + _distance * (_weaponDirection select 0), - (getPos _vehicle select 1) + _distance * (_weaponDirection select 1), - (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) -]; +GVAR(Position) = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance); diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 1b2443b44a..ebbd6e3a06 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -1,40 +1,38 @@ /* * Author: KoffeinFlummi - * * Calculates the offsets for all weapons needed to hit the current target. * * Arguments: - * 0: The vehicle + * 0: Vehicle + * 1: Turret * * Return Value: - * none + * None + * + * Public: No */ - #include "script_component.hpp" -private ["_vehicle", "_turret", "_turretConfig", "_distance", "_weapons", "_magazines", "_showHint", "_playSound", "_i"]; +params ["_vehicle", "_turret", "_distance", ["_showHint", false], ["_playSound", true]]; -_vehicle = _this select 0; -_turret = _this select 1; +private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); -_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath); +call (updateRangeHUD); -_distance = call FUNC(getRange); +if (isNil "_distance") then { + _distance = call FUNC(getRange); -_weapons = _vehicle weaponsTurret _turret; -_magazines = _vehicle magazinesTurret _turret; - -if (_distance == 0) then { - _distance = [ - getNumber (_turretConfig >> QGVAR(DistanceInterval)), - getNumber (_turretConfig >> QGVAR(MaxDistance)), - getNumber (_turretConfig >> QGVAR(MinDistance)) - ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision + if (_distance == 0) then { + _distance = [ + getNumber (_turretConfig >> QGVAR(DistanceInterval)), + getNumber (_turretConfig >> QGVAR(MaxDistance)), + getNumber (_turretConfig >> QGVAR(MinDistance)) + ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision + }; }; -private ["_weapon", "_weaponDirection", "_angleTarget"]; -_weapon = _vehicle currentWeaponTurret _turret; -_weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets +private _weapon = _vehicle currentWeaponTurret _turret; +private _weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then { _weaponDirection = eyeDirection _vehicle; @@ -44,169 +42,140 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr _weaponDirection = [1,0,0]; }; -_angleTarget = asin (_weaponDirection select 2); - -if (count _this > 2) then { - if((_this select 2) > -1) then { - _distance = _this select 2; - }; -}; - -if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then { - terminate GVAR(backgroundCalculation); -}; - -private ["_movingAzimuth", "_posTarget", "_velocityTarget"]; +private _angleTarget = asin (_weaponDirection select 2); // MOVING TARGETS -_movingAzimuth = 0; -if (ACE_time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { - // calculate speed of target - _posTarget = [ - (getPos _vehicle select 0) + _distance * (_weaponDirection select 0), - (getPos _vehicle select 1) + _distance * (_weaponDirection select 1), - (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) - ]; - _velocityTarget = [ - ((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(time)), - ((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(time)), - ((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(time)) - ]; +private _movingAzimuth = 0; - private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"]; +if (ACE_time - GVAR(time) > 1 && GVAR(time) != -1 && isNil {_this select 2}) then { + // calculate speed of target + private _posTarget = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance); + private _velocityTarget = (_posTarget vectorDiff GVAR(position)) vectorMultiply (1 / (ACE_time - GVAR(time))); // estimate time to target - _magazineType = _vehicle currentMagazineTurret _turret; - _ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo"); - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed"); - _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); - _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); + private _magazine = _vehicle currentMagazineTurret _turret; + private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); + private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); + private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); + private _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); + private _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulationStep"); + private _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); - _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); if (_initSpeedCoef < 0) then { - _initSpeed = _initSpeed * -_initSpeedCoef; + _initSpeed = _initSpeed * - _initSpeedCoef; }; + if (_initSpeedCoef > 0) then { _initSpeed = _initSpeedCoef; }; if (_simulationStep != 0) then { - private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"]; + private _posX = 0; + private _velocityX = _initSpeed; + private _velocityY = 0; + private _timeToTarget = 0; - _posX = 0; - _velocityX = _initSpeed; - _velocityY = 0; - _timeToTarget = 0; - - for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do { + for "_i" from 1 to (floor (_timeToLive / _simulationStep) + 1) do { _posX = _posX + _velocityX * _simulationStep; + if (_posX >= _distance) exitWith { // bullet passed the target _timeToTarget = _i * _simulationStep; }; - _velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2); + + private _velocityMagnitude = sqrt (_velocityX ^ 2 + _velocityY ^ 2); + _velocityX = _velocityX + _velocityX * _velocityMagnitude * _airFriction * _simulationStep; _velocityY = _velocityY + _velocityY * _velocityMagnitude * _airFriction * _simulationStep - 9.81 * _simulationStep; }; - private ["_posArrival", "_dirArrival"]; - // calculate offsets - _posArrival = [ - (_posTarget select 0) + (_velocityTarget select 0) * _timeToTarget, - (_posTarget select 1) + (_velocityTarget select 1) * _timeToTarget, - (_posTarget select 2) + (_velocityTarget select 2) * _timeToTarget - ]; - - _dirArrival = [ - ((_posArrival select 0) - (getPos _vehicle select 0)) / (_posArrival distance (getPos _vehicle)), - ((_posArrival select 1) - (getPos _vehicle select 1)) / (_posArrival distance (getPos _vehicle)), - ((_posArrival select 2) - (getPos _vehicle select 2)) / (_posArrival distance (getPos _vehicle)) - ]; + private _posArrival = _posTarget vectorAdd (_velocityTarget vectorMultiply _timeToTarget); + private _dirArrival = (_posArrival vectorDiff getPosASL _vehicle) vectorMultiply (1 / (_posArrival vectorDistance getPosASL _vehicle)); _movingAzimuth = ((_dirArrival select 0) atan2 (_dirArrival select 1)) - ((_weaponDirection select 0) atan2 (_weaponDirection select 1)); _angleTarget = asin (_dirArrival select 2); - _distance = floor (_posArrival distance (getPos _vehicle)); + _distance = floor (_posArrival distance (getPosASL _vehicle)); }; }; + GVAR(enabled) = false; GVAR(time) = -1; -private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"]; - // CALCULATE AZIMUTH CORRECTION -_viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret]; -_FCSAzimuth = _movingAzimuth; +private _viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret]; +private _FCSAzimuth = _movingAzimuth; if (_viewDiff != 0) then { _FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth; }; // CALCULATE OFFSET -_FCSMagazines = []; -_FCSElevation = []; +private _FCSMagazines = []; +private _FCSElevation = []; { - private ["_magazine", "_ammoType"]; - _magazine = _x; - _ammoType = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); + private _magazine = _x; + private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); - if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then { - private ["_maxElev", "_initSpeed", "_airFriction", "_offset"]; - - _maxElev = getNumber (_turretConfig >> "maxElev"); - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); - _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); + if !(getText (configFile >> "CfgAmmo" >> _ammo >> "simulation") == "shotMissile") then { + private _maxElev = getNumber (_turretConfig >> "maxElev"); + private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); + private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); { private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"]; _weapon = _x; _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); + { if (_x != "this") then { _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); _weaponMagazines append _muzzleMagazines; }; - } forEach _muzzles; + false + } count _muzzles; + if (_magazine in _weaponMagazines) exitWith { _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); + if (_initSpeedCoef < 0) then { _initSpeed = _initSpeed * -_initSpeedCoef; }; + if (_initSpeedCoef > 0) then { _initSpeed = _initSpeedCoef; }; }; - } forEach _weapons; + false + } count (_vehicle weaponsTurret _turret); - _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; + private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; _offset = parseNumber _offset; - _FCSMagazines = _FCSMagazines + [_magazine]; - _FCSElevation = _FCSElevation + [_offset]; + _FCSMagazines pushBack _magazine; + _FCSElevation pushBack _offset; }; -} forEach _magazines; + false +} count (_vehicle magazinesTurret _turret); -[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic); +[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], _FCSMagazines] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic); -[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic); +[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic); -_showHint = false; -if( (count _this) > 3) then { - _showHint = _this select 3; -}; - -_playSound = true; -if( (count _this) > 3) then { - _playSound = _this select 4; -}; - -if(_playSound) then { +if (_playSound) then { playSound "ACE_Sound_Click"; }; -if(_showHint) then { +if (_showHint) then { [format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured); }; + +//Update the hud's distance display to the new value or "----" if out of range +//(10m fudge because of EFUNC(common,getTargetDistance)) +if (_distance + 10 >= getNumber (_turretConfig >> QGVAR(MaxDistance))) then { + ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText "----"; +} else { + ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber); +}; diff --git a/addons/fcs/functions/fnc_onForceUpdate.sqf b/addons/fcs/functions/fnc_onForceUpdate.sqf index 6f477fd3f6..005a0d7801 100644 --- a/addons/fcs/functions/fnc_onForceUpdate.sqf +++ b/addons/fcs/functions/fnc_onForceUpdate.sqf @@ -1,7 +1,13 @@ #include "script_component.hpp" -if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; +params ["_unit"]; + +private _vehicle = vehicle _unit; + +if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false}; if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; -[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false] call FUNC(keyDown); -[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false, false] call FUNC(keyUp); \ No newline at end of file +private _turret = _unit call EFUNC(common,getTurretIndex); + +[_vehicle, _turret, -1, false] call FUNC(keyDown); +[_vehicle, _turret, -1, false, false] call FUNC(keyUp); diff --git a/addons/fcs/functions/fnc_reset.sqf b/addons/fcs/functions/fnc_reset.sqf index 48e3803c83..dcb1718b3f 100644 --- a/addons/fcs/functions/fnc_reset.sqf +++ b/addons/fcs/functions/fnc_reset.sqf @@ -1,21 +1,19 @@ /* * Author: KoffeinFlummi - * * Resets the FCS to default. * * Arguments: - * 0: Vehicle + * 0: Vehicle + * 1: Turret * * Return Value: * none + * + * Public: No */ - #include "script_component.hpp" -private ["_vehicle", "_turret"]; - -_vehicle = _this select 0; -_turret = _this select 1; +params ["_vehicle", "_turret"]; [_vehicle, format ["%1_%2", QGVAR(Distance), _turret], 0] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], []] call EFUNC(common,setVariablePublic); diff --git a/addons/fcs/functions/fnc_updateRangeHUD.sqf b/addons/fcs/functions/fnc_updateRangeHUD.sqf new file mode 100644 index 0000000000..374254c620 --- /dev/null +++ b/addons/fcs/functions/fnc_updateRangeHUD.sqf @@ -0,0 +1,18 @@ +/* + * Author: commy2 + * Update compatible info elements. + * + * Argument: + * None + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]; + +(_dlgRangefinder displayCtrl 1713151) ctrlSetText ctrlText (_dlgRangefinder displayCtrl 151); diff --git a/addons/fcs/functions/fnc_vehicleInit.sqf b/addons/fcs/functions/fnc_vehicleInit.sqf index 8ac23073f6..901e0477ab 100644 --- a/addons/fcs/functions/fnc_vehicleInit.sqf +++ b/addons/fcs/functions/fnc_vehicleInit.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi, commy2 - * * Checks if a vehicle is equipped with an FCS and if so, adds the fired event handler. Execute on server. * * Arguments: @@ -8,17 +7,15 @@ * * Return Value: * none + * + * Public: No */ - #include "script_component.hpp" -private "_vehicle"; - -_vehicle = _this select 0; +params ["_vehicle"]; { - private "_turretConfig"; - _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath); + private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath); if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) then { _vehicle setVariable [format ["%1_%2", QGVAR(Distance), _x], 0, true]; @@ -42,4 +39,5 @@ _vehicle = _this select 0; _vehicle setVariable [format ["%1_%2", QGVAR(ViewDiff), _x], 0, true]; }; }; -} forEach allTurrets _vehicle; + false +} count allTurrets _vehicle; diff --git a/addons/fcs/functions/script_component.hpp b/addons/fcs/functions/script_component.hpp index 8ada0f7a71..179c66c15e 100644 --- a/addons/fcs/functions/script_component.hpp +++ b/addons/fcs/functions/script_component.hpp @@ -1,12 +1 @@ -#define COMPONENT fcs -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_FCS - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_FCS - #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS -#endif - -#include "\z\ace\addons\main\script_macros.hpp" +#include "\z\ace\addons\fcs\script_component.hpp" \ No newline at end of file diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 3b22cb2262..a302776741 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -28,7 +28,7 @@ [vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call FUNC(keyUp); false }, -[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key +[15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key ["ACE3 Vehicles", QGVAR(adjustRangeUp), localize LSTRING(AdjustRangeUp), { @@ -42,7 +42,7 @@ true }, {false}, -[201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key +[201, [false, false, false]], false] call CBA_fnc_addKeybind; //PageUp Key ["ACE3 Vehicles", QGVAR(adjustRangDown), localize LSTRING(AdjustRangeDown), { @@ -56,4 +56,4 @@ true }, {false}, -[209, [false, false, false]], false] call cba_fnc_addKeybind; //PageDown Key +[209, [false, false, false]], false] call CBA_fnc_addKeybind; //PageDown Key diff --git a/addons/finger/XEH_postInit.sqf b/addons/finger/XEH_postInit.sqf index 5d2fa5a261..394c0cfd3b 100644 --- a/addons/finger/XEH_postInit.sqf +++ b/addons/finger/XEH_postInit.sqf @@ -19,5 +19,5 @@ GVAR(pfeh_id) = -1; _this call FUNC(keyPress); }, {false}, - [41, [true, false, false]], true] call cba_fnc_addKeybind; // Shift + Tilda (hold) + [41, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + Tilda (hold) }] call EFUNC(common,addEventHandler); diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index 5a1e23a278..02c870a519 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -27,7 +27,7 @@ _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise vectorAdd [random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y] }; -_data = [ACE_diagTime, _fingerPos, ([_sourceUnit] call EFUNC(common,getName))]; +_data = [ACE_diagTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName))]; HASH_SET(GVAR(fingersHash), _sourceUnit, _data); if (GVAR(pfeh_id) == -1) then { diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index 88030cc7d9..1a11bf246a 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -63,6 +63,7 @@ Preferências de apontamento Настройки указания пальцем Ajustes de señalado + Nastavení ukázování směru Pointing Enabled @@ -72,6 +73,7 @@ Apontamento ativado Указание пальцем включено Señalado habilitado + Ukazování povoleno Pointing Max Range @@ -81,6 +83,7 @@ Distância máxima do apontamento Макс. дальность Distancia máxima de señalado + Maximální dosah pro ukazování směru Max range between players to show the pointing indicator [default: 4 meters] @@ -90,6 +93,7 @@ Distância máxima entre jogadores para mostrar o apontamento [padrão: 4 metros] Максимальная дальность между игроками для отображения индикатора указания пальцем [по-умолчанию: 4 метра] Distancia máxima entre los jugadores para mostrar el indicador que señala [por defecto: 4 metros] + Maximální vzdálenost mezi hráči pro ukázání směru [výchozí: 4 metry] - + \ No newline at end of file diff --git a/addons/frag/CfgAmmoReflections.hpp b/addons/frag/CfgAmmoReflections.hpp index f59d67f89a..0331dd41dd 100644 --- a/addons/frag/CfgAmmoReflections.hpp +++ b/addons/frag/CfgAmmoReflections.hpp @@ -1,6 +1,65 @@ //CfgAmmoReflections.hpp -#define ACE_EXPLOSION_REFLECTION(range, hit) class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base { indirectHitRange = range; indirectHit = hit; dangerRadiusHit = range*3; suppressionRadiusHit = range*2; }; +#define ACE_EXPLOSION_REFLECTION(range, hit)\ +class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base {\ + indirectHitRange = range;\ + indirectHit = hit;\ + dangerRadiusHit = range*3;\ + suppressionRadiusHit = range*2;\ +} + +#define ACE_EXPLOSION_RANGE(range)\ + ACE_EXPLOSION_REFLECTION(range,10);\ + ACE_EXPLOSION_REFLECTION(range,20);\ + ACE_EXPLOSION_REFLECTION(range,30);\ + ACE_EXPLOSION_REFLECTION(range,40);\ + ACE_EXPLOSION_REFLECTION(range,50);\ + ACE_EXPLOSION_REFLECTION(range,60);\ + ACE_EXPLOSION_REFLECTION(range,70);\ + ACE_EXPLOSION_REFLECTION(range,80);\ + ACE_EXPLOSION_REFLECTION(range,90);\ + ACE_EXPLOSION_REFLECTION(range,100);\ + ACE_EXPLOSION_REFLECTION(range,110);\ + ACE_EXPLOSION_REFLECTION(range,120);\ + ACE_EXPLOSION_REFLECTION(range,130);\ + ACE_EXPLOSION_REFLECTION(range,140);\ + ACE_EXPLOSION_REFLECTION(range,150);\ + ACE_EXPLOSION_REFLECTION(range,160);\ + ACE_EXPLOSION_REFLECTION(range,170);\ + ACE_EXPLOSION_REFLECTION(range,180);\ + ACE_EXPLOSION_REFLECTION(range,190);\ + ACE_EXPLOSION_REFLECTION(range,200);\ + ACE_EXPLOSION_REFLECTION(range,210);\ + ACE_EXPLOSION_REFLECTION(range,220);\ + ACE_EXPLOSION_REFLECTION(range,230);\ + ACE_EXPLOSION_REFLECTION(range,240);\ + ACE_EXPLOSION_REFLECTION(range,250);\ + ACE_EXPLOSION_REFLECTION(range,260);\ + ACE_EXPLOSION_REFLECTION(range,270);\ + ACE_EXPLOSION_REFLECTION(range,280);\ + ACE_EXPLOSION_REFLECTION(range,290);\ + ACE_EXPLOSION_REFLECTION(range,300);\ + ACE_EXPLOSION_REFLECTION(range,310);\ + ACE_EXPLOSION_REFLECTION(range,320);\ + ACE_EXPLOSION_REFLECTION(range,330);\ + ACE_EXPLOSION_REFLECTION(range,340);\ + ACE_EXPLOSION_REFLECTION(range,350);\ + ACE_EXPLOSION_REFLECTION(range,360);\ + ACE_EXPLOSION_REFLECTION(range,370);\ + ACE_EXPLOSION_REFLECTION(range,380);\ + ACE_EXPLOSION_REFLECTION(range,390);\ + ACE_EXPLOSION_REFLECTION(range,400);\ + ACE_EXPLOSION_REFLECTION(range,410);\ + ACE_EXPLOSION_REFLECTION(range,420);\ + ACE_EXPLOSION_REFLECTION(range,430);\ + ACE_EXPLOSION_REFLECTION(range,440);\ + ACE_EXPLOSION_REFLECTION(range,450);\ + ACE_EXPLOSION_REFLECTION(range,460);\ + ACE_EXPLOSION_REFLECTION(range,470);\ + ACE_EXPLOSION_REFLECTION(range,480);\ + ACE_EXPLOSION_REFLECTION(range,490);\ + ACE_EXPLOSION_REFLECTION(range,500) + class ace_explosion_reflection_base : Sh_120mm_HE { CraterWaterEffects = ""; CraterEffects = ""; @@ -19,2504 +78,53 @@ class ace_explosion_reflection_base : Sh_120mm_HE { craterShape = "\A3\weapons_f\empty.p3d"; }; -ACE_EXPLOSION_REFLECTION(2,10); -ACE_EXPLOSION_REFLECTION(2,20); -ACE_EXPLOSION_REFLECTION(2,30); -ACE_EXPLOSION_REFLECTION(2,40); -ACE_EXPLOSION_REFLECTION(2,50); -ACE_EXPLOSION_REFLECTION(2,60); -ACE_EXPLOSION_REFLECTION(2,70); -ACE_EXPLOSION_REFLECTION(2,80); -ACE_EXPLOSION_REFLECTION(2,90); -ACE_EXPLOSION_REFLECTION(2,100); -ACE_EXPLOSION_REFLECTION(2,110); -ACE_EXPLOSION_REFLECTION(2,120); -ACE_EXPLOSION_REFLECTION(2,130); -ACE_EXPLOSION_REFLECTION(2,140); -ACE_EXPLOSION_REFLECTION(2,150); -ACE_EXPLOSION_REFLECTION(2,160); -ACE_EXPLOSION_REFLECTION(2,170); -ACE_EXPLOSION_REFLECTION(2,180); -ACE_EXPLOSION_REFLECTION(2,190); -ACE_EXPLOSION_REFLECTION(2,200); -ACE_EXPLOSION_REFLECTION(2,210); -ACE_EXPLOSION_REFLECTION(2,220); -ACE_EXPLOSION_REFLECTION(2,230); -ACE_EXPLOSION_REFLECTION(2,240); -ACE_EXPLOSION_REFLECTION(2,250); -ACE_EXPLOSION_REFLECTION(2,260); -ACE_EXPLOSION_REFLECTION(2,270); -ACE_EXPLOSION_REFLECTION(2,280); -ACE_EXPLOSION_REFLECTION(2,290); -ACE_EXPLOSION_REFLECTION(2,300); -ACE_EXPLOSION_REFLECTION(2,310); -ACE_EXPLOSION_REFLECTION(2,320); -ACE_EXPLOSION_REFLECTION(2,330); -ACE_EXPLOSION_REFLECTION(2,340); -ACE_EXPLOSION_REFLECTION(2,350); -ACE_EXPLOSION_REFLECTION(2,360); -ACE_EXPLOSION_REFLECTION(2,370); -ACE_EXPLOSION_REFLECTION(2,380); -ACE_EXPLOSION_REFLECTION(2,390); -ACE_EXPLOSION_REFLECTION(2,400); -ACE_EXPLOSION_REFLECTION(2,410); -ACE_EXPLOSION_REFLECTION(2,420); -ACE_EXPLOSION_REFLECTION(2,430); -ACE_EXPLOSION_REFLECTION(2,440); -ACE_EXPLOSION_REFLECTION(2,450); -ACE_EXPLOSION_REFLECTION(2,460); -ACE_EXPLOSION_REFLECTION(2,470); -ACE_EXPLOSION_REFLECTION(2,480); -ACE_EXPLOSION_REFLECTION(2,490); -ACE_EXPLOSION_REFLECTION(2,500); -ACE_EXPLOSION_REFLECTION(4,10); -ACE_EXPLOSION_REFLECTION(4,20); -ACE_EXPLOSION_REFLECTION(4,30); -ACE_EXPLOSION_REFLECTION(4,40); -ACE_EXPLOSION_REFLECTION(4,50); -ACE_EXPLOSION_REFLECTION(4,60); -ACE_EXPLOSION_REFLECTION(4,70); -ACE_EXPLOSION_REFLECTION(4,80); -ACE_EXPLOSION_REFLECTION(4,90); -ACE_EXPLOSION_REFLECTION(4,100); -ACE_EXPLOSION_REFLECTION(4,110); -ACE_EXPLOSION_REFLECTION(4,120); -ACE_EXPLOSION_REFLECTION(4,130); -ACE_EXPLOSION_REFLECTION(4,140); -ACE_EXPLOSION_REFLECTION(4,150); -ACE_EXPLOSION_REFLECTION(4,160); -ACE_EXPLOSION_REFLECTION(4,170); -ACE_EXPLOSION_REFLECTION(4,180); -ACE_EXPLOSION_REFLECTION(4,190); -ACE_EXPLOSION_REFLECTION(4,200); -ACE_EXPLOSION_REFLECTION(4,210); -ACE_EXPLOSION_REFLECTION(4,220); -ACE_EXPLOSION_REFLECTION(4,230); -ACE_EXPLOSION_REFLECTION(4,240); -ACE_EXPLOSION_REFLECTION(4,250); -ACE_EXPLOSION_REFLECTION(4,260); -ACE_EXPLOSION_REFLECTION(4,270); -ACE_EXPLOSION_REFLECTION(4,280); -ACE_EXPLOSION_REFLECTION(4,290); -ACE_EXPLOSION_REFLECTION(4,300); -ACE_EXPLOSION_REFLECTION(4,310); -ACE_EXPLOSION_REFLECTION(4,320); -ACE_EXPLOSION_REFLECTION(4,330); -ACE_EXPLOSION_REFLECTION(4,340); -ACE_EXPLOSION_REFLECTION(4,350); -ACE_EXPLOSION_REFLECTION(4,360); -ACE_EXPLOSION_REFLECTION(4,370); -ACE_EXPLOSION_REFLECTION(4,380); -ACE_EXPLOSION_REFLECTION(4,390); -ACE_EXPLOSION_REFLECTION(4,400); -ACE_EXPLOSION_REFLECTION(4,410); -ACE_EXPLOSION_REFLECTION(4,420); -ACE_EXPLOSION_REFLECTION(4,430); -ACE_EXPLOSION_REFLECTION(4,440); -ACE_EXPLOSION_REFLECTION(4,450); -ACE_EXPLOSION_REFLECTION(4,460); -ACE_EXPLOSION_REFLECTION(4,470); -ACE_EXPLOSION_REFLECTION(4,480); -ACE_EXPLOSION_REFLECTION(4,490); -ACE_EXPLOSION_REFLECTION(4,500); -ACE_EXPLOSION_REFLECTION(6,10); -ACE_EXPLOSION_REFLECTION(6,20); -ACE_EXPLOSION_REFLECTION(6,30); -ACE_EXPLOSION_REFLECTION(6,40); -ACE_EXPLOSION_REFLECTION(6,50); -ACE_EXPLOSION_REFLECTION(6,60); -ACE_EXPLOSION_REFLECTION(6,70); -ACE_EXPLOSION_REFLECTION(6,80); -ACE_EXPLOSION_REFLECTION(6,90); -ACE_EXPLOSION_REFLECTION(6,100); -ACE_EXPLOSION_REFLECTION(6,110); -ACE_EXPLOSION_REFLECTION(6,120); -ACE_EXPLOSION_REFLECTION(6,130); -ACE_EXPLOSION_REFLECTION(6,140); -ACE_EXPLOSION_REFLECTION(6,150); -ACE_EXPLOSION_REFLECTION(6,160); -ACE_EXPLOSION_REFLECTION(6,170); -ACE_EXPLOSION_REFLECTION(6,180); -ACE_EXPLOSION_REFLECTION(6,190); -ACE_EXPLOSION_REFLECTION(6,200); -ACE_EXPLOSION_REFLECTION(6,210); -ACE_EXPLOSION_REFLECTION(6,220); -ACE_EXPLOSION_REFLECTION(6,230); -ACE_EXPLOSION_REFLECTION(6,240); -ACE_EXPLOSION_REFLECTION(6,250); -ACE_EXPLOSION_REFLECTION(6,260); -ACE_EXPLOSION_REFLECTION(6,270); -ACE_EXPLOSION_REFLECTION(6,280); -ACE_EXPLOSION_REFLECTION(6,290); -ACE_EXPLOSION_REFLECTION(6,300); -ACE_EXPLOSION_REFLECTION(6,310); -ACE_EXPLOSION_REFLECTION(6,320); -ACE_EXPLOSION_REFLECTION(6,330); -ACE_EXPLOSION_REFLECTION(6,340); -ACE_EXPLOSION_REFLECTION(6,350); -ACE_EXPLOSION_REFLECTION(6,360); -ACE_EXPLOSION_REFLECTION(6,370); -ACE_EXPLOSION_REFLECTION(6,380); -ACE_EXPLOSION_REFLECTION(6,390); -ACE_EXPLOSION_REFLECTION(6,400); -ACE_EXPLOSION_REFLECTION(6,410); -ACE_EXPLOSION_REFLECTION(6,420); -ACE_EXPLOSION_REFLECTION(6,430); -ACE_EXPLOSION_REFLECTION(6,440); -ACE_EXPLOSION_REFLECTION(6,450); -ACE_EXPLOSION_REFLECTION(6,460); -ACE_EXPLOSION_REFLECTION(6,470); -ACE_EXPLOSION_REFLECTION(6,480); -ACE_EXPLOSION_REFLECTION(6,490); -ACE_EXPLOSION_REFLECTION(6,500); -ACE_EXPLOSION_REFLECTION(8,10); -ACE_EXPLOSION_REFLECTION(8,20); -ACE_EXPLOSION_REFLECTION(8,30); -ACE_EXPLOSION_REFLECTION(8,40); -ACE_EXPLOSION_REFLECTION(8,50); -ACE_EXPLOSION_REFLECTION(8,60); -ACE_EXPLOSION_REFLECTION(8,70); -ACE_EXPLOSION_REFLECTION(8,80); -ACE_EXPLOSION_REFLECTION(8,90); -ACE_EXPLOSION_REFLECTION(8,100); -ACE_EXPLOSION_REFLECTION(8,110); -ACE_EXPLOSION_REFLECTION(8,120); -ACE_EXPLOSION_REFLECTION(8,130); -ACE_EXPLOSION_REFLECTION(8,140); -ACE_EXPLOSION_REFLECTION(8,150); -ACE_EXPLOSION_REFLECTION(8,160); -ACE_EXPLOSION_REFLECTION(8,170); -ACE_EXPLOSION_REFLECTION(8,180); -ACE_EXPLOSION_REFLECTION(8,190); -ACE_EXPLOSION_REFLECTION(8,200); -ACE_EXPLOSION_REFLECTION(8,210); -ACE_EXPLOSION_REFLECTION(8,220); -ACE_EXPLOSION_REFLECTION(8,230); -ACE_EXPLOSION_REFLECTION(8,240); -ACE_EXPLOSION_REFLECTION(8,250); -ACE_EXPLOSION_REFLECTION(8,260); -ACE_EXPLOSION_REFLECTION(8,270); -ACE_EXPLOSION_REFLECTION(8,280); -ACE_EXPLOSION_REFLECTION(8,290); -ACE_EXPLOSION_REFLECTION(8,300); -ACE_EXPLOSION_REFLECTION(8,310); -ACE_EXPLOSION_REFLECTION(8,320); -ACE_EXPLOSION_REFLECTION(8,330); -ACE_EXPLOSION_REFLECTION(8,340); -ACE_EXPLOSION_REFLECTION(8,350); -ACE_EXPLOSION_REFLECTION(8,360); -ACE_EXPLOSION_REFLECTION(8,370); -ACE_EXPLOSION_REFLECTION(8,380); -ACE_EXPLOSION_REFLECTION(8,390); -ACE_EXPLOSION_REFLECTION(8,400); -ACE_EXPLOSION_REFLECTION(8,410); -ACE_EXPLOSION_REFLECTION(8,420); -ACE_EXPLOSION_REFLECTION(8,430); -ACE_EXPLOSION_REFLECTION(8,440); -ACE_EXPLOSION_REFLECTION(8,450); -ACE_EXPLOSION_REFLECTION(8,460); -ACE_EXPLOSION_REFLECTION(8,470); -ACE_EXPLOSION_REFLECTION(8,480); -ACE_EXPLOSION_REFLECTION(8,490); -ACE_EXPLOSION_REFLECTION(8,500); -ACE_EXPLOSION_REFLECTION(10,10); -ACE_EXPLOSION_REFLECTION(10,20); -ACE_EXPLOSION_REFLECTION(10,30); -ACE_EXPLOSION_REFLECTION(10,40); -ACE_EXPLOSION_REFLECTION(10,50); -ACE_EXPLOSION_REFLECTION(10,60); -ACE_EXPLOSION_REFLECTION(10,70); -ACE_EXPLOSION_REFLECTION(10,80); -ACE_EXPLOSION_REFLECTION(10,90); -ACE_EXPLOSION_REFLECTION(10,100); -ACE_EXPLOSION_REFLECTION(10,110); -ACE_EXPLOSION_REFLECTION(10,120); -ACE_EXPLOSION_REFLECTION(10,130); -ACE_EXPLOSION_REFLECTION(10,140); -ACE_EXPLOSION_REFLECTION(10,150); -ACE_EXPLOSION_REFLECTION(10,160); -ACE_EXPLOSION_REFLECTION(10,170); -ACE_EXPLOSION_REFLECTION(10,180); -ACE_EXPLOSION_REFLECTION(10,190); -ACE_EXPLOSION_REFLECTION(10,200); -ACE_EXPLOSION_REFLECTION(10,210); -ACE_EXPLOSION_REFLECTION(10,220); -ACE_EXPLOSION_REFLECTION(10,230); -ACE_EXPLOSION_REFLECTION(10,240); -ACE_EXPLOSION_REFLECTION(10,250); -ACE_EXPLOSION_REFLECTION(10,260); -ACE_EXPLOSION_REFLECTION(10,270); -ACE_EXPLOSION_REFLECTION(10,280); -ACE_EXPLOSION_REFLECTION(10,290); -ACE_EXPLOSION_REFLECTION(10,300); -ACE_EXPLOSION_REFLECTION(10,310); -ACE_EXPLOSION_REFLECTION(10,320); -ACE_EXPLOSION_REFLECTION(10,330); -ACE_EXPLOSION_REFLECTION(10,340); -ACE_EXPLOSION_REFLECTION(10,350); -ACE_EXPLOSION_REFLECTION(10,360); -ACE_EXPLOSION_REFLECTION(10,370); -ACE_EXPLOSION_REFLECTION(10,380); -ACE_EXPLOSION_REFLECTION(10,390); -ACE_EXPLOSION_REFLECTION(10,400); -ACE_EXPLOSION_REFLECTION(10,410); -ACE_EXPLOSION_REFLECTION(10,420); -ACE_EXPLOSION_REFLECTION(10,430); -ACE_EXPLOSION_REFLECTION(10,440); -ACE_EXPLOSION_REFLECTION(10,450); -ACE_EXPLOSION_REFLECTION(10,460); -ACE_EXPLOSION_REFLECTION(10,470); -ACE_EXPLOSION_REFLECTION(10,480); -ACE_EXPLOSION_REFLECTION(10,490); -ACE_EXPLOSION_REFLECTION(10,500); -ACE_EXPLOSION_REFLECTION(12,10); -ACE_EXPLOSION_REFLECTION(12,20); -ACE_EXPLOSION_REFLECTION(12,30); -ACE_EXPLOSION_REFLECTION(12,40); -ACE_EXPLOSION_REFLECTION(12,50); -ACE_EXPLOSION_REFLECTION(12,60); -ACE_EXPLOSION_REFLECTION(12,70); -ACE_EXPLOSION_REFLECTION(12,80); -ACE_EXPLOSION_REFLECTION(12,90); -ACE_EXPLOSION_REFLECTION(12,100); -ACE_EXPLOSION_REFLECTION(12,110); -ACE_EXPLOSION_REFLECTION(12,120); -ACE_EXPLOSION_REFLECTION(12,130); -ACE_EXPLOSION_REFLECTION(12,140); -ACE_EXPLOSION_REFLECTION(12,150); -ACE_EXPLOSION_REFLECTION(12,160); -ACE_EXPLOSION_REFLECTION(12,170); -ACE_EXPLOSION_REFLECTION(12,180); -ACE_EXPLOSION_REFLECTION(12,190); -ACE_EXPLOSION_REFLECTION(12,200); -ACE_EXPLOSION_REFLECTION(12,210); -ACE_EXPLOSION_REFLECTION(12,220); -ACE_EXPLOSION_REFLECTION(12,230); -ACE_EXPLOSION_REFLECTION(12,240); -ACE_EXPLOSION_REFLECTION(12,250); -ACE_EXPLOSION_REFLECTION(12,260); -ACE_EXPLOSION_REFLECTION(12,270); -ACE_EXPLOSION_REFLECTION(12,280); -ACE_EXPLOSION_REFLECTION(12,290); -ACE_EXPLOSION_REFLECTION(12,300); -ACE_EXPLOSION_REFLECTION(12,310); -ACE_EXPLOSION_REFLECTION(12,320); -ACE_EXPLOSION_REFLECTION(12,330); -ACE_EXPLOSION_REFLECTION(12,340); -ACE_EXPLOSION_REFLECTION(12,350); -ACE_EXPLOSION_REFLECTION(12,360); -ACE_EXPLOSION_REFLECTION(12,370); -ACE_EXPLOSION_REFLECTION(12,380); -ACE_EXPLOSION_REFLECTION(12,390); -ACE_EXPLOSION_REFLECTION(12,400); -ACE_EXPLOSION_REFLECTION(12,410); -ACE_EXPLOSION_REFLECTION(12,420); -ACE_EXPLOSION_REFLECTION(12,430); -ACE_EXPLOSION_REFLECTION(12,440); -ACE_EXPLOSION_REFLECTION(12,450); -ACE_EXPLOSION_REFLECTION(12,460); -ACE_EXPLOSION_REFLECTION(12,470); -ACE_EXPLOSION_REFLECTION(12,480); -ACE_EXPLOSION_REFLECTION(12,490); -ACE_EXPLOSION_REFLECTION(12,500); -ACE_EXPLOSION_REFLECTION(14,10); -ACE_EXPLOSION_REFLECTION(14,20); -ACE_EXPLOSION_REFLECTION(14,30); -ACE_EXPLOSION_REFLECTION(14,40); -ACE_EXPLOSION_REFLECTION(14,50); -ACE_EXPLOSION_REFLECTION(14,60); -ACE_EXPLOSION_REFLECTION(14,70); -ACE_EXPLOSION_REFLECTION(14,80); -ACE_EXPLOSION_REFLECTION(14,90); -ACE_EXPLOSION_REFLECTION(14,100); -ACE_EXPLOSION_REFLECTION(14,110); -ACE_EXPLOSION_REFLECTION(14,120); -ACE_EXPLOSION_REFLECTION(14,130); -ACE_EXPLOSION_REFLECTION(14,140); -ACE_EXPLOSION_REFLECTION(14,150); -ACE_EXPLOSION_REFLECTION(14,160); -ACE_EXPLOSION_REFLECTION(14,170); -ACE_EXPLOSION_REFLECTION(14,180); -ACE_EXPLOSION_REFLECTION(14,190); -ACE_EXPLOSION_REFLECTION(14,200); -ACE_EXPLOSION_REFLECTION(14,210); -ACE_EXPLOSION_REFLECTION(14,220); -ACE_EXPLOSION_REFLECTION(14,230); -ACE_EXPLOSION_REFLECTION(14,240); -ACE_EXPLOSION_REFLECTION(14,250); -ACE_EXPLOSION_REFLECTION(14,260); -ACE_EXPLOSION_REFLECTION(14,270); -ACE_EXPLOSION_REFLECTION(14,280); -ACE_EXPLOSION_REFLECTION(14,290); -ACE_EXPLOSION_REFLECTION(14,300); -ACE_EXPLOSION_REFLECTION(14,310); -ACE_EXPLOSION_REFLECTION(14,320); -ACE_EXPLOSION_REFLECTION(14,330); -ACE_EXPLOSION_REFLECTION(14,340); -ACE_EXPLOSION_REFLECTION(14,350); -ACE_EXPLOSION_REFLECTION(14,360); -ACE_EXPLOSION_REFLECTION(14,370); -ACE_EXPLOSION_REFLECTION(14,380); -ACE_EXPLOSION_REFLECTION(14,390); -ACE_EXPLOSION_REFLECTION(14,400); -ACE_EXPLOSION_REFLECTION(14,410); -ACE_EXPLOSION_REFLECTION(14,420); -ACE_EXPLOSION_REFLECTION(14,430); -ACE_EXPLOSION_REFLECTION(14,440); -ACE_EXPLOSION_REFLECTION(14,450); -ACE_EXPLOSION_REFLECTION(14,460); -ACE_EXPLOSION_REFLECTION(14,470); -ACE_EXPLOSION_REFLECTION(14,480); -ACE_EXPLOSION_REFLECTION(14,490); -ACE_EXPLOSION_REFLECTION(14,500); -ACE_EXPLOSION_REFLECTION(16,10); -ACE_EXPLOSION_REFLECTION(16,20); -ACE_EXPLOSION_REFLECTION(16,30); -ACE_EXPLOSION_REFLECTION(16,40); -ACE_EXPLOSION_REFLECTION(16,50); -ACE_EXPLOSION_REFLECTION(16,60); -ACE_EXPLOSION_REFLECTION(16,70); -ACE_EXPLOSION_REFLECTION(16,80); -ACE_EXPLOSION_REFLECTION(16,90); -ACE_EXPLOSION_REFLECTION(16,100); -ACE_EXPLOSION_REFLECTION(16,110); -ACE_EXPLOSION_REFLECTION(16,120); -ACE_EXPLOSION_REFLECTION(16,130); -ACE_EXPLOSION_REFLECTION(16,140); -ACE_EXPLOSION_REFLECTION(16,150); -ACE_EXPLOSION_REFLECTION(16,160); -ACE_EXPLOSION_REFLECTION(16,170); -ACE_EXPLOSION_REFLECTION(16,180); -ACE_EXPLOSION_REFLECTION(16,190); -ACE_EXPLOSION_REFLECTION(16,200); -ACE_EXPLOSION_REFLECTION(16,210); -ACE_EXPLOSION_REFLECTION(16,220); -ACE_EXPLOSION_REFLECTION(16,230); -ACE_EXPLOSION_REFLECTION(16,240); -ACE_EXPLOSION_REFLECTION(16,250); -ACE_EXPLOSION_REFLECTION(16,260); -ACE_EXPLOSION_REFLECTION(16,270); -ACE_EXPLOSION_REFLECTION(16,280); -ACE_EXPLOSION_REFLECTION(16,290); -ACE_EXPLOSION_REFLECTION(16,300); -ACE_EXPLOSION_REFLECTION(16,310); -ACE_EXPLOSION_REFLECTION(16,320); -ACE_EXPLOSION_REFLECTION(16,330); -ACE_EXPLOSION_REFLECTION(16,340); -ACE_EXPLOSION_REFLECTION(16,350); -ACE_EXPLOSION_REFLECTION(16,360); -ACE_EXPLOSION_REFLECTION(16,370); -ACE_EXPLOSION_REFLECTION(16,380); -ACE_EXPLOSION_REFLECTION(16,390); -ACE_EXPLOSION_REFLECTION(16,400); -ACE_EXPLOSION_REFLECTION(16,410); -ACE_EXPLOSION_REFLECTION(16,420); -ACE_EXPLOSION_REFLECTION(16,430); -ACE_EXPLOSION_REFLECTION(16,440); -ACE_EXPLOSION_REFLECTION(16,450); -ACE_EXPLOSION_REFLECTION(16,460); -ACE_EXPLOSION_REFLECTION(16,470); -ACE_EXPLOSION_REFLECTION(16,480); -ACE_EXPLOSION_REFLECTION(16,490); -ACE_EXPLOSION_REFLECTION(16,500); -ACE_EXPLOSION_REFLECTION(18,10); -ACE_EXPLOSION_REFLECTION(18,20); -ACE_EXPLOSION_REFLECTION(18,30); -ACE_EXPLOSION_REFLECTION(18,40); -ACE_EXPLOSION_REFLECTION(18,50); -ACE_EXPLOSION_REFLECTION(18,60); -ACE_EXPLOSION_REFLECTION(18,70); -ACE_EXPLOSION_REFLECTION(18,80); -ACE_EXPLOSION_REFLECTION(18,90); -ACE_EXPLOSION_REFLECTION(18,100); -ACE_EXPLOSION_REFLECTION(18,110); -ACE_EXPLOSION_REFLECTION(18,120); -ACE_EXPLOSION_REFLECTION(18,130); -ACE_EXPLOSION_REFLECTION(18,140); -ACE_EXPLOSION_REFLECTION(18,150); -ACE_EXPLOSION_REFLECTION(18,160); -ACE_EXPLOSION_REFLECTION(18,170); -ACE_EXPLOSION_REFLECTION(18,180); -ACE_EXPLOSION_REFLECTION(18,190); -ACE_EXPLOSION_REFLECTION(18,200); -ACE_EXPLOSION_REFLECTION(18,210); -ACE_EXPLOSION_REFLECTION(18,220); -ACE_EXPLOSION_REFLECTION(18,230); -ACE_EXPLOSION_REFLECTION(18,240); -ACE_EXPLOSION_REFLECTION(18,250); -ACE_EXPLOSION_REFLECTION(18,260); -ACE_EXPLOSION_REFLECTION(18,270); -ACE_EXPLOSION_REFLECTION(18,280); -ACE_EXPLOSION_REFLECTION(18,290); -ACE_EXPLOSION_REFLECTION(18,300); -ACE_EXPLOSION_REFLECTION(18,310); -ACE_EXPLOSION_REFLECTION(18,320); -ACE_EXPLOSION_REFLECTION(18,330); -ACE_EXPLOSION_REFLECTION(18,340); -ACE_EXPLOSION_REFLECTION(18,350); -ACE_EXPLOSION_REFLECTION(18,360); -ACE_EXPLOSION_REFLECTION(18,370); -ACE_EXPLOSION_REFLECTION(18,380); -ACE_EXPLOSION_REFLECTION(18,390); -ACE_EXPLOSION_REFLECTION(18,400); -ACE_EXPLOSION_REFLECTION(18,410); -ACE_EXPLOSION_REFLECTION(18,420); -ACE_EXPLOSION_REFLECTION(18,430); -ACE_EXPLOSION_REFLECTION(18,440); -ACE_EXPLOSION_REFLECTION(18,450); -ACE_EXPLOSION_REFLECTION(18,460); -ACE_EXPLOSION_REFLECTION(18,470); -ACE_EXPLOSION_REFLECTION(18,480); -ACE_EXPLOSION_REFLECTION(18,490); -ACE_EXPLOSION_REFLECTION(18,500); -ACE_EXPLOSION_REFLECTION(20,10); -ACE_EXPLOSION_REFLECTION(20,20); -ACE_EXPLOSION_REFLECTION(20,30); -ACE_EXPLOSION_REFLECTION(20,40); -ACE_EXPLOSION_REFLECTION(20,50); -ACE_EXPLOSION_REFLECTION(20,60); -ACE_EXPLOSION_REFLECTION(20,70); -ACE_EXPLOSION_REFLECTION(20,80); -ACE_EXPLOSION_REFLECTION(20,90); -ACE_EXPLOSION_REFLECTION(20,100); -ACE_EXPLOSION_REFLECTION(20,110); -ACE_EXPLOSION_REFLECTION(20,120); -ACE_EXPLOSION_REFLECTION(20,130); -ACE_EXPLOSION_REFLECTION(20,140); -ACE_EXPLOSION_REFLECTION(20,150); -ACE_EXPLOSION_REFLECTION(20,160); -ACE_EXPLOSION_REFLECTION(20,170); -ACE_EXPLOSION_REFLECTION(20,180); -ACE_EXPLOSION_REFLECTION(20,190); -ACE_EXPLOSION_REFLECTION(20,200); -ACE_EXPLOSION_REFLECTION(20,210); -ACE_EXPLOSION_REFLECTION(20,220); -ACE_EXPLOSION_REFLECTION(20,230); -ACE_EXPLOSION_REFLECTION(20,240); -ACE_EXPLOSION_REFLECTION(20,250); -ACE_EXPLOSION_REFLECTION(20,260); -ACE_EXPLOSION_REFLECTION(20,270); -ACE_EXPLOSION_REFLECTION(20,280); -ACE_EXPLOSION_REFLECTION(20,290); -ACE_EXPLOSION_REFLECTION(20,300); -ACE_EXPLOSION_REFLECTION(20,310); -ACE_EXPLOSION_REFLECTION(20,320); -ACE_EXPLOSION_REFLECTION(20,330); -ACE_EXPLOSION_REFLECTION(20,340); -ACE_EXPLOSION_REFLECTION(20,350); -ACE_EXPLOSION_REFLECTION(20,360); -ACE_EXPLOSION_REFLECTION(20,370); -ACE_EXPLOSION_REFLECTION(20,380); -ACE_EXPLOSION_REFLECTION(20,390); -ACE_EXPLOSION_REFLECTION(20,400); -ACE_EXPLOSION_REFLECTION(20,410); -ACE_EXPLOSION_REFLECTION(20,420); -ACE_EXPLOSION_REFLECTION(20,430); -ACE_EXPLOSION_REFLECTION(20,440); -ACE_EXPLOSION_REFLECTION(20,450); -ACE_EXPLOSION_REFLECTION(20,460); -ACE_EXPLOSION_REFLECTION(20,470); -ACE_EXPLOSION_REFLECTION(20,480); -ACE_EXPLOSION_REFLECTION(20,490); -ACE_EXPLOSION_REFLECTION(20,500); -ACE_EXPLOSION_REFLECTION(22,10); -ACE_EXPLOSION_REFLECTION(22,20); -ACE_EXPLOSION_REFLECTION(22,30); -ACE_EXPLOSION_REFLECTION(22,40); -ACE_EXPLOSION_REFLECTION(22,50); -ACE_EXPLOSION_REFLECTION(22,60); -ACE_EXPLOSION_REFLECTION(22,70); -ACE_EXPLOSION_REFLECTION(22,80); -ACE_EXPLOSION_REFLECTION(22,90); -ACE_EXPLOSION_REFLECTION(22,100); -ACE_EXPLOSION_REFLECTION(22,110); -ACE_EXPLOSION_REFLECTION(22,120); -ACE_EXPLOSION_REFLECTION(22,130); -ACE_EXPLOSION_REFLECTION(22,140); -ACE_EXPLOSION_REFLECTION(22,150); -ACE_EXPLOSION_REFLECTION(22,160); -ACE_EXPLOSION_REFLECTION(22,170); -ACE_EXPLOSION_REFLECTION(22,180); -ACE_EXPLOSION_REFLECTION(22,190); -ACE_EXPLOSION_REFLECTION(22,200); -ACE_EXPLOSION_REFLECTION(22,210); -ACE_EXPLOSION_REFLECTION(22,220); -ACE_EXPLOSION_REFLECTION(22,230); -ACE_EXPLOSION_REFLECTION(22,240); -ACE_EXPLOSION_REFLECTION(22,250); -ACE_EXPLOSION_REFLECTION(22,260); -ACE_EXPLOSION_REFLECTION(22,270); -ACE_EXPLOSION_REFLECTION(22,280); -ACE_EXPLOSION_REFLECTION(22,290); -ACE_EXPLOSION_REFLECTION(22,300); -ACE_EXPLOSION_REFLECTION(22,310); -ACE_EXPLOSION_REFLECTION(22,320); -ACE_EXPLOSION_REFLECTION(22,330); -ACE_EXPLOSION_REFLECTION(22,340); -ACE_EXPLOSION_REFLECTION(22,350); -ACE_EXPLOSION_REFLECTION(22,360); -ACE_EXPLOSION_REFLECTION(22,370); -ACE_EXPLOSION_REFLECTION(22,380); -ACE_EXPLOSION_REFLECTION(22,390); -ACE_EXPLOSION_REFLECTION(22,400); -ACE_EXPLOSION_REFLECTION(22,410); -ACE_EXPLOSION_REFLECTION(22,420); -ACE_EXPLOSION_REFLECTION(22,430); -ACE_EXPLOSION_REFLECTION(22,440); -ACE_EXPLOSION_REFLECTION(22,450); -ACE_EXPLOSION_REFLECTION(22,460); -ACE_EXPLOSION_REFLECTION(22,470); -ACE_EXPLOSION_REFLECTION(22,480); -ACE_EXPLOSION_REFLECTION(22,490); -ACE_EXPLOSION_REFLECTION(22,500); -ACE_EXPLOSION_REFLECTION(24,10); -ACE_EXPLOSION_REFLECTION(24,20); -ACE_EXPLOSION_REFLECTION(24,30); -ACE_EXPLOSION_REFLECTION(24,40); -ACE_EXPLOSION_REFLECTION(24,50); -ACE_EXPLOSION_REFLECTION(24,60); -ACE_EXPLOSION_REFLECTION(24,70); -ACE_EXPLOSION_REFLECTION(24,80); -ACE_EXPLOSION_REFLECTION(24,90); -ACE_EXPLOSION_REFLECTION(24,100); -ACE_EXPLOSION_REFLECTION(24,110); -ACE_EXPLOSION_REFLECTION(24,120); -ACE_EXPLOSION_REFLECTION(24,130); -ACE_EXPLOSION_REFLECTION(24,140); -ACE_EXPLOSION_REFLECTION(24,150); -ACE_EXPLOSION_REFLECTION(24,160); -ACE_EXPLOSION_REFLECTION(24,170); -ACE_EXPLOSION_REFLECTION(24,180); -ACE_EXPLOSION_REFLECTION(24,190); -ACE_EXPLOSION_REFLECTION(24,200); -ACE_EXPLOSION_REFLECTION(24,210); -ACE_EXPLOSION_REFLECTION(24,220); -ACE_EXPLOSION_REFLECTION(24,230); -ACE_EXPLOSION_REFLECTION(24,240); -ACE_EXPLOSION_REFLECTION(24,250); -ACE_EXPLOSION_REFLECTION(24,260); -ACE_EXPLOSION_REFLECTION(24,270); -ACE_EXPLOSION_REFLECTION(24,280); -ACE_EXPLOSION_REFLECTION(24,290); -ACE_EXPLOSION_REFLECTION(24,300); -ACE_EXPLOSION_REFLECTION(24,310); -ACE_EXPLOSION_REFLECTION(24,320); -ACE_EXPLOSION_REFLECTION(24,330); -ACE_EXPLOSION_REFLECTION(24,340); -ACE_EXPLOSION_REFLECTION(24,350); -ACE_EXPLOSION_REFLECTION(24,360); -ACE_EXPLOSION_REFLECTION(24,370); -ACE_EXPLOSION_REFLECTION(24,380); -ACE_EXPLOSION_REFLECTION(24,390); -ACE_EXPLOSION_REFLECTION(24,400); -ACE_EXPLOSION_REFLECTION(24,410); -ACE_EXPLOSION_REFLECTION(24,420); -ACE_EXPLOSION_REFLECTION(24,430); -ACE_EXPLOSION_REFLECTION(24,440); -ACE_EXPLOSION_REFLECTION(24,450); -ACE_EXPLOSION_REFLECTION(24,460); -ACE_EXPLOSION_REFLECTION(24,470); -ACE_EXPLOSION_REFLECTION(24,480); -ACE_EXPLOSION_REFLECTION(24,490); -ACE_EXPLOSION_REFLECTION(24,500); -ACE_EXPLOSION_REFLECTION(26,10); -ACE_EXPLOSION_REFLECTION(26,20); -ACE_EXPLOSION_REFLECTION(26,30); -ACE_EXPLOSION_REFLECTION(26,40); -ACE_EXPLOSION_REFLECTION(26,50); -ACE_EXPLOSION_REFLECTION(26,60); -ACE_EXPLOSION_REFLECTION(26,70); -ACE_EXPLOSION_REFLECTION(26,80); -ACE_EXPLOSION_REFLECTION(26,90); -ACE_EXPLOSION_REFLECTION(26,100); -ACE_EXPLOSION_REFLECTION(26,110); -ACE_EXPLOSION_REFLECTION(26,120); -ACE_EXPLOSION_REFLECTION(26,130); -ACE_EXPLOSION_REFLECTION(26,140); -ACE_EXPLOSION_REFLECTION(26,150); -ACE_EXPLOSION_REFLECTION(26,160); -ACE_EXPLOSION_REFLECTION(26,170); -ACE_EXPLOSION_REFLECTION(26,180); -ACE_EXPLOSION_REFLECTION(26,190); -ACE_EXPLOSION_REFLECTION(26,200); -ACE_EXPLOSION_REFLECTION(26,210); -ACE_EXPLOSION_REFLECTION(26,220); -ACE_EXPLOSION_REFLECTION(26,230); -ACE_EXPLOSION_REFLECTION(26,240); -ACE_EXPLOSION_REFLECTION(26,250); -ACE_EXPLOSION_REFLECTION(26,260); -ACE_EXPLOSION_REFLECTION(26,270); -ACE_EXPLOSION_REFLECTION(26,280); -ACE_EXPLOSION_REFLECTION(26,290); -ACE_EXPLOSION_REFLECTION(26,300); -ACE_EXPLOSION_REFLECTION(26,310); -ACE_EXPLOSION_REFLECTION(26,320); -ACE_EXPLOSION_REFLECTION(26,330); -ACE_EXPLOSION_REFLECTION(26,340); -ACE_EXPLOSION_REFLECTION(26,350); -ACE_EXPLOSION_REFLECTION(26,360); -ACE_EXPLOSION_REFLECTION(26,370); -ACE_EXPLOSION_REFLECTION(26,380); -ACE_EXPLOSION_REFLECTION(26,390); -ACE_EXPLOSION_REFLECTION(26,400); -ACE_EXPLOSION_REFLECTION(26,410); -ACE_EXPLOSION_REFLECTION(26,420); -ACE_EXPLOSION_REFLECTION(26,430); -ACE_EXPLOSION_REFLECTION(26,440); -ACE_EXPLOSION_REFLECTION(26,450); -ACE_EXPLOSION_REFLECTION(26,460); -ACE_EXPLOSION_REFLECTION(26,470); -ACE_EXPLOSION_REFLECTION(26,480); -ACE_EXPLOSION_REFLECTION(26,490); -ACE_EXPLOSION_REFLECTION(26,500); -ACE_EXPLOSION_REFLECTION(28,10); -ACE_EXPLOSION_REFLECTION(28,20); -ACE_EXPLOSION_REFLECTION(28,30); -ACE_EXPLOSION_REFLECTION(28,40); -ACE_EXPLOSION_REFLECTION(28,50); -ACE_EXPLOSION_REFLECTION(28,60); -ACE_EXPLOSION_REFLECTION(28,70); -ACE_EXPLOSION_REFLECTION(28,80); -ACE_EXPLOSION_REFLECTION(28,90); -ACE_EXPLOSION_REFLECTION(28,100); -ACE_EXPLOSION_REFLECTION(28,110); -ACE_EXPLOSION_REFLECTION(28,120); -ACE_EXPLOSION_REFLECTION(28,130); -ACE_EXPLOSION_REFLECTION(28,140); -ACE_EXPLOSION_REFLECTION(28,150); -ACE_EXPLOSION_REFLECTION(28,160); -ACE_EXPLOSION_REFLECTION(28,170); -ACE_EXPLOSION_REFLECTION(28,180); -ACE_EXPLOSION_REFLECTION(28,190); -ACE_EXPLOSION_REFLECTION(28,200); -ACE_EXPLOSION_REFLECTION(28,210); -ACE_EXPLOSION_REFLECTION(28,220); -ACE_EXPLOSION_REFLECTION(28,230); -ACE_EXPLOSION_REFLECTION(28,240); -ACE_EXPLOSION_REFLECTION(28,250); -ACE_EXPLOSION_REFLECTION(28,260); -ACE_EXPLOSION_REFLECTION(28,270); -ACE_EXPLOSION_REFLECTION(28,280); -ACE_EXPLOSION_REFLECTION(28,290); -ACE_EXPLOSION_REFLECTION(28,300); -ACE_EXPLOSION_REFLECTION(28,310); -ACE_EXPLOSION_REFLECTION(28,320); -ACE_EXPLOSION_REFLECTION(28,330); -ACE_EXPLOSION_REFLECTION(28,340); -ACE_EXPLOSION_REFLECTION(28,350); -ACE_EXPLOSION_REFLECTION(28,360); -ACE_EXPLOSION_REFLECTION(28,370); -ACE_EXPLOSION_REFLECTION(28,380); -ACE_EXPLOSION_REFLECTION(28,390); -ACE_EXPLOSION_REFLECTION(28,400); -ACE_EXPLOSION_REFLECTION(28,410); -ACE_EXPLOSION_REFLECTION(28,420); -ACE_EXPLOSION_REFLECTION(28,430); -ACE_EXPLOSION_REFLECTION(28,440); -ACE_EXPLOSION_REFLECTION(28,450); -ACE_EXPLOSION_REFLECTION(28,460); -ACE_EXPLOSION_REFLECTION(28,470); -ACE_EXPLOSION_REFLECTION(28,480); -ACE_EXPLOSION_REFLECTION(28,490); -ACE_EXPLOSION_REFLECTION(28,500); -ACE_EXPLOSION_REFLECTION(30,10); -ACE_EXPLOSION_REFLECTION(30,20); -ACE_EXPLOSION_REFLECTION(30,30); -ACE_EXPLOSION_REFLECTION(30,40); -ACE_EXPLOSION_REFLECTION(30,50); -ACE_EXPLOSION_REFLECTION(30,60); -ACE_EXPLOSION_REFLECTION(30,70); -ACE_EXPLOSION_REFLECTION(30,80); -ACE_EXPLOSION_REFLECTION(30,90); -ACE_EXPLOSION_REFLECTION(30,100); -ACE_EXPLOSION_REFLECTION(30,110); -ACE_EXPLOSION_REFLECTION(30,120); -ACE_EXPLOSION_REFLECTION(30,130); -ACE_EXPLOSION_REFLECTION(30,140); -ACE_EXPLOSION_REFLECTION(30,150); -ACE_EXPLOSION_REFLECTION(30,160); -ACE_EXPLOSION_REFLECTION(30,170); -ACE_EXPLOSION_REFLECTION(30,180); -ACE_EXPLOSION_REFLECTION(30,190); -ACE_EXPLOSION_REFLECTION(30,200); -ACE_EXPLOSION_REFLECTION(30,210); -ACE_EXPLOSION_REFLECTION(30,220); -ACE_EXPLOSION_REFLECTION(30,230); -ACE_EXPLOSION_REFLECTION(30,240); -ACE_EXPLOSION_REFLECTION(30,250); -ACE_EXPLOSION_REFLECTION(30,260); -ACE_EXPLOSION_REFLECTION(30,270); -ACE_EXPLOSION_REFLECTION(30,280); -ACE_EXPLOSION_REFLECTION(30,290); -ACE_EXPLOSION_REFLECTION(30,300); -ACE_EXPLOSION_REFLECTION(30,310); -ACE_EXPLOSION_REFLECTION(30,320); -ACE_EXPLOSION_REFLECTION(30,330); -ACE_EXPLOSION_REFLECTION(30,340); -ACE_EXPLOSION_REFLECTION(30,350); -ACE_EXPLOSION_REFLECTION(30,360); -ACE_EXPLOSION_REFLECTION(30,370); -ACE_EXPLOSION_REFLECTION(30,380); -ACE_EXPLOSION_REFLECTION(30,390); -ACE_EXPLOSION_REFLECTION(30,400); -ACE_EXPLOSION_REFLECTION(30,410); -ACE_EXPLOSION_REFLECTION(30,420); -ACE_EXPLOSION_REFLECTION(30,430); -ACE_EXPLOSION_REFLECTION(30,440); -ACE_EXPLOSION_REFLECTION(30,450); -ACE_EXPLOSION_REFLECTION(30,460); -ACE_EXPLOSION_REFLECTION(30,470); -ACE_EXPLOSION_REFLECTION(30,480); -ACE_EXPLOSION_REFLECTION(30,490); -ACE_EXPLOSION_REFLECTION(30,500); -ACE_EXPLOSION_REFLECTION(32,10); -ACE_EXPLOSION_REFLECTION(32,20); -ACE_EXPLOSION_REFLECTION(32,30); -ACE_EXPLOSION_REFLECTION(32,40); -ACE_EXPLOSION_REFLECTION(32,50); -ACE_EXPLOSION_REFLECTION(32,60); -ACE_EXPLOSION_REFLECTION(32,70); -ACE_EXPLOSION_REFLECTION(32,80); -ACE_EXPLOSION_REFLECTION(32,90); -ACE_EXPLOSION_REFLECTION(32,100); -ACE_EXPLOSION_REFLECTION(32,110); -ACE_EXPLOSION_REFLECTION(32,120); -ACE_EXPLOSION_REFLECTION(32,130); -ACE_EXPLOSION_REFLECTION(32,140); -ACE_EXPLOSION_REFLECTION(32,150); -ACE_EXPLOSION_REFLECTION(32,160); -ACE_EXPLOSION_REFLECTION(32,170); -ACE_EXPLOSION_REFLECTION(32,180); -ACE_EXPLOSION_REFLECTION(32,190); -ACE_EXPLOSION_REFLECTION(32,200); -ACE_EXPLOSION_REFLECTION(32,210); -ACE_EXPLOSION_REFLECTION(32,220); -ACE_EXPLOSION_REFLECTION(32,230); -ACE_EXPLOSION_REFLECTION(32,240); -ACE_EXPLOSION_REFLECTION(32,250); -ACE_EXPLOSION_REFLECTION(32,260); -ACE_EXPLOSION_REFLECTION(32,270); -ACE_EXPLOSION_REFLECTION(32,280); -ACE_EXPLOSION_REFLECTION(32,290); -ACE_EXPLOSION_REFLECTION(32,300); -ACE_EXPLOSION_REFLECTION(32,310); -ACE_EXPLOSION_REFLECTION(32,320); -ACE_EXPLOSION_REFLECTION(32,330); -ACE_EXPLOSION_REFLECTION(32,340); -ACE_EXPLOSION_REFLECTION(32,350); -ACE_EXPLOSION_REFLECTION(32,360); -ACE_EXPLOSION_REFLECTION(32,370); -ACE_EXPLOSION_REFLECTION(32,380); -ACE_EXPLOSION_REFLECTION(32,390); -ACE_EXPLOSION_REFLECTION(32,400); -ACE_EXPLOSION_REFLECTION(32,410); -ACE_EXPLOSION_REFLECTION(32,420); -ACE_EXPLOSION_REFLECTION(32,430); -ACE_EXPLOSION_REFLECTION(32,440); -ACE_EXPLOSION_REFLECTION(32,450); -ACE_EXPLOSION_REFLECTION(32,460); -ACE_EXPLOSION_REFLECTION(32,470); -ACE_EXPLOSION_REFLECTION(32,480); -ACE_EXPLOSION_REFLECTION(32,490); -ACE_EXPLOSION_REFLECTION(32,500); -ACE_EXPLOSION_REFLECTION(34,10); -ACE_EXPLOSION_REFLECTION(34,20); -ACE_EXPLOSION_REFLECTION(34,30); -ACE_EXPLOSION_REFLECTION(34,40); -ACE_EXPLOSION_REFLECTION(34,50); -ACE_EXPLOSION_REFLECTION(34,60); -ACE_EXPLOSION_REFLECTION(34,70); -ACE_EXPLOSION_REFLECTION(34,80); -ACE_EXPLOSION_REFLECTION(34,90); -ACE_EXPLOSION_REFLECTION(34,100); -ACE_EXPLOSION_REFLECTION(34,110); -ACE_EXPLOSION_REFLECTION(34,120); -ACE_EXPLOSION_REFLECTION(34,130); -ACE_EXPLOSION_REFLECTION(34,140); -ACE_EXPLOSION_REFLECTION(34,150); -ACE_EXPLOSION_REFLECTION(34,160); -ACE_EXPLOSION_REFLECTION(34,170); -ACE_EXPLOSION_REFLECTION(34,180); -ACE_EXPLOSION_REFLECTION(34,190); -ACE_EXPLOSION_REFLECTION(34,200); -ACE_EXPLOSION_REFLECTION(34,210); -ACE_EXPLOSION_REFLECTION(34,220); -ACE_EXPLOSION_REFLECTION(34,230); -ACE_EXPLOSION_REFLECTION(34,240); -ACE_EXPLOSION_REFLECTION(34,250); -ACE_EXPLOSION_REFLECTION(34,260); -ACE_EXPLOSION_REFLECTION(34,270); -ACE_EXPLOSION_REFLECTION(34,280); -ACE_EXPLOSION_REFLECTION(34,290); -ACE_EXPLOSION_REFLECTION(34,300); -ACE_EXPLOSION_REFLECTION(34,310); -ACE_EXPLOSION_REFLECTION(34,320); -ACE_EXPLOSION_REFLECTION(34,330); -ACE_EXPLOSION_REFLECTION(34,340); -ACE_EXPLOSION_REFLECTION(34,350); -ACE_EXPLOSION_REFLECTION(34,360); -ACE_EXPLOSION_REFLECTION(34,370); -ACE_EXPLOSION_REFLECTION(34,380); -ACE_EXPLOSION_REFLECTION(34,390); -ACE_EXPLOSION_REFLECTION(34,400); -ACE_EXPLOSION_REFLECTION(34,410); -ACE_EXPLOSION_REFLECTION(34,420); -ACE_EXPLOSION_REFLECTION(34,430); -ACE_EXPLOSION_REFLECTION(34,440); -ACE_EXPLOSION_REFLECTION(34,450); -ACE_EXPLOSION_REFLECTION(34,460); -ACE_EXPLOSION_REFLECTION(34,470); -ACE_EXPLOSION_REFLECTION(34,480); -ACE_EXPLOSION_REFLECTION(34,490); -ACE_EXPLOSION_REFLECTION(34,500); -ACE_EXPLOSION_REFLECTION(36,10); -ACE_EXPLOSION_REFLECTION(36,20); -ACE_EXPLOSION_REFLECTION(36,30); -ACE_EXPLOSION_REFLECTION(36,40); -ACE_EXPLOSION_REFLECTION(36,50); -ACE_EXPLOSION_REFLECTION(36,60); -ACE_EXPLOSION_REFLECTION(36,70); -ACE_EXPLOSION_REFLECTION(36,80); -ACE_EXPLOSION_REFLECTION(36,90); -ACE_EXPLOSION_REFLECTION(36,100); -ACE_EXPLOSION_REFLECTION(36,110); -ACE_EXPLOSION_REFLECTION(36,120); -ACE_EXPLOSION_REFLECTION(36,130); -ACE_EXPLOSION_REFLECTION(36,140); -ACE_EXPLOSION_REFLECTION(36,150); -ACE_EXPLOSION_REFLECTION(36,160); -ACE_EXPLOSION_REFLECTION(36,170); -ACE_EXPLOSION_REFLECTION(36,180); -ACE_EXPLOSION_REFLECTION(36,190); -ACE_EXPLOSION_REFLECTION(36,200); -ACE_EXPLOSION_REFLECTION(36,210); -ACE_EXPLOSION_REFLECTION(36,220); -ACE_EXPLOSION_REFLECTION(36,230); -ACE_EXPLOSION_REFLECTION(36,240); -ACE_EXPLOSION_REFLECTION(36,250); -ACE_EXPLOSION_REFLECTION(36,260); -ACE_EXPLOSION_REFLECTION(36,270); -ACE_EXPLOSION_REFLECTION(36,280); -ACE_EXPLOSION_REFLECTION(36,290); -ACE_EXPLOSION_REFLECTION(36,300); -ACE_EXPLOSION_REFLECTION(36,310); -ACE_EXPLOSION_REFLECTION(36,320); -ACE_EXPLOSION_REFLECTION(36,330); -ACE_EXPLOSION_REFLECTION(36,340); -ACE_EXPLOSION_REFLECTION(36,350); -ACE_EXPLOSION_REFLECTION(36,360); -ACE_EXPLOSION_REFLECTION(36,370); -ACE_EXPLOSION_REFLECTION(36,380); -ACE_EXPLOSION_REFLECTION(36,390); -ACE_EXPLOSION_REFLECTION(36,400); -ACE_EXPLOSION_REFLECTION(36,410); -ACE_EXPLOSION_REFLECTION(36,420); -ACE_EXPLOSION_REFLECTION(36,430); -ACE_EXPLOSION_REFLECTION(36,440); -ACE_EXPLOSION_REFLECTION(36,450); -ACE_EXPLOSION_REFLECTION(36,460); -ACE_EXPLOSION_REFLECTION(36,470); -ACE_EXPLOSION_REFLECTION(36,480); -ACE_EXPLOSION_REFLECTION(36,490); -ACE_EXPLOSION_REFLECTION(36,500); -ACE_EXPLOSION_REFLECTION(38,10); -ACE_EXPLOSION_REFLECTION(38,20); -ACE_EXPLOSION_REFLECTION(38,30); -ACE_EXPLOSION_REFLECTION(38,40); -ACE_EXPLOSION_REFLECTION(38,50); -ACE_EXPLOSION_REFLECTION(38,60); -ACE_EXPLOSION_REFLECTION(38,70); -ACE_EXPLOSION_REFLECTION(38,80); -ACE_EXPLOSION_REFLECTION(38,90); -ACE_EXPLOSION_REFLECTION(38,100); -ACE_EXPLOSION_REFLECTION(38,110); -ACE_EXPLOSION_REFLECTION(38,120); -ACE_EXPLOSION_REFLECTION(38,130); -ACE_EXPLOSION_REFLECTION(38,140); -ACE_EXPLOSION_REFLECTION(38,150); -ACE_EXPLOSION_REFLECTION(38,160); -ACE_EXPLOSION_REFLECTION(38,170); -ACE_EXPLOSION_REFLECTION(38,180); -ACE_EXPLOSION_REFLECTION(38,190); -ACE_EXPLOSION_REFLECTION(38,200); -ACE_EXPLOSION_REFLECTION(38,210); -ACE_EXPLOSION_REFLECTION(38,220); -ACE_EXPLOSION_REFLECTION(38,230); -ACE_EXPLOSION_REFLECTION(38,240); -ACE_EXPLOSION_REFLECTION(38,250); -ACE_EXPLOSION_REFLECTION(38,260); -ACE_EXPLOSION_REFLECTION(38,270); -ACE_EXPLOSION_REFLECTION(38,280); -ACE_EXPLOSION_REFLECTION(38,290); -ACE_EXPLOSION_REFLECTION(38,300); -ACE_EXPLOSION_REFLECTION(38,310); -ACE_EXPLOSION_REFLECTION(38,320); -ACE_EXPLOSION_REFLECTION(38,330); -ACE_EXPLOSION_REFLECTION(38,340); -ACE_EXPLOSION_REFLECTION(38,350); -ACE_EXPLOSION_REFLECTION(38,360); -ACE_EXPLOSION_REFLECTION(38,370); -ACE_EXPLOSION_REFLECTION(38,380); -ACE_EXPLOSION_REFLECTION(38,390); -ACE_EXPLOSION_REFLECTION(38,400); -ACE_EXPLOSION_REFLECTION(38,410); -ACE_EXPLOSION_REFLECTION(38,420); -ACE_EXPLOSION_REFLECTION(38,430); -ACE_EXPLOSION_REFLECTION(38,440); -ACE_EXPLOSION_REFLECTION(38,450); -ACE_EXPLOSION_REFLECTION(38,460); -ACE_EXPLOSION_REFLECTION(38,470); -ACE_EXPLOSION_REFLECTION(38,480); -ACE_EXPLOSION_REFLECTION(38,490); -ACE_EXPLOSION_REFLECTION(38,500); -ACE_EXPLOSION_REFLECTION(40,10); -ACE_EXPLOSION_REFLECTION(40,20); -ACE_EXPLOSION_REFLECTION(40,30); -ACE_EXPLOSION_REFLECTION(40,40); -ACE_EXPLOSION_REFLECTION(40,50); -ACE_EXPLOSION_REFLECTION(40,60); -ACE_EXPLOSION_REFLECTION(40,70); -ACE_EXPLOSION_REFLECTION(40,80); -ACE_EXPLOSION_REFLECTION(40,90); -ACE_EXPLOSION_REFLECTION(40,100); -ACE_EXPLOSION_REFLECTION(40,110); -ACE_EXPLOSION_REFLECTION(40,120); -ACE_EXPLOSION_REFLECTION(40,130); -ACE_EXPLOSION_REFLECTION(40,140); -ACE_EXPLOSION_REFLECTION(40,150); -ACE_EXPLOSION_REFLECTION(40,160); -ACE_EXPLOSION_REFLECTION(40,170); -ACE_EXPLOSION_REFLECTION(40,180); -ACE_EXPLOSION_REFLECTION(40,190); -ACE_EXPLOSION_REFLECTION(40,200); -ACE_EXPLOSION_REFLECTION(40,210); -ACE_EXPLOSION_REFLECTION(40,220); -ACE_EXPLOSION_REFLECTION(40,230); -ACE_EXPLOSION_REFLECTION(40,240); -ACE_EXPLOSION_REFLECTION(40,250); -ACE_EXPLOSION_REFLECTION(40,260); -ACE_EXPLOSION_REFLECTION(40,270); -ACE_EXPLOSION_REFLECTION(40,280); -ACE_EXPLOSION_REFLECTION(40,290); -ACE_EXPLOSION_REFLECTION(40,300); -ACE_EXPLOSION_REFLECTION(40,310); -ACE_EXPLOSION_REFLECTION(40,320); -ACE_EXPLOSION_REFLECTION(40,330); -ACE_EXPLOSION_REFLECTION(40,340); -ACE_EXPLOSION_REFLECTION(40,350); -ACE_EXPLOSION_REFLECTION(40,360); -ACE_EXPLOSION_REFLECTION(40,370); -ACE_EXPLOSION_REFLECTION(40,380); -ACE_EXPLOSION_REFLECTION(40,390); -ACE_EXPLOSION_REFLECTION(40,400); -ACE_EXPLOSION_REFLECTION(40,410); -ACE_EXPLOSION_REFLECTION(40,420); -ACE_EXPLOSION_REFLECTION(40,430); -ACE_EXPLOSION_REFLECTION(40,440); -ACE_EXPLOSION_REFLECTION(40,450); -ACE_EXPLOSION_REFLECTION(40,460); -ACE_EXPLOSION_REFLECTION(40,470); -ACE_EXPLOSION_REFLECTION(40,480); -ACE_EXPLOSION_REFLECTION(40,490); -ACE_EXPLOSION_REFLECTION(40,500); -ACE_EXPLOSION_REFLECTION(42,10); -ACE_EXPLOSION_REFLECTION(42,20); -ACE_EXPLOSION_REFLECTION(42,30); -ACE_EXPLOSION_REFLECTION(42,40); -ACE_EXPLOSION_REFLECTION(42,50); -ACE_EXPLOSION_REFLECTION(42,60); -ACE_EXPLOSION_REFLECTION(42,70); -ACE_EXPLOSION_REFLECTION(42,80); -ACE_EXPLOSION_REFLECTION(42,90); -ACE_EXPLOSION_REFLECTION(42,100); -ACE_EXPLOSION_REFLECTION(42,110); -ACE_EXPLOSION_REFLECTION(42,120); -ACE_EXPLOSION_REFLECTION(42,130); -ACE_EXPLOSION_REFLECTION(42,140); -ACE_EXPLOSION_REFLECTION(42,150); -ACE_EXPLOSION_REFLECTION(42,160); -ACE_EXPLOSION_REFLECTION(42,170); -ACE_EXPLOSION_REFLECTION(42,180); -ACE_EXPLOSION_REFLECTION(42,190); -ACE_EXPLOSION_REFLECTION(42,200); -ACE_EXPLOSION_REFLECTION(42,210); -ACE_EXPLOSION_REFLECTION(42,220); -ACE_EXPLOSION_REFLECTION(42,230); -ACE_EXPLOSION_REFLECTION(42,240); -ACE_EXPLOSION_REFLECTION(42,250); -ACE_EXPLOSION_REFLECTION(42,260); -ACE_EXPLOSION_REFLECTION(42,270); -ACE_EXPLOSION_REFLECTION(42,280); -ACE_EXPLOSION_REFLECTION(42,290); -ACE_EXPLOSION_REFLECTION(42,300); -ACE_EXPLOSION_REFLECTION(42,310); -ACE_EXPLOSION_REFLECTION(42,320); -ACE_EXPLOSION_REFLECTION(42,330); -ACE_EXPLOSION_REFLECTION(42,340); -ACE_EXPLOSION_REFLECTION(42,350); -ACE_EXPLOSION_REFLECTION(42,360); -ACE_EXPLOSION_REFLECTION(42,370); -ACE_EXPLOSION_REFLECTION(42,380); -ACE_EXPLOSION_REFLECTION(42,390); -ACE_EXPLOSION_REFLECTION(42,400); -ACE_EXPLOSION_REFLECTION(42,410); -ACE_EXPLOSION_REFLECTION(42,420); -ACE_EXPLOSION_REFLECTION(42,430); -ACE_EXPLOSION_REFLECTION(42,440); -ACE_EXPLOSION_REFLECTION(42,450); -ACE_EXPLOSION_REFLECTION(42,460); -ACE_EXPLOSION_REFLECTION(42,470); -ACE_EXPLOSION_REFLECTION(42,480); -ACE_EXPLOSION_REFLECTION(42,490); -ACE_EXPLOSION_REFLECTION(42,500); -ACE_EXPLOSION_REFLECTION(44,10); -ACE_EXPLOSION_REFLECTION(44,20); -ACE_EXPLOSION_REFLECTION(44,30); -ACE_EXPLOSION_REFLECTION(44,40); -ACE_EXPLOSION_REFLECTION(44,50); -ACE_EXPLOSION_REFLECTION(44,60); -ACE_EXPLOSION_REFLECTION(44,70); -ACE_EXPLOSION_REFLECTION(44,80); -ACE_EXPLOSION_REFLECTION(44,90); -ACE_EXPLOSION_REFLECTION(44,100); -ACE_EXPLOSION_REFLECTION(44,110); -ACE_EXPLOSION_REFLECTION(44,120); -ACE_EXPLOSION_REFLECTION(44,130); -ACE_EXPLOSION_REFLECTION(44,140); -ACE_EXPLOSION_REFLECTION(44,150); -ACE_EXPLOSION_REFLECTION(44,160); -ACE_EXPLOSION_REFLECTION(44,170); -ACE_EXPLOSION_REFLECTION(44,180); -ACE_EXPLOSION_REFLECTION(44,190); -ACE_EXPLOSION_REFLECTION(44,200); -ACE_EXPLOSION_REFLECTION(44,210); -ACE_EXPLOSION_REFLECTION(44,220); -ACE_EXPLOSION_REFLECTION(44,230); -ACE_EXPLOSION_REFLECTION(44,240); -ACE_EXPLOSION_REFLECTION(44,250); -ACE_EXPLOSION_REFLECTION(44,260); -ACE_EXPLOSION_REFLECTION(44,270); -ACE_EXPLOSION_REFLECTION(44,280); -ACE_EXPLOSION_REFLECTION(44,290); -ACE_EXPLOSION_REFLECTION(44,300); -ACE_EXPLOSION_REFLECTION(44,310); -ACE_EXPLOSION_REFLECTION(44,320); -ACE_EXPLOSION_REFLECTION(44,330); -ACE_EXPLOSION_REFLECTION(44,340); -ACE_EXPLOSION_REFLECTION(44,350); -ACE_EXPLOSION_REFLECTION(44,360); -ACE_EXPLOSION_REFLECTION(44,370); -ACE_EXPLOSION_REFLECTION(44,380); -ACE_EXPLOSION_REFLECTION(44,390); -ACE_EXPLOSION_REFLECTION(44,400); -ACE_EXPLOSION_REFLECTION(44,410); -ACE_EXPLOSION_REFLECTION(44,420); -ACE_EXPLOSION_REFLECTION(44,430); -ACE_EXPLOSION_REFLECTION(44,440); -ACE_EXPLOSION_REFLECTION(44,450); -ACE_EXPLOSION_REFLECTION(44,460); -ACE_EXPLOSION_REFLECTION(44,470); -ACE_EXPLOSION_REFLECTION(44,480); -ACE_EXPLOSION_REFLECTION(44,490); -ACE_EXPLOSION_REFLECTION(44,500); -ACE_EXPLOSION_REFLECTION(46,10); -ACE_EXPLOSION_REFLECTION(46,20); -ACE_EXPLOSION_REFLECTION(46,30); -ACE_EXPLOSION_REFLECTION(46,40); -ACE_EXPLOSION_REFLECTION(46,50); -ACE_EXPLOSION_REFLECTION(46,60); -ACE_EXPLOSION_REFLECTION(46,70); -ACE_EXPLOSION_REFLECTION(46,80); -ACE_EXPLOSION_REFLECTION(46,90); -ACE_EXPLOSION_REFLECTION(46,100); -ACE_EXPLOSION_REFLECTION(46,110); -ACE_EXPLOSION_REFLECTION(46,120); -ACE_EXPLOSION_REFLECTION(46,130); -ACE_EXPLOSION_REFLECTION(46,140); -ACE_EXPLOSION_REFLECTION(46,150); -ACE_EXPLOSION_REFLECTION(46,160); -ACE_EXPLOSION_REFLECTION(46,170); -ACE_EXPLOSION_REFLECTION(46,180); -ACE_EXPLOSION_REFLECTION(46,190); -ACE_EXPLOSION_REFLECTION(46,200); -ACE_EXPLOSION_REFLECTION(46,210); -ACE_EXPLOSION_REFLECTION(46,220); -ACE_EXPLOSION_REFLECTION(46,230); -ACE_EXPLOSION_REFLECTION(46,240); -ACE_EXPLOSION_REFLECTION(46,250); -ACE_EXPLOSION_REFLECTION(46,260); -ACE_EXPLOSION_REFLECTION(46,270); -ACE_EXPLOSION_REFLECTION(46,280); -ACE_EXPLOSION_REFLECTION(46,290); -ACE_EXPLOSION_REFLECTION(46,300); -ACE_EXPLOSION_REFLECTION(46,310); -ACE_EXPLOSION_REFLECTION(46,320); -ACE_EXPLOSION_REFLECTION(46,330); -ACE_EXPLOSION_REFLECTION(46,340); -ACE_EXPLOSION_REFLECTION(46,350); -ACE_EXPLOSION_REFLECTION(46,360); -ACE_EXPLOSION_REFLECTION(46,370); -ACE_EXPLOSION_REFLECTION(46,380); -ACE_EXPLOSION_REFLECTION(46,390); -ACE_EXPLOSION_REFLECTION(46,400); -ACE_EXPLOSION_REFLECTION(46,410); -ACE_EXPLOSION_REFLECTION(46,420); -ACE_EXPLOSION_REFLECTION(46,430); -ACE_EXPLOSION_REFLECTION(46,440); -ACE_EXPLOSION_REFLECTION(46,450); -ACE_EXPLOSION_REFLECTION(46,460); -ACE_EXPLOSION_REFLECTION(46,470); -ACE_EXPLOSION_REFLECTION(46,480); -ACE_EXPLOSION_REFLECTION(46,490); -ACE_EXPLOSION_REFLECTION(46,500); -ACE_EXPLOSION_REFLECTION(48,10); -ACE_EXPLOSION_REFLECTION(48,20); -ACE_EXPLOSION_REFLECTION(48,30); -ACE_EXPLOSION_REFLECTION(48,40); -ACE_EXPLOSION_REFLECTION(48,50); -ACE_EXPLOSION_REFLECTION(48,60); -ACE_EXPLOSION_REFLECTION(48,70); -ACE_EXPLOSION_REFLECTION(48,80); -ACE_EXPLOSION_REFLECTION(48,90); -ACE_EXPLOSION_REFLECTION(48,100); -ACE_EXPLOSION_REFLECTION(48,110); -ACE_EXPLOSION_REFLECTION(48,120); -ACE_EXPLOSION_REFLECTION(48,130); -ACE_EXPLOSION_REFLECTION(48,140); -ACE_EXPLOSION_REFLECTION(48,150); -ACE_EXPLOSION_REFLECTION(48,160); -ACE_EXPLOSION_REFLECTION(48,170); -ACE_EXPLOSION_REFLECTION(48,180); -ACE_EXPLOSION_REFLECTION(48,190); -ACE_EXPLOSION_REFLECTION(48,200); -ACE_EXPLOSION_REFLECTION(48,210); -ACE_EXPLOSION_REFLECTION(48,220); -ACE_EXPLOSION_REFLECTION(48,230); -ACE_EXPLOSION_REFLECTION(48,240); -ACE_EXPLOSION_REFLECTION(48,250); -ACE_EXPLOSION_REFLECTION(48,260); -ACE_EXPLOSION_REFLECTION(48,270); -ACE_EXPLOSION_REFLECTION(48,280); -ACE_EXPLOSION_REFLECTION(48,290); -ACE_EXPLOSION_REFLECTION(48,300); -ACE_EXPLOSION_REFLECTION(48,310); -ACE_EXPLOSION_REFLECTION(48,320); -ACE_EXPLOSION_REFLECTION(48,330); -ACE_EXPLOSION_REFLECTION(48,340); -ACE_EXPLOSION_REFLECTION(48,350); -ACE_EXPLOSION_REFLECTION(48,360); -ACE_EXPLOSION_REFLECTION(48,370); -ACE_EXPLOSION_REFLECTION(48,380); -ACE_EXPLOSION_REFLECTION(48,390); -ACE_EXPLOSION_REFLECTION(48,400); -ACE_EXPLOSION_REFLECTION(48,410); -ACE_EXPLOSION_REFLECTION(48,420); -ACE_EXPLOSION_REFLECTION(48,430); -ACE_EXPLOSION_REFLECTION(48,440); -ACE_EXPLOSION_REFLECTION(48,450); -ACE_EXPLOSION_REFLECTION(48,460); -ACE_EXPLOSION_REFLECTION(48,470); -ACE_EXPLOSION_REFLECTION(48,480); -ACE_EXPLOSION_REFLECTION(48,490); -ACE_EXPLOSION_REFLECTION(48,500); -ACE_EXPLOSION_REFLECTION(50,10); -ACE_EXPLOSION_REFLECTION(50,20); -ACE_EXPLOSION_REFLECTION(50,30); -ACE_EXPLOSION_REFLECTION(50,40); -ACE_EXPLOSION_REFLECTION(50,50); -ACE_EXPLOSION_REFLECTION(50,60); -ACE_EXPLOSION_REFLECTION(50,70); -ACE_EXPLOSION_REFLECTION(50,80); -ACE_EXPLOSION_REFLECTION(50,90); -ACE_EXPLOSION_REFLECTION(50,100); -ACE_EXPLOSION_REFLECTION(50,110); -ACE_EXPLOSION_REFLECTION(50,120); -ACE_EXPLOSION_REFLECTION(50,130); -ACE_EXPLOSION_REFLECTION(50,140); -ACE_EXPLOSION_REFLECTION(50,150); -ACE_EXPLOSION_REFLECTION(50,160); -ACE_EXPLOSION_REFLECTION(50,170); -ACE_EXPLOSION_REFLECTION(50,180); -ACE_EXPLOSION_REFLECTION(50,190); -ACE_EXPLOSION_REFLECTION(50,200); -ACE_EXPLOSION_REFLECTION(50,210); -ACE_EXPLOSION_REFLECTION(50,220); -ACE_EXPLOSION_REFLECTION(50,230); -ACE_EXPLOSION_REFLECTION(50,240); -ACE_EXPLOSION_REFLECTION(50,250); -ACE_EXPLOSION_REFLECTION(50,260); -ACE_EXPLOSION_REFLECTION(50,270); -ACE_EXPLOSION_REFLECTION(50,280); -ACE_EXPLOSION_REFLECTION(50,290); -ACE_EXPLOSION_REFLECTION(50,300); -ACE_EXPLOSION_REFLECTION(50,310); -ACE_EXPLOSION_REFLECTION(50,320); -ACE_EXPLOSION_REFLECTION(50,330); -ACE_EXPLOSION_REFLECTION(50,340); -ACE_EXPLOSION_REFLECTION(50,350); -ACE_EXPLOSION_REFLECTION(50,360); -ACE_EXPLOSION_REFLECTION(50,370); -ACE_EXPLOSION_REFLECTION(50,380); -ACE_EXPLOSION_REFLECTION(50,390); -ACE_EXPLOSION_REFLECTION(50,400); -ACE_EXPLOSION_REFLECTION(50,410); -ACE_EXPLOSION_REFLECTION(50,420); -ACE_EXPLOSION_REFLECTION(50,430); -ACE_EXPLOSION_REFLECTION(50,440); -ACE_EXPLOSION_REFLECTION(50,450); -ACE_EXPLOSION_REFLECTION(50,460); -ACE_EXPLOSION_REFLECTION(50,470); -ACE_EXPLOSION_REFLECTION(50,480); -ACE_EXPLOSION_REFLECTION(50,490); -ACE_EXPLOSION_REFLECTION(50,500); -ACE_EXPLOSION_REFLECTION(52,10); -ACE_EXPLOSION_REFLECTION(52,20); -ACE_EXPLOSION_REFLECTION(52,30); -ACE_EXPLOSION_REFLECTION(52,40); -ACE_EXPLOSION_REFLECTION(52,50); -ACE_EXPLOSION_REFLECTION(52,60); -ACE_EXPLOSION_REFLECTION(52,70); -ACE_EXPLOSION_REFLECTION(52,80); -ACE_EXPLOSION_REFLECTION(52,90); -ACE_EXPLOSION_REFLECTION(52,100); -ACE_EXPLOSION_REFLECTION(52,110); -ACE_EXPLOSION_REFLECTION(52,120); -ACE_EXPLOSION_REFLECTION(52,130); -ACE_EXPLOSION_REFLECTION(52,140); -ACE_EXPLOSION_REFLECTION(52,150); -ACE_EXPLOSION_REFLECTION(52,160); -ACE_EXPLOSION_REFLECTION(52,170); -ACE_EXPLOSION_REFLECTION(52,180); -ACE_EXPLOSION_REFLECTION(52,190); -ACE_EXPLOSION_REFLECTION(52,200); -ACE_EXPLOSION_REFLECTION(52,210); -ACE_EXPLOSION_REFLECTION(52,220); -ACE_EXPLOSION_REFLECTION(52,230); -ACE_EXPLOSION_REFLECTION(52,240); -ACE_EXPLOSION_REFLECTION(52,250); -ACE_EXPLOSION_REFLECTION(52,260); -ACE_EXPLOSION_REFLECTION(52,270); -ACE_EXPLOSION_REFLECTION(52,280); -ACE_EXPLOSION_REFLECTION(52,290); -ACE_EXPLOSION_REFLECTION(52,300); -ACE_EXPLOSION_REFLECTION(52,310); -ACE_EXPLOSION_REFLECTION(52,320); -ACE_EXPLOSION_REFLECTION(52,330); -ACE_EXPLOSION_REFLECTION(52,340); -ACE_EXPLOSION_REFLECTION(52,350); -ACE_EXPLOSION_REFLECTION(52,360); -ACE_EXPLOSION_REFLECTION(52,370); -ACE_EXPLOSION_REFLECTION(52,380); -ACE_EXPLOSION_REFLECTION(52,390); -ACE_EXPLOSION_REFLECTION(52,400); -ACE_EXPLOSION_REFLECTION(52,410); -ACE_EXPLOSION_REFLECTION(52,420); -ACE_EXPLOSION_REFLECTION(52,430); -ACE_EXPLOSION_REFLECTION(52,440); -ACE_EXPLOSION_REFLECTION(52,450); -ACE_EXPLOSION_REFLECTION(52,460); -ACE_EXPLOSION_REFLECTION(52,470); -ACE_EXPLOSION_REFLECTION(52,480); -ACE_EXPLOSION_REFLECTION(52,490); -ACE_EXPLOSION_REFLECTION(52,500); -ACE_EXPLOSION_REFLECTION(54,10); -ACE_EXPLOSION_REFLECTION(54,20); -ACE_EXPLOSION_REFLECTION(54,30); -ACE_EXPLOSION_REFLECTION(54,40); -ACE_EXPLOSION_REFLECTION(54,50); -ACE_EXPLOSION_REFLECTION(54,60); -ACE_EXPLOSION_REFLECTION(54,70); -ACE_EXPLOSION_REFLECTION(54,80); -ACE_EXPLOSION_REFLECTION(54,90); -ACE_EXPLOSION_REFLECTION(54,100); -ACE_EXPLOSION_REFLECTION(54,110); -ACE_EXPLOSION_REFLECTION(54,120); -ACE_EXPLOSION_REFLECTION(54,130); -ACE_EXPLOSION_REFLECTION(54,140); -ACE_EXPLOSION_REFLECTION(54,150); -ACE_EXPLOSION_REFLECTION(54,160); -ACE_EXPLOSION_REFLECTION(54,170); -ACE_EXPLOSION_REFLECTION(54,180); -ACE_EXPLOSION_REFLECTION(54,190); -ACE_EXPLOSION_REFLECTION(54,200); -ACE_EXPLOSION_REFLECTION(54,210); -ACE_EXPLOSION_REFLECTION(54,220); -ACE_EXPLOSION_REFLECTION(54,230); -ACE_EXPLOSION_REFLECTION(54,240); -ACE_EXPLOSION_REFLECTION(54,250); -ACE_EXPLOSION_REFLECTION(54,260); -ACE_EXPLOSION_REFLECTION(54,270); -ACE_EXPLOSION_REFLECTION(54,280); -ACE_EXPLOSION_REFLECTION(54,290); -ACE_EXPLOSION_REFLECTION(54,300); -ACE_EXPLOSION_REFLECTION(54,310); -ACE_EXPLOSION_REFLECTION(54,320); -ACE_EXPLOSION_REFLECTION(54,330); -ACE_EXPLOSION_REFLECTION(54,340); -ACE_EXPLOSION_REFLECTION(54,350); -ACE_EXPLOSION_REFLECTION(54,360); -ACE_EXPLOSION_REFLECTION(54,370); -ACE_EXPLOSION_REFLECTION(54,380); -ACE_EXPLOSION_REFLECTION(54,390); -ACE_EXPLOSION_REFLECTION(54,400); -ACE_EXPLOSION_REFLECTION(54,410); -ACE_EXPLOSION_REFLECTION(54,420); -ACE_EXPLOSION_REFLECTION(54,430); -ACE_EXPLOSION_REFLECTION(54,440); -ACE_EXPLOSION_REFLECTION(54,450); -ACE_EXPLOSION_REFLECTION(54,460); -ACE_EXPLOSION_REFLECTION(54,470); -ACE_EXPLOSION_REFLECTION(54,480); -ACE_EXPLOSION_REFLECTION(54,490); -ACE_EXPLOSION_REFLECTION(54,500); -ACE_EXPLOSION_REFLECTION(56,10); -ACE_EXPLOSION_REFLECTION(56,20); -ACE_EXPLOSION_REFLECTION(56,30); -ACE_EXPLOSION_REFLECTION(56,40); -ACE_EXPLOSION_REFLECTION(56,50); -ACE_EXPLOSION_REFLECTION(56,60); -ACE_EXPLOSION_REFLECTION(56,70); -ACE_EXPLOSION_REFLECTION(56,80); -ACE_EXPLOSION_REFLECTION(56,90); -ACE_EXPLOSION_REFLECTION(56,100); -ACE_EXPLOSION_REFLECTION(56,110); -ACE_EXPLOSION_REFLECTION(56,120); -ACE_EXPLOSION_REFLECTION(56,130); -ACE_EXPLOSION_REFLECTION(56,140); -ACE_EXPLOSION_REFLECTION(56,150); -ACE_EXPLOSION_REFLECTION(56,160); -ACE_EXPLOSION_REFLECTION(56,170); -ACE_EXPLOSION_REFLECTION(56,180); -ACE_EXPLOSION_REFLECTION(56,190); -ACE_EXPLOSION_REFLECTION(56,200); -ACE_EXPLOSION_REFLECTION(56,210); -ACE_EXPLOSION_REFLECTION(56,220); -ACE_EXPLOSION_REFLECTION(56,230); -ACE_EXPLOSION_REFLECTION(56,240); -ACE_EXPLOSION_REFLECTION(56,250); -ACE_EXPLOSION_REFLECTION(56,260); -ACE_EXPLOSION_REFLECTION(56,270); -ACE_EXPLOSION_REFLECTION(56,280); -ACE_EXPLOSION_REFLECTION(56,290); -ACE_EXPLOSION_REFLECTION(56,300); -ACE_EXPLOSION_REFLECTION(56,310); -ACE_EXPLOSION_REFLECTION(56,320); -ACE_EXPLOSION_REFLECTION(56,330); -ACE_EXPLOSION_REFLECTION(56,340); -ACE_EXPLOSION_REFLECTION(56,350); -ACE_EXPLOSION_REFLECTION(56,360); -ACE_EXPLOSION_REFLECTION(56,370); -ACE_EXPLOSION_REFLECTION(56,380); -ACE_EXPLOSION_REFLECTION(56,390); -ACE_EXPLOSION_REFLECTION(56,400); -ACE_EXPLOSION_REFLECTION(56,410); -ACE_EXPLOSION_REFLECTION(56,420); -ACE_EXPLOSION_REFLECTION(56,430); -ACE_EXPLOSION_REFLECTION(56,440); -ACE_EXPLOSION_REFLECTION(56,450); -ACE_EXPLOSION_REFLECTION(56,460); -ACE_EXPLOSION_REFLECTION(56,470); -ACE_EXPLOSION_REFLECTION(56,480); -ACE_EXPLOSION_REFLECTION(56,490); -ACE_EXPLOSION_REFLECTION(56,500); -ACE_EXPLOSION_REFLECTION(58,10); -ACE_EXPLOSION_REFLECTION(58,20); -ACE_EXPLOSION_REFLECTION(58,30); -ACE_EXPLOSION_REFLECTION(58,40); -ACE_EXPLOSION_REFLECTION(58,50); -ACE_EXPLOSION_REFLECTION(58,60); -ACE_EXPLOSION_REFLECTION(58,70); -ACE_EXPLOSION_REFLECTION(58,80); -ACE_EXPLOSION_REFLECTION(58,90); -ACE_EXPLOSION_REFLECTION(58,100); -ACE_EXPLOSION_REFLECTION(58,110); -ACE_EXPLOSION_REFLECTION(58,120); -ACE_EXPLOSION_REFLECTION(58,130); -ACE_EXPLOSION_REFLECTION(58,140); -ACE_EXPLOSION_REFLECTION(58,150); -ACE_EXPLOSION_REFLECTION(58,160); -ACE_EXPLOSION_REFLECTION(58,170); -ACE_EXPLOSION_REFLECTION(58,180); -ACE_EXPLOSION_REFLECTION(58,190); -ACE_EXPLOSION_REFLECTION(58,200); -ACE_EXPLOSION_REFLECTION(58,210); -ACE_EXPLOSION_REFLECTION(58,220); -ACE_EXPLOSION_REFLECTION(58,230); -ACE_EXPLOSION_REFLECTION(58,240); -ACE_EXPLOSION_REFLECTION(58,250); -ACE_EXPLOSION_REFLECTION(58,260); -ACE_EXPLOSION_REFLECTION(58,270); -ACE_EXPLOSION_REFLECTION(58,280); -ACE_EXPLOSION_REFLECTION(58,290); -ACE_EXPLOSION_REFLECTION(58,300); -ACE_EXPLOSION_REFLECTION(58,310); -ACE_EXPLOSION_REFLECTION(58,320); -ACE_EXPLOSION_REFLECTION(58,330); -ACE_EXPLOSION_REFLECTION(58,340); -ACE_EXPLOSION_REFLECTION(58,350); -ACE_EXPLOSION_REFLECTION(58,360); -ACE_EXPLOSION_REFLECTION(58,370); -ACE_EXPLOSION_REFLECTION(58,380); -ACE_EXPLOSION_REFLECTION(58,390); -ACE_EXPLOSION_REFLECTION(58,400); -ACE_EXPLOSION_REFLECTION(58,410); -ACE_EXPLOSION_REFLECTION(58,420); -ACE_EXPLOSION_REFLECTION(58,430); -ACE_EXPLOSION_REFLECTION(58,440); -ACE_EXPLOSION_REFLECTION(58,450); -ACE_EXPLOSION_REFLECTION(58,460); -ACE_EXPLOSION_REFLECTION(58,470); -ACE_EXPLOSION_REFLECTION(58,480); -ACE_EXPLOSION_REFLECTION(58,490); -ACE_EXPLOSION_REFLECTION(58,500); -ACE_EXPLOSION_REFLECTION(60,10); -ACE_EXPLOSION_REFLECTION(60,20); -ACE_EXPLOSION_REFLECTION(60,30); -ACE_EXPLOSION_REFLECTION(60,40); -ACE_EXPLOSION_REFLECTION(60,50); -ACE_EXPLOSION_REFLECTION(60,60); -ACE_EXPLOSION_REFLECTION(60,70); -ACE_EXPLOSION_REFLECTION(60,80); -ACE_EXPLOSION_REFLECTION(60,90); -ACE_EXPLOSION_REFLECTION(60,100); -ACE_EXPLOSION_REFLECTION(60,110); -ACE_EXPLOSION_REFLECTION(60,120); -ACE_EXPLOSION_REFLECTION(60,130); -ACE_EXPLOSION_REFLECTION(60,140); -ACE_EXPLOSION_REFLECTION(60,150); -ACE_EXPLOSION_REFLECTION(60,160); -ACE_EXPLOSION_REFLECTION(60,170); -ACE_EXPLOSION_REFLECTION(60,180); -ACE_EXPLOSION_REFLECTION(60,190); -ACE_EXPLOSION_REFLECTION(60,200); -ACE_EXPLOSION_REFLECTION(60,210); -ACE_EXPLOSION_REFLECTION(60,220); -ACE_EXPLOSION_REFLECTION(60,230); -ACE_EXPLOSION_REFLECTION(60,240); -ACE_EXPLOSION_REFLECTION(60,250); -ACE_EXPLOSION_REFLECTION(60,260); -ACE_EXPLOSION_REFLECTION(60,270); -ACE_EXPLOSION_REFLECTION(60,280); -ACE_EXPLOSION_REFLECTION(60,290); -ACE_EXPLOSION_REFLECTION(60,300); -ACE_EXPLOSION_REFLECTION(60,310); -ACE_EXPLOSION_REFLECTION(60,320); -ACE_EXPLOSION_REFLECTION(60,330); -ACE_EXPLOSION_REFLECTION(60,340); -ACE_EXPLOSION_REFLECTION(60,350); -ACE_EXPLOSION_REFLECTION(60,360); -ACE_EXPLOSION_REFLECTION(60,370); -ACE_EXPLOSION_REFLECTION(60,380); -ACE_EXPLOSION_REFLECTION(60,390); -ACE_EXPLOSION_REFLECTION(60,400); -ACE_EXPLOSION_REFLECTION(60,410); -ACE_EXPLOSION_REFLECTION(60,420); -ACE_EXPLOSION_REFLECTION(60,430); -ACE_EXPLOSION_REFLECTION(60,440); -ACE_EXPLOSION_REFLECTION(60,450); -ACE_EXPLOSION_REFLECTION(60,460); -ACE_EXPLOSION_REFLECTION(60,470); -ACE_EXPLOSION_REFLECTION(60,480); -ACE_EXPLOSION_REFLECTION(60,490); -ACE_EXPLOSION_REFLECTION(60,500); -ACE_EXPLOSION_REFLECTION(62,10); -ACE_EXPLOSION_REFLECTION(62,20); -ACE_EXPLOSION_REFLECTION(62,30); -ACE_EXPLOSION_REFLECTION(62,40); -ACE_EXPLOSION_REFLECTION(62,50); -ACE_EXPLOSION_REFLECTION(62,60); -ACE_EXPLOSION_REFLECTION(62,70); -ACE_EXPLOSION_REFLECTION(62,80); -ACE_EXPLOSION_REFLECTION(62,90); -ACE_EXPLOSION_REFLECTION(62,100); -ACE_EXPLOSION_REFLECTION(62,110); -ACE_EXPLOSION_REFLECTION(62,120); -ACE_EXPLOSION_REFLECTION(62,130); -ACE_EXPLOSION_REFLECTION(62,140); -ACE_EXPLOSION_REFLECTION(62,150); -ACE_EXPLOSION_REFLECTION(62,160); -ACE_EXPLOSION_REFLECTION(62,170); -ACE_EXPLOSION_REFLECTION(62,180); -ACE_EXPLOSION_REFLECTION(62,190); -ACE_EXPLOSION_REFLECTION(62,200); -ACE_EXPLOSION_REFLECTION(62,210); -ACE_EXPLOSION_REFLECTION(62,220); -ACE_EXPLOSION_REFLECTION(62,230); -ACE_EXPLOSION_REFLECTION(62,240); -ACE_EXPLOSION_REFLECTION(62,250); -ACE_EXPLOSION_REFLECTION(62,260); -ACE_EXPLOSION_REFLECTION(62,270); -ACE_EXPLOSION_REFLECTION(62,280); -ACE_EXPLOSION_REFLECTION(62,290); -ACE_EXPLOSION_REFLECTION(62,300); -ACE_EXPLOSION_REFLECTION(62,310); -ACE_EXPLOSION_REFLECTION(62,320); -ACE_EXPLOSION_REFLECTION(62,330); -ACE_EXPLOSION_REFLECTION(62,340); -ACE_EXPLOSION_REFLECTION(62,350); -ACE_EXPLOSION_REFLECTION(62,360); -ACE_EXPLOSION_REFLECTION(62,370); -ACE_EXPLOSION_REFLECTION(62,380); -ACE_EXPLOSION_REFLECTION(62,390); -ACE_EXPLOSION_REFLECTION(62,400); -ACE_EXPLOSION_REFLECTION(62,410); -ACE_EXPLOSION_REFLECTION(62,420); -ACE_EXPLOSION_REFLECTION(62,430); -ACE_EXPLOSION_REFLECTION(62,440); -ACE_EXPLOSION_REFLECTION(62,450); -ACE_EXPLOSION_REFLECTION(62,460); -ACE_EXPLOSION_REFLECTION(62,470); -ACE_EXPLOSION_REFLECTION(62,480); -ACE_EXPLOSION_REFLECTION(62,490); -ACE_EXPLOSION_REFLECTION(62,500); -ACE_EXPLOSION_REFLECTION(64,10); -ACE_EXPLOSION_REFLECTION(64,20); -ACE_EXPLOSION_REFLECTION(64,30); -ACE_EXPLOSION_REFLECTION(64,40); -ACE_EXPLOSION_REFLECTION(64,50); -ACE_EXPLOSION_REFLECTION(64,60); -ACE_EXPLOSION_REFLECTION(64,70); -ACE_EXPLOSION_REFLECTION(64,80); -ACE_EXPLOSION_REFLECTION(64,90); -ACE_EXPLOSION_REFLECTION(64,100); -ACE_EXPLOSION_REFLECTION(64,110); -ACE_EXPLOSION_REFLECTION(64,120); -ACE_EXPLOSION_REFLECTION(64,130); -ACE_EXPLOSION_REFLECTION(64,140); -ACE_EXPLOSION_REFLECTION(64,150); -ACE_EXPLOSION_REFLECTION(64,160); -ACE_EXPLOSION_REFLECTION(64,170); -ACE_EXPLOSION_REFLECTION(64,180); -ACE_EXPLOSION_REFLECTION(64,190); -ACE_EXPLOSION_REFLECTION(64,200); -ACE_EXPLOSION_REFLECTION(64,210); -ACE_EXPLOSION_REFLECTION(64,220); -ACE_EXPLOSION_REFLECTION(64,230); -ACE_EXPLOSION_REFLECTION(64,240); -ACE_EXPLOSION_REFLECTION(64,250); -ACE_EXPLOSION_REFLECTION(64,260); -ACE_EXPLOSION_REFLECTION(64,270); -ACE_EXPLOSION_REFLECTION(64,280); -ACE_EXPLOSION_REFLECTION(64,290); -ACE_EXPLOSION_REFLECTION(64,300); -ACE_EXPLOSION_REFLECTION(64,310); -ACE_EXPLOSION_REFLECTION(64,320); -ACE_EXPLOSION_REFLECTION(64,330); -ACE_EXPLOSION_REFLECTION(64,340); -ACE_EXPLOSION_REFLECTION(64,350); -ACE_EXPLOSION_REFLECTION(64,360); -ACE_EXPLOSION_REFLECTION(64,370); -ACE_EXPLOSION_REFLECTION(64,380); -ACE_EXPLOSION_REFLECTION(64,390); -ACE_EXPLOSION_REFLECTION(64,400); -ACE_EXPLOSION_REFLECTION(64,410); -ACE_EXPLOSION_REFLECTION(64,420); -ACE_EXPLOSION_REFLECTION(64,430); -ACE_EXPLOSION_REFLECTION(64,440); -ACE_EXPLOSION_REFLECTION(64,450); -ACE_EXPLOSION_REFLECTION(64,460); -ACE_EXPLOSION_REFLECTION(64,470); -ACE_EXPLOSION_REFLECTION(64,480); -ACE_EXPLOSION_REFLECTION(64,490); -ACE_EXPLOSION_REFLECTION(64,500); -ACE_EXPLOSION_REFLECTION(66,10); -ACE_EXPLOSION_REFLECTION(66,20); -ACE_EXPLOSION_REFLECTION(66,30); -ACE_EXPLOSION_REFLECTION(66,40); -ACE_EXPLOSION_REFLECTION(66,50); -ACE_EXPLOSION_REFLECTION(66,60); -ACE_EXPLOSION_REFLECTION(66,70); -ACE_EXPLOSION_REFLECTION(66,80); -ACE_EXPLOSION_REFLECTION(66,90); -ACE_EXPLOSION_REFLECTION(66,100); -ACE_EXPLOSION_REFLECTION(66,110); -ACE_EXPLOSION_REFLECTION(66,120); -ACE_EXPLOSION_REFLECTION(66,130); -ACE_EXPLOSION_REFLECTION(66,140); -ACE_EXPLOSION_REFLECTION(66,150); -ACE_EXPLOSION_REFLECTION(66,160); -ACE_EXPLOSION_REFLECTION(66,170); -ACE_EXPLOSION_REFLECTION(66,180); -ACE_EXPLOSION_REFLECTION(66,190); -ACE_EXPLOSION_REFLECTION(66,200); -ACE_EXPLOSION_REFLECTION(66,210); -ACE_EXPLOSION_REFLECTION(66,220); -ACE_EXPLOSION_REFLECTION(66,230); -ACE_EXPLOSION_REFLECTION(66,240); -ACE_EXPLOSION_REFLECTION(66,250); -ACE_EXPLOSION_REFLECTION(66,260); -ACE_EXPLOSION_REFLECTION(66,270); -ACE_EXPLOSION_REFLECTION(66,280); -ACE_EXPLOSION_REFLECTION(66,290); -ACE_EXPLOSION_REFLECTION(66,300); -ACE_EXPLOSION_REFLECTION(66,310); -ACE_EXPLOSION_REFLECTION(66,320); -ACE_EXPLOSION_REFLECTION(66,330); -ACE_EXPLOSION_REFLECTION(66,340); -ACE_EXPLOSION_REFLECTION(66,350); -ACE_EXPLOSION_REFLECTION(66,360); -ACE_EXPLOSION_REFLECTION(66,370); -ACE_EXPLOSION_REFLECTION(66,380); -ACE_EXPLOSION_REFLECTION(66,390); -ACE_EXPLOSION_REFLECTION(66,400); -ACE_EXPLOSION_REFLECTION(66,410); -ACE_EXPLOSION_REFLECTION(66,420); -ACE_EXPLOSION_REFLECTION(66,430); -ACE_EXPLOSION_REFLECTION(66,440); -ACE_EXPLOSION_REFLECTION(66,450); -ACE_EXPLOSION_REFLECTION(66,460); -ACE_EXPLOSION_REFLECTION(66,470); -ACE_EXPLOSION_REFLECTION(66,480); -ACE_EXPLOSION_REFLECTION(66,490); -ACE_EXPLOSION_REFLECTION(66,500); -ACE_EXPLOSION_REFLECTION(68,10); -ACE_EXPLOSION_REFLECTION(68,20); -ACE_EXPLOSION_REFLECTION(68,30); -ACE_EXPLOSION_REFLECTION(68,40); -ACE_EXPLOSION_REFLECTION(68,50); -ACE_EXPLOSION_REFLECTION(68,60); -ACE_EXPLOSION_REFLECTION(68,70); -ACE_EXPLOSION_REFLECTION(68,80); -ACE_EXPLOSION_REFLECTION(68,90); -ACE_EXPLOSION_REFLECTION(68,100); -ACE_EXPLOSION_REFLECTION(68,110); -ACE_EXPLOSION_REFLECTION(68,120); -ACE_EXPLOSION_REFLECTION(68,130); -ACE_EXPLOSION_REFLECTION(68,140); -ACE_EXPLOSION_REFLECTION(68,150); -ACE_EXPLOSION_REFLECTION(68,160); -ACE_EXPLOSION_REFLECTION(68,170); -ACE_EXPLOSION_REFLECTION(68,180); -ACE_EXPLOSION_REFLECTION(68,190); -ACE_EXPLOSION_REFLECTION(68,200); -ACE_EXPLOSION_REFLECTION(68,210); -ACE_EXPLOSION_REFLECTION(68,220); -ACE_EXPLOSION_REFLECTION(68,230); -ACE_EXPLOSION_REFLECTION(68,240); -ACE_EXPLOSION_REFLECTION(68,250); -ACE_EXPLOSION_REFLECTION(68,260); -ACE_EXPLOSION_REFLECTION(68,270); -ACE_EXPLOSION_REFLECTION(68,280); -ACE_EXPLOSION_REFLECTION(68,290); -ACE_EXPLOSION_REFLECTION(68,300); -ACE_EXPLOSION_REFLECTION(68,310); -ACE_EXPLOSION_REFLECTION(68,320); -ACE_EXPLOSION_REFLECTION(68,330); -ACE_EXPLOSION_REFLECTION(68,340); -ACE_EXPLOSION_REFLECTION(68,350); -ACE_EXPLOSION_REFLECTION(68,360); -ACE_EXPLOSION_REFLECTION(68,370); -ACE_EXPLOSION_REFLECTION(68,380); -ACE_EXPLOSION_REFLECTION(68,390); -ACE_EXPLOSION_REFLECTION(68,400); -ACE_EXPLOSION_REFLECTION(68,410); -ACE_EXPLOSION_REFLECTION(68,420); -ACE_EXPLOSION_REFLECTION(68,430); -ACE_EXPLOSION_REFLECTION(68,440); -ACE_EXPLOSION_REFLECTION(68,450); -ACE_EXPLOSION_REFLECTION(68,460); -ACE_EXPLOSION_REFLECTION(68,470); -ACE_EXPLOSION_REFLECTION(68,480); -ACE_EXPLOSION_REFLECTION(68,490); -ACE_EXPLOSION_REFLECTION(68,500); -ACE_EXPLOSION_REFLECTION(70,10); -ACE_EXPLOSION_REFLECTION(70,20); -ACE_EXPLOSION_REFLECTION(70,30); -ACE_EXPLOSION_REFLECTION(70,40); -ACE_EXPLOSION_REFLECTION(70,50); -ACE_EXPLOSION_REFLECTION(70,60); -ACE_EXPLOSION_REFLECTION(70,70); -ACE_EXPLOSION_REFLECTION(70,80); -ACE_EXPLOSION_REFLECTION(70,90); -ACE_EXPLOSION_REFLECTION(70,100); -ACE_EXPLOSION_REFLECTION(70,110); -ACE_EXPLOSION_REFLECTION(70,120); -ACE_EXPLOSION_REFLECTION(70,130); -ACE_EXPLOSION_REFLECTION(70,140); -ACE_EXPLOSION_REFLECTION(70,150); -ACE_EXPLOSION_REFLECTION(70,160); -ACE_EXPLOSION_REFLECTION(70,170); -ACE_EXPLOSION_REFLECTION(70,180); -ACE_EXPLOSION_REFLECTION(70,190); -ACE_EXPLOSION_REFLECTION(70,200); -ACE_EXPLOSION_REFLECTION(70,210); -ACE_EXPLOSION_REFLECTION(70,220); -ACE_EXPLOSION_REFLECTION(70,230); -ACE_EXPLOSION_REFLECTION(70,240); -ACE_EXPLOSION_REFLECTION(70,250); -ACE_EXPLOSION_REFLECTION(70,260); -ACE_EXPLOSION_REFLECTION(70,270); -ACE_EXPLOSION_REFLECTION(70,280); -ACE_EXPLOSION_REFLECTION(70,290); -ACE_EXPLOSION_REFLECTION(70,300); -ACE_EXPLOSION_REFLECTION(70,310); -ACE_EXPLOSION_REFLECTION(70,320); -ACE_EXPLOSION_REFLECTION(70,330); -ACE_EXPLOSION_REFLECTION(70,340); -ACE_EXPLOSION_REFLECTION(70,350); -ACE_EXPLOSION_REFLECTION(70,360); -ACE_EXPLOSION_REFLECTION(70,370); -ACE_EXPLOSION_REFLECTION(70,380); -ACE_EXPLOSION_REFLECTION(70,390); -ACE_EXPLOSION_REFLECTION(70,400); -ACE_EXPLOSION_REFLECTION(70,410); -ACE_EXPLOSION_REFLECTION(70,420); -ACE_EXPLOSION_REFLECTION(70,430); -ACE_EXPLOSION_REFLECTION(70,440); -ACE_EXPLOSION_REFLECTION(70,450); -ACE_EXPLOSION_REFLECTION(70,460); -ACE_EXPLOSION_REFLECTION(70,470); -ACE_EXPLOSION_REFLECTION(70,480); -ACE_EXPLOSION_REFLECTION(70,490); -ACE_EXPLOSION_REFLECTION(70,500); -ACE_EXPLOSION_REFLECTION(72,10); -ACE_EXPLOSION_REFLECTION(72,20); -ACE_EXPLOSION_REFLECTION(72,30); -ACE_EXPLOSION_REFLECTION(72,40); -ACE_EXPLOSION_REFLECTION(72,50); -ACE_EXPLOSION_REFLECTION(72,60); -ACE_EXPLOSION_REFLECTION(72,70); -ACE_EXPLOSION_REFLECTION(72,80); -ACE_EXPLOSION_REFLECTION(72,90); -ACE_EXPLOSION_REFLECTION(72,100); -ACE_EXPLOSION_REFLECTION(72,110); -ACE_EXPLOSION_REFLECTION(72,120); -ACE_EXPLOSION_REFLECTION(72,130); -ACE_EXPLOSION_REFLECTION(72,140); -ACE_EXPLOSION_REFLECTION(72,150); -ACE_EXPLOSION_REFLECTION(72,160); -ACE_EXPLOSION_REFLECTION(72,170); -ACE_EXPLOSION_REFLECTION(72,180); -ACE_EXPLOSION_REFLECTION(72,190); -ACE_EXPLOSION_REFLECTION(72,200); -ACE_EXPLOSION_REFLECTION(72,210); -ACE_EXPLOSION_REFLECTION(72,220); -ACE_EXPLOSION_REFLECTION(72,230); -ACE_EXPLOSION_REFLECTION(72,240); -ACE_EXPLOSION_REFLECTION(72,250); -ACE_EXPLOSION_REFLECTION(72,260); -ACE_EXPLOSION_REFLECTION(72,270); -ACE_EXPLOSION_REFLECTION(72,280); -ACE_EXPLOSION_REFLECTION(72,290); -ACE_EXPLOSION_REFLECTION(72,300); -ACE_EXPLOSION_REFLECTION(72,310); -ACE_EXPLOSION_REFLECTION(72,320); -ACE_EXPLOSION_REFLECTION(72,330); -ACE_EXPLOSION_REFLECTION(72,340); -ACE_EXPLOSION_REFLECTION(72,350); -ACE_EXPLOSION_REFLECTION(72,360); -ACE_EXPLOSION_REFLECTION(72,370); -ACE_EXPLOSION_REFLECTION(72,380); -ACE_EXPLOSION_REFLECTION(72,390); -ACE_EXPLOSION_REFLECTION(72,400); -ACE_EXPLOSION_REFLECTION(72,410); -ACE_EXPLOSION_REFLECTION(72,420); -ACE_EXPLOSION_REFLECTION(72,430); -ACE_EXPLOSION_REFLECTION(72,440); -ACE_EXPLOSION_REFLECTION(72,450); -ACE_EXPLOSION_REFLECTION(72,460); -ACE_EXPLOSION_REFLECTION(72,470); -ACE_EXPLOSION_REFLECTION(72,480); -ACE_EXPLOSION_REFLECTION(72,490); -ACE_EXPLOSION_REFLECTION(72,500); -ACE_EXPLOSION_REFLECTION(74,10); -ACE_EXPLOSION_REFLECTION(74,20); -ACE_EXPLOSION_REFLECTION(74,30); -ACE_EXPLOSION_REFLECTION(74,40); -ACE_EXPLOSION_REFLECTION(74,50); -ACE_EXPLOSION_REFLECTION(74,60); -ACE_EXPLOSION_REFLECTION(74,70); -ACE_EXPLOSION_REFLECTION(74,80); -ACE_EXPLOSION_REFLECTION(74,90); -ACE_EXPLOSION_REFLECTION(74,100); -ACE_EXPLOSION_REFLECTION(74,110); -ACE_EXPLOSION_REFLECTION(74,120); -ACE_EXPLOSION_REFLECTION(74,130); -ACE_EXPLOSION_REFLECTION(74,140); -ACE_EXPLOSION_REFLECTION(74,150); -ACE_EXPLOSION_REFLECTION(74,160); -ACE_EXPLOSION_REFLECTION(74,170); -ACE_EXPLOSION_REFLECTION(74,180); -ACE_EXPLOSION_REFLECTION(74,190); -ACE_EXPLOSION_REFLECTION(74,200); -ACE_EXPLOSION_REFLECTION(74,210); -ACE_EXPLOSION_REFLECTION(74,220); -ACE_EXPLOSION_REFLECTION(74,230); -ACE_EXPLOSION_REFLECTION(74,240); -ACE_EXPLOSION_REFLECTION(74,250); -ACE_EXPLOSION_REFLECTION(74,260); -ACE_EXPLOSION_REFLECTION(74,270); -ACE_EXPLOSION_REFLECTION(74,280); -ACE_EXPLOSION_REFLECTION(74,290); -ACE_EXPLOSION_REFLECTION(74,300); -ACE_EXPLOSION_REFLECTION(74,310); -ACE_EXPLOSION_REFLECTION(74,320); -ACE_EXPLOSION_REFLECTION(74,330); -ACE_EXPLOSION_REFLECTION(74,340); -ACE_EXPLOSION_REFLECTION(74,350); -ACE_EXPLOSION_REFLECTION(74,360); -ACE_EXPLOSION_REFLECTION(74,370); -ACE_EXPLOSION_REFLECTION(74,380); -ACE_EXPLOSION_REFLECTION(74,390); -ACE_EXPLOSION_REFLECTION(74,400); -ACE_EXPLOSION_REFLECTION(74,410); -ACE_EXPLOSION_REFLECTION(74,420); -ACE_EXPLOSION_REFLECTION(74,430); -ACE_EXPLOSION_REFLECTION(74,440); -ACE_EXPLOSION_REFLECTION(74,450); -ACE_EXPLOSION_REFLECTION(74,460); -ACE_EXPLOSION_REFLECTION(74,470); -ACE_EXPLOSION_REFLECTION(74,480); -ACE_EXPLOSION_REFLECTION(74,490); -ACE_EXPLOSION_REFLECTION(74,500); -ACE_EXPLOSION_REFLECTION(76,10); -ACE_EXPLOSION_REFLECTION(76,20); -ACE_EXPLOSION_REFLECTION(76,30); -ACE_EXPLOSION_REFLECTION(76,40); -ACE_EXPLOSION_REFLECTION(76,50); -ACE_EXPLOSION_REFLECTION(76,60); -ACE_EXPLOSION_REFLECTION(76,70); -ACE_EXPLOSION_REFLECTION(76,80); -ACE_EXPLOSION_REFLECTION(76,90); -ACE_EXPLOSION_REFLECTION(76,100); -ACE_EXPLOSION_REFLECTION(76,110); -ACE_EXPLOSION_REFLECTION(76,120); -ACE_EXPLOSION_REFLECTION(76,130); -ACE_EXPLOSION_REFLECTION(76,140); -ACE_EXPLOSION_REFLECTION(76,150); -ACE_EXPLOSION_REFLECTION(76,160); -ACE_EXPLOSION_REFLECTION(76,170); -ACE_EXPLOSION_REFLECTION(76,180); -ACE_EXPLOSION_REFLECTION(76,190); -ACE_EXPLOSION_REFLECTION(76,200); -ACE_EXPLOSION_REFLECTION(76,210); -ACE_EXPLOSION_REFLECTION(76,220); -ACE_EXPLOSION_REFLECTION(76,230); -ACE_EXPLOSION_REFLECTION(76,240); -ACE_EXPLOSION_REFLECTION(76,250); -ACE_EXPLOSION_REFLECTION(76,260); -ACE_EXPLOSION_REFLECTION(76,270); -ACE_EXPLOSION_REFLECTION(76,280); -ACE_EXPLOSION_REFLECTION(76,290); -ACE_EXPLOSION_REFLECTION(76,300); -ACE_EXPLOSION_REFLECTION(76,310); -ACE_EXPLOSION_REFLECTION(76,320); -ACE_EXPLOSION_REFLECTION(76,330); -ACE_EXPLOSION_REFLECTION(76,340); -ACE_EXPLOSION_REFLECTION(76,350); -ACE_EXPLOSION_REFLECTION(76,360); -ACE_EXPLOSION_REFLECTION(76,370); -ACE_EXPLOSION_REFLECTION(76,380); -ACE_EXPLOSION_REFLECTION(76,390); -ACE_EXPLOSION_REFLECTION(76,400); -ACE_EXPLOSION_REFLECTION(76,410); -ACE_EXPLOSION_REFLECTION(76,420); -ACE_EXPLOSION_REFLECTION(76,430); -ACE_EXPLOSION_REFLECTION(76,440); -ACE_EXPLOSION_REFLECTION(76,450); -ACE_EXPLOSION_REFLECTION(76,460); -ACE_EXPLOSION_REFLECTION(76,470); -ACE_EXPLOSION_REFLECTION(76,480); -ACE_EXPLOSION_REFLECTION(76,490); -ACE_EXPLOSION_REFLECTION(76,500); -ACE_EXPLOSION_REFLECTION(78,10); -ACE_EXPLOSION_REFLECTION(78,20); -ACE_EXPLOSION_REFLECTION(78,30); -ACE_EXPLOSION_REFLECTION(78,40); -ACE_EXPLOSION_REFLECTION(78,50); -ACE_EXPLOSION_REFLECTION(78,60); -ACE_EXPLOSION_REFLECTION(78,70); -ACE_EXPLOSION_REFLECTION(78,80); -ACE_EXPLOSION_REFLECTION(78,90); -ACE_EXPLOSION_REFLECTION(78,100); -ACE_EXPLOSION_REFLECTION(78,110); -ACE_EXPLOSION_REFLECTION(78,120); -ACE_EXPLOSION_REFLECTION(78,130); -ACE_EXPLOSION_REFLECTION(78,140); -ACE_EXPLOSION_REFLECTION(78,150); -ACE_EXPLOSION_REFLECTION(78,160); -ACE_EXPLOSION_REFLECTION(78,170); -ACE_EXPLOSION_REFLECTION(78,180); -ACE_EXPLOSION_REFLECTION(78,190); -ACE_EXPLOSION_REFLECTION(78,200); -ACE_EXPLOSION_REFLECTION(78,210); -ACE_EXPLOSION_REFLECTION(78,220); -ACE_EXPLOSION_REFLECTION(78,230); -ACE_EXPLOSION_REFLECTION(78,240); -ACE_EXPLOSION_REFLECTION(78,250); -ACE_EXPLOSION_REFLECTION(78,260); -ACE_EXPLOSION_REFLECTION(78,270); -ACE_EXPLOSION_REFLECTION(78,280); -ACE_EXPLOSION_REFLECTION(78,290); -ACE_EXPLOSION_REFLECTION(78,300); -ACE_EXPLOSION_REFLECTION(78,310); -ACE_EXPLOSION_REFLECTION(78,320); -ACE_EXPLOSION_REFLECTION(78,330); -ACE_EXPLOSION_REFLECTION(78,340); -ACE_EXPLOSION_REFLECTION(78,350); -ACE_EXPLOSION_REFLECTION(78,360); -ACE_EXPLOSION_REFLECTION(78,370); -ACE_EXPLOSION_REFLECTION(78,380); -ACE_EXPLOSION_REFLECTION(78,390); -ACE_EXPLOSION_REFLECTION(78,400); -ACE_EXPLOSION_REFLECTION(78,410); -ACE_EXPLOSION_REFLECTION(78,420); -ACE_EXPLOSION_REFLECTION(78,430); -ACE_EXPLOSION_REFLECTION(78,440); -ACE_EXPLOSION_REFLECTION(78,450); -ACE_EXPLOSION_REFLECTION(78,460); -ACE_EXPLOSION_REFLECTION(78,470); -ACE_EXPLOSION_REFLECTION(78,480); -ACE_EXPLOSION_REFLECTION(78,490); -ACE_EXPLOSION_REFLECTION(78,500); -ACE_EXPLOSION_REFLECTION(80,10); -ACE_EXPLOSION_REFLECTION(80,20); -ACE_EXPLOSION_REFLECTION(80,30); -ACE_EXPLOSION_REFLECTION(80,40); -ACE_EXPLOSION_REFLECTION(80,50); -ACE_EXPLOSION_REFLECTION(80,60); -ACE_EXPLOSION_REFLECTION(80,70); -ACE_EXPLOSION_REFLECTION(80,80); -ACE_EXPLOSION_REFLECTION(80,90); -ACE_EXPLOSION_REFLECTION(80,100); -ACE_EXPLOSION_REFLECTION(80,110); -ACE_EXPLOSION_REFLECTION(80,120); -ACE_EXPLOSION_REFLECTION(80,130); -ACE_EXPLOSION_REFLECTION(80,140); -ACE_EXPLOSION_REFLECTION(80,150); -ACE_EXPLOSION_REFLECTION(80,160); -ACE_EXPLOSION_REFLECTION(80,170); -ACE_EXPLOSION_REFLECTION(80,180); -ACE_EXPLOSION_REFLECTION(80,190); -ACE_EXPLOSION_REFLECTION(80,200); -ACE_EXPLOSION_REFLECTION(80,210); -ACE_EXPLOSION_REFLECTION(80,220); -ACE_EXPLOSION_REFLECTION(80,230); -ACE_EXPLOSION_REFLECTION(80,240); -ACE_EXPLOSION_REFLECTION(80,250); -ACE_EXPLOSION_REFLECTION(80,260); -ACE_EXPLOSION_REFLECTION(80,270); -ACE_EXPLOSION_REFLECTION(80,280); -ACE_EXPLOSION_REFLECTION(80,290); -ACE_EXPLOSION_REFLECTION(80,300); -ACE_EXPLOSION_REFLECTION(80,310); -ACE_EXPLOSION_REFLECTION(80,320); -ACE_EXPLOSION_REFLECTION(80,330); -ACE_EXPLOSION_REFLECTION(80,340); -ACE_EXPLOSION_REFLECTION(80,350); -ACE_EXPLOSION_REFLECTION(80,360); -ACE_EXPLOSION_REFLECTION(80,370); -ACE_EXPLOSION_REFLECTION(80,380); -ACE_EXPLOSION_REFLECTION(80,390); -ACE_EXPLOSION_REFLECTION(80,400); -ACE_EXPLOSION_REFLECTION(80,410); -ACE_EXPLOSION_REFLECTION(80,420); -ACE_EXPLOSION_REFLECTION(80,430); -ACE_EXPLOSION_REFLECTION(80,440); -ACE_EXPLOSION_REFLECTION(80,450); -ACE_EXPLOSION_REFLECTION(80,460); -ACE_EXPLOSION_REFLECTION(80,470); -ACE_EXPLOSION_REFLECTION(80,480); -ACE_EXPLOSION_REFLECTION(80,490); -ACE_EXPLOSION_REFLECTION(80,500); -ACE_EXPLOSION_REFLECTION(82,10); -ACE_EXPLOSION_REFLECTION(82,20); -ACE_EXPLOSION_REFLECTION(82,30); -ACE_EXPLOSION_REFLECTION(82,40); -ACE_EXPLOSION_REFLECTION(82,50); -ACE_EXPLOSION_REFLECTION(82,60); -ACE_EXPLOSION_REFLECTION(82,70); -ACE_EXPLOSION_REFLECTION(82,80); -ACE_EXPLOSION_REFLECTION(82,90); -ACE_EXPLOSION_REFLECTION(82,100); -ACE_EXPLOSION_REFLECTION(82,110); -ACE_EXPLOSION_REFLECTION(82,120); -ACE_EXPLOSION_REFLECTION(82,130); -ACE_EXPLOSION_REFLECTION(82,140); -ACE_EXPLOSION_REFLECTION(82,150); -ACE_EXPLOSION_REFLECTION(82,160); -ACE_EXPLOSION_REFLECTION(82,170); -ACE_EXPLOSION_REFLECTION(82,180); -ACE_EXPLOSION_REFLECTION(82,190); -ACE_EXPLOSION_REFLECTION(82,200); -ACE_EXPLOSION_REFLECTION(82,210); -ACE_EXPLOSION_REFLECTION(82,220); -ACE_EXPLOSION_REFLECTION(82,230); -ACE_EXPLOSION_REFLECTION(82,240); -ACE_EXPLOSION_REFLECTION(82,250); -ACE_EXPLOSION_REFLECTION(82,260); -ACE_EXPLOSION_REFLECTION(82,270); -ACE_EXPLOSION_REFLECTION(82,280); -ACE_EXPLOSION_REFLECTION(82,290); -ACE_EXPLOSION_REFLECTION(82,300); -ACE_EXPLOSION_REFLECTION(82,310); -ACE_EXPLOSION_REFLECTION(82,320); -ACE_EXPLOSION_REFLECTION(82,330); -ACE_EXPLOSION_REFLECTION(82,340); -ACE_EXPLOSION_REFLECTION(82,350); -ACE_EXPLOSION_REFLECTION(82,360); -ACE_EXPLOSION_REFLECTION(82,370); -ACE_EXPLOSION_REFLECTION(82,380); -ACE_EXPLOSION_REFLECTION(82,390); -ACE_EXPLOSION_REFLECTION(82,400); -ACE_EXPLOSION_REFLECTION(82,410); -ACE_EXPLOSION_REFLECTION(82,420); -ACE_EXPLOSION_REFLECTION(82,430); -ACE_EXPLOSION_REFLECTION(82,440); -ACE_EXPLOSION_REFLECTION(82,450); -ACE_EXPLOSION_REFLECTION(82,460); -ACE_EXPLOSION_REFLECTION(82,470); -ACE_EXPLOSION_REFLECTION(82,480); -ACE_EXPLOSION_REFLECTION(82,490); -ACE_EXPLOSION_REFLECTION(82,500); -ACE_EXPLOSION_REFLECTION(84,10); -ACE_EXPLOSION_REFLECTION(84,20); -ACE_EXPLOSION_REFLECTION(84,30); -ACE_EXPLOSION_REFLECTION(84,40); -ACE_EXPLOSION_REFLECTION(84,50); -ACE_EXPLOSION_REFLECTION(84,60); -ACE_EXPLOSION_REFLECTION(84,70); -ACE_EXPLOSION_REFLECTION(84,80); -ACE_EXPLOSION_REFLECTION(84,90); -ACE_EXPLOSION_REFLECTION(84,100); -ACE_EXPLOSION_REFLECTION(84,110); -ACE_EXPLOSION_REFLECTION(84,120); -ACE_EXPLOSION_REFLECTION(84,130); -ACE_EXPLOSION_REFLECTION(84,140); -ACE_EXPLOSION_REFLECTION(84,150); -ACE_EXPLOSION_REFLECTION(84,160); -ACE_EXPLOSION_REFLECTION(84,170); -ACE_EXPLOSION_REFLECTION(84,180); -ACE_EXPLOSION_REFLECTION(84,190); -ACE_EXPLOSION_REFLECTION(84,200); -ACE_EXPLOSION_REFLECTION(84,210); -ACE_EXPLOSION_REFLECTION(84,220); -ACE_EXPLOSION_REFLECTION(84,230); -ACE_EXPLOSION_REFLECTION(84,240); -ACE_EXPLOSION_REFLECTION(84,250); -ACE_EXPLOSION_REFLECTION(84,260); -ACE_EXPLOSION_REFLECTION(84,270); -ACE_EXPLOSION_REFLECTION(84,280); -ACE_EXPLOSION_REFLECTION(84,290); -ACE_EXPLOSION_REFLECTION(84,300); -ACE_EXPLOSION_REFLECTION(84,310); -ACE_EXPLOSION_REFLECTION(84,320); -ACE_EXPLOSION_REFLECTION(84,330); -ACE_EXPLOSION_REFLECTION(84,340); -ACE_EXPLOSION_REFLECTION(84,350); -ACE_EXPLOSION_REFLECTION(84,360); -ACE_EXPLOSION_REFLECTION(84,370); -ACE_EXPLOSION_REFLECTION(84,380); -ACE_EXPLOSION_REFLECTION(84,390); -ACE_EXPLOSION_REFLECTION(84,400); -ACE_EXPLOSION_REFLECTION(84,410); -ACE_EXPLOSION_REFLECTION(84,420); -ACE_EXPLOSION_REFLECTION(84,430); -ACE_EXPLOSION_REFLECTION(84,440); -ACE_EXPLOSION_REFLECTION(84,450); -ACE_EXPLOSION_REFLECTION(84,460); -ACE_EXPLOSION_REFLECTION(84,470); -ACE_EXPLOSION_REFLECTION(84,480); -ACE_EXPLOSION_REFLECTION(84,490); -ACE_EXPLOSION_REFLECTION(84,500); -ACE_EXPLOSION_REFLECTION(86,10); -ACE_EXPLOSION_REFLECTION(86,20); -ACE_EXPLOSION_REFLECTION(86,30); -ACE_EXPLOSION_REFLECTION(86,40); -ACE_EXPLOSION_REFLECTION(86,50); -ACE_EXPLOSION_REFLECTION(86,60); -ACE_EXPLOSION_REFLECTION(86,70); -ACE_EXPLOSION_REFLECTION(86,80); -ACE_EXPLOSION_REFLECTION(86,90); -ACE_EXPLOSION_REFLECTION(86,100); -ACE_EXPLOSION_REFLECTION(86,110); -ACE_EXPLOSION_REFLECTION(86,120); -ACE_EXPLOSION_REFLECTION(86,130); -ACE_EXPLOSION_REFLECTION(86,140); -ACE_EXPLOSION_REFLECTION(86,150); -ACE_EXPLOSION_REFLECTION(86,160); -ACE_EXPLOSION_REFLECTION(86,170); -ACE_EXPLOSION_REFLECTION(86,180); -ACE_EXPLOSION_REFLECTION(86,190); -ACE_EXPLOSION_REFLECTION(86,200); -ACE_EXPLOSION_REFLECTION(86,210); -ACE_EXPLOSION_REFLECTION(86,220); -ACE_EXPLOSION_REFLECTION(86,230); -ACE_EXPLOSION_REFLECTION(86,240); -ACE_EXPLOSION_REFLECTION(86,250); -ACE_EXPLOSION_REFLECTION(86,260); -ACE_EXPLOSION_REFLECTION(86,270); -ACE_EXPLOSION_REFLECTION(86,280); -ACE_EXPLOSION_REFLECTION(86,290); -ACE_EXPLOSION_REFLECTION(86,300); -ACE_EXPLOSION_REFLECTION(86,310); -ACE_EXPLOSION_REFLECTION(86,320); -ACE_EXPLOSION_REFLECTION(86,330); -ACE_EXPLOSION_REFLECTION(86,340); -ACE_EXPLOSION_REFLECTION(86,350); -ACE_EXPLOSION_REFLECTION(86,360); -ACE_EXPLOSION_REFLECTION(86,370); -ACE_EXPLOSION_REFLECTION(86,380); -ACE_EXPLOSION_REFLECTION(86,390); -ACE_EXPLOSION_REFLECTION(86,400); -ACE_EXPLOSION_REFLECTION(86,410); -ACE_EXPLOSION_REFLECTION(86,420); -ACE_EXPLOSION_REFLECTION(86,430); -ACE_EXPLOSION_REFLECTION(86,440); -ACE_EXPLOSION_REFLECTION(86,450); -ACE_EXPLOSION_REFLECTION(86,460); -ACE_EXPLOSION_REFLECTION(86,470); -ACE_EXPLOSION_REFLECTION(86,480); -ACE_EXPLOSION_REFLECTION(86,490); -ACE_EXPLOSION_REFLECTION(86,500); -ACE_EXPLOSION_REFLECTION(88,10); -ACE_EXPLOSION_REFLECTION(88,20); -ACE_EXPLOSION_REFLECTION(88,30); -ACE_EXPLOSION_REFLECTION(88,40); -ACE_EXPLOSION_REFLECTION(88,50); -ACE_EXPLOSION_REFLECTION(88,60); -ACE_EXPLOSION_REFLECTION(88,70); -ACE_EXPLOSION_REFLECTION(88,80); -ACE_EXPLOSION_REFLECTION(88,90); -ACE_EXPLOSION_REFLECTION(88,100); -ACE_EXPLOSION_REFLECTION(88,110); -ACE_EXPLOSION_REFLECTION(88,120); -ACE_EXPLOSION_REFLECTION(88,130); -ACE_EXPLOSION_REFLECTION(88,140); -ACE_EXPLOSION_REFLECTION(88,150); -ACE_EXPLOSION_REFLECTION(88,160); -ACE_EXPLOSION_REFLECTION(88,170); -ACE_EXPLOSION_REFLECTION(88,180); -ACE_EXPLOSION_REFLECTION(88,190); -ACE_EXPLOSION_REFLECTION(88,200); -ACE_EXPLOSION_REFLECTION(88,210); -ACE_EXPLOSION_REFLECTION(88,220); -ACE_EXPLOSION_REFLECTION(88,230); -ACE_EXPLOSION_REFLECTION(88,240); -ACE_EXPLOSION_REFLECTION(88,250); -ACE_EXPLOSION_REFLECTION(88,260); -ACE_EXPLOSION_REFLECTION(88,270); -ACE_EXPLOSION_REFLECTION(88,280); -ACE_EXPLOSION_REFLECTION(88,290); -ACE_EXPLOSION_REFLECTION(88,300); -ACE_EXPLOSION_REFLECTION(88,310); -ACE_EXPLOSION_REFLECTION(88,320); -ACE_EXPLOSION_REFLECTION(88,330); -ACE_EXPLOSION_REFLECTION(88,340); -ACE_EXPLOSION_REFLECTION(88,350); -ACE_EXPLOSION_REFLECTION(88,360); -ACE_EXPLOSION_REFLECTION(88,370); -ACE_EXPLOSION_REFLECTION(88,380); -ACE_EXPLOSION_REFLECTION(88,390); -ACE_EXPLOSION_REFLECTION(88,400); -ACE_EXPLOSION_REFLECTION(88,410); -ACE_EXPLOSION_REFLECTION(88,420); -ACE_EXPLOSION_REFLECTION(88,430); -ACE_EXPLOSION_REFLECTION(88,440); -ACE_EXPLOSION_REFLECTION(88,450); -ACE_EXPLOSION_REFLECTION(88,460); -ACE_EXPLOSION_REFLECTION(88,470); -ACE_EXPLOSION_REFLECTION(88,480); -ACE_EXPLOSION_REFLECTION(88,490); -ACE_EXPLOSION_REFLECTION(88,500); -ACE_EXPLOSION_REFLECTION(90,10); -ACE_EXPLOSION_REFLECTION(90,20); -ACE_EXPLOSION_REFLECTION(90,30); -ACE_EXPLOSION_REFLECTION(90,40); -ACE_EXPLOSION_REFLECTION(90,50); -ACE_EXPLOSION_REFLECTION(90,60); -ACE_EXPLOSION_REFLECTION(90,70); -ACE_EXPLOSION_REFLECTION(90,80); -ACE_EXPLOSION_REFLECTION(90,90); -ACE_EXPLOSION_REFLECTION(90,100); -ACE_EXPLOSION_REFLECTION(90,110); -ACE_EXPLOSION_REFLECTION(90,120); -ACE_EXPLOSION_REFLECTION(90,130); -ACE_EXPLOSION_REFLECTION(90,140); -ACE_EXPLOSION_REFLECTION(90,150); -ACE_EXPLOSION_REFLECTION(90,160); -ACE_EXPLOSION_REFLECTION(90,170); -ACE_EXPLOSION_REFLECTION(90,180); -ACE_EXPLOSION_REFLECTION(90,190); -ACE_EXPLOSION_REFLECTION(90,200); -ACE_EXPLOSION_REFLECTION(90,210); -ACE_EXPLOSION_REFLECTION(90,220); -ACE_EXPLOSION_REFLECTION(90,230); -ACE_EXPLOSION_REFLECTION(90,240); -ACE_EXPLOSION_REFLECTION(90,250); -ACE_EXPLOSION_REFLECTION(90,260); -ACE_EXPLOSION_REFLECTION(90,270); -ACE_EXPLOSION_REFLECTION(90,280); -ACE_EXPLOSION_REFLECTION(90,290); -ACE_EXPLOSION_REFLECTION(90,300); -ACE_EXPLOSION_REFLECTION(90,310); -ACE_EXPLOSION_REFLECTION(90,320); -ACE_EXPLOSION_REFLECTION(90,330); -ACE_EXPLOSION_REFLECTION(90,340); -ACE_EXPLOSION_REFLECTION(90,350); -ACE_EXPLOSION_REFLECTION(90,360); -ACE_EXPLOSION_REFLECTION(90,370); -ACE_EXPLOSION_REFLECTION(90,380); -ACE_EXPLOSION_REFLECTION(90,390); -ACE_EXPLOSION_REFLECTION(90,400); -ACE_EXPLOSION_REFLECTION(90,410); -ACE_EXPLOSION_REFLECTION(90,420); -ACE_EXPLOSION_REFLECTION(90,430); -ACE_EXPLOSION_REFLECTION(90,440); -ACE_EXPLOSION_REFLECTION(90,450); -ACE_EXPLOSION_REFLECTION(90,460); -ACE_EXPLOSION_REFLECTION(90,470); -ACE_EXPLOSION_REFLECTION(90,480); -ACE_EXPLOSION_REFLECTION(90,490); -ACE_EXPLOSION_REFLECTION(90,500); -ACE_EXPLOSION_REFLECTION(92,10); -ACE_EXPLOSION_REFLECTION(92,20); -ACE_EXPLOSION_REFLECTION(92,30); -ACE_EXPLOSION_REFLECTION(92,40); -ACE_EXPLOSION_REFLECTION(92,50); -ACE_EXPLOSION_REFLECTION(92,60); -ACE_EXPLOSION_REFLECTION(92,70); -ACE_EXPLOSION_REFLECTION(92,80); -ACE_EXPLOSION_REFLECTION(92,90); -ACE_EXPLOSION_REFLECTION(92,100); -ACE_EXPLOSION_REFLECTION(92,110); -ACE_EXPLOSION_REFLECTION(92,120); -ACE_EXPLOSION_REFLECTION(92,130); -ACE_EXPLOSION_REFLECTION(92,140); -ACE_EXPLOSION_REFLECTION(92,150); -ACE_EXPLOSION_REFLECTION(92,160); -ACE_EXPLOSION_REFLECTION(92,170); -ACE_EXPLOSION_REFLECTION(92,180); -ACE_EXPLOSION_REFLECTION(92,190); -ACE_EXPLOSION_REFLECTION(92,200); -ACE_EXPLOSION_REFLECTION(92,210); -ACE_EXPLOSION_REFLECTION(92,220); -ACE_EXPLOSION_REFLECTION(92,230); -ACE_EXPLOSION_REFLECTION(92,240); -ACE_EXPLOSION_REFLECTION(92,250); -ACE_EXPLOSION_REFLECTION(92,260); -ACE_EXPLOSION_REFLECTION(92,270); -ACE_EXPLOSION_REFLECTION(92,280); -ACE_EXPLOSION_REFLECTION(92,290); -ACE_EXPLOSION_REFLECTION(92,300); -ACE_EXPLOSION_REFLECTION(92,310); -ACE_EXPLOSION_REFLECTION(92,320); -ACE_EXPLOSION_REFLECTION(92,330); -ACE_EXPLOSION_REFLECTION(92,340); -ACE_EXPLOSION_REFLECTION(92,350); -ACE_EXPLOSION_REFLECTION(92,360); -ACE_EXPLOSION_REFLECTION(92,370); -ACE_EXPLOSION_REFLECTION(92,380); -ACE_EXPLOSION_REFLECTION(92,390); -ACE_EXPLOSION_REFLECTION(92,400); -ACE_EXPLOSION_REFLECTION(92,410); -ACE_EXPLOSION_REFLECTION(92,420); -ACE_EXPLOSION_REFLECTION(92,430); -ACE_EXPLOSION_REFLECTION(92,440); -ACE_EXPLOSION_REFLECTION(92,450); -ACE_EXPLOSION_REFLECTION(92,460); -ACE_EXPLOSION_REFLECTION(92,470); -ACE_EXPLOSION_REFLECTION(92,480); -ACE_EXPLOSION_REFLECTION(92,490); -ACE_EXPLOSION_REFLECTION(92,500); -ACE_EXPLOSION_REFLECTION(94,10); -ACE_EXPLOSION_REFLECTION(94,20); -ACE_EXPLOSION_REFLECTION(94,30); -ACE_EXPLOSION_REFLECTION(94,40); -ACE_EXPLOSION_REFLECTION(94,50); -ACE_EXPLOSION_REFLECTION(94,60); -ACE_EXPLOSION_REFLECTION(94,70); -ACE_EXPLOSION_REFLECTION(94,80); -ACE_EXPLOSION_REFLECTION(94,90); -ACE_EXPLOSION_REFLECTION(94,100); -ACE_EXPLOSION_REFLECTION(94,110); -ACE_EXPLOSION_REFLECTION(94,120); -ACE_EXPLOSION_REFLECTION(94,130); -ACE_EXPLOSION_REFLECTION(94,140); -ACE_EXPLOSION_REFLECTION(94,150); -ACE_EXPLOSION_REFLECTION(94,160); -ACE_EXPLOSION_REFLECTION(94,170); -ACE_EXPLOSION_REFLECTION(94,180); -ACE_EXPLOSION_REFLECTION(94,190); -ACE_EXPLOSION_REFLECTION(94,200); -ACE_EXPLOSION_REFLECTION(94,210); -ACE_EXPLOSION_REFLECTION(94,220); -ACE_EXPLOSION_REFLECTION(94,230); -ACE_EXPLOSION_REFLECTION(94,240); -ACE_EXPLOSION_REFLECTION(94,250); -ACE_EXPLOSION_REFLECTION(94,260); -ACE_EXPLOSION_REFLECTION(94,270); -ACE_EXPLOSION_REFLECTION(94,280); -ACE_EXPLOSION_REFLECTION(94,290); -ACE_EXPLOSION_REFLECTION(94,300); -ACE_EXPLOSION_REFLECTION(94,310); -ACE_EXPLOSION_REFLECTION(94,320); -ACE_EXPLOSION_REFLECTION(94,330); -ACE_EXPLOSION_REFLECTION(94,340); -ACE_EXPLOSION_REFLECTION(94,350); -ACE_EXPLOSION_REFLECTION(94,360); -ACE_EXPLOSION_REFLECTION(94,370); -ACE_EXPLOSION_REFLECTION(94,380); -ACE_EXPLOSION_REFLECTION(94,390); -ACE_EXPLOSION_REFLECTION(94,400); -ACE_EXPLOSION_REFLECTION(94,410); -ACE_EXPLOSION_REFLECTION(94,420); -ACE_EXPLOSION_REFLECTION(94,430); -ACE_EXPLOSION_REFLECTION(94,440); -ACE_EXPLOSION_REFLECTION(94,450); -ACE_EXPLOSION_REFLECTION(94,460); -ACE_EXPLOSION_REFLECTION(94,470); -ACE_EXPLOSION_REFLECTION(94,480); -ACE_EXPLOSION_REFLECTION(94,490); -ACE_EXPLOSION_REFLECTION(94,500); -ACE_EXPLOSION_REFLECTION(96,10); -ACE_EXPLOSION_REFLECTION(96,20); -ACE_EXPLOSION_REFLECTION(96,30); -ACE_EXPLOSION_REFLECTION(96,40); -ACE_EXPLOSION_REFLECTION(96,50); -ACE_EXPLOSION_REFLECTION(96,60); -ACE_EXPLOSION_REFLECTION(96,70); -ACE_EXPLOSION_REFLECTION(96,80); -ACE_EXPLOSION_REFLECTION(96,90); -ACE_EXPLOSION_REFLECTION(96,100); -ACE_EXPLOSION_REFLECTION(96,110); -ACE_EXPLOSION_REFLECTION(96,120); -ACE_EXPLOSION_REFLECTION(96,130); -ACE_EXPLOSION_REFLECTION(96,140); -ACE_EXPLOSION_REFLECTION(96,150); -ACE_EXPLOSION_REFLECTION(96,160); -ACE_EXPLOSION_REFLECTION(96,170); -ACE_EXPLOSION_REFLECTION(96,180); -ACE_EXPLOSION_REFLECTION(96,190); -ACE_EXPLOSION_REFLECTION(96,200); -ACE_EXPLOSION_REFLECTION(96,210); -ACE_EXPLOSION_REFLECTION(96,220); -ACE_EXPLOSION_REFLECTION(96,230); -ACE_EXPLOSION_REFLECTION(96,240); -ACE_EXPLOSION_REFLECTION(96,250); -ACE_EXPLOSION_REFLECTION(96,260); -ACE_EXPLOSION_REFLECTION(96,270); -ACE_EXPLOSION_REFLECTION(96,280); -ACE_EXPLOSION_REFLECTION(96,290); -ACE_EXPLOSION_REFLECTION(96,300); -ACE_EXPLOSION_REFLECTION(96,310); -ACE_EXPLOSION_REFLECTION(96,320); -ACE_EXPLOSION_REFLECTION(96,330); -ACE_EXPLOSION_REFLECTION(96,340); -ACE_EXPLOSION_REFLECTION(96,350); -ACE_EXPLOSION_REFLECTION(96,360); -ACE_EXPLOSION_REFLECTION(96,370); -ACE_EXPLOSION_REFLECTION(96,380); -ACE_EXPLOSION_REFLECTION(96,390); -ACE_EXPLOSION_REFLECTION(96,400); -ACE_EXPLOSION_REFLECTION(96,410); -ACE_EXPLOSION_REFLECTION(96,420); -ACE_EXPLOSION_REFLECTION(96,430); -ACE_EXPLOSION_REFLECTION(96,440); -ACE_EXPLOSION_REFLECTION(96,450); -ACE_EXPLOSION_REFLECTION(96,460); -ACE_EXPLOSION_REFLECTION(96,470); -ACE_EXPLOSION_REFLECTION(96,480); -ACE_EXPLOSION_REFLECTION(96,490); -ACE_EXPLOSION_REFLECTION(96,500); -ACE_EXPLOSION_REFLECTION(98,10); -ACE_EXPLOSION_REFLECTION(98,20); -ACE_EXPLOSION_REFLECTION(98,30); -ACE_EXPLOSION_REFLECTION(98,40); -ACE_EXPLOSION_REFLECTION(98,50); -ACE_EXPLOSION_REFLECTION(98,60); -ACE_EXPLOSION_REFLECTION(98,70); -ACE_EXPLOSION_REFLECTION(98,80); -ACE_EXPLOSION_REFLECTION(98,90); -ACE_EXPLOSION_REFLECTION(98,100); -ACE_EXPLOSION_REFLECTION(98,110); -ACE_EXPLOSION_REFLECTION(98,120); -ACE_EXPLOSION_REFLECTION(98,130); -ACE_EXPLOSION_REFLECTION(98,140); -ACE_EXPLOSION_REFLECTION(98,150); -ACE_EXPLOSION_REFLECTION(98,160); -ACE_EXPLOSION_REFLECTION(98,170); -ACE_EXPLOSION_REFLECTION(98,180); -ACE_EXPLOSION_REFLECTION(98,190); -ACE_EXPLOSION_REFLECTION(98,200); -ACE_EXPLOSION_REFLECTION(98,210); -ACE_EXPLOSION_REFLECTION(98,220); -ACE_EXPLOSION_REFLECTION(98,230); -ACE_EXPLOSION_REFLECTION(98,240); -ACE_EXPLOSION_REFLECTION(98,250); -ACE_EXPLOSION_REFLECTION(98,260); -ACE_EXPLOSION_REFLECTION(98,270); -ACE_EXPLOSION_REFLECTION(98,280); -ACE_EXPLOSION_REFLECTION(98,290); -ACE_EXPLOSION_REFLECTION(98,300); -ACE_EXPLOSION_REFLECTION(98,310); -ACE_EXPLOSION_REFLECTION(98,320); -ACE_EXPLOSION_REFLECTION(98,330); -ACE_EXPLOSION_REFLECTION(98,340); -ACE_EXPLOSION_REFLECTION(98,350); -ACE_EXPLOSION_REFLECTION(98,360); -ACE_EXPLOSION_REFLECTION(98,370); -ACE_EXPLOSION_REFLECTION(98,380); -ACE_EXPLOSION_REFLECTION(98,390); -ACE_EXPLOSION_REFLECTION(98,400); -ACE_EXPLOSION_REFLECTION(98,410); -ACE_EXPLOSION_REFLECTION(98,420); -ACE_EXPLOSION_REFLECTION(98,430); -ACE_EXPLOSION_REFLECTION(98,440); -ACE_EXPLOSION_REFLECTION(98,450); -ACE_EXPLOSION_REFLECTION(98,460); -ACE_EXPLOSION_REFLECTION(98,470); -ACE_EXPLOSION_REFLECTION(98,480); -ACE_EXPLOSION_REFLECTION(98,490); -ACE_EXPLOSION_REFLECTION(98,500); -ACE_EXPLOSION_REFLECTION(100,10); -ACE_EXPLOSION_REFLECTION(100,20); -ACE_EXPLOSION_REFLECTION(100,30); -ACE_EXPLOSION_REFLECTION(100,40); -ACE_EXPLOSION_REFLECTION(100,50); -ACE_EXPLOSION_REFLECTION(100,60); -ACE_EXPLOSION_REFLECTION(100,70); -ACE_EXPLOSION_REFLECTION(100,80); -ACE_EXPLOSION_REFLECTION(100,90); -ACE_EXPLOSION_REFLECTION(100,100); -ACE_EXPLOSION_REFLECTION(100,110); -ACE_EXPLOSION_REFLECTION(100,120); -ACE_EXPLOSION_REFLECTION(100,130); -ACE_EXPLOSION_REFLECTION(100,140); -ACE_EXPLOSION_REFLECTION(100,150); -ACE_EXPLOSION_REFLECTION(100,160); -ACE_EXPLOSION_REFLECTION(100,170); -ACE_EXPLOSION_REFLECTION(100,180); -ACE_EXPLOSION_REFLECTION(100,190); -ACE_EXPLOSION_REFLECTION(100,200); -ACE_EXPLOSION_REFLECTION(100,210); -ACE_EXPLOSION_REFLECTION(100,220); -ACE_EXPLOSION_REFLECTION(100,230); -ACE_EXPLOSION_REFLECTION(100,240); -ACE_EXPLOSION_REFLECTION(100,250); -ACE_EXPLOSION_REFLECTION(100,260); -ACE_EXPLOSION_REFLECTION(100,270); -ACE_EXPLOSION_REFLECTION(100,280); -ACE_EXPLOSION_REFLECTION(100,290); -ACE_EXPLOSION_REFLECTION(100,300); -ACE_EXPLOSION_REFLECTION(100,310); -ACE_EXPLOSION_REFLECTION(100,320); -ACE_EXPLOSION_REFLECTION(100,330); -ACE_EXPLOSION_REFLECTION(100,340); -ACE_EXPLOSION_REFLECTION(100,350); -ACE_EXPLOSION_REFLECTION(100,360); -ACE_EXPLOSION_REFLECTION(100,370); -ACE_EXPLOSION_REFLECTION(100,380); -ACE_EXPLOSION_REFLECTION(100,390); -ACE_EXPLOSION_REFLECTION(100,400); -ACE_EXPLOSION_REFLECTION(100,410); -ACE_EXPLOSION_REFLECTION(100,420); -ACE_EXPLOSION_REFLECTION(100,430); -ACE_EXPLOSION_REFLECTION(100,440); -ACE_EXPLOSION_REFLECTION(100,450); -ACE_EXPLOSION_REFLECTION(100,460); -ACE_EXPLOSION_REFLECTION(100,470); -ACE_EXPLOSION_REFLECTION(100,480); -ACE_EXPLOSION_REFLECTION(100,490); -ACE_EXPLOSION_REFLECTION(100,500); - +ACE_EXPLOSION_RANGE(2); +ACE_EXPLOSION_RANGE(4); +ACE_EXPLOSION_RANGE(6); +ACE_EXPLOSION_RANGE(8); +ACE_EXPLOSION_RANGE(10); +ACE_EXPLOSION_RANGE(12); +ACE_EXPLOSION_RANGE(14); +ACE_EXPLOSION_RANGE(16); +ACE_EXPLOSION_RANGE(18); +ACE_EXPLOSION_RANGE(20); +ACE_EXPLOSION_RANGE(22); +ACE_EXPLOSION_RANGE(24); +ACE_EXPLOSION_RANGE(26); +ACE_EXPLOSION_RANGE(28); +ACE_EXPLOSION_RANGE(30); +ACE_EXPLOSION_RANGE(32); +ACE_EXPLOSION_RANGE(34); +ACE_EXPLOSION_RANGE(36); +ACE_EXPLOSION_RANGE(38); +ACE_EXPLOSION_RANGE(40); +ACE_EXPLOSION_RANGE(42); +ACE_EXPLOSION_RANGE(44); +ACE_EXPLOSION_RANGE(46); +ACE_EXPLOSION_RANGE(48); +ACE_EXPLOSION_RANGE(50); +ACE_EXPLOSION_RANGE(52); +ACE_EXPLOSION_RANGE(54); +ACE_EXPLOSION_RANGE(56); +ACE_EXPLOSION_RANGE(58); +ACE_EXPLOSION_RANGE(60); +ACE_EXPLOSION_RANGE(62); +ACE_EXPLOSION_RANGE(64); +ACE_EXPLOSION_RANGE(66); +ACE_EXPLOSION_RANGE(68); +ACE_EXPLOSION_RANGE(70); +ACE_EXPLOSION_RANGE(72); +ACE_EXPLOSION_RANGE(74); +ACE_EXPLOSION_RANGE(76); +ACE_EXPLOSION_RANGE(78); +ACE_EXPLOSION_RANGE(80); +ACE_EXPLOSION_RANGE(82); +ACE_EXPLOSION_RANGE(84); +ACE_EXPLOSION_RANGE(86); +ACE_EXPLOSION_RANGE(88); +ACE_EXPLOSION_RANGE(90); +ACE_EXPLOSION_RANGE(92); +ACE_EXPLOSION_RANGE(94); +ACE_EXPLOSION_RANGE(96); +ACE_EXPLOSION_RANGE(98); +ACE_EXPLOSION_RANGE(100); diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf index 749c4bd2ec..f6daee1c06 100644 --- a/addons/frag/functions/fnc_doExplosions.sqf +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -1,7 +1,7 @@ -//fnc_doExplosions.sqf -#include "script_component.hpp" - -private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; +//fnc_doExplosions.sqf +#include "script_component.hpp" + +private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; _params = _this select 0; _explosions = _params select 0; _index = _params select 1; @@ -20,7 +20,7 @@ for "_i" from _index to ((_index+2) min (count _explosions)) do { }; _index = _index + 2; if(_index >= (count _explosions)) then { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; } else { _params set[1, _index]; }; diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index b0e24f0972..7702e34fd5 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -1,7 +1,7 @@ -//fnc_doReflections.sqf -#include "script_component.hpp" - -private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"]; +//fnc_doReflections.sqf +#include "script_component.hpp" + +private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"]; _pos = _this select 0; _ammo = _this select 1; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index 193e1e7154..7f8fd2a13c 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -1,6 +1,6 @@ -//fnc_findReflections.sqf -#include "script_component.hpp" - +//fnc_findReflections.sqf +#include "script_component.hpp" + private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec", "_zAng"]; _params = _this select 0; @@ -21,15 +21,15 @@ _indirectHit = _explosiveInfo select 1; _distanceCount = (floor _indirectHitRange*4) min 100; if(_zIndex < 5) then { - _lastPos = _pos; - _zAng = _zIndex*20+2; - if(_zAng > 80) then { - _radi = 1; - _zAng = 90; + _lastPos = _pos; + _zAng = _zIndex*20+2; + if(_zAng > 80) then { + _radi = 1; + _zAng = 90; }; for "_i" from 0 to _radi do { _test = true; - _vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call cba_fnc_polar2vect; + _vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call CBA_fnc_polar2vect; for "_x" from 1 to _distanceCount do { _testPos = _pos vectorAdd (_vec vectorMultiply _x); // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; @@ -43,7 +43,7 @@ if(_zIndex < 5) then { // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; // TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]]; - }; + }; // if(terrainIntersectASL [_pos, _testPos]) exitWith {}; _lastPos = _testPos; }; @@ -106,7 +106,7 @@ if(_zIndex < 5) then { _range = _range - (_range%2); if(_hit >= 10 && _range > 0) then { - // TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; + // TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; // TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]]; _refExp = format["ace_explosion_reflection_%1_%2", _range, _hit]; // _refExp createVehicle (ASLtoATL _bpos); @@ -122,5 +122,5 @@ if(_zIndex < 5) then { // _dirvec = _dirvec vectorMultiply 100; // _can setVelocity _dirvec; [DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/frag/functions/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf index 13c8f31f33..f8ddf42084 100644 --- a/addons/frag/functions/fnc_stopTracing.sqf +++ b/addons/frag/functions/fnc_stopTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(GVAR(tracesStarted)) then { GVAR(tracesStarted) = false; - [GVAR(traceID)] call cba_fnc_removePerFrameHandler; + [GVAR(traceID)] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/frag/functions/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf index b87892ab15..24910db163 100644 --- a/addons/frag/functions/fnc_trackTrace.sqf +++ b/addons/frag/functions/fnc_trackTrace.sqf @@ -10,5 +10,5 @@ if (alive _tracerObj && (count GVAR(traces)) > 0) then { _positions = _data select 4; _positions set [(count _positions), [(getPos _tracerObj), vectorMagnitude (velocity _tracerObj)]]; } else { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/gestures/$PBOPREFIX$ b/addons/gestures/$PBOPREFIX$ new file mode 100644 index 0000000000..47459a13ac --- /dev/null +++ b/addons/gestures/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\gestures \ No newline at end of file diff --git a/addons/gestures/ACE_Settings.hpp b/addons/gestures/ACE_Settings.hpp new file mode 100644 index 0000000000..a9e77807c0 --- /dev/null +++ b/addons/gestures/ACE_Settings.hpp @@ -0,0 +1,11 @@ +class ACE_Settings { + class GVAR(showOnInteractionMenu) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + category = ECSTRING(interact_menu,Category_InteractionMenu); + displayName = CSTRING(showOnInteractionMenu_displayName); + description = CSTRING(showOnInteractionMenu_description); + values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(justKeybinds), CSTRING(keysAndInteractionMenu)}; + }; +}; diff --git a/addons/gestures/CfgEventHandlers.hpp b/addons/gestures/CfgEventHandlers.hpp new file mode 100644 index 0000000000..7b003bbe8c --- /dev/null +++ b/addons/gestures/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/gestures/CfgVehicles.hpp b/addons/gestures/CfgVehicles.hpp new file mode 100644 index 0000000000..6ada84c736 --- /dev/null +++ b/addons/gestures/CfgVehicles.hpp @@ -0,0 +1,142 @@ +class CfgVehicles { + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ADDON { + displayName = CSTRING(Gestures); + condition = QUOTE((canStand _target) && GVAR(ReloadMutex) && {GVAR(showOnInteractionMenu) == 2}); + statement = ""; + showDisabled = 1; + priority = 3.5; + icon = PATHTOF(UI\gestures_ca.paa); + + class GVAR(Advance) { + displayName = CSTRING(BIgestureAdvance); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureAdvance';); + showDisabled = 1; + priority = 1.9; + }; + class GVAR(Go) { + displayName = CSTRING(BIgestureGo); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); + showDisabled = 1; + priority = 1.8; + }; + class GVAR(Follow) { + displayName = CSTRING(BIgestureFollow); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFollow';); + showDisabled = 1; + priority = 1.7; + }; + class GVAR(Up) { + displayName = CSTRING(BIgestureUp); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureUp';); + showDisabled = 1; + priority = 1.5; + }; + class GVAR(CeaseFire) { + displayName = CSTRING(BIgestureCeaseFire); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCeaseFire';); + showDisabled = 1; + priority = 1.3; + }; + class GVAR(Freeze) { + displayName = CSTRING(BIgestureFreeze); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFreeze';); + showDisabled = 1; + priority = 1.2; + }; + class GVAR(Forward) { + displayName = CSTRING(forward); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(forward)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.9; + }; + class GVAR(Regroup) { + displayName = CSTRING(regroup); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(regroup)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.8; + }; + class GVAR(Stop) { + displayName = CSTRING(stop); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(stop)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.7; + }; + class GVAR(Cover) { + displayName = CSTRING(cover); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(cover)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.6; + }; + class GVAR(Point) { + displayName = CSTRING(point); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(point)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.5; + }; + class GVAR(Engage) { + displayName = CSTRING(engage); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(engage)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.4; + }; + class GVAR(Hold) { + displayName = CSTRING(hold); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(hold)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.3; + }; + class GVAR(Warning) { + displayName = CSTRING(warning); + condition = QUOTE(canStand _target && GVAR(ReloadMutex)); + statement = QUOTE(QUOTE(QGVAR(warning)) call FUNC(playSignal)); + showDisabled = 1; + priority = 1.2; + }; + /* + class class GVAR(Yes) { + displayName = ECSTRING(common,Yes); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); + showDisabled = 1; + priority = 1.1; + }; + + class class GVAR(No) { + displayName = ECSTRING(common,No); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureNo';); + showDisabled = 1; + priority = 1.0; + }; + + class class GVAR(Hi) { + displayName = CSTRING(Gestures_Hi); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); + showDisabled = 1; + priority = 0.9; + }; + */ + + }; + + }; + }; +}; diff --git a/addons/interaction/UI/gestures_ca.paa b/addons/gestures/UI/gestures_ca.paa similarity index 100% rename from addons/interaction/UI/gestures_ca.paa rename to addons/gestures/UI/gestures_ca.paa diff --git a/addons/gestures/XEH_postInit.sqf b/addons/gestures/XEH_postInit.sqf new file mode 100644 index 0000000000..fec57ab111 --- /dev/null +++ b/addons/gestures/XEH_postInit.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +#include "key.sqf" + +// reload mutex, you can't play signal while reloading +GVAR(ReloadMutex) = true; + +// Event for main display to be loaded: +["mainDisplayLoaded", { + // handle reloading + (findDisplay 46) displayAddEventHandler ["KeyDown", { + if ((_this select 1) in actionKeys "ReloadMagazine") then { + if ((isNull ACE_player) || {!alive ACE_player}) exitWith {false}; + private _weapon = currentWeapon ACE_player; + + if (_weapon != "") then { + GVAR(ReloadMutex) = false; + + private _gesture = getText (configfile >> "CfgWeapons" >> _weapon >> "reloadAction"); + private _isLauncher = _weapon isKindOf ["Launcher", (configFile >> "CfgWeapons")]; + private _config = ["CfgGesturesMale", "CfgMovesMaleSdr"] select _isLauncher; + private _duration = getNumber (configfile >> _config >> "States" >> _gesture >> "speed"); + + if (_duration != 0) then { + _duration = if (_duration < 0) then { abs _duration } else { 1 / _duration }; + } else { + _duration = 3; + }; + + TRACE_2("Reloading, blocking gestures",_weapon,_duration); + [{GVAR(ReloadMutex) = true;}, [], _duration] call EFUNC(common,waitAndExecute); + }; + }; + false + }]; +}] call EFUNC(common,addEventHandler); diff --git a/addons/gestures/XEH_preInit.sqf b/addons/gestures/XEH_preInit.sqf new file mode 100644 index 0000000000..7fd2bb47f2 --- /dev/null +++ b/addons/gestures/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(playSignal); + +ADDON = true; diff --git a/addons/gestures/anim/ace_cover.rtm b/addons/gestures/anim/ace_cover.rtm new file mode 100644 index 0000000000..ce15001076 Binary files /dev/null and b/addons/gestures/anim/ace_cover.rtm differ diff --git a/addons/gestures/anim/ace_cover_stand_lowered.rtm b/addons/gestures/anim/ace_cover_stand_lowered.rtm new file mode 100644 index 0000000000..b6838579ba Binary files /dev/null and b/addons/gestures/anim/ace_cover_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_engage.rtm b/addons/gestures/anim/ace_engage.rtm new file mode 100644 index 0000000000..7dd573fb8f Binary files /dev/null and b/addons/gestures/anim/ace_engage.rtm differ diff --git a/addons/gestures/anim/ace_engage_stand_lowered.rtm b/addons/gestures/anim/ace_engage_stand_lowered.rtm new file mode 100644 index 0000000000..e4dee60e60 Binary files /dev/null and b/addons/gestures/anim/ace_engage_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_forward.rtm b/addons/gestures/anim/ace_forward.rtm new file mode 100644 index 0000000000..3715c4f7fc Binary files /dev/null and b/addons/gestures/anim/ace_forward.rtm differ diff --git a/addons/gestures/anim/ace_forward_stand_lowered.rtm b/addons/gestures/anim/ace_forward_stand_lowered.rtm new file mode 100644 index 0000000000..40ca7465aa Binary files /dev/null and b/addons/gestures/anim/ace_forward_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_hold.rtm b/addons/gestures/anim/ace_hold.rtm new file mode 100644 index 0000000000..e6fcb3e742 Binary files /dev/null and b/addons/gestures/anim/ace_hold.rtm differ diff --git a/addons/gestures/anim/ace_hold_stand_lowered.rtm b/addons/gestures/anim/ace_hold_stand_lowered.rtm new file mode 100644 index 0000000000..9ab8bca0cc Binary files /dev/null and b/addons/gestures/anim/ace_hold_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_point.rtm b/addons/gestures/anim/ace_point.rtm new file mode 100644 index 0000000000..9e64cc630d Binary files /dev/null and b/addons/gestures/anim/ace_point.rtm differ diff --git a/addons/gestures/anim/ace_point_stand_lowered.rtm b/addons/gestures/anim/ace_point_stand_lowered.rtm new file mode 100644 index 0000000000..4d0fc5c1d2 Binary files /dev/null and b/addons/gestures/anim/ace_point_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_regroup.rtm b/addons/gestures/anim/ace_regroup.rtm new file mode 100644 index 0000000000..2c40118e7c Binary files /dev/null and b/addons/gestures/anim/ace_regroup.rtm differ diff --git a/addons/gestures/anim/ace_regroup_stand_lowered.rtm b/addons/gestures/anim/ace_regroup_stand_lowered.rtm new file mode 100644 index 0000000000..9cd871f218 Binary files /dev/null and b/addons/gestures/anim/ace_regroup_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_stop.rtm b/addons/gestures/anim/ace_stop.rtm new file mode 100644 index 0000000000..af1d8465be Binary files /dev/null and b/addons/gestures/anim/ace_stop.rtm differ diff --git a/addons/gestures/anim/ace_stop_stand_lowered.rtm b/addons/gestures/anim/ace_stop_stand_lowered.rtm new file mode 100644 index 0000000000..8b6d9270b6 Binary files /dev/null and b/addons/gestures/anim/ace_stop_stand_lowered.rtm differ diff --git a/addons/gestures/anim/ace_warning.rtm b/addons/gestures/anim/ace_warning.rtm new file mode 100644 index 0000000000..ff42d81727 Binary files /dev/null and b/addons/gestures/anim/ace_warning.rtm differ diff --git a/addons/gestures/anim/ace_warning_stand_lowered.rtm b/addons/gestures/anim/ace_warning_stand_lowered.rtm new file mode 100644 index 0000000000..9c9e86ec79 Binary files /dev/null and b/addons/gestures/anim/ace_warning_stand_lowered.rtm differ diff --git a/addons/gestures/cfgMovesBasic.hpp b/addons/gestures/cfgMovesBasic.hpp new file mode 100644 index 0000000000..a708787fd5 --- /dev/null +++ b/addons/gestures/cfgMovesBasic.hpp @@ -0,0 +1,200 @@ +class CfgMovesBasic { + class ManActions { + GVAR(forward) = QGVAR(forward); + GVAR(stop) = QGVAR(stop); + GVAR(cover) = QGVAR(cover); + GVAR(regroup) = QGVAR(regroup); + GVAR(engage) = QGVAR(engage); + GVAR(point) = QGVAR(point); + GVAR(hold) = QGVAR(hold); + GVAR(warning) = QGVAR(warningS); + + GVAR(forwardStandLowered) = QGVAR(forwardStandLowered); + GVAR(stopStandLowered) = QGVAR(stopStandLowered); + GVAR(coverStandLowered) = QGVAR(coverStandLowered); + GVAR(regroupStandLowered) = QGVAR(regroupStandLowered); + GVAR(engageStandLowered) = QGVAR(engageStandLowered); + GVAR(pointStandLowered) = QGVAR(pointStandLowered); + GVAR(holdStandLowered) = QGVAR(holdStandLowered); + GVAR(warningStandLowered) = QGVAR(warningStandLowered); + }; + + class Actions { + class NoActions: ManActions { + GVAR(forward)[] = {QGVAR(forward), "Gesture"}; + GVAR(stop)[] = {QGVAR(stop), "Gesture"}; + GVAR(cover)[] = {QGVAR(cover), "Gesture"}; + GVAR(regroup)[] = {QGVAR(regroup), "Gesture"}; + GVAR(engage)[] = {QGVAR(engage), "Gesture"}; + GVAR(point)[] = {QGVAR(point), "Gesture"}; + GVAR(hold)[] = {QGVAR(hold), "Gesture"}; + GVAR(warning)[] = {QGVAR(warning), "Gesture"}; + + GVAR(forwardStandLowered)[] = {QGVAR(forwardStandLowered), "Gesture"}; + GVAR(stopStandLowered)[] = {QGVAR(stopStandLowered), "Gesture"}; + GVAR(coverStandLowered)[] = {QGVAR(coverStandLowered), "Gesture"}; + GVAR(regroupStandLowered)[] = {QGVAR(regroupStandLowered), "Gesture"}; + GVAR(engageStandLowered)[] = {QGVAR(engageStandLowered), "Gesture"}; + GVAR(pointStandLowered)[] = {QGVAR(pointStandLowered), "Gesture"}; + GVAR(holdStandLowered)[] = {QGVAR(holdStandLowered), "Gesture"}; + GVAR(warningStandLowered)[] = {QGVAR(warningStandLowered), "Gesture"}; + }; + }; +}; + +class CfgGesturesMale { + class Default; + + class BlendAnims { + GVAR(LeftArm)[] = { + "LeftShoulder", 1, + "LeftArm", 1, + "LeftArmRoll", 1, + "LeftForeArm", 1, + "LeftForeArmRoll", 1, + "LeftHand", 1, + "LeftHandIndex1", 1, + "LeftHandIndex2", 1, + "LeftHandIndex3", 1, + "LeftHandMiddle1", 1, + "LeftHandMiddle2", 1, + "LeftHandMiddle3", 1, + "LeftHandPinky1", 1, + "LeftHandMiddle2", 1, + "LeftHandMiddle3", 1, + "LeftHandPinky1", 1, + "LeftHandPinky2", 1, + "LeftHandPinky3", 1, + "LeftHandRing", 1, + "LeftHandRing1", 1, + "LeftHandRing2", 1, + "LeftHandRing3", 1, + "LeftHandThumb1", 1, + "LeftHandThumb2", 1, + "LeftHandThumb3", 1 + }; + }; + + class States { + class GVAR(Base): Default { + actions = "NoActions"; + canPullTrigger = 0; + connectAs = ""; + connectFrom[] = {}; + connectTo[] = {}; + disableWeapons = 0; + enableBinocular = 1; + enableMissile = 1; + enableOptics = 0; + equivalentTo = ""; + file = "\A3\anims_f\Data\anim\Sdr\gst\GestureHi.rtm"; + forceAim = 0; + headBobMode = 0; + headBobStrength = 0; + interpolateFrom[] = {}; + interpolateTo[] = {}; + interpolateWith[] = {}; + interpolationRestart = 0; + interpolationSpeed = 6; + looped = 0; + mask = QGVAR(LeftArm); + minPlayTime = 0.5; + preload = 0; + ragdoll = 0; + relSpeedMax = 1; + relSpeedMin = 1; + showHandGun = 0; + showItemInHand = 0; + showItemInRightHand = 0; + showWeaponAim = 1; + soundEdge[] = {0.5,1}; + soundEnabled = 1; + soundOverride = ""; + speed = -2; + static = 0; + terminal = 0; + Walkcycles = 1; + weaponIK = 1; + + leftHandIKBeg = 1; + leftHandIKCurve[] = {0, 1, 0.1, 0, 0.8, 0, 1, 1}; + leftHandIKEnd = 1; + + rightHandIKBeg = 1; + rightHandIKCurve[] = {1}; + rightHandIKEnd = 1; + }; + + class GVAR(forward): GVAR(Base) { + file = QUOTE(PATHTOF(anim\ace_forward.rtm)); + speed = 1; + }; + + class GVAR(forwardStandLowered): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_forward_stand_lowered.rtm)); + }; + + class GVAR(stop): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_stop.rtm)); + speed = 0.6; + }; + + class GVAR(stopStandLowered): GVAR(stop) { + file = QUOTE(PATHTOF(anim\ace_stop_stand_lowered.rtm)); + }; + + class GVAR(cover): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_cover.rtm)); + speed = 0.8; + }; + + class GVAR(coverStandLowered): GVAR(cover) { + file = QUOTE(PATHTOF(anim\ace_cover_stand_lowered.rtm)); + }; + + class GVAR(regroup): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_regroup.rtm)); + speed = 0.8; + }; + + class GVAR(regroupStandLowered): GVAR(regroup) { + file = QUOTE(PATHTOF(anim\ace_regroup_stand_lowered.rtm)); + }; + + class GVAR(engage): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_engage.rtm)); + speed = 0.9; + }; + + class GVAR(engageStandLowered): GVAR(engage) { + file = QUOTE(PATHTOF(anim\ace_engage_stand_lowered.rtm)); + }; + + class GVAR(point): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_point.rtm)); + speed = 0.8; + }; + + class GVAR(pointStandLowered): GVAR(point) { + file = QUOTE(PATHTOF(anim\ace_point_stand_lowered.rtm)); + }; + + class GVAR(hold): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_hold.rtm)); + speed = 0.8; + }; + + class GVAR(holdStandLowered): GVAR(hold) { + file = QUOTE(PATHTOF(anim\ace_hold_stand_lowered.rtm)); + }; + + class GVAR(warning): GVAR(forward) { + file = QUOTE(PATHTOF(anim\ace_warning.rtm)); + speed = 0.8; + }; + + class GVAR(warningStandLowered): GVAR(warning) { + file = QUOTE(PATHTOF(anim\ace_warning_stand_lowered.rtm)); + }; + }; +}; diff --git a/addons/gestures/config.cpp b/addons/gestures/config.cpp new file mode 100644 index 0000000000..39cb8f0951 --- /dev/null +++ b/addons/gestures/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interact_menu"}; + author[] = {"joko // Jonas", "Emperias", "Zigomarvin"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgMovesBasic.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/gestures/functions/fnc_playSignal.sqf b/addons/gestures/functions/fnc_playSignal.sqf new file mode 100644 index 0000000000..feb79f5370 --- /dev/null +++ b/addons/gestures/functions/fnc_playSignal.sqf @@ -0,0 +1,38 @@ +/* + * Author: joko // Jonas, Emperias, Zigomarvin + * Detect if the player and play the Gesture Animation + * + * Arguments: + * Animation + * + * Return Value: + * + * + * Example: + * "GeniusAnimation" call ace_gestures_fnc_playSignal + * + * Public: No + */ +#include "script_component.hpp" + +TRACE_1("params",_this); + +if (!GVAR(ReloadMutex)) exitWith {false}; +if (GVAR(showOnInteractionMenu) == 0) exitWith {false}; +if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +private _gesture = if ((_this select [0,2]) == "BI") then { + //If it starts with BI, just strip off the leading BI and use it directly + _this select [2] +} else { + //Adjust gesture based on stance: + if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then { + format ["%1StandLowered", _this] + } else { + _this + }; +}; + +TRACE_1("playing gesture",_gesture); +ACE_player playAction _gesture; +true diff --git a/addons/gestures/functions/script_component.hpp b/addons/gestures/functions/script_component.hpp new file mode 100644 index 0000000000..53f6849ebc --- /dev/null +++ b/addons/gestures/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\gestures\script_component.hpp" diff --git a/addons/gestures/key.sqf b/addons/gestures/key.sqf new file mode 100644 index 0000000000..54d6d50c0c --- /dev/null +++ b/addons/gestures/key.sqf @@ -0,0 +1,42 @@ +#include "\a3\editor_f\Data\Scripts\dikCodes.h" + +{ + _x params ["_currentName","_key"]; + + private _signalName = format [QGVAR(%1), _currentName]; + if (_currentName select [0,2] == "BI") then { + //Don't add "ace_gestures_" prefix to BI gestures + _signalName = _currentName; + }; + + private _code = (compile format [QUOTE('%1' call FUNC(playSignal);), _signalName]); + + TRACE_4("Adding KeyBind",_currentName,_signalName,_code,_key); + + [ + "ACE3 Gestures", + _currentName, + localize format[LSTRING(%1), _currentName], + _code, + {false}, + [_key, [false, (_key != -1), false]], + false + ] call CBA_fnc_addKeybind; + + false +} count [ + ["stop", DIK_NUMPAD2], + ["cover", DIK_NUMPAD3], + ["forward", DIK_NUMPAD4], + ["regroup", DIK_NUMPAD5], + ["engage", DIK_NUMPAD6], + ["point", DIK_NUMPAD7], + ["hold", DIK_NUMPAD8], + ["warning", DIK_NUMPAD9], + ["BIgestureGo", -1], + ["BIgestureAdvance", -1], + ["BIgestureFollow", -1], + ["BIgestureUp", -1], + ["BIgestureFreeze", -1], + ["BIgestureCeaseFire", -1] +]; diff --git a/addons/gestures/script_component.hpp b/addons/gestures/script_component.hpp new file mode 100644 index 0000000000..06650c6ba8 --- /dev/null +++ b/addons/gestures/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT Gestures +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_GESTURES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_GESTURES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GESTURES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/gestures/stringtable.xml b/addons/gestures/stringtable.xml new file mode 100644 index 0000000000..0d21846d58 --- /dev/null +++ b/addons/gestures/stringtable.xml @@ -0,0 +1,224 @@ + + + + + ACE Gestures + ACE Gesten + ACE Gesty + ACE Posunky + ACE Signaux + ACE Kézjelek + ACE Gesti + ACE Gestos + ACE Жесты + ACE Gestos + + + Gestures + Gesten + Gestos + Gesty + Posunky + Signaux + Жесты + Kézjelek + Gestos + Gesti + + + Advance + Vordringen + Avanzar + Naprzód + Postoupit + Avancer + Продвигаться + Előre + Avançar + Avanzare + + + Go + Los + Adelante + Szybko + Jít + Aller + Идти + Mozgás + Mover-se + Muoversi + + + Follow + Folgen + Seguirme + Za mną + Následovat + Suivre + Следовать + Utánam + Seguir + Seguire + + + Up + Aufstehen + Arriba + Do góry + Vztyk + Debout + Вверх + Fel + Acima + Alzarsi + + + Cease Fire + Feuer einstellen + Alto el fuego + Wstrzymać ogień + Zastavit palbu + Halte au feu + Прекратить огонь + Tüzet szüntess + Cessar Fogo + Cessare il Fuoco + + + Point + Zeigen + Señalar + Wskazać + Ukázat + Pointer + Показать направление + Mutat + Apontar + Puntare a + + + Freeze + Keine Bewegung + Alto + Stać + Stát + Halte + Замереть + Állj + Alto + Fermi + + + + Stop + Stop + Stop + Stop + Стоп + Parar + + + + Cover + Deckung + Cubrirse + Do osłony + Krýt se + A couvert + Укрыться + Fedezékbe + Proteger-se + Copertura + + + + Rally up + Regroupement + Sammeln + Zbiórka + Собраться + Reagrupar + + + + Move forward + En avant + Vorwärts Bewegen + Naprzód + Вперед + Mover em frente + + + + Engage + Engager + Atak + Открыть огонь + Engajar + + + + Point + Pointer + Zeigen + Wskaż + Показать направление + Ponta + + + + Hold + Tenir + Anhalten + Wstrzymać + Ждать + Esperar + + + + Warning + Attention + Achtung + Uwaga + Внимание + Aviso + + + Hi + Hallo + Hola + Witaj + Ahoj + Salut + Привет + Helló + Olá + Ciao + + + Attack + Angreifen + Atacar + Do ataku + Zaútočit + Attaquer + Атаковать + Támadás + Atacar + Attaccare + + + Show Gestures On Interaction Menu + + + Show gestures on the self interaction menu, or just use keybinds, or disable completely + + + Just Keybinds + + + Keybinds + Interaction Menu + + + \ No newline at end of file diff --git a/addons/goggles/CfgEventHandlers.hpp b/addons/goggles/CfgEventHandlers.hpp index 67f17fda18..8c24b6d5ec 100644 --- a/addons/goggles/CfgEventHandlers.hpp +++ b/addons/goggles/CfgEventHandlers.hpp @@ -14,15 +14,15 @@ class Extended_PostInit_EventHandlers { class Extended_Killed_EventHandlers { class CAManBase { class ADDON { - killed = QUOTE(_this call FUNC(handleKilled)); + clientKilled = QUOTE(_this call FUNC(handleKilled)); }; }; }; -class Extended_Fired_EventHandlers { +class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - fired = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)}); + clientFiredBIS = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleFired)}); }; }; }; @@ -30,7 +30,7 @@ class Extended_Fired_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class ADDON { - explosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)}); + clientExplosion = QUOTE(if (local (_this select 0)) then {_this call FUNC(handleExplosion)}); }; }; }; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index 09a84ad151..a4872f6a3f 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -114,16 +114,20 @@ private _fnc_checkGoggles = { // goggles effects main PFH [{ + BEGIN_COUNTER(goggles); + // rain call FUNC(applyRainEffect); // auto remove effects under water - if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then { + if (GVAR(EffectsActive) && {underwater ACE_player} && {[goggles ACE_player] call FUNC(isDivingGoggles)}) then { call FUNC(removeRainEffect); call FUNC(removeDirtEffect); call FUNC(removeDustEffect); }; // rotor wash effect - call FUNC(applyRotorWashEffect) -}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler; + call FUNC(applyRotorWashEffect); + + END_COUNTER(goggles); +}, 0.5, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index 95b699eb1c..0812200a87 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -183,13 +183,13 @@ class CfgGlasses { ACE_Resistance = 1; ACE_Protection = 1; }; - class G_Bandanna_sport:G_Bandanna_blk { + class G_Bandanna_sport: G_Bandanna_shades { ACE_Color[] = {1,0,0}; ACE_TintAmount=COLOUR; ACE_Resistance = 1; ACE_Protection = 1; }; - class G_Bandanna_aviator:G_Bandanna_blk { + class G_Bandanna_aviator: G_Bandanna_shades { ACE_Color[] = {0,0,-1}; ACE_TintAmount=COLOUR; ACE_Resistance = 1; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index c7ff386f9d..4b5ee13a0f 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith {false}; if (call FUNC(externalCamera)) exitWith {false}; private ["_unit", "_effects"]; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index 75f4853c01..944b98f127 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -15,7 +15,6 @@ */ #include "script_component.hpp" -if (GVAR(showInThirdPerson)) exitWith {}; if (call FUNC(ExternalCamera)) exitWith {}; private ["_unit", "_amount"]; diff --git a/addons/goggles/functions/fnc_externalCamera.sqf b/addons/goggles/functions/fnc_externalCamera.sqf index 1af09827ab..85776fb0d6 100644 --- a/addons/goggles/functions/fnc_externalCamera.sqf +++ b/addons/goggles/functions/fnc_externalCamera.sqf @@ -15,4 +15,8 @@ */ #include "script_component.hpp" -cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return +if (GVAR(showInThirdPerson)) then { + cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive) +} else { + cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) +}; diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index 795cdd78b1..b5c71a3d94 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -37,7 +37,6 @@ _effects set [BROKEN, true]; SETGLASSES(_unit,_effects); if (getText (_config >> "ACE_OverlayCracked") != "") then { - if (GVAR(showInThirdPerson)) exitWith {}; if (call FUNC(ExternalCamera)) exitWith {}; if (isNull (GLASSDISPLAY)) then { diff --git a/addons/grenades/functions/fnc_flare.sqf b/addons/grenades/functions/fnc_flare.sqf index bf1d571640..74360e39b9 100644 --- a/addons/grenades/functions/fnc_flare.sqf +++ b/addons/grenades/functions/fnc_flare.sqf @@ -20,8 +20,7 @@ params ["_projectile", "_color", "_intensity", "_timeToLive"]; -private "_light"; -_light = "#lightpoint" createVehicleLocal position _projectile; +private _light = "#lightpoint" createVehicleLocal position _projectile; _light setLightColor _color; _light setLightAmbient _color; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 0ac6502284..06466c70d4 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -17,14 +17,12 @@ params ["_grenade"]; -private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"]; - -_affected = _grenade nearEntities ["CAManBase", 20]; +private _affected = _grenade nearEntities ["CAManBase", 20]; { if (local _x && {alive _x}) then { - _strength = 1 - ((_x distance _grenade) min 15) / 15; + private _strength = 1 - ((_x distance _grenade) min 15) / 15; TRACE_3("FlashBangEffect Start",_x,(_x distance _grenade),_strength); @@ -47,12 +45,12 @@ _affected = _grenade nearEntities ["CAManBase", 20]; } else { //Do effects for player // is there line of sight to the grenade? - _posGrenade = getPosASL _grenade; - _eyePos = eyePos ACE_player; //PositionASL + private _posGrenade = getPosASL _grenade; + private _eyePos = eyePos ACE_player; //PositionASL _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) - _losCount = { + private _losCount = { !lineIntersects [_posGrenade vectorAdd _x, _eyePos, _grenade, ACE_player] } count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; @@ -68,9 +66,9 @@ _affected = _grenade nearEntities ["CAManBase", 20]; // account for people looking away by slightly // reducing the effect for visual effects. - _eyeDir = (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); - _dirToUnitVector = _eyePos vectorFromTo _posGrenade; - _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); + private _eyeDir = (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); + private _dirToUnitVector = _eyePos vectorFromTo _posGrenade; + private _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); // from 0-45deg, full effect if (_angleDiff > 45) then { @@ -85,7 +83,8 @@ _affected = _grenade nearEntities ["CAManBase", 20]; }; // create flash to illuminate environment - _light = "#lightpoint" createVehicleLocal (getPos _grenade); + private _light = "#lightpoint" createVehicleLocal getPos _grenade; + _light setLightBrightness 200; _light setLightAmbient [1,1,1]; _light setLightColor [1,1,1]; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index 21d132464a..ef6224f8ce 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -20,8 +20,7 @@ params ["_projectile"]; if (alive _projectile) then { playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - private "_affected"; - _affected = _projectile nearEntities ["CAManBase", 50]; + private _affected = _projectile nearEntities ["CAManBase", 50]; ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; diff --git a/addons/grenades/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf index 7789e12ac4..99149f5185 100644 --- a/addons/grenades/functions/fnc_nextMode.sqf +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -15,9 +15,7 @@ */ #include "script_component.hpp" -private ["_mode", "_hint"]; - -_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; +private _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; if (_mode == 4) then { _mode = 0; @@ -30,13 +28,13 @@ if (_mode == 3) then { _mode = 4; }; -_hint = [ -localize LSTRING(NormalThrow), -localize LSTRING(HighThrow), -localize LSTRING(PreciseThrow), -localize LSTRING(RollGrenade), -localize LSTRING(DropGrenade) -] select _mode; +private _hint = localize ([ + LSTRING(NormalThrow), + LSTRING(HighThrow), + LSTRING(PreciseThrow), + LSTRING(RollGrenade), + LSTRING(DropGrenade) +] select _mode); [_hint] call EFUNC(common,displayTextStructured); diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 9439aef4bd..e66498a854 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -30,24 +30,22 @@ if (isNull _projectile) then { _projectile = nearestObject [_unit, _ammo]; }; +private _config = configFile >> "CfgAmmo" >> _ammo; + // handle special grenades if (local _unit) then { - if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flashbang)) == 1) then { - private "_fuzeTime"; - _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); + if (getNumber (_config >> QGVAR(flashbang)) == 1) then { + private _fuzeTime = getNumber (_config >> "explosionTime"); [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime, 0] call EFUNC(common,waitAndExecute); }; }; -if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { - private ["_fuzeTime", "_timeToLive", "_color", "_intensity"]; - - _fuzeTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosionTime"); - _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive"); - _color = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(color)); - _intensity = _color select 3; - _color resize 3; +if (getNumber (_config >> QGVAR(flare)) == 1) then { + private _fuzeTime = getNumber (_config >> "explosionTime"); + private _timeToLive = getNumber (_config >> "timeToLive"); + private _color = getArray (_config >> QGVAR(color)); + private _intensity = _color deleteAt 3; [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime, 0] call EFUNC(common,waitAndExecute); }; @@ -55,12 +53,10 @@ if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(flare)) == 1) then { // handle throw modes if (_unit != ACE_player) exitWith {}; -private "_mode"; -_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; +private _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; if (_mode != 0) then { - private "_velocity"; - _velocity = velocity _projectile; + private _velocity = velocity _projectile; switch (_mode) do { //high throw diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 31282500e8..44d9e7ad47 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -100,7 +100,7 @@ M127A1 Hand Held Signal (White) M127A1 Leuchtmittel (Weiß) - Světlice M127A1 (Bílá) + Ruční signální světlice M127A1 (Bílá) M127A1 Kézi Jelzőrakéta (Fehér) M127A1 Bengala (Bianco) Flara ręczna sygnałowa M127A1 (biała) @@ -112,7 +112,7 @@ M127A1 Hand Held Signal (Red) M127A1 Leuchtmittel (Rot) - Světlice M127A1 (Červená) + Ruční signální světlice M127A1 (Červená) M127A1 Kézi Jelzőrakéta (Piros) M127A1 Bengala (Rosso) Flara ręczna sygnałowa M127A1 (czerwona) @@ -124,7 +124,7 @@ M127A1 Hand Held Signal (Green) M127A1 Leuchtmittel (Grün) - Světlice M127A1 (Zelená) + Ruční signální světlice M127A1 (Zelená) M127A1 Kézi Jelzőrakéta (Zöld) M127A1 Bengala (Verde) Flara ręczna sygnałowa M127A1 (zielona) @@ -136,7 +136,7 @@ M127A1 Hand Held Signal (Yellow) M127A1 Leuchtmittel (Gelb) - Světlice M127A1 (Žlutá) + Ruční signální světlice M127A1 (Žlutá) M127A1 Kézi Jelzőrakéta (Sárga) M127A1 Bengala (Giallo) Flara ręczna sygnałowa M127A1 (żółta) @@ -148,7 +148,7 @@ White Hand Flare Weiße Leuchtkugel, wird wie eine Granate geworfen. - Světlice (Bílá) + Ruční světlice (Bílá) Kézi jelzőrakéta, Fehér színű Bengala (Bianco) Flara ręczna (biała) @@ -160,7 +160,7 @@ Red Hand Flare Rote Leuchtkugel, wird wie eine Granate geworfen. - Světlice (Červená) + Ruční světlice (Červená) Kézi jelzőrakéta, Piros színű Bengala (Rosso) Flara ręczna (czerwona) @@ -172,7 +172,7 @@ Green Hand Flare Grüne Leuchtkugel, wird wie eine Granate geworfen. - Světlice (Zelená) + Ruční světlice (Zelená) Kézi jelzőrakéta, Zöld színű Bengala (Verde) Flara ręczna (zielona) @@ -184,7 +184,7 @@ Yellow Hand Flare Gelbe Leuchtkugel, wird wie eine Granate geworfen. - Světlice (Žlutá) + Ruční světlice (Žlutá) Kézi jelzőrakéta, Sárga színű Bengala (Giallo) Flara ręczna (żółta) @@ -242,4 +242,4 @@ M127A1 (Amarilla) - + \ No newline at end of file diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp index 262c3edc34..13f445a987 100644 --- a/addons/hearing/ACE_Settings.hpp +++ b/addons/hearing/ACE_Settings.hpp @@ -25,4 +25,10 @@ class ACE_Settings { displayName = CSTRING(enabledForZeusUnits_DisplayName); description = CSTRING(enabledForZeusUnits_Description); }; + class GVAR(autoAddEarplugsToUnits) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(autoAddEarplugsToUnits_DisplayName); + description = CSTRING(autoAddEarplugsToUnits_Description); + }; }; diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index f09f259266..e31501d1c3 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers { class Extended_Init_EventHandlers { class CAManBase { class GVAR(AddEarPlugs) { - init = QUOTE( if (local (_this select 0)) then {_this call FUNC(addEarPlugs)}; ); + serverInit = QUOTE( _this call FUNC(addEarPlugs) ); }; }; }; @@ -33,3 +33,11 @@ class Extended_Explosion_EventHandlers { }; }; }; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(_this call FUNC(handleRespawn)); + }; + }; +}; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 72377ca970..3873377052 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -11,7 +11,6 @@ class CfgVehicles { showDisabled = 0; priority = 2.5; icon = PATHTOF(UI\ACE_earplugs_x_ca.paa); - hotkey = "E"; }; class ACE_RemoveEarplugs { displayName = CSTRING(EarPlugs_Off); @@ -21,7 +20,6 @@ class CfgVehicles { showDisabled = 0; priority = 2.5; icon = PATHTOF(UI\ACE_earplugs_x_ca.paa); - hotkey = "E"; }; }; }; @@ -137,6 +135,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class autoAddEarplugsToUnits { + displayName = CSTRING(autoAddEarplugsToUnits_DisplayName); + description = CSTRING(autoAddEarplugsToUnits_Description); + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 7c21baaed2..7e1c932f62 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -42,7 +42,8 @@ class CfgWeapons { class H_PilotHelmetFighter_O: H_PilotHelmetFighter_B {}; class H_PilotHelmetFighter_I: H_PilotHelmetFighter_B {}; - class H_Cap_headphones: H_HelmetB { + class HelmetBase; + class H_Cap_headphones: HelmetBase { GVAR(protection) = 0.5; GVAR(lowerVolume) = 0.60; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 66406ad917..b8745acaaa 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -26,7 +26,7 @@ GVAR(time4) = 0; ["playerChanged", { GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; - ACE_player setvariable [QGVAR(deaf), false]; + ACE_player setVariable [QGVAR(deaf), false]; GVAR(beep) = false; GVAR(beep2) = false; diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 16b9f35f80..3355d0cff4 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(addEarPlugs); PREP(earRinging); PREP(explosionNear); PREP(firedNear); +PREP(handleRespawn); PREP(hasEarPlugsIn); PREP(moduleHearing); PREP(putInEarPlugs); diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index b2e43bc718..9e6bd0cab2 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -14,29 +14,50 @@ * Public: No */ #include "script_component.hpp" + params ["_unit"]; +TRACE_2("params",_unit,typeOf _unit); -// Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios) -if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; +// only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addEarPlugs), _this]; +}; -private ["_launcher"]; +// Exit if hearing is disabled OR autoAdd is disabled OR soldier has earplugs already in (persistence scenarios) +if (!GVAR(enableCombatDeafness) || {!GVAR(autoAddEarplugsToUnits)} || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; // add earplugs if the soldier has a rocket launcher -_launcher = secondaryWeapon _unit; - -if (_launcher != "") exitWith { +if ((secondaryWeapon _unit) != "") exitWith { + TRACE_1("has launcher - adding",_unit); _unit addItem "ACE_EarPlugs"; }; // otherwise add earplugs if the soldier has a big rifle -private ["_magazine", "_ammo"]; +if ((primaryWeapon _unit) == "") exitWith {}; -_magazine = primaryWeaponMagazine _unit select 0; +(primaryWeaponMagazine _unit) params [["_magazine", ""]]; +if (_magazine == "") exitWith {}; -if (isNil "_magazine") exitWith {}; +private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); +private _count = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); -_ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); +private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); +_caliber = call { + if (_ammo isKindOf ["ShellBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; + if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; + if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; + if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; + if (_caliber <= 0) then { 6.5 } else { _caliber }; +}; +private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; -if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "audiblefire") > 8) then { +//If unit has a machine gun boost effective loudness 50% +if (_count >= 50) then {_loudness = _loudness * 1.5}; + +TRACE_2("primaryWeapon",_unit,_loudness); + +if (_loudness > 0.2) then { + TRACE_1("loud gun - adding",_unit); _unit addItem "ACE_EarPlugs"; }; diff --git a/addons/hearing/functions/fnc_handleRespawn.sqf b/addons/hearing/functions/fnc_handleRespawn.sqf new file mode 100644 index 0000000000..527d5d6b16 --- /dev/null +++ b/addons/hearing/functions/fnc_handleRespawn.sqf @@ -0,0 +1,35 @@ +/* + * Author: PabstMirror + * Reset earplugs on respawn, and then re-add if appropriate + * + * Arguments: + * 0: Unit + * + * Return Value: + * Nothing + * + * Example: + * [player] call ACE_hearing_fnc_handleRespawn; + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; +TRACE_2("params",_unit,typeOf _unit); + +if (!local _unit) exitWith {}; //XEH should only be called on local units + +private _respawn = [0] call BIS_fnc_missionRespawnType; + +//if respawn is not Group or side: +if (_respawn <= 3) then { + //Remove earplugs if they have them: + if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { + TRACE_1("had EarPlugs in - removing",_unit); + _unit setVariable ["ACE_hasEarPlugsin", false, true]; + }; +}; + +//Re-add if they need them: +[_unit] call FUNC(addEarPlugs); diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 0aa8843485..35836ddb0c 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -20,4 +20,5 @@ if ((_logic getVariable "DisableEarRinging") != -1) then { }; [_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(autoAddEarplugsToUnits), "autoAddEarplugsToUnits"] call EFUNC(common,readSettingFromModule); ACE_LOGINFO("Hearing Module Initialized."); diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index f1cb063971..e36151aea4 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -42,7 +42,7 @@ if (!_justUpdateVolume) then { GVAR(deafnessPrior) = GVAR(deafnessDV); if (GVAR(deafnessDV) > 19.75) then { - ACE_player setvariable [QGVAR(deaf), true]; + ACE_player setVariable [QGVAR(deaf), true]; if ((!GVAR(DisableEarRinging)) && {ACE_time > GVAR(time4)}) then { playSound "ACE_Combat_Deafness"; GVAR(beep2) = true; @@ -50,7 +50,7 @@ if (!_justUpdateVolume) then { GVAR(time4) = ACE_time + 30; }; } else { - ACE_player setvariable [QGVAR(deaf), false]; + ACE_player setVariable [QGVAR(deaf), false]; }; if (GVAR(deafnessDV) > 10) then { diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 05dde3a1bf..71767a0cb0 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -51,7 +51,7 @@ Earplugs in - Ohrenstöpsel drinnen + Ohrenstöpsel drin Tapones puestos Stopery włożone Špunty v uších @@ -153,17 +153,33 @@ Effect Zeus RC + Beeinflusst Zeus-Einheiten Wpływ na Zeus RC Влияет на юнита Зевса Afeta Zeus CR Efecto Zeus RC + Ovlivnit Zeus RC Allow zeus remote controlled units to be able to take hearing damage. + Erlaubt, durch von Zeus gesteuerten Einheiten, einen Hörschaden davonzutragen. Aktywuj efekty utraty słuchu dla jednostek kontrolowanych zdalnie przez Zeusa. Контролирует оглушение в бою и звон в ушах. При активации играки могут быть оглушены близкими выстрелами и взрывами при отсутствии защиты для ушей. Permite que unidades remotamente controladas pelo Zeus sejam atingidas por danos auditivos. Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos. + Aktivovat efekt ztráty sluchu pro vzdáleně ovládané jednotky. + + + Add earplugs to units + Dodaj stopery dla jednostek + Добавлять юнитам беруши + Adiciona protetores de ouvido as unidades + + + Add the `ACE_EarPlugs` item to all units that have loud weapons. Can disable if using custom loadouts. + Dodaje `ACE_EarPlugs` - stopery - do wszystkich jednostek, które posiadają głośną broń. Można wyłaczyć w przypadku korzystania z niestandardowych loadoutów. + Добавляет предмет `ACE_EarPlugs` всем юнитам, которые имеют громкое оружие. Можно отключить при ручной настройке снаряжения. + Adicionar o item `ACE_EarPlugs` a todas as unidades que tenham armas barulhentas. Pode ser desabilitado com carregamentos customizados. \ No newline at end of file diff --git a/addons/hitreactions/XEH_preInit.sqf b/addons/hitreactions/XEH_preInit.sqf index d3c0973ee7..88df4102a1 100644 --- a/addons/hitreactions/XEH_preInit.sqf +++ b/addons/hitreactions/XEH_preInit.sqf @@ -3,5 +3,6 @@ ADDON = false; PREP(fallDown); +PREP(getRandomAnimation); ADDON = true; diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index d93b99bd6b..9ed43ae14f 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -35,8 +35,7 @@ if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { [_unit] call EFUNC(medical,playInjuredSound); }; -private "_vehicle"; -_vehicle = vehicle _unit; +private _vehicle = vehicle _unit; // handle static weapons if (_vehicle isKindOf "StaticWeapon") exitWith { @@ -53,61 +52,20 @@ if (_vehicle != _unit) exitWith {}; if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {}; // handle ladders -if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit >> "AGM_isLadder") == 1) exitWith { +if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit >> "ACE_isLadder") == 1) exitWith { _unit action ["LadderOff", nearestObject [position _unit, "House"]]; }; // only play animation when standing due to lack of animations, sry if !(stance _unit in ["CROUCH", "STAND"]) exitWith {}; -private "_velocity"; -_velocity = vectorMagnitude velocity _unit; +private _velocity = vectorMagnitude velocity _unit; // only fall when moving if (_velocity < 2) exitWith {}; // get correct animation by weapon -private "_anim"; - -call { - private "_weapon"; - _weapon = currentWeapon _unit; - - if (_weapon == "") exitWith { - _anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon" - }; - - if (_weapon == primaryWeapon _unit) exitWith { - if ([_unit] call EFUNC(common,isPlayer)) then { - private "_isRunning"; - _isRunning = _velocity > 4; - - _anim = [ - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" - ] select floor random 4; - } else { - _anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"; - }; - }; - - if (_weapon == handgunWeapon _unit) exitWith { - if ([_unit] call EFUNC(common,isPlayer)) then { - _anim = [ - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" - ] select floor random 4; - } else { - _anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"; - }; - }; - - _anim = ""; -}; +private _anim = _unit call FUNC(getRandomAnimation); // exit if no animation for this weapon exists, i.e. binocular or rocket launcher if (_anim == "") exitWith {}; diff --git a/addons/hitreactions/functions/fnc_getRandomAnimation.sqf b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf new file mode 100644 index 0000000000..996901a31e --- /dev/null +++ b/addons/hitreactions/functions/fnc_getRandomAnimation.sqf @@ -0,0 +1,51 @@ +/* + * Author: commy2 + * Get a random fall animation for the unit. + * + * Arguments: + * 0: unit + * + * Return Value: + * Fall animation + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +private _weapon = currentWeapon _unit; + +if (_weapon == "") exitWith { + "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon" +}; + +if (_weapon == primaryWeapon _unit) exitWith { + if (_unit call EFUNC(common,isPlayer)) then { + private _isRunning = _velocity > 4; + + [ + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" + ] select floor random 4 + } else { + "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon" + }; +}; + +if (_weapon == handgunWeapon _unit) exitWith { + if (_unit call EFUNC(common,isPlayer)) then { + [ + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" + ] select floor random 4 + } else { + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon" + }; +}; + +"" diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index 9426de13fd..2eb7611a6a 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -93,7 +93,7 @@ GVAR(no_cams) sort true; GVAR(pos) = getPosVisual GVAR(huntIR); if ((!dialog) || (count GVAR(no_cams) == 0) || ((GVAR(pos) select 2) <= 20)) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; GVAR(stop) = true; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index b1c269533d..e06ada87ea 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -48,7 +48,7 @@ createDialog "ace_huntir_cam_dialog_off"; _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; if ((!dialog) || GVAR(done)) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; if (dialog && GVAR(state) == "connected") then { [_nearestHuntIRs select 0] call FUNC(cam); diff --git a/addons/huntir/stringtable.xml b/addons/huntir/stringtable.xml index 3af7f8157b..5cb9729dd7 100644 --- a/addons/huntir/stringtable.xml +++ b/addons/huntir/stringtable.xml @@ -1,11 +1,11 @@ - + HuntIR Transport Box HuntIR Transportkiste Caja de transporte de HuntIR - Trasnportní bedna HuntIR + Transportní bedna HuntIR Ящик с HuntIR HuntIR Transport Box Skrzynia HuntIR @@ -194,4 +194,4 @@ Esc - Sai do Ajuda - + \ No newline at end of file diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 59fb01a353..f5e8a57db5 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -41,14 +41,14 @@ GVAR(ParsedTextCached) = []; // Statement [0] call FUNC(keyDown) },{[0,false] call FUNC(keyUp)}, -[219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key +[219, [false, false, false]], false] call CBA_fnc_addKeybind; //Left Windows Key ["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)), { // Statement [1] call FUNC(keyDown) },{[1,false] call FUNC(keyUp)}, -[219, [false, true, false]], false] call cba_fnc_addKeybind; //Left Windows Key + Ctrl/Strg +[219, [false, true, false]], false] call CBA_fnc_addKeybind; //Left Windows Key + Ctrl/Strg // Listens for the falling unconscious event, just in case the menu needs to be closed @@ -77,37 +77,6 @@ GVAR(ParsedTextCached) = []; if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; }] call EFUNC(common,addEventHandler); -// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings) -["zeusDisplayChanged",{ - if (_this select 1) then { - (finddisplay 312) displayAddEventHandler ["KeyUp", { - _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; - _key = _key select 5; - _dik = _key select 0; - _mods = _key select 1; - - if ((_this select 1) == _dik) then { - if ((_this select [2,3]) isEqualTo _mods) then { - [_this,'keyup'] call CBA_events_fnc_keyHandler - }; - }; - }]; - (finddisplay 312) displayAddEventHandler ["KeyDown", { - _key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind; - _key = _key select 5; - _dik = _key select 0; - _mods = _key select 1; - - if ((_this select 1) == _dik) then { - if ((_this select [2,3]) isEqualTo _mods) then { - [_this,'keydown'] call CBA_events_fnc_keyHandler - }; - }; - }]; - }; -}] call EFUNC(common,addEventHandler); - - //Debug to help end users identify mods that break CBA's XEH [{ private ["_badClassnames"]; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 6dd4c5ee74..d84130e21c 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -17,7 +17,7 @@ params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; _isMan = false; -if (typeName _target == "OBJECT") then { +if (_target isEqualType objNull) then { _objectType = typeOf _target; _isMan = _target isKindOf "CAManBase"; }; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 2c8cdc279c..123f83110d 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -17,7 +17,7 @@ params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; _isMan = false; -if (typeName _target == "OBJECT") then { +if (_target isEqualType objNull) then { _objectType = typeOf _target; _isMan = _target isKindOf "CAManBase"; }; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 256984c104..0edef384d4 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -40,11 +40,11 @@ params [ ["_modifierFunction", {}] ]; -_position = if (typeName (_position) == "STRING") then { +_position = if (_position isEqualType "") then { // If the action is set to a selection, create the suitable code compile format ["_target selectionPosition '%1'", _position]; } else { - if (typeName (_position) == "ARRAY") then { + if (_position isEqualType []) then { // If the action is set to a array position, create the suitable code compile format ["%1", _position]; } else { diff --git a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf index 13b241e1d1..334fc13f25 100644 --- a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf +++ b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf @@ -6,6 +6,6 @@ params ["_ctrl", "_index", "_text"]; //systemChat str (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")); if (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")) then { - GVAR(ParsedTextCached) set [_index, _text]; - _ctrl ctrlSetStructuredText parseText _text; + GVAR(ParsedTextCached) set [_index, _text]; + _ctrl ctrlSetStructuredText parseText _text; }; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 1a14acae07..1f7cf8140b 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -78,10 +78,10 @@ if (GVAR(openedMenuType) >= 0) then { // Execute the current action if it's run on hover private _tmp = ((GVAR(selectedAction) select 0) select 9) select 3; private _runOnHover = true; - if ((typeName _tmp) == "CODE" ) then { + if (_tmp isEqualType {}) then { _runOnHover = call _tmp; } else { - if ((typeName _tmp) == "BOOL" ) then { + if (_tmp isEqualType false) then { _runOnHover = _tmp; } else { _runOnHover = _tmp > 0; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 81a6887f97..c5b2c887ce 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -34,7 +34,7 @@ _fnc_renderNearbyActions = { // Quick oclussion test. Skip objects more than 1 m behind the camera plane _lambda = ((getPosASL _x) vectorDiff _cameraPos) vectorDotProduct _cameraDir; - if (_lambda > -1) then { + if ((_lambda > -1) && {!isObjectHidden _target}) then { _numInteractions = 0; // Prevent interacting with yourself or your own vehicle if (_target != ACE_player && {_target != vehicle ACE_player}) then { diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 8b8ae963d9..573845c08a 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -116,7 +116,7 @@ _angle = _centerAngle - _angleSpan / 2; private ["_offset","_newPos"]; _newPos = if (GVAR(UseListMenu)) then { [(_sPos select 0) + _scaleX, - (_sPos select 1) + _scaleY * (_foreachindex - _numChildren/2 + 0.5)]; + (_sPos select 1) + _scaleY * (_forEachIndex - _numChildren/2 + 0.5)]; } else { [(_sPos select 0) - _scaleX * (cos _angle), (_sPos select 1) + _scaleY * (sin _angle)]; diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf index fdd7d14573..98abfdccd1 100644 --- a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -80,11 +80,10 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; // systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime]; { _helperPos = (_houseBeingScaned modelToWorld (_houseBeingScaned selectionPosition _x)) call EFUNC(common,positionToASL); - _helperObject = "Sign_Sphere25cm_F" createVehicleLocal _helperPos; + _helperObject = "ACE_LogicDummy" createVehicleLocal _helperPos; _addedHelpers pushBack _helperObject; _helperObject setVariable [QGVAR(building), _houseBeingScaned]; _helperObject setPosASL _helperPos; - _helperObject hideObject true; TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned); { diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 37da2aa95c..3f3ad122f2 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -301,9 +301,15 @@ Interaction Animation Speed + Szybkość animacji interakcji + Скорость анимации меню взаимодействия + Velocidade da animação de interação Makes menu animations faster and decreases the time needed to hover to show sub actions + Przyśpiesza animacje menu interakcji oraz czas wymagany do pokazania podmenu + Ускоряет анимацию меню и уменьшает задержку при наведении мыши для раскрытия подменю + Faz com que as animações do menu de interação sejam mais rápidas, dimiuindo a necessidade de esperar para mostrar as ações - + \ No newline at end of file diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp index 075c1f056d..a4e6dad42c 100644 --- a/addons/interaction/ACE_Settings.hpp +++ b/addons/interaction/ACE_Settings.hpp @@ -4,4 +4,11 @@ class ACE_Settings { value = 1; typeName = "BOOL"; }; + class GVAR(enableMagazinePassing) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(PassMagazineSetting); + category = ECSTRING(interact_menu,Category_InteractionMenu); + }; }; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index dfe4f2025e..494f1d109e 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -36,6 +36,32 @@ class CfgVehicles { icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; selection = "pelvis"; + class ACE_PassMagazine { + displayName = CSTRING(PassMagazine); + condition = ""; + statement = ""; + showDisabled = 0; + priority = 3.3; + icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\cargomag_ca.paa"; + + class ACE_PassMagazinePrimary { + displayName = CSTRING(PassMagazinePrimary); + condition = QUOTE([ARR_3(_player,_target,primaryWeapon _target)] call FUNC(canPassMagazine)); + statement = QUOTE([ARR_3(_player,_target,primaryWeapon _target)] call FUNC(passMagazine)); + showDisabled = 0; + priority = 3; + icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\primaryweapon_ca.paa"; + }; + class ACE_PassMagazineHandgun { + displayName = CSTRING(PassMagazineHandgun); + condition = QUOTE([ARR_3(_player,_target,handgunWeapon _target)] call FUNC(canPassMagazine)); + statement = QUOTE([ARR_3(_player,_target,handgunWeapon _target)] call FUNC(passMagazine)); + showDisabled = 0; + priority = 1; + icon = "\a3\ui_f\data\gui\Rsc\RscDisplayArsenal\handgun_ca.paa"; + }; + }; + class ACE_TeamManagement { displayName = CSTRING(TeamManagement); condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); @@ -43,7 +69,6 @@ class CfgVehicles { showDisabled = 0; priority = 3.2; icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; class ACE_AssignTeamRed { displayName = CSTRING(AssignTeamRed); @@ -52,7 +77,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\team\team_red_ca.paa); priority = 2.4; - hotkey = "R"; }; class ACE_AssignTeamGreen { displayName = CSTRING(AssignTeamGreen); @@ -61,7 +85,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\team\team_green_ca.paa); priority = 2.3; - hotkey = "G"; }; class ACE_AssignTeamBlue { displayName = CSTRING(AssignTeamBlue); @@ -70,7 +93,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\team\team_blue_ca.paa); priority = 2.2; - hotkey = "B"; }; class ACE_AssignTeamYellow { displayName = CSTRING(AssignTeamYellow); @@ -79,7 +101,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\team\team_yellow_ca.paa); priority = 2.1; - hotkey = "Y"; }; class ACE_UnassignTeam { displayName = CSTRING(LeaveTeam); @@ -88,7 +109,6 @@ class CfgVehicles { showDisabled = 1; icon = PATHTOF(UI\team\team_white_ca.paa); priority = 2.5; - hotkey = "N"; }; }; @@ -99,7 +119,6 @@ class CfgVehicles { showDisabled = 0; priority = 2.6; icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "J"; }; class ACE_GetDown { displayName = CSTRING(GetDown); @@ -198,7 +217,6 @@ class CfgVehicles { showDisabled = 1; priority = 3.2; icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; class ACE_JoinTeamRed { displayName = CSTRING(JoinTeamRed); @@ -208,7 +226,6 @@ class CfgVehicles { showDisabled = 1; priority = 2.4; icon = PATHTOF(UI\team\team_red_ca.paa); - hotkey = "R"; }; class ACE_JoinTeamGreen { displayName = CSTRING(JoinTeamGreen); @@ -218,7 +235,6 @@ class CfgVehicles { showDisabled = 1; priority = 2.3; icon = PATHTOF(UI\team\team_green_ca.paa); - hotkey = "G"; }; class ACE_JoinTeamBlue { displayName = CSTRING(JoinTeamBlue); @@ -228,7 +244,6 @@ class CfgVehicles { showDisabled = 1; priority = 2.2; icon = PATHTOF(UI\team\team_blue_ca.paa); - hotkey = "B"; }; class ACE_JoinTeamYellow { displayName = CSTRING(JoinTeamYellow); @@ -238,7 +253,6 @@ class CfgVehicles { showDisabled = 1; priority = 2.1; icon = PATHTOF(UI\team\team_yellow_ca.paa); - hotkey = "Y"; }; class ACE_LeaveTeam { displayName = CSTRING(LeaveTeam); @@ -248,7 +262,6 @@ class CfgVehicles { showDisabled = 1; priority = 2.5; icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "N"; }; class ACE_BecomeLeader { displayName = CSTRING(BecomeLeader); @@ -258,7 +271,6 @@ class CfgVehicles { showDisabled = 1; priority = 1.0; icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "L"; }; class ACE_LeaveGroup { displayName = CSTRING(LeaveGroup); @@ -268,115 +280,8 @@ class CfgVehicles { showDisabled = 1; priority = 1.2; icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; }; }; - - class ACE_Gestures { - displayName = CSTRING(Gestures); - condition = "canStand _target"; - statement = ""; - showDisabled = 1; - priority = 3.5; - icon = PATHTOF(UI\gestures_ca.paa); - hotkey = "G"; - - /*class ACE_Gesture_Advance { - displayName = CSTRING(Gestures_Attack); - condition = "canStand _target"; - statement = "_target playActionNow 'gestureAttack';"; - showDisabled = 1; - priority = 2.0; - };*/ - class ACE_Gesture_Advance { - displayName = CSTRING(Gestures_Advance); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureAdvance';); - showDisabled = 1; - priority = 1.9; - hotkey = "1"; - }; - class ACE_Gesture_Go { - displayName = CSTRING(Gestures_Go); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); - showDisabled = 1; - priority = 1.8; - hotkey = "2"; - }; - class ACE_Gesture_Follow { - displayName = CSTRING(Gestures_Follow); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFollow';); - showDisabled = 1; - priority = 1.7; - hotkey = "3"; - }; - /*class ACE_Gesture_Point { - displayName = CSTRING(Gestures_Point); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gesturePoint';); - showDisabled = 1; - priority = 1.6; - };*/ - class ACE_Gesture_Up { - displayName = CSTRING(Gestures_Up); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureUp';); - showDisabled = 1; - priority = 1.5; - hotkey = "4"; - }; - class ACE_Gesture_Cover { - displayName = CSTRING(Gestures_Cover); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCover';); - showDisabled = 1; - priority = 1.4; - hotkey = "5"; - }; - class ACE_Gesture_CeaseFire { - displayName = CSTRING(Gestures_Cease_Fire); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCeaseFire';); - showDisabled = 1; - priority = 1.3; - hotkey = "6"; - }; - class ACE_Gesture_Freeze { - displayName = CSTRING(Gestures_Freeze); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFreeze';); - showDisabled = 1; - priority = 1.2; - hotkey = "7"; - }; - class ACE_Gesture_Yes { - displayName = ECSTRING(common,Yes); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); - showDisabled = 1; - priority = 1.1; - hotkey = "8"; - }; - class ACE_Gesture_No { - displayName = ECSTRING(common,No); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureNo';); - showDisabled = 1; - priority = 1.0; - hotkey = "9"; - }; - class ACE_Gesture_Hi { - displayName = CSTRING(Gestures_Hi); - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); - showDisabled = 1; - priority = 0.9; - hotkey = "0"; - }; - }; - class ACE_Equipment { displayName = CSTRING(Equipment); condition = QUOTE(true); @@ -385,7 +290,6 @@ class CfgVehicles { showDisabled = 1; priority = 4.5; icon = ""; // @todo - hotkey = "E"; }; }; }; @@ -558,6 +462,14 @@ class CfgVehicles { }; }; + class Pod_Heli_Transport_04_base_F: StaticWeapon { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + distance = 5; + }; + }; + }; + class StaticMGWeapon: StaticWeapon {}; class HMG_01_base_F: StaticMGWeapon {}; @@ -585,8 +497,8 @@ class CfgVehicles { }; }; - class thingX; - class ReammoBox_F: thingX { + class ThingX; + class ReammoBox_F: ThingX { class ACE_Actions { class ACE_MainActions { displayName = CSTRING(MainAction); @@ -607,7 +519,7 @@ class CfgVehicles { class ACE_SelfActions {}; }; - class ACE_RepairItem_Base: thingX { + class ACE_RepairItem_Base: ThingX { class ACE_Actions { class ACE_MainActions { displayName = CSTRING(MainAction); @@ -619,4 +531,23 @@ class CfgVehicles { class ACE_SelfActions {}; }; + + class RoadCone_F: ThingX { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 2; + condition = "true"; + }; + }; + }; + + class RoadBarrier_F: RoadCone_F { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0,0.500671]"; + }; + }; + }; }; diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index ee90af64ad..bed8a349bc 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -29,19 +29,11 @@ GVAR(isOpeningDoor) = false; if (_unit == ACE_player) then { addCamShake [4, 0.5, 5]; - private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0)); - [_message] call FUNC(displayTextStructured); + private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 1)); + [_message] call EFUNC(common,displayTextStructured); }; }] call EFUNC(common,addEventHandler); -// restore global fire teams for JIP -private "_team"; -{ - _team = _x getVariable [QGVAR(assignedFireTeam), ""]; - if (_team != "") then {_x assignTeam _team}; - false -} count allUnits; - // add keybinds ["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), { // Conditions: canInteract @@ -67,8 +59,11 @@ private "_team"; // Conditions: specific if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; + //Tap whichever shoulder is closest + private _shoulderNum = [0, 1] select (([cursorTarget, ACE_player] call BIS_fnc_relativeDirTo) > 180); + // Statement - [ACE_player, cursorTarget, 0] call FUNC(tapShoulder); + [ACE_player, cursorTarget, _shoulderNum] call FUNC(tapShoulder); true }, {false}, diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index 95be20f141..258567482d 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -20,6 +20,8 @@ PREP(sendAway); PREP(canJoinGroup); PREP(canJoinTeam); PREP(joinTeam); +PREP(canPassMagazine); +PREP(passMagazine); PREP(canBecomeLeader); PREP(doBecomeLeader); PREP(canTapShoulder); diff --git a/addons/interaction/functions/fnc_canPassMagazine.sqf b/addons/interaction/functions/fnc_canPassMagazine.sqf new file mode 100644 index 0000000000..1c1dd1bb2d --- /dev/null +++ b/addons/interaction/functions/fnc_canPassMagazine.sqf @@ -0,0 +1,30 @@ +/* + * Author: BaerMitUmlaut + * Checks if unit has a spare magazine for the specified weapon. + * + * Arguments: + * 0: Unit that passes the magazine + * 1: Unit to pass the magazine to + * 2: Weapon classname + * + * Return Value: + * Unit can pass magazine + * + * Example: + * [_player, _target, "arifle_MX_F"] call ace_interaction_fnc_canPassMagazine + * + * Public: No + */ + +#include "script_component.hpp" +params ["_player", "_target", "_weapon"]; +private ["_compatibleMags"]; + +if (!GVAR(enableMagazinePassing)) exitWith {false}; + +_compatibleMags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); +{ + _x params ["_className", "", "_loaded"]; + if ((_className in _compatibleMags) && {!_loaded} && {_target canAdd _className}) exitWith {true}; + false +} foreach (magazinesAmmoFull _player); diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index 39f43e7fa3..d7f9d9140e 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -19,4 +19,4 @@ if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith { (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -showHUD true; +["mouseHint", []] call EFUNC(common,showHud); //This is equivalent to the old showHud true diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 9283e7b474..1ada3843c1 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -18,15 +18,11 @@ params ["_unit", "_team"]; -// make sure correct team is set on JIP -_unit setVariable [QGVAR(assignedFireTeam), _team, true]; - -// join fire team on every machine in that group -["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent); +["CBA_teamColorChanged", [_unit, _team]] call CBA_fnc_globalEvent; // display message if (_unit == ACE_player) then { - private "_message"; + private "_message"; if (_team == "MAIN") then { _message = localize LSTRING(LeftTeam); diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf new file mode 100644 index 0000000000..2afe2f3817 --- /dev/null +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -0,0 +1,57 @@ +/* + * Author: BaerMitUmlaut + * Pass spare magazine for the specified weapon. + * + * Arguments: + * 0: Unit that passes the magazine + * 1: Unit to pass the magazine to + * 2: Weapon classname + * + * Return Value: + * None + * + * Example: + * [_player, _target, "arifle_MX_F"] call ace_interaction_fnc_magToPassazine + * + * Public: No + */ + +#include "script_component.hpp" +params ["_player", "_target", "_weapon"]; +private ["_compatibleMags", "_filteredMags", "_magToPass", "_magToPassIndex", "_playerName", "_magToPassDisplayName"]; + +_compatibleMags = getArray (configfile >> "CfgWeapons" >> _weapon >> "magazines"); +_filteredMags = [magazinesAmmoFull _player, { + params ["_className", "", "_loaded"]; + _className in _compatibleMags && !_loaded +}] call EFUNC(common,filter); + +//select magazine with most ammo +_magToPass = _filteredMags select 0; +_magToPassIndex = 0; +{ + _x params ["_className", "_ammoCount"]; + if ((_ammoCount > (_magToPass select 1)) && (_target canAdd _className)) then { + _magToPass = _x; + _magToPassIndex = _forEachIndex; + }; +} foreach _filteredMags; + +//remove all magazines and add them again, except the one to be passed +//needed because of missing commands, see http://feedback.arma3.com/view.php?id=12782 +_magToPass params ["_magToPassClassName", "_magToPassAmmoCount"]; +_player removeMagazines _magToPassClassName; +{ + _x params ["_className", "_ammoCount"]; + if ((_className == _magToPassClassName) && (_forEachIndex != _magToPassIndex)) then { + _player addMagazine [_className, _ammoCount]; + }; +} foreach _filteredMags; + +_player playActionNow "PutDown"; + +_target addMagazine [_magToPassClassName, _magToPassAmmoCount]; + +_playerName = [_player] call EFUNC(common,getName); +_magToPassDisplayName = getText (configFile >> "CfgMagazines" >> _magToPassClassName >> "displayName"); +["displayTextStructured", [_target], [[LSTRING(PassMagazineHint), _playerName, _magToPassDisplayName], 1.5, _target]] call EFUNC(common,targetEvent); \ No newline at end of file diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index e8f279cc0c..429b7d7670 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -50,4 +50,4 @@ if (_scroll == "") exitWith { (_display displayCtrl 1002) ctrlSetText _scroll; -showHUD false; +["mouseHint", [false, true, true, true, true, true, true, false]] call EFUNC(common,showHud); //This is equivalent to the old showHud false diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 13383f8088..4171789b22 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -253,138 +253,6 @@ << Voltar << Indietro - - Gestures - Gesten - Gestos - Gesty - Posunky - Signaux - Жесты - Kézjelek - Gestos - Gesti - - - Attack - Angreifen - Atacar - Do ataku - Zaútočit - Attaquer - Атаковать - Támadás - Atacar - Attaccare - - - Advance - Vordringen - Avanzar - Naprzód - Postoupit - Avancer - Продвигаться - Előre - Avançar - Avanzare - - - Go - Los - Adelante - Szybko - Jít - Aller - Идти - Mozgás - Mover-se - Muoversi - - - Follow - Folgen - Seguirme - Za mną - Následovat - Suivre - Следовать - Utánam - Seguir - Seguire - - - Point - Zeigen - Señalar - Wskazać - Ukázat - Pointer - Точка - Mutat - Apontar - Puntare a - - - Up - Aufstehen - Arriba - Do góry - Vztyk - Debout - Вверх - Fel - Acima - Alzarsi - - - Cover - Deckung - Cubrirse - Do osłony - Krýt se - A couvert - Укрыться - Fedezékbe - Proteger-se - Copertura - - - Cease Fire - Feuer einstellen - Alto el fuego - Wstrzymać ogień - Zastavit palbu - Halte au feu - Прекратить огонь - Tüzet szüntess - Cessar Fogo - Cessare il Fuoco - - - Freeze - Keine Bewegung - Alto - Stać - Stát - Halte - Замереть - Állj - Alto - Fermi - - - Hi - Hallo - Hola - Witaj - Ahoj - Salut - Привет - Helló - Olá - Ciao - Put weapon on back Waffe wegstecken @@ -823,5 +691,40 @@ O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes. Управление группами позволяет назначать цвета членам групп, брать командование, вступать в группы или покидать их. + + Pass magazine + Magazin geben + Podaj magazynek + Передать магазин + Passar carregador + + + Primary magazine + Gewehrmagazin + Magazynek karabinowy + Основной магазин + Carregador primário + + + Pistol magazine + Pistolenmagazin + Magazynek pistoletowy + Магазин к пистолету + Carregador da pistola + + + %1 passed you a %2 magazine. + %1 hat dir ein %2 Magazin gegeben. + %1 podał Ci magazynek %2. + %1 передал вам магазин %2. + %1 passou a você um carregador %2. + + + Show "pass magazine" interaction + Zeige "Magazine geben" Interaktion + Pokaż interakcję "podaj magazynek" + Показывать действие "передать магазин" + Mostrar a interação "Passar carregador" + - + \ No newline at end of file diff --git a/addons/inventory/CfgEventHandlers.hpp b/addons/inventory/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0cd959a047 --- /dev/null +++ b/addons/inventory/CfgEventHandlers.hpp @@ -0,0 +1,12 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp index f845f50a35..c3a1904678 100644 --- a/addons/inventory/RscDisplayInventory.hpp +++ b/addons/inventory/RscDisplayInventory.hpp @@ -87,31 +87,37 @@ class RscDisplayInventory { class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary { x = X_PART(26.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class BackgroundSlotPrimaryUnderBarrel: BackgroundSlotPrimary { - x = X_PART(29); + x = X_PART(28.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { - x = X_PART(31.4); + x = X_PART(30.6); y = Y_PART(9.2); //not sure why different (double check release) - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary { - x = X_PART(33.8); + x = X_PART(32.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryMagazineGL: BackgroundSlotPrimary { + x = X_PART(34.6); + y = Y_PART(9.1); + w = W_PART(1.9); h = H_PART(2); }; class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary { x = X_PART(36.2); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class BackgroundSlotSecondary: BackgroundSlotPrimary { @@ -292,31 +298,37 @@ class RscDisplayInventory { class SlotPrimaryMuzzle: SlotPrimary { x = X_PART(26.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class SlotPrimaryUnderBarrel: SlotPrimary { - x = X_PART(29); + x = X_PART(28.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class SlotPrimaryFlashlight: SlotPrimary { - x = X_PART(31.4); + x = X_PART(30.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class SlotPrimaryOptics: SlotPrimary { - x = X_PART(33.8); + x = X_PART(32.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); + h = H_PART(2); + }; + class SlotPrimaryMagazineGL: SlotPrimary { + x = X_PART(34.6); + y = Y_PART(9.1); + w = W_PART(1.9); h = H_PART(2); }; class SlotPrimaryMagazine: SlotPrimary { - x = X_PART(36.2); + x = X_PART(36.6); y = Y_PART(9.1); - w = W_PART(2.3); + w = W_PART(1.9); h = H_PART(2); }; class SlotSecondary: SlotPrimary { diff --git a/addons/inventory/XEH_postInit.sqf b/addons/inventory/XEH_postInit.sqf new file mode 100644 index 0000000000..d0e3fb042a --- /dev/null +++ b/addons/inventory/XEH_postInit.sqf @@ -0,0 +1,50 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(customFilters) = []; +GVAR(selectedFilterIndex) = -1; + +["inventoryDisplayLoaded", {_this call FUNC(inventoryDisplayLoaded)}] call EFUNC(common,addEventHandler); + +// add custom filters + +// generate list of grenades +GVAR(Grenades_ItemList) = []; + +{ + GVAR(Grenades_ItemList) append getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); + false +} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); + +// make list case insensitive +GVAR(Grenades_ItemList) = [GVAR(Grenades_ItemList), {toLower _this}] call EFUNC(common,map); + +// filter duplicates +GVAR(Grenades_ItemList) = GVAR(Grenades_ItemList) arrayIntersect GVAR(Grenades_ItemList); + +[localize LSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter); + +[localize LSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter); +[localize LSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter); +[localize LSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter); +[localize LSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter); + +// generate list of medical items +GVAR(Medical_ItemList) = []; + +{ + GVAR(Medical_ItemList) append getArray (_x >> "items"); + false +} count ( + ("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Basic")) + + ("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Advanced")) +); + +// make list case insensitive +GVAR(Medical_ItemList) = [GVAR(Medical_ItemList), {if (_this isEqualType "") then {toLower _this}}] call EFUNC(common,map); + +// filter duplicates +GVAR(Medical_ItemList) = GVAR(Medical_ItemList) arrayIntersect GVAR(Medical_ItemList); + +[localize LSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter); diff --git a/addons/inventory/XEH_preInit.sqf b/addons/inventory/XEH_preInit.sqf new file mode 100644 index 0000000000..d574cacf3b --- /dev/null +++ b/addons/inventory/XEH_preInit.sqf @@ -0,0 +1,64 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addCustomFilter); +PREP(currentItemListBox); +PREP(forceItemListUpdate); +PREP(inventoryDisplayLoaded); +PREP(onLBSelChanged); + +// cache config +// items in the inventory display can only be distinguished by their lb names and pictures +// this can cause collisions (mainly weapons with attachments), +// but if the item has the same name and picture it at least shouldn't change the filter anyway +// luckily we don't need private items, so dummy and parent classes are out of the picture + +if !(uiNamespace getVariable [QGVAR(configCached), false]) then { + private _fnc_addToCache = { + private _displayName = getText (_this >> "displayName"); + private _picture = getText (_this >> "picture"); + + // list box seems to delete the leading backslash + if (_picture select [0,1] == "\") then { + _picture = _picture select [1]; + }; + + uiNamespace setVariable [format [QGVAR(ItemKey:%1:%2), _displayName, _picture], _this]; + }; + + // weapons and items + { + if (getNumber (_x >> "scope") > 0) then {_x call _fnc_addToCache}; + false + } count ( + ("true" configClasses (configFile >> "CfgWeapons")) + + ("true" configClasses (configFile >> "CfgGlasses")) + ); + + // magazines + { + if (getNumber (_x >> "scope") == 2) then {_x call _fnc_addToCache}; + false + } count ("true" configClasses (configFile >> "CfgMagazines")); + + // backpacks + { + if (getNumber (_x >> "scope") > 0 && {getNumber (_x >> "isBackpack") == 1}) then {_x call _fnc_addToCache}; + false + } count ("true" configClasses (configFile >> "CfgVehicles")); + + uiNamespace setVariable [QGVAR(configCached), true]; +}; + +PREP(filterWeapons); +PREP(filterMagazines); +PREP(filterItems); +PREP(filterHeadgear); +PREP(filterUniforms); +PREP(filterVests); +PREP(filterBackpacks); +PREP(filterGrenades); +PREP(filterMedical); + +ADDON = true; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 1190525901..f0982a46b4 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -6,11 +6,13 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"Pabst Mirror"}; + author[] = {"Pabst Mirror, commy2"}; authorUrl = "https://github.com/PabstMirror/"; VERSION_CONFIG; }; }; +#include "CfgEventHandlers.hpp" + #include "RscDisplayInventory.hpp" #include "ACE_Settings.hpp" diff --git a/addons/inventory/functions/fnc_addCustomFilter.sqf b/addons/inventory/functions/fnc_addCustomFilter.sqf new file mode 100644 index 0000000000..44e43bdbf0 --- /dev/null +++ b/addons/inventory/functions/fnc_addCustomFilter.sqf @@ -0,0 +1,19 @@ +/* + * Author: commy2 + * Adds a custom filter list to the inventory display. + * Functions are here as strings, because list boxes can only store numbers and strings. + * + * Arguments: + * 0: Localized filter display name + * 1: Filter function name + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params [["_filterName", "ERROR: No Name", [""]], ["_fncName", "", [""]]]; + +GVAR(customFilters) pushBack [_filterName, _fncName]; diff --git a/addons/inventory/functions/fnc_currentItemListBox.sqf b/addons/inventory/functions/fnc_currentItemListBox.sqf new file mode 100644 index 0000000000..1f1b528e93 --- /dev/null +++ b/addons/inventory/functions/fnc_currentItemListBox.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * Returns the current item list box of given inventory display. + * These can be Ground, Soldier, Uniform, Backpack or Vest. + * Can also be Weapon since 1.52, but that apparently uses one of the above. + * + * Arguments: + * 0: Inventory display + * + * Return Value: + * Currently selected item list box + * + * Public: No + */ +#include "script_component.hpp" + +params ["_display"]; + +scopeName "main"; + +{ + private _control = _display displayCtrl _x; + + if (ctrlShown _control) then { + _control breakOut "main"; + }; + false +} count [IDC_ITEMLIST_GROUND, IDC_ITEMLIST_SOLDIER, IDC_ITEMLIST_UNIFORM, IDC_ITEMLIST_VEST, IDC_ITEMLIST_BACKPACK]; + +-1 diff --git a/addons/inventory/functions/fnc_filterBackpacks.sqf b/addons/inventory/functions/fnc_filterBackpacks.sqf new file mode 100644 index 0000000000..9b629de66f --- /dev/null +++ b/addons/inventory/functions/fnc_filterBackpacks.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Backpacks filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +getNumber (_config >> "isBackpack") == 1 diff --git a/addons/inventory/functions/fnc_filterGrenades.sqf b/addons/inventory/functions/fnc_filterGrenades.sqf new file mode 100644 index 0000000000..0acfbcaa2c --- /dev/null +++ b/addons/inventory/functions/fnc_filterGrenades.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Grenades filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +toLower configName _config in GVAR(Grenades_ItemList) diff --git a/addons/inventory/functions/fnc_filterHeadgear.sqf b/addons/inventory/functions/fnc_filterHeadgear.sqf new file mode 100644 index 0000000000..056406a3d1 --- /dev/null +++ b/addons/inventory/functions/fnc_filterHeadgear.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Headgear filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +getNumber (_config >> "ItemInfo" >> "type") in [TYPE_HEADGEAR, TYPE_HMD] || {isClass (configFile >> "CfgGlasses" >> configName _config)} diff --git a/addons/inventory/functions/fnc_filterItems.sqf b/addons/inventory/functions/fnc_filterItems.sqf new file mode 100644 index 0000000000..b9bf9baeea --- /dev/null +++ b/addons/inventory/functions/fnc_filterItems.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Remove uniforms, vests and backpacks from Items filter. + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +!(getNumber (_config >> "ItemInfo" >> "type") in [TYPE_UNIFORM, TYPE_VESTS, TYPE_HEADGEAR]) && {!(_this call FUNC(filterBackpacks))} diff --git a/addons/inventory/functions/fnc_filterMagazines.sqf b/addons/inventory/functions/fnc_filterMagazines.sqf new file mode 100644 index 0000000000..dfd357f61d --- /dev/null +++ b/addons/inventory/functions/fnc_filterMagazines.sqf @@ -0,0 +1,15 @@ +/* + * Author: commy2 + * Remove backpacks and grenades from Magazines filter. + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +!(_this call FUNC(filterBackpacks)) && {!(_this call FUNC(filterGrenades))} diff --git a/addons/inventory/functions/fnc_filterMedical.sqf b/addons/inventory/functions/fnc_filterMedical.sqf new file mode 100644 index 0000000000..397be50f06 --- /dev/null +++ b/addons/inventory/functions/fnc_filterMedical.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Medical filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +toLower configName _config in GVAR(Medical_ItemList) diff --git a/addons/inventory/functions/fnc_filterUniforms.sqf b/addons/inventory/functions/fnc_filterUniforms.sqf new file mode 100644 index 0000000000..4c135dfa88 --- /dev/null +++ b/addons/inventory/functions/fnc_filterUniforms.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Uniforms filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +getNumber (_config >> "ItemInfo" >> "type") == TYPE_UNIFORM diff --git a/addons/inventory/functions/fnc_filterVests.sqf b/addons/inventory/functions/fnc_filterVests.sqf new file mode 100644 index 0000000000..646e23d04d --- /dev/null +++ b/addons/inventory/functions/fnc_filterVests.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * Filter condition for the Vests filter list + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +params ["_config"]; + +getNumber (_config >> "ItemInfo" >> "type") == TYPE_VEST diff --git a/addons/inventory/functions/fnc_filterWeapons.sqf b/addons/inventory/functions/fnc_filterWeapons.sqf new file mode 100644 index 0000000000..94a92814ae --- /dev/null +++ b/addons/inventory/functions/fnc_filterWeapons.sqf @@ -0,0 +1,15 @@ +/* + * Author: commy2 + * Remove backpacks from Weapons filter. + * + * Arguments: + * 0: Item config entry + * + * Return Value: + * Item should appear in this list? + * + * Public: No + */ +#include "script_component.hpp" + +!(_this call FUNC(filterBackpacks)) diff --git a/addons/inventory/functions/fnc_forceItemListUpdate.sqf b/addons/inventory/functions/fnc_forceItemListUpdate.sqf new file mode 100644 index 0000000000..89142b99ff --- /dev/null +++ b/addons/inventory/functions/fnc_forceItemListUpdate.sqf @@ -0,0 +1,40 @@ +/* + * Author: commy2 + * Updates item list and removes every entry that does not fit in the currently selected filter list. + * + * Arguments: + * 0: Inventory display + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +params ["_display"]; + +private _index = GVAR(selectedFilterIndex); +private _itemList = _display call FUNC(currentItemListBox); +private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData _index); + +if (_filterFunction isEqualType {}) then { + private _i = 0; + + while {_i < lbSize _itemList} do { + private _config = uiNamespace getVariable [ + format [QGVAR(ItemKey:%1:%2), _itemList lbText _i, _itemList lbPicture _i], + configNull + ]; + + if (!isNull _config && {!(_config call _filterFunction)}) then { + _itemList lbDelete _i; + + // in case the filter function returns nil. Otherwise could lock up the game. + _i = _i - 1; + }; + + _i = _i + 1; + }; +}; diff --git a/addons/inventory/functions/fnc_inventoryDisplayLoaded.sqf b/addons/inventory/functions/fnc_inventoryDisplayLoaded.sqf new file mode 100644 index 0000000000..6e48c1ec2a --- /dev/null +++ b/addons/inventory/functions/fnc_inventoryDisplayLoaded.sqf @@ -0,0 +1,77 @@ +/* + * Author: commy2 + * Executed every time an inventory display is opened. + * + * Arguments: + * 0: Inventory display + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +params ["_display"]; + +private _filter = _display displayCtrl IDC_FILTERLISTS; + +// engine defined behaviour is the following: +// lb value, data and text don't matter, only the index. +// the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items +// all of them show backpacks, because BI +// all other indecies show everything, so all we have to do is delete stuff we dont like +_filter ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChanged)}]; + +// have to add these a frame later, because this event happens before the engine adds the default filters +[{ + disableSerialization; + params ["_filter"]; + + // remove "All", so we can push it to the back later. + // to keep localization we can keep the lbText (displayed name). + private _index = lbSize _filter - 1; + private _nameAll = _filter lbText _index; + _filter lbDelete _index; + + // add additional filter functions to the default filters. These remove backpacks etc. + _filter lbSetData [0, QFUNC(filterWeapons)]; + _filter lbSetData [1, QFUNC(filterMagazines)]; + _filter lbSetData [2, QFUNC(filterItems)]; + + // add our custom filters + { + _x params ["_name", "_fncName"]; + + _index = _filter lbAdd _name; + _filter lbSetData [_index, _fncName]; + + false + } count GVAR(customFilters); + + // readd "All" filter to last position and select it + _index = _filter lbAdd _nameAll; + _filter lbSetCurSel _index; +}, [_filter]] call EFUNC(common,execNextFrame); + +// monitor changes that can happen and force our update +private _dummyControl = _display ctrlCreate ["RscMapControl", -1]; + +_dummyControl ctrlSetPosition [0,0,0,0]; +_dummyControl ctrlCommit 0; + +_dummyControl ctrlAddEventHandler ["Draw", { + disableSerialization; + params ["_dummyControl"]; + + private _display = ctrlParent _dummyControl; + + private _itemList = _display call FUNC(currentItemListBox); + + // monitoring is done by setting a lb value. These are unused here and are reset every time the list box updates. + if (_itemList lbValue 0 != DUMMY_VALUE) then { + _display call FUNC(forceItemListUpdate); + _itemList lbSetValue [0, DUMMY_VALUE]; + }; +}]; diff --git a/addons/inventory/functions/fnc_onLBSelChanged.sqf b/addons/inventory/functions/fnc_onLBSelChanged.sqf new file mode 100644 index 0000000000..61e4b12b10 --- /dev/null +++ b/addons/inventory/functions/fnc_onLBSelChanged.sqf @@ -0,0 +1,27 @@ +/* + * Author: commy2 + * Executed when the filter list box is changed. + * Sets new filter list index. + * + * Arguments: + * 0: Filter list box + * 1: Filter list index + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +params ["_filter", "_index"]; + +GVAR(selectedFilterIndex) = _index; + +[{ + disableSerialization; + params ["_display"]; + + [_display] call FUNC(forceItemListUpdate); +}, [ctrlParent _filter]] call EFUNC(common,execNextFrame); diff --git a/addons/inventory/functions/script_component.hpp b/addons/inventory/functions/script_component.hpp new file mode 100644 index 0000000000..07c5e38d2d --- /dev/null +++ b/addons/inventory/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\inventory\script_component.hpp" \ No newline at end of file diff --git a/addons/inventory/script_component.hpp b/addons/inventory/script_component.hpp index 248f324b36..b013e08570 100644 --- a/addons/inventory/script_component.hpp +++ b/addons/inventory/script_component.hpp @@ -2,11 +2,20 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_INVENTORY - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_INVENTORY - #define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY + #define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define IDC_FILTERLISTS 6554 +#define IDC_ITEMLIST_GROUND 632 +#define IDC_ITEMLIST_SOLDIER 640 +#define IDC_ITEMLIST_UNIFORM 633 +#define IDC_ITEMLIST_VEST 638 +#define IDC_ITEMLIST_BACKPACK 619 + +#define DUMMY_VALUE 127 diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml index 04cac46b87..af21fe3ddf 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -25,5 +25,33 @@ Normalmente il menù inventario è scalato in base alle dimensioni interfaccia. Questa opzione di permette di ingrandirlo ulteriormente ma senza aumentare la dimensione del testo. Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas. + + Backpacks + Rucksäcke + + + Headgear + Kopfbedeckungen + + + Glasses + Brillen + + + Uniforms + Uniformen + + + Vests + Westen + + + Grenades + Granaten + + + Medical + Sanimaterial + diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index cf02d5359e..8be68be5b5 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -55,7 +55,7 @@ if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); }; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; GVAR(pfehID) = -1; }; diff --git a/addons/javelin/initKeybinds.sqf b/addons/javelin/initKeybinds.sqf index 15215466e8..10b5e2813d 100644 --- a/addons/javelin/initKeybinds.sqf +++ b/addons/javelin/initKeybinds.sqf @@ -19,7 +19,7 @@ [ACE_player] call FUNC(lockKeyUp); false }, -[15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key +[15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key ["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), { false }, @@ -27,4 +27,4 @@ [ACE_player] call FUNC(cycleFireMode); false }, -[15, [false, true, false]], false] call cba_fnc_addKeybind; //Ctrl+Tab Key \ No newline at end of file +[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key \ No newline at end of file diff --git a/addons/kestrel4500/functions/fnc_updateDisplay.sqf b/addons/kestrel4500/functions/fnc_updateDisplay.sqf index e63b18bcfc..75c0db2e86 100644 --- a/addons/kestrel4500/functions/fnc_updateDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_updateDisplay.sqf @@ -23,7 +23,7 @@ private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); { - ctrlSetText [_x , _outputData select _foreachindex]; + ctrlSetText [_x , _outputData select _forEachIndex]; } forEach [74100, 74200, 74201, 74300, 74301, 74302, 74303, 74304, 74305, 74400, 74401, 74500, 74600, 74601, 74602, 74603, 74604, 74605]; if (GVAR(referenceHeadingMenu) == 1) then { diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index dd3f02a0cc..d8976ac204 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? model = "\A3\Weapons_F\empty.p3d"; destrType = "DestructNo"; - simulation = "house"; + simulation = "LaserTarget"; class EventHandlers { init = QUOTE(_this call FUNC(laser_init)); diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 4c4f242482..6d993b07de 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -10,7 +10,7 @@ _shooter = _args select 1; _uuid = _args select 2; if(isNull _laserTarget || !alive _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; REM(GVAR(VanillaLasers), _laserTarget); // Remove laseron diff --git a/addons/laser_selfdesignate/XEH_post_init.sqf b/addons/laser_selfdesignate/XEH_post_init.sqf index 6904ee6c47..dc30361926 100644 --- a/addons/laser_selfdesignate/XEH_post_init.sqf +++ b/addons/laser_selfdesignate/XEH_post_init.sqf @@ -1,3 +1,2 @@ #include "script_component.hpp" -NO_DEDICATED; diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 34ca98808b..3ea9ed158b 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,19 +1,36 @@ -// by commy2 and esteldunedain +/* + * Author: commy2 and esteldunedain + * Draw a Laser Point + * + * Arguments: + * 0: Target unit + * 1: Range + * 2: is Green + * 3: Brightness + * + * Return Value: + * None + * + * Example: + * [player, 10, false, 2] call ace_laserpointer_fnc_drawLaserpoint + * + * Public: No + */ #include "script_component.hpp" -params ["_unit", "_range", "_isGreen", "_brightness"]; +params ["_target", "_range", "_isGreen", "_brightness"]; -private ["_p0", "_v1", "_v2", "_v3", "_p1", "_pL", "_distance", "_pL2", "_camPos", "_size"]; +private _unit = ACE_player; -_p0 = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "righthand")); +private _p0 = AGLToASL (_target modelToWorldVisual (_target selectionPosition "righthand")); // Find a system of orthogonal reference vectors // _v1 points in the direction of the weapon // _v2 points to the right of the weapon // _v3 points to the top side of the weapon -_v1 = _unit weaponDirection currentWeapon _unit; -_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); -_v3 = _v2 vectorCrossProduct _v1; +private _v1 = _target weaponDirection currentWeapon _target; +private _v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); +private _v3 = _v2 vectorCrossProduct _v1; // Offset over the 3 reference axis // This offset could eventually be configured by weapon in the config @@ -22,23 +39,24 @@ _v3 = _v2 vectorCrossProduct _v1; #define OFFV3 0.08 // Offset _p0, the start of the laser -_p0 = _p0 vectorAdd (_v1 vectorMultiply OFFV1) vectorAdd (_v3 vectorMultiply OFFV3) vectorAdd (_v2 vectorMultiply OFFV2); +_p0 = _p0 vectorAdd (_v1 vectorMultiply OFFV1) vectorAdd (_v3 vectorMultiply OFFV3) vectorAdd (_v2 vectorMultiply OFFV2); // Calculate _p1, the potential end of the laser -_p1 = _p0 vectorAdd (_v1 vectorMultiply _range); +private _p1 = _p0 vectorAdd (_v1 vectorMultiply _range); -_pL = lineIntersectsSurfaces [_p0, _p1, ACE_player, vehicle ACE_player, true, 1, "GEOM", "FIRE"] select 0 select 0; +private _pL = lineIntersectsSurfaces [_p0, _p1, _unit, vehicle _unit] select 0 select 0; // no intersection found, quit if (isNil "_pL") exitWith {}; -_distance = _p0 vectorDistance _pL; +private _distance = _p0 vectorDistance _pL; //systemChat str _distance; if (_distance < 0.5) exitWith {}; _pL = _p0 vectorAdd (_v1 vectorMultiply _distance); -_pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); + +private _pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); _pL = ASLtoAGL _pL; @@ -50,19 +68,20 @@ drawLine3D [ ]; */ -//systemChat str [_unit, "FIRE"] intersect [_camPos, _pL]; +//systemChat str [_target, "FIRE"] intersect [_camPos, _pL]; -_camPos = positionCameraToWorld [0,0,0.2]; -if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; -if (count ([ACE_player, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; +private _camPos = positionCameraToWorld [0,0,0.2]; + +if (count ([_target, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; +if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; // Convert _camPos to ASL _camPos = AGLToASL _camPos; -if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; -if ( lineIntersects [_camPos, _pL2]) exitWith {}; +if (terrainIntersectASL [_camPos, _pL2]) exitWith {}; +if (lineIntersects [_camPos, _pL2]) exitWith {}; -_size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range; +private _size = 2 * sqrt (1 / _distance) * (call EFUNC(common,getZoom)); drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index 9e61e70156..1945dcf2b7 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -1,34 +1,33 @@ -// by commy2 +/* + * Author: commy2 + * Draw the visible laser beams of all cached units. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_brightness", "_cacheName", "_isIR", "_laser", "_laserID", "_weapon"]; +private _isIR = currentVisionMode ACE_player; -_isIR = currentVisionMode ACE_player; if (_isIR == 2) exitWith {}; _isIR = _isIR == 1; -_brightness = 2 - call EFUNC(common,ambientBrightness); +private _brightness = 2 - call EFUNC(common,ambientBrightness); { - _weapon = currentWeapon _x; - - _laser = switch (_weapon) do { - case (primaryWeapon _x): { - primaryWeaponItems _x select 1; - }; - case (secondaryWeapon _x): { - secondaryWeaponItems _x select 1; - }; - case (handgunWeapon _x): { - handgunItems _x select 1; - }; - default {""}; - }; + private _weapon = currentWeapon _x; + private _laser = (_x weaponAccessories _weapon) select 1; if (_laser != "") then { - _cacheName = format [QGVAR(laser_%1), _laser]; - _laserID = missionNamespace getVariable [_cacheName, -1]; + private _cacheName = format [QGVAR(laser_%1), _laser]; + private _laserID = missionNamespace getVariable [_cacheName, -1]; + if (missionNamespace getVariable [_cacheName, -1] == -1) then { _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); missionNamespace setVariable [_cacheName, _laserID]; @@ -38,5 +37,5 @@ _brightness = 2 - call EFUNC(common,ambientBrightness); [_x, 100, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); }; }; - -} forEach GVAR(nearUnits); + false +} count GVAR(nearUnits); diff --git a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf index 3332631c49..e26d5f75c1 100644 --- a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf +++ b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf @@ -1,89 +1,54 @@ -// by commy2 +/* + * Author: Commy2 + * Switch between laser modes. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_weapon", "_error"]; +params ["_unit", "_weapon"]; -_unit = _this select 0; -_weapon = _this select 1; - -// 1 = primary, 2 = secondary, 3 = handgun -private "_currentWeaponType"; -_currentWeaponType = 0; - -private "_pointer"; -_pointer = switch (_weapon) do { - case (primaryWeapon _unit): { - _currentWeaponType = 1; - primaryWeaponItems _unit select 1 - }; - case (secondaryWeapon _unit): { - _currentWeaponType = 2; - secondaryWeaponItems _unit select 1 - }; - case (handgunWeapon _unit): { - _currentWeaponType = 3; - handgunItems _unit select 1 - }; - default {""}; -}; +private _pointer = (_unit weaponAccessories _weapon) select 1; if (_pointer == "") exitWith {}; -private "_config"; -_config = configFile >> "CfgWeapons" >> _pointer; +private _config = configFile >> "CfgWeapons" >> _pointer; -private "_nextPointer"; -_nextPointer = getText (_config >> "ACE_nextModeClass"); +private _nextPointer = getText (_config >> "ACE_nextModeClass"); if (_nextPointer == "") exitWith {}; //If system disabled, don't switch to a laser: -private "_nextPointerIsLaser"; -_nextPointerIsLaser = getNumber (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_laserpointer"); +private _nextPointerIsLaser = getNumber (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_laserpointer"); if ((!GVAR(enabled)) && {_nextPointerIsLaser == 1}) exitWith {}; // disable inheritance for this entry, because addons claim this as a base class for convenience if !((_config >> "ACE_nextModeClass") in configProperties [_config, "true", false]) exitWith {}; -private ["_description", "_picture"]; +_unit addWeaponItem [_weapon, _nextPointer]; -_description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); -_picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); -_error = false; +private _error = false; -switch (_currentWeaponType) do { - case 1: { - _unit removePrimaryWeaponItem _pointer; - _unit addPrimaryWeaponItem _nextPointer; - if (((primaryWeaponItems _unit) select 1) != _nextPointer) then { - ERROR("NextPointer not compatible"); - _unit addPrimaryWeaponItem _pointer; - _error = true; - }; - }; - case 2: { - _unit removeSecondaryWeaponItem _pointer; - _unit addSecondaryWeaponItem _nextPointer; - if (((secondaryWeaponItems _unit) select 1) != _nextPointer) then { - ERROR("NextPointer not compatible"); - _unit addSecondaryWeaponItem _pointer; - _error = true; - }; - }; - case 3: { - _unit removeHandgunItem _pointer; - _unit addHandgunItem _nextPointer; - if (((handgunItems _unit) select 1) != _nextPointer) then { - ERROR("NextPointer not compatible"); - _unit addHandgunItem _pointer; - _error = true; - }; - }; +if ((_unit weaponAccessories _weapon) select 1 != _nextPointer) then { + ERROR("NextPointer not compatible"); + _unit addWeaponItem [_weapon, _pointer]; + _error = true; }; if (!_error) then { + private _description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); + private _picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); + [_description, _picture] call EFUNC(common,displayTextPicture); } else { - ACE_LOGERROR_3("Failed to add %1 to %2 - reverting to %3",_nextPointer,_weapon,_pointer); + ACE_LOGERROR_3("Failed to add %1 to %2 - reverting to %3",_nextPointer,_weapon,_pointer); }; + playSound "ACE_Sound_Click"; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 878f44cf9a..d9122139b7 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks if object is a fence. Should work on any fence type, even (typeof == ""). + * Checks if object is a fence. Should work on any fence type, even (typeOf == ""). * Call is fairly expensive because of all of the string checking. * * Arguments: diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index 34e369199f..fc875c8d2b 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -27,7 +27,7 @@ _unitMagCounts = []; private "_xFullMagazineCount"; _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; - _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); + _xFullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _xClassname}}) then { diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index ab380cb1ed..f0fbcf49c1 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -24,7 +24,7 @@ private ["_structuredOutputText", "_picture", "_fullMags", "_partialMags", "_ful params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; _args params ["_magazineClassname", "_lastAmmoCount"]; -_fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); +_fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count"); //Don't show anything if player can't interact: if (!([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index b11fc3697d..859bbdfdfa 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -24,7 +24,7 @@ private ["_magazineCfg", "_fullMagazineCount", "_isBelt", "_startingAmmoCounts", params ["_target", "_player", "_magazineClassname"]; if (isNil "_magazineClassname" || {_magazineClassname == ""}) exitWith {ERROR("Bad Mag Classname");}; -_magazineCfg = configfile >> "CfgMagazines" >> _magazineClassname; +_magazineCfg = configFile >> "CfgMagazines" >> _magazineClassname; // Calculate actual ammo to transfer during repack _fullMagazineCount = getNumber (_magazineCfg >> "count"); //Is linked belt magazine: @@ -57,7 +57,7 @@ _startingAmmoCounts = []; }; } forEach (magazinesAmmoFull _player); -if ((count _startingAmmoCounts) < 2) exitwith {ERROR("Not Enough Mags to Repack");}; +if ((count _startingAmmoCounts) < 2) exitWith {ERROR("Not Enough Mags to Repack");}; _simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simulateRepackEvents); _totalTime = (_simEvents select ((count _simEvents) - 1) select 0); diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index a65d126110..fdb020c114 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -38,25 +38,48 @@ #define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \ - weapon = #WEAPON; \ - count = COUNT; \ + weapon = #WEAPON; \ + count = COUNT; \ } #define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ + name = #ITEM; \ + count = COUNT; \ } #define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \ - magazine = #MAGAZINE; \ - count = COUNT; \ + magazine = #MAGAZINE; \ + count = COUNT; \ } #define MACRO_ADDBACKPACK(BACKPACK,COUNT) class _xx_##BACKPACK { \ - backpack = #BACKPACK; \ - count = COUNT; \ + backpack = #BACKPACK; \ + count = COUNT; \ } +// item types +#define TYPE_DEFAULT 0 +#define TYPE_MUZZLE 101 +#define TYPE_OPTICS 201 +#define TYPE_FLASHLIGHT 301 +#define TYPE_BIPOD 302 +#define TYPE_FIRST_AID_KIT 401 +#define TYPE_FINS 501 // not implemented +#define TYPE_BREATHING_BOMB 601 // not implemented +#define TYPE_NVG 602 +#define TYPE_GOGGLE 603 +#define TYPE_SCUBA 604 // not implemented +#define TYPE_HEADGEAR 605 +#define TYPE_FACTOR 607 +#define TYPE_RADIO 611 +#define TYPE_HMD 616 +#define TYPE_BINOCULAR 617 +#define TYPE_MEDIKIT 619 +#define TYPE_TOOLKIT 620 +#define TYPE_UAV_TERMINAL 621 +#define TYPE_VEST 701 +#define TYPE_UNIFORM 801 +#define TYPE_BACKPACK 901 #ifdef DISABLE_COMPILE_CACHE #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) @@ -83,6 +106,8 @@ #define ACE_isHC (!hasInterface && !isDedicated) +#define IDC_STAMINA_BAR 193 + //By default CBA's TRACE/LOG/WARNING spawn a buffer, which can cause messages to be logged out of order: #ifdef CBA_DEBUG_SYNCHRONOUS #define CBA_fnc_log { params ["_file","_lineNum","_message"]; diag_log [diag_frameNo, diag_tickTime, time, _file + ":"+str(_lineNum + 1), _message]; } diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 6345950d8b..912736c264 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -4,12 +4,12 @@ #define PREFIX ace #define MAJOR 3 -#define MINOR 3 -#define PATCHLVL 3 +#define MINOR 4 +#define PATCHLVL 2 #define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD // MINIMAL required version for the Mod. Components can specify others.. -#define REQUIRED_VERSION 1.52 +#define REQUIRED_VERSION 1.54 diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index 511da9875a..02021520b4 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -3,6 +3,7 @@ ACE Logistics + ACE Logistik ACE Logistyka Logísticas ACE ACE: логистика diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 720d4e8a7b..7d7f98207f 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class ACE_MapFlashlight { displayName = CSTRING(Action_Flashlights); icon = QUOTE(\a3\ui_f\data\IGUI\Cfg\VehicleToggles\lightsiconon_ca.paa); - condition = QUOTE(GVAR(mapIllumination) && visibleMap && (count ([ACE_player] call FUNC(getUnitFlashlights)) > 0)); + condition = QUOTE(GVAR(mapIllumination) && visibleMap && {count ([ACE_player] call FUNC(getUnitFlashlights)) > 0}); statement = "true"; exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; insertChildren = QUOTE(_this call DFUNC(compileFlashlightMenu)); diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index a89e3fb8e3..00e9e737cf 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -100,7 +100,7 @@ call FUNC(determineZoom); GVAR(glow) = objNull; ["playerInventoryChanged", { - _flashlights = [ACE_player] call FUNC(getUnitFlashlights); + private _flashlights = [ACE_player] call FUNC(getUnitFlashlights); if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then { GVAR(flashlightInUse) = ""; }; @@ -139,5 +139,9 @@ GVAR(hasWatch) = true; if (isNull (_this select 0)) exitWith { GVAR(hasWatch) = true; }; - GVAR(hasWatch) = "ItemWatch" in (_this select 1 select 17); + GVAR(hasWatch) = false; + { + if (_x isKindOf ["ItemWatch", configFile >> "CfgWeapons"]) exitWith {GVAR(hasWatch) = true;}; + false + } count (assignedItems ACE_player); }] call EFUNC(common,addEventHandler); diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index 71e4e8c818..e9a619b5a4 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" // BEGIN_COUNTER(blueForceTrackingUpdate); -private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"]; +private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_colour", "_marker"]; // Delete last set of markers (always) { @@ -28,12 +28,10 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { }; { - _markerType = [_x] call EFUNC(common,getMarkerType); + private _markerType = [_x] call EFUNC(common,getMarkerType); + private _colour = format ["Color%1", side _x]; - - _colour = format ["Color%1", side _x]; - - _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; + private _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; _marker setMarkerTypeLocal _markerType; _marker setMarkerColorLocal _colour; _marker setMarkerTextLocal (groupID _x); diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf index 0d081bb57c..bc6746f46e 100644 --- a/addons/map/functions/fnc_compileFlashlightMenu.sqf +++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf @@ -18,48 +18,29 @@ #include "script_component.hpp" -params ["_vehicle", "_player", "_parameters"]; +params ["", "_player"]; + +private["_action", "_actions", "_cfg", "_displayName", "_flashlights", "_icon", "_statement"]; _actions = []; _flashlights = [_player] call FUNC(getUnitFlashlights); //add all carried flashlight menus and on/off submenu actions { - _displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); - _icon = getText (configFile >> "CfgWeapons" >> _x >> "picture"); - - _children = { - params ["_vehicle", "_player", "_flashlight"]; - _actions = []; - - _onAction = [ - (_flashlight + "_On"), - "On", - "", - {[_this select 2] call FUNC(switchFlashlight)}, - {GVAR(flashlightInUse) != (_this select 2)}, - {}, - _flashlight - ] call EFUNC(interact_menu,createAction); - - _offAction = [ - (_flashlight + "_Off"), - "Off", - "", - {[""] call FUNC(switchFlashlight)}, - {GVAR(flashlightInUse) == (_this select 2)}, - {}, - _flashlight - ] call EFUNC(interact_menu,createAction); - - _actions pushBack [_onAction, [], _player]; - _actions pushBack [_offAction, [], _player]; - - _actions + _cfg = (configFile >> "CfgWeapons" >> _x); + _displayName = getText (_cfg >> "displayName"); + _icon = getText (_cfg >> "picture"); + + _statement = if (GVAR(flashlightInUse) == _x) then { + _displayName = format [localize LSTRING(turnLightOff), _displayName]; + {[""] call FUNC(switchFlashlight)} + } else { + _displayName = format [localize LSTRING(turnLightOn), _displayName]; + {[_this select 2] call FUNC(switchFlashlight)} }; - _parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction); - _actions pushBack [_parentAction, [], _player]; + _action = [_x, _displayName, _icon, _statement, {true}, {}, _x] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _player]; } forEach _flashlights; -_actions \ No newline at end of file +_actions diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 01f3882f1f..9712b84515 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -12,14 +12,13 @@ * Public: No */ #include "script_component.hpp" +params ["_unit"]; -EXPLODE_1_PVT(_this,_unit); - -private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"]; +private ["_fnc_blendColor", "_lightTint", "_fnc_calcColor", "_l", "_lightLevel", "_vehicle", "_isEnclosed", "_nearObjects", "_light", "_ll", "_flashlight", "_flareTint"]; // Blend two colors _fnc_blendColor = { - EXPLODE_3_PVT(_this,_c1,_c2,_alpha); + params ["_c1", "_c2", "_alpha"]; [(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha, (_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha, (_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha, @@ -27,16 +26,17 @@ _fnc_blendColor = { }; // Ambient light tint depending on time of day -_lightTint = switch (true) do { - case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] }; - case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; - case (sunOrMoon > 0.50) : {[[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor}; - case (sunOrMoon <= 0.5) : { [0,0,0.1,1] }; +_lightTint = call { + if (sunOrMoon == 1.0) exitWith { [0.5,0.5,0.5,1] }; + if (sunOrMoon > 0.80) exitWith { [[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor }; + if (sunOrMoon > 0.50) exitWith { [[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor }; + if (sunOrMoon <= 0.5) exitWith { [0,0,0.1,1] }; + [0,0,0,0] }; // Calculates overlay color from tint and light level _fnc_calcColor = { - EXPLODE_2_PVT(_this,_c1,_lightLevel); + params ["_c1", "_lightLevel"]; if (_lightLevel < 0.5) then { _l = _lightLevel / 0.5; @@ -68,13 +68,12 @@ if (_lightLevel > 0.95) exitWith { [false, [0.5,0.5,0.5,0]] }; -private "_vehicle"; _vehicle = vehicle _unit; // Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination) if (_vehicle != _unit) then { // Player is in a vehicle - if (isTurnedOut _unit && { _vehicle isKindOf "Tank" || { ( _vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane" ) && { (driver _vehicle) == _unit || { (gunner _vehicle) == _unit } } } || {_vehicle isKindOf "Wheeled_APC"}}) then { + if (!isTurnedOut _unit && { _vehicle isKindOf "Tank" || { ( _vehicle isKindOf "Helicopter" || _vehicle isKindOf "Plane" ) && { (driver _vehicle) == _unit || { (gunner _vehicle) == _unit } } } || {_vehicle isKindOf "Wheeled_APC"}}) then { _isEnclosed = true; }; }; @@ -124,4 +123,4 @@ if (_lightLevel > 0.95) exitWith { }; // Calculate resulting map color -[true, [_lightTint, _lightLevel] call _fnc_calcColor] \ No newline at end of file +[true, [_lightTint, _lightLevel] call _fnc_calcColor] diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf index 345fc68583..bdfc9a866b 100644 --- a/addons/map/functions/fnc_determineZoom.sqf +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -13,7 +13,7 @@ #include "script_component.hpp" private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"]; -_grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; +_grids = (configFile >> "CfgWorlds" >> worldName >> "Grid"); _fourSize = -1; _sixSize = -1; for "_i" from 1 to 10 do { diff --git a/addons/map/functions/fnc_flashlightGlow.sqf b/addons/map/functions/fnc_flashlightGlow.sqf index 5e72a6c183..011489f321 100644 --- a/addons/map/functions/fnc_flashlightGlow.sqf +++ b/addons/map/functions/fnc_flashlightGlow.sqf @@ -16,15 +16,16 @@ #include "script_component.hpp" +private ["_light", "_color", "_class"]; params ["_flashlight"]; _light = GVAR(glow); if (!isNull _light) then {deleteVehicle _light}; if (_flashlight != "") then { - _colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); - if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; - _class = format["ACE_FlashlightProxy_%1", _colour]; + _color = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); + if !(_color in ["white", "red", "green", "blue", "yellow"]) then {_color = "white"}; + _class = format["ACE_FlashlightProxy_%1", _color]; _light = _class createVehicle [0,0,0]; _light attachTo [ACE_player, [0,0.5,-0.1], "head"]; @@ -32,4 +33,4 @@ if (_flashlight != "") then { _light = objNull; }; -GVAR(glow) = _light; \ No newline at end of file +GVAR(glow) = _light; diff --git a/addons/map/functions/fnc_getUnitFlashlights.sqf b/addons/map/functions/fnc_getUnitFlashlights.sqf index 8fb8066374..41874cc0ca 100644 --- a/addons/map/functions/fnc_getUnitFlashlights.sqf +++ b/addons/map/functions/fnc_getUnitFlashlights.sqf @@ -18,7 +18,7 @@ params ["_unit"]; -_flashlights = []; +private _flashlights = []; { if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then { @@ -26,4 +26,4 @@ _flashlights = []; }; } forEach (items _unit); -_flashlights \ No newline at end of file +_flashlights diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf index ec08f14d4c..84fcc32773 100644 --- a/addons/map/functions/fnc_simulateMapLight.sqf +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -16,6 +16,7 @@ #include "script_component.hpp" +private ["_hmd", "_flashlight", "_screenSize", "_realViewPortY", "_realViewPortX", "_fillTex", "_colourAlpha", "_shadeAlpha", "_colourList", "_maxColour"]; params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"]; _hmd = hmd ACE_player; @@ -50,6 +51,7 @@ if (_flashlight == "") then { //ambient shade fill _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0]; } else { + private ["_mousePos", "_colour", "_size", "_flashTex", "_beamSize", "_viewPortRatioFixY", "_offsetX", "_offsetYDown", "_offsetYUp"]; //mouse pos _mousePos = GVAR(mousePos); @@ -86,4 +88,4 @@ if (_flashlight == "") then { _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) + _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //right _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) - _offsetYDown], _screenSize * 4, _screenSize, 0, "", 0]; //down _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) + _offsetYUp], _screenSize * 4, _screenSize * 4, 0, "", 0]; //up -}; \ No newline at end of file +}; diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index 72f5d0cec1..0e36a6fdd6 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" - +private ["_mapCtrl", "_mapScale", "_mapCentre", "_light"]; _mapCtrl = findDisplay 12 displayCtrl 51; _mapScale = ctrlMapScale _mapCtrl; _mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; @@ -73,4 +73,4 @@ if (GVAR(mapLimitZoom)) then { _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, _mapCentre]; ctrlMapAnimCommit _mapCtrl; }; -}; \ No newline at end of file +}; diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 8eab673caf..a7eb5482e2 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -14,9 +14,9 @@ Map illumination? + Kartenbeleuchtung Oświetlenie mapy ¿Iluminación de mapa? - Kartenausleuchtung Osvětlení mapy Iluminação do mapa? Luminosité @@ -25,6 +25,7 @@ Simulate map lighting based on ambient lighting and player's items? + Simuliere Kartenbeleuchtung auf Basis des Umgebungslichts sowie der mitgeführten Gegenstände? Symuluj oświetlenie mapy bazujące na oświetleniu otoczenia oraz przedmiotach gracza? Calcul la luminosité de la carte en fonction des conditions de lumière Симулировать освещение карты на основе окружающего света и приборов игрока? @@ -33,6 +34,7 @@ Map flashlight glow? + Kartenbeleuchtung durch Dritte erkennbar Poświata latarki Свет фонаря на карте? Brilho de lanterna no mapa? @@ -40,6 +42,7 @@ Add external glow to players who use flashlight on map? + Kartenbeleuchtung mittels Taschenlampe durch Dritte erkennbar? Pokaż poświatę światła latarki na graczu, który używa latarki na widoku mapy? Добавить свет при использовании фонаря на карте? Adicionar brilho externo para jogadores que usam lanterna no mapa? @@ -71,7 +74,7 @@ Limit map zoom? Ograniczony zoom ¿Limitar el zoom de mapa? - Kartenzoom einschränken + Kartenvergrößerung einschränken Omezit přiblížení mapy? Limitar zoom do mapa? Limiter le zoom de la carte? @@ -82,7 +85,7 @@ Limit the amount of zoom available for the map? Ogranicza maksymalny stopień przybliżenia mapy Limita la cantidad de zoom disponible para el mapa - Zoomstufe der Karte einschränken? + Schränkt die maximale Kartenvergrößerung ein. Omezit stupeň přiblížení pro mapu? Limitar a quantidade de zoom disponível para o mapa? Limite le zoom maximum pour la carte? @@ -93,7 +96,7 @@ Show cursor coordinates? Koordynaty pod kursorem ¿Mostrar coordenadas de cursor? - Zeige Cursor-Koordinaten? + Zeige Mauszeiger-Koordinaten? Zobrazit souřadnice u kurzoru? Mostrar coordenadas no cursor? Afficher les coordonnées sur le curseur? @@ -135,6 +138,7 @@ BFT Enable + BFT aktivieren RFA ativo Aktywuj BFT Povolit BFT @@ -145,6 +149,7 @@ Enable Blue Force Tracking. Default: No + Aktiviert Blue Force Tracking. Standard: Nein Ativa Rastreio de Forças Azuis. Padrão: Não Aktywuj Blue Force Tracking. Domyślnie: Nie Povolit Blue Force Tracking. Výchozí: Ne @@ -210,6 +215,7 @@ Flashlights + Taschenlampen Latarki Lanternas Фонари @@ -218,6 +224,7 @@ NVG + NSG Noktowizja Óculos de Visão Noturna ПНВ @@ -226,6 +233,7 @@ On + Ein Włącz Ligado Вкл. @@ -234,6 +242,7 @@ Off + Aus Wyłącz Desligado Выкл. @@ -242,6 +251,7 @@ Increase Brightness + Erhöhe Helligkeit Zwiększ czułość Aumentar brilho Увеличить яркость @@ -250,23 +260,50 @@ Decrease Brightness + Veringere Helligkeit Zmniejsz czułość Diminuir brilho Уменьшить яркость Snížit jas Reducir brillo + + Turn On %1 + %1 Aktivieren + Encender %1 + Włącz %1 + Allumer %1 + Zapnout %1 + Accendi %1 + %1 Bekapcsolása + Ativar %1 + Активировать %1 + + + Turn Off %1 + %1 Deaktivieren + Apagar %1 + Wyłącz %1 + Éteindre %1 + Vypnout %1 + Spegni %1 + %1 Kikapcsolása + Desativar %1 + Деактивировать %1 + Set Channel At Start + Setzt Kanal am Spielstart Ust. domyślny kanał Definir canal no início Установить канал на старте Change the starting marker channel at mission start + Setzt den Chat/Markierungskanal am Missionsstart Ustaw domyślny kanał dla markerów przy starcie misji Muda o canal do marcador no início da missão Изменить начальный канал для установки маркеров при запуске миссии - \ No newline at end of file + diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf index 809bbaf117..fdf89a46d6 100644 --- a/addons/map_gestures/functions/fnc_isValidColorArray.sqf +++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf @@ -20,11 +20,11 @@ scopeName "main"; params ["_colorArray"]; if (isNil "_colorArray") exitWith {false}; -if ((typeName _colorArray) != "ARRAY") exitWith {false}; +if (!(_colorArray isEqualType [])) exitWith {false}; if (count _colorArray != 4) exitWith {false}; { - if ((typeName _x) != "SCALAR" || _x < 0 || _x > 1) exitWith {false breakOut "main"}; + if ((!(_x isEqualType 0)) || {_x < 0 || _x > 1}) exitWith {false breakOut "main"}; } count _colorArray; true diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index 83ff9c4a86..b53508e538 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -4,116 +4,143 @@ Map Gestures Gestos no mapa + Gesty na mapie Жесты на карте Enabled Ativado + Aktywne Включено + Povoleno Map Gesture Max Range Distância para gestos no mapa + Maks. zasięg gestów Макс. дистанция жестов на карте Max range between players to show the map gesture indicator [default: 7 meters] Distância max. entre os jogadores para mostrar o indicador de gesto no mapa [padrão: 7 metros] + Maksymalny zasięg, w obrębie którego gesty będą widoczne dla graczy [domyślnie: 7 metrów] Макс. дистанция между игроками для отображения жестов на карте [по-умолчанию: 7 метров] Lead Default Color Cor padrão para o líder + Domyślny kolor lidera Лид. цвет по-умолчанию Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients] Valor de cor alternativa para líderes de grupo + Domyślny kolor dla liderów grup. Значение цвета для лидеров групп. Default Color Cor padrão + Kolor domyślny Цвет по-умолчанию Fallback Color value when there is no group setting. [Module: leave blank to not force on clients] Valor alternativo de cor + Kolor domyślny Значение цвета. Lead Color Cor do líder + Kolor lidera Лид. цвет Color value for group leaders of groups synced with this module. Valor de cor para líderes de grupo sincronizados com este módulo. + Kolor dla liderów grup zsynchronizowanych z tym modułem. Значение цвета для лидеров групп, которые [группы] синхронизированы с этим модулем. Color Cor + Kolor Цвет + Barva Color value for group members of groups synced with this module. Valor de cor para membros de grupo sincronizados com este módulo. + Kolor dla członków grup zsynchronizowanych z tym modułem. Значение цвета для членов групп, которые [группы] синхронизированы с этим модулем. Map Gestures - Group Settings Gestos no mapa - Definições de Grupo + Gesty na mapie - ustawienia grup Жесты на карте - настройки групп Update Interval Intervalo de atualizações + Interwał aktualizacji Интервал обновления + Interval aktualizace Time between data updates. Tempo entre atualização de dados + Odstęp pomiędzy aktualizacjami danych Время между обновлениями данных. + Čas mezi aktualizacemi dat. Group color configurations Configurações de cores de grupo + Konf. koloru grup Конфигурация цвета групп Group color configuration containing arrays of color pairs ([leadColor, color]). Configuração de cores de grupo contendo arrays com pares de cores ([leadColor, color]). + Konfiguracja kolorów grup zawierająca tablice par kolorów ([kolorLidera, kolor]). Конфигурация цвета групп содержит массив цветовых пар ([лид. цвет, цвет]). Hash of Group ID mapped to the Group color configuration index. Hashes de ID de grupos mapeados para o índice de configuração de cor de grupos. + Hasz ID grup zmapowanych w indeksie konfiguracji koloru grup. Хеш ID групп, соответствующих индексам конфигурации цвета групп. GroupID Color configuration mapping Mapeamento de configuração para cores de GroupID + Mapowanie kolorów poprzez GroupID Соответствие ID групп конфигурации цвета групп Enables the Map Gestures. Ativa os gestos no mapa + Aktywuje gesty na mapie. Включает указания на карте. Name Text Color Cor do texto do nome + Kolor nazw Цвет текста имени Color of the name tag text besides the map gestures mark. Cor do texto da etiqueta de nome que fica embaixo da marcação de gestos no mapa. + Kolor nazwy gracza obok markera gestu mapy. Цвет инмени игрока рядом с маркером жестов. Map Gestures Gestos no mapa + Gesty na mapie Жесты на карте diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 19869ee3ce..cb1a4598ad 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -44,7 +44,7 @@ if (_dir != 1) then { deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); // Log who drew on the briefing screen - (text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog); + [ACE_INFOFORMAT_1("Player %1 drew on the briefing screen", profileName)] call EFUNC(common,serverLog); } else { GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker)); diff --git a/addons/markers/CfgEventHandlers.hpp b/addons/markers/CfgEventHandlers.hpp index e75956f440..0cd959a047 100644 --- a/addons/markers/CfgEventHandlers.hpp +++ b/addons/markers/CfgEventHandlers.hpp @@ -1,3 +1,4 @@ + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/markers/InsertMarker.hpp b/addons/markers/InsertMarker.hpp index 82712fa8f1..5d7cc987e2 100644 --- a/addons/markers/InsertMarker.hpp +++ b/addons/markers/InsertMarker.hpp @@ -1,3 +1,4 @@ + class RscPicture; class RscText; class RscStructuredText; @@ -12,21 +13,9 @@ class RscXSliderH; class RscDisplayInsertMarker { onLoad = QUOTE(_this call DFUNC(initInsertMarker);); onUnload = QUOTE(_this call DFUNC(placeMarker);); - // idd = 54; movingEnable = 1; - class controlsBackground { - // class RscText_1000: RscText {idc = 1000;}; - }; - class controls { - // class ButtonMenuOK: RscButtonMenuOK {idc = 1;}; - // class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;}; - // class Title: RscText {idc = 1001;}; - // class Description: RscStructuredText {idc = 1100;}; - // class DescriptionChannel: RscStructuredText {idc = 1101;}; - // class MarkerPicture: RscPicture {idc = 102;}; - // class MarkerText: RscEdit {idc = 101;}; - // class MarkerChannel: RscCombo {idc = 103;}; + class controls { class MarkerShape: RscCombo { idc = 1210; }; @@ -39,22 +28,5 @@ class RscDisplayInsertMarker { class MarkerAngleText: RscText { idc = 1221; }; - - /*class SizeX: RscEdit { - idc = 1200; - text = "10"; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class SizeY: RscEdit { - idc = 1201; - text = "10"; - x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - };*/ }; }; diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf index ecb4d579fe..f7bf35093c 100644 --- a/addons/markers/XEH_postInit.sqf +++ b/addons/markers/XEH_postInit.sqf @@ -9,14 +9,13 @@ // request marker data for JIP if (isMultiplayer && {!isServer} && {hasInterface}) then { - private "_logic"; - _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + private _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + [QGVAR(sendMarkersJIP), [_logic]] call EFUNC(common,serverEvent); }; - GVAR(mapDisplaysWithDrawEHs) = []; GVAR(currentMarkerPosition) = []; GVAR(currentMarkerAngle) = 0; GVAR(currentMarkerColorConfigName) = ""; -GVAR(currentMarkerConfigName) = ""; \ No newline at end of file +GVAR(currentMarkerConfigName) = ""; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index e47514f4fa..477632d225 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -2,8 +2,10 @@ ADDON = false; +PREP(getEnabledChannels); PREP(initInsertMarker); PREP(mapDrawEH); +PREP(onLBSelChangedChannel); PREP(onLBSelChangedColor); PREP(onLBSelChangedShape); PREP(onSliderPosChangedAngle); @@ -12,19 +14,19 @@ PREP(sendMarkersJIP); PREP(setMarkerJIP); PREP(setMarkerNetwork); -private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"]; - // init marker types if (isNil QGVAR(MarkersCache)) then { - _config = configfile >> "CfgMarkers"; GVAR(MarkersCache) = []; + private _config = configfile >> "CfgMarkers"; + for "_a" from 0 to (count _config - 1) do { - _marker = _config select _a; - _scope = getNumber (_marker >> "scope"); - if (_scope == 2) then { - _name = getText (_marker >> "name"); - _icon = getText (_marker >> "icon"); + private _marker = _config select _a; + + if (getNumber (_marker >> "scope") == 2) then { + private _name = getText (_marker >> "name"); + private _icon = getText (_marker >> "icon"); + GVAR(MarkersCache) pushBack [_name, _a, _icon]; }; }; @@ -32,22 +34,25 @@ if (isNil QGVAR(MarkersCache)) then { // init marker colors if (isNil QGVAR(MarkerColorsCache)) then { - _config = configfile >> "CfgMarkerColors"; GVAR(MarkerColorsCache) = []; + private _config = configfile >> "CfgMarkerColors"; + for "_a" from 0 to (count _config - 1) do { - _marker = _config select _a; - _scope = getNumber (_marker >> "scope"); - if (_scope == 2) then { - _name = getText (_marker >> "name"); - _rgba = getArray (_marker >> "color"); + private _marker = _config select _a; + + if (getNumber (_marker >> "scope") == 2) then { + private _name = getText (_marker >> "name"); + private _rgba = getArray (_marker >> "color"); + { - if (typeName _x != "SCALAR") then { + if !( _x isEqualType 0) then { _rgba set [_forEachIndex, call compile _x]; }; } forEach _rgba; + _rgba params ["_red", "_green", "_blue", "_alpha"]; - _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha]; + private _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha]; GVAR(MarkerColorsCache) pushBack [_name, _a, _icon]; }; diff --git a/addons/markers/functions/fnc_getEnabledChannels.sqf b/addons/markers/functions/fnc_getEnabledChannels.sqf new file mode 100644 index 0000000000..9a64ff06d4 --- /dev/null +++ b/addons/markers/functions/fnc_getEnabledChannels.sqf @@ -0,0 +1,54 @@ +/* + * Author: commy2 + * Return enabled channels. + * + * Arguments: + * 0: false - use channel id, true - use localized channel names (default: false) + * + * Return Value: + * Enabled Channels + * + * Public: No + */ +#include "script_component.hpp" + +params [["_localize", false, [false]]]; + +private _currentChannel = currentChannel; +private _enabledChannels = []; + +if (_localize) then { + if (setCurrentChannel 0) then { + _enabledChannels pushBack localize "str_channel_global"; + }; + + if (setCurrentChannel 1) then { + _enabledChannels pushBack localize "str_channel_side"; + }; + + if (setCurrentChannel 2) then { + _enabledChannels pushBack localize "str_channel_command"; + }; + + if (setCurrentChannel 3) then { + _enabledChannels pushBack localize "str_channel_group"; + }; + + if (setCurrentChannel 4) then { + _enabledChannels pushBack localize "str_channel_vehicle"; + }; + + if (setCurrentChannel 5) then { + _enabledChannels pushBack localize "str_channel_direct"; + }; +} else { + for "_i" from 0 to 5 do { + if (setCurrentChannel _i) then { + _enabledChannels pushBack _i; + }; + }; +}; + +setCurrentChannel _currentChannel; + +_enabledChannels diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 07e2bc46c4..08c078c4f5 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -16,53 +16,61 @@ */ #include "script_component.hpp" -#define BORDER 0.005 +#define BORDER 0.005 [{ - private ["_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"]; - disableserialization; params ["_display"]; TRACE_1("params",_display); //Can't place markers when can't interact - if (!([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith { + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith { _display closeDisplay 2; //emulate "Cancel" button }; //BIS Controls: - _text = _display displayctrl 101; - _picture = _display displayctrl 102; - _channel = _display displayctrl 103; - _buttonOK = _display displayctrl 1; - _buttonCancel = _display displayctrl 2; - _description = _display displayctrl 1100; - _title = _display displayctrl 1001; - _descriptionChannel = _display displayctrl 1101; + private _text = _display displayctrl 101; + private _picture = _display displayctrl 102; + private _channel = _display displayctrl 103; + private _buttonOK = _display displayctrl 1; + private _buttonCancel = _display displayctrl 2; + private _description = _display displayctrl 1100; + private _title = _display displayctrl 1001; + private _descriptionChannel = _display displayctrl 1101; //ACE Controls: // _sizeX = _display displayctrl 1200; // _sizeY = _display displayctrl 1201; - _aceShapeLB = _display displayctrl 1210; - _aceColorLB = _display displayctrl 1211; - _aceAngleSlider = _display displayctrl 1220; - _aceAngleSliderText = _display displayctrl 1221; + private _aceShapeLB = _display displayctrl 1210; + private _aceColorLB = _display displayctrl 1211; + private _aceAngleSlider = _display displayctrl 1220; + private _aceAngleSliderText = _display displayctrl 1221; + //////////////////// + // Install MapDrawEH on current map + private _mapIDD = -1; - //Install MapDrawEH on current map - _mapIDD = -1; { - if (!isNull (findDisplay _x)) exitWith {_mapIDD = _x}; - } forEach [12, 37, 52, 53, 160]; - if (_mapIDD == -1) exitWith {ERROR("No Map?");}; - if (!(_mapIDD in GVAR(mapDisplaysWithDrawEHs))) then { - GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD; - ((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}]; + if (!isNull (findDisplay _x)) exitWith { + _mapIDD = _x; + }; + false + } count [12, 37, 52, 53, 160]; + + if (_mapIDD == -1) exitWith { + ERROR("No Map?"); }; - //Calculate center position of the marker placement ctrl - _pos = ctrlPosition _picture; + if !(_mapIDD in GVAR(mapDisplaysWithDrawEHs)) then { + GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD; + ((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}]; // @todo check if persistent + }; + + //////////////////// + // Calculate center position of the marker placement ctrl + private _pos = ctrlPosition _picture; _pos = [(_pos select 0) + (_pos select 2) / 2, (_pos select 1) + (_pos select 3) / 2]; + GVAR(currentMarkerPosition) = ((findDisplay _mapIDD) displayCtrl 51) ctrlMapScreenToWorld _pos; //Hide the bis picture: @@ -77,98 +85,116 @@ //--- Background _pos = ctrlposition _text; - _pos params ["_posX", "_posY", "_posW", "_posH"]; + _pos params ["_posX", "_posY", "_posW", "_posH"]; _posX = _posX + 0.01; _posY = _posY min ((safeZoneH + safeZoneY) - (8 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen - _pos set [0,_posX]; - _pos set [1,_posY]; - _text ctrlsetposition _pos; - _text ctrlcommit 0; + _pos set [0, _posX]; + _pos set [1, _posY]; + _text ctrlSetPosition _pos; + _text ctrlCommit 0; //--- Title - _pos set [1,_posY - 2*_posH - BORDER]; - _pos set [3,_posH]; - _title ctrlsetposition _pos; - _title ctrlcommit 0; + _pos set [1, _posY - 2 * _posH - BORDER]; + _pos set [3, _posH]; + _title ctrlSetPosition _pos; + _title ctrlCommit 0; //--- Description - _pos set [1,_posY - 1*_posH]; - _pos set [3,6*_posH + 6 * BORDER]; - _description ctrlenable false; - _description ctrlsetposition _pos; - _description ctrlsetstructuredtext parsetext format ["%1", (localize "str_lib_label_description")]; - _description ctrlcommit 0; + _pos set [1, _posY - 1 * _posH]; + _pos set [3,6 * _posH + 6 * BORDER]; + _description ctrlEnable false; + _description ctrlSetPosition _pos; + _description ctrlSetStructuredText parseText format ["%1", localize "str_lib_label_description"]; + _description ctrlCommit 0; //--- Shape - _pos set [1,_posY + 1 * _posH + 2 * BORDER]; - _pos set [2,_posW]; - _pos set [3,_posH]; - _aceShapeLB ctrlsetposition _pos; - _aceShapeLB ctrlcommit 0; + _pos set [1, _posY + 1 * _posH + 2 * BORDER]; + _pos set [2, _posW]; + _pos set [3, _posH]; + _aceShapeLB ctrlSetPosition _pos; + _aceShapeLB ctrlCommit 0; //--- Color - _pos set [1,_posY + 2 * _posH + 3 * BORDER]; - _pos set [2,_posW]; - _aceColorLB ctrlsetposition _pos; - _aceColorLB ctrlcommit 0; + _pos set [1, _posY + 2 * _posH + 3 * BORDER]; + _pos set [2, _posW]; + _aceColorLB ctrlSetPosition _pos; + _aceColorLB ctrlCommit 0; //--- Angle - _pos set [1,_posY + 3 * _posH + 4 * BORDER]; - _pos set [2,_posW]; - _aceAngleSlider ctrlsetposition _pos; - _aceAngleSlider ctrlcommit 0; + _pos set [1, _posY + 3 * _posH + 4 * BORDER]; + _pos set [2, _posW]; + _aceAngleSlider ctrlSetPosition _pos; + _aceAngleSlider ctrlCommit 0; //--- Angle Text - _pos set [1,_posY + 4 * _posH + 5 * BORDER]; - _pos set [2,_posW]; - _aceAngleSliderText ctrlsetposition _pos; - _aceAngleSliderText ctrlcommit 0; + _pos set [1, _posY + 4 * _posH + 5 * BORDER]; + _pos set [2, _posW]; + _aceAngleSliderText ctrlSetPosition _pos; + _aceAngleSliderText ctrlCommit 0; + + private _offsetButtons = 0; - _offsetButtons = 0; if (isMultiplayer) then { _pos set [1,_posY + 5 * _posH + 7 * BORDER]; _pos set [3,_posH]; - _descriptionChannel ctrlsetstructuredtext parsetext format ["%1", (localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0") + ":"]; - _descriptionChannel ctrlsetposition _pos; - _descriptionChannel ctrlcommit 0; + _descriptionChannel ctrlSetStructuredText parseText format ["%1:", localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0"]; + _descriptionChannel ctrlSetPosition _pos; + _descriptionChannel ctrlCommit 0; _pos set [1,_posY + 6 * _posH + 7 * BORDER]; _pos set [3,_posH]; - _channel ctrlsetposition _pos; - _channel ctrlcommit 0; + _channel ctrlSetPosition _pos; + _channel ctrlCommit 0; + + // channels are added by engine and not script. we have to manually delete them. requires channel names to be unique? + private _enabledChannels = true call FUNC(getEnabledChannels); + private _i = 0; + + while {_i < lbSize _channel} do { + private _channelName = _channel lbText _i; + + // _enabledChannels can not include custom channels names. Therefore also check if it's a custom one. Blame BI if the unit should not access the channel. + if (_channelName in _enabledChannels || {!(_channelName in CHANNEL_NAMES)}) then { + _i = _i + 1; + } else { + _channel lbDelete _i; + }; + }; + + private _currentChannelName = CHANNEL_NAMES param [currentChannel, localize "str_channel_group"]; + + // select current channel in list box, must be done after lbDelete + for "_j" from 0 to (lbSize _channel - 1) do { + if (_channel lbText _j == _currentChannelName) then { + _channel lbSetCurSel _j; + }; + }; + + _channel ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedChannel)}]; + _offsetButtons = 7 * _posH + 8 * BORDER; } else { - _descriptionChannel ctrlshow false; - _channel ctrlshow false; + _descriptionChannel ctrlShow false; + _channel ctrlShow false; _offsetButtons = 5 * _posH + 7 * BORDER; }; //--- ButtonOK - _pos set [1,_posY + _offsetButtons]; - _pos set [2,_posW / 2 - BORDER]; - _pos set [3,_posH]; - _buttonOk ctrlsetposition _pos; - _buttonOk ctrlcommit 0; + _pos set [1, _posY + _offsetButtons]; + _pos set [2, _posW / 2 - BORDER]; + _pos set [3, _posH]; + _buttonOk ctrlSetPosition _pos; + _buttonOk ctrlCommit 0; //--- ButtonCancel - _pos set [0,_posX + _posW / 2]; - _pos set [1,_posY + _offsetButtons]; - _pos set [2,_posW / 2]; - _pos set [3,_posH]; - _buttonCancel ctrlsetposition _pos; - _buttonCancel ctrlcommit 0; - - //--- PositionX - /*_pos set [1,_posY + 2 * _posH + 3 * BORDER]; - _sizeX ctrlsetposition _pos; - _sizeX ctrlcommit 0;*/ - - //--- PositionY - /*_pos set [1,_posY + 2 * _posH + 3 * BORDER]; - _sizeY ctrlsetposition _pos; - _sizeY ctrlcommit 0;*/ - + _pos set [0, _posX + _posW / 2]; + _pos set [1, _posY + _offsetButtons]; + _pos set [2, _posW / 2]; + _pos set [3, _posH]; + _buttonCancel ctrlSetPosition _pos; + _buttonCancel ctrlCommit 0; + //////////////////// // init marker shape lb lbClear _aceShapeLB; { @@ -177,14 +203,15 @@ _aceShapeLB lbSetValue [_forEachIndex, _set]; _aceShapeLB lbSetPicture [_forEachIndex, _pic]; } forEach GVAR(MarkersCache); - _curSelShape = GETGVAR(curSelMarkerShape,0); + + private _curSelShape = GETGVAR(curSelMarkerShape,0); _aceShapeLB lbSetCurSel _curSelShape; //Update now and add eventHandler: [_aceShapeLB, _curSelShape] call FUNC(onLBSelChangedShape); _aceShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}]; - + //////////////////// // init marker color lb lbClear _aceColorLB; { @@ -193,20 +220,22 @@ _aceColorLB lbSetValue [_forEachIndex, _set]; _aceColorLB lbSetPicture [_forEachIndex, _pic]; } forEach GVAR(MarkerColorsCache); - _curSelColor = GETGVAR(curSelMarkerColor,0); + + private _curSelColor = GETGVAR(curSelMarkerColor,0); _aceColorLB lbSetCurSel _curSelColor; //Update now and add eventHandler: [_aceColorLB, _curSelColor] call FUNC(onLBSelChangedColor); _aceColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}]; - + //////////////////// // init marker angle slider _aceAngleSlider sliderSetRange [-180, 180]; - _curSelAngle = GETGVAR(currentMarkerAngle,0); + + private _curSelAngle = GETGVAR(currentMarkerAngle,0); _aceAngleSlider sliderSetPosition _curSelAngle; + //Update now and add eventHandler: [_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle); _aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}]; - }, _this] call EFUNC(common,execNextFrame); diff --git a/addons/markers/functions/fnc_mapDrawEH.sqf b/addons/markers/functions/fnc_mapDrawEH.sqf index babdfbbb44..7197c90cc7 100644 --- a/addons/markers/functions/fnc_mapDrawEH.sqf +++ b/addons/markers/functions/fnc_mapDrawEH.sqf @@ -15,32 +15,42 @@ */ #include "script_component.hpp" -private ["_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"]; - params ["_theMap"]; // TRACE_1("params",_theMap); //Only show if marker place is open: -if (isNull (findDisplay 54)) exitWith {}; +if (isNull findDisplay 54) exitWith {}; //Error checking: -if ((GVAR(currentMarkerConfigName) == "") || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {ERROR("Bad Data");}; +if (GVAR(currentMarkerConfigName) == "" || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith { + ERROR("Bad Data"); +}; -_sizeX = 1; -_sizeY = 1; +private _sizeX = 1; +private _sizeY = 1; -_textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName); -_texture = getText (_textureConfig >> "icon"); -_markerSize = getNumber (_textureConfig >> "size"); -_markerShadow = getNumber (_textureConfig >> "shadow"); -_colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName)); -_drawColor = getArray (_colorConfig >> "color"); +private _textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName); +private _texture = getText (_textureConfig >> "icon"); +private _markerSize = getNumber (_textureConfig >> "size"); +private _markerShadow = getNumber (_textureConfig >> "shadow"); +private _colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName)); +private _drawColor = getArray (_colorConfig >> "color"); //Convert possible code into numbers { - if (typeName _x == "STRING") then { - _drawColor set [_forEachIndex, (call compile _x)]; + if (_x isEqualType "") then { + _drawColor set [_forEachIndex, call compile _x]; }; } forEach _drawColor; -_drawColor set [3, ((_drawColor select 3) * 0.875)]; //Arma adds a slight transparency -_theMap drawIcon [_texture, _drawColor, GVAR(currentMarkerPosition), (_sizeX * _markerSize), (_sizeY * _markerSize), GVAR(currentMarkerAngle), "", _markerShadow]; +_drawColor set [3, (_drawColor select 3) * 0.875]; //Arma adds a slight transparency + +_theMap drawIcon [ + _texture, + _drawColor, + GVAR(currentMarkerPosition), + _sizeX * _markerSize, + _sizeY * _markerSize, + GVAR(currentMarkerAngle), + "", + _markerShadow +]; diff --git a/addons/markers/functions/fnc_onLBSelChangedChannel.sqf b/addons/markers/functions/fnc_onLBSelChangedChannel.sqf new file mode 100644 index 0000000000..f63c4e5cf4 --- /dev/null +++ b/addons/markers/functions/fnc_onLBSelChangedChannel.sqf @@ -0,0 +1,21 @@ +/* + * Author: commy2 + * When the channel list box is changed. + * + * Arguments: + * 0: Channel ListBox (idc 103) + * 1: Selected Index + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_ctrl", "_index"]; +TRACE_2("params",_ctrl,_index); + +private _channelName = _ctrl lbText _index; + +setCurrentChannel (CHANNEL_NAMES find _channelName); diff --git a/addons/markers/functions/fnc_onLBSelChangedColor.sqf b/addons/markers/functions/fnc_onLBSelChangedColor.sqf index 0b9c5af209..215cd72580 100644 --- a/addons/markers/functions/fnc_onLBSelChangedColor.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedColor.sqf @@ -16,15 +16,13 @@ */ #include "script_component.hpp" -private ["_data", "_config"]; - params ["_ctrl", "_index"]; TRACE_2("params",_ctrl,_index); -_data = _ctrl lbValue _index; +private _data = _ctrl lbValue _index; GVAR(curSelMarkerColor) = _index; -_config = (configfile >> "CfgMarkerColors") select _data; +private _config = (configFile >> "CfgMarkerColors") select _data; -GVAR(currentMarkerColorConfigName) = (configName _config); +GVAR(currentMarkerColorConfigName) = configName _config; diff --git a/addons/markers/functions/fnc_onLBSelChangedShape.sqf b/addons/markers/functions/fnc_onLBSelChangedShape.sqf index c8587e6205..41f0f30a0d 100644 --- a/addons/markers/functions/fnc_onLBSelChangedShape.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedShape.sqf @@ -16,15 +16,13 @@ */ #include "script_component.hpp" -private ["_data", "_config"]; - params ["_ctrl", "_index"]; TRACE_2("params",_ctrl,_index); -_data = _ctrl lbValue _index; +private _data = _ctrl lbValue _index; GVAR(curSelMarkerShape) = _index; -_config = (configfile >> "CfgMarkers") select _data; +private _config = (configFile >> "CfgMarkers") select _data; -GVAR(currentMarkerConfigName) = (configName _config); +GVAR(currentMarkerConfigName) = configName _config; diff --git a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf index 16c6acfad9..030e2314ab 100644 --- a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf +++ b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf @@ -16,12 +16,11 @@ */ #include "script_component.hpp" -private ["_direction"]; - params ["_ctrl", "_data"]; TRACE_2("params",_ctrl,_data); -_direction = round _data; +private _direction = round _data; + if (_direction < 0) then { _direction = _direction + 360; }; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index 36b61151ee..5b0783b454 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -21,16 +21,15 @@ params ["_display", "_closeNum"]; TRACE_2("params",_display,_closeNum); if (_closeNum == 1) then { - // set and send marker data the next frame. the actual marker isn't created yet [{ [QGVAR(setMarkerNetwork), [ - allMapMarkers select (count allMapMarkers - 1), [ - GETGVAR(currentMarkerConfigName,""), - GETGVAR(currentMarkerColorConfigName,""), - GETGVAR(currentMarkerPosition,[]), - GETGVAR(currentMarkerAngle,0) - ] + allMapMarkers select (count allMapMarkers - 1), [ + GETGVAR(currentMarkerConfigName,""), + GETGVAR(currentMarkerColorConfigName,""), + GETGVAR(currentMarkerPosition,[]), + GETGVAR(currentMarkerAngle,0) + ] ]] call EFUNC(common,globalEvent); }, []] call EFUNC(common,execNextFrame); diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 4e6b47b46b..bd8832fb36 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -21,31 +21,34 @@ params ["_allMapMarkers", "_allMapMarkersProperties", "_logic"]; TRACE_3("params",_allMapMarkers,_allMapMarkersProperties,_logic); { - private ["_index", "_data", "_config"]; - - _index = _allMapMarkers find _x; + private _index = _allMapMarkers find _x; if (_index != -1) then { - _data = _allMapMarkersProperties select _index; - _data params ["_name", "_color", "_pos", "_dir"]; + private _data = _allMapMarkersProperties select _index; + _data params ["_markerClassname", "_colorClassname", "_pos", "_dir"]; + + private _config = (configfile >> "CfgMarkers") >> _markerClassname; - _config = (configfile >> "CfgMarkers") >> _name; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); - _config == (configFile >> "CfgMarkers" >> "MilDot"); + _config = configFile >> "CfgMarkers" >> "MilDot"; }; - _x setMarkerTypeLocal (configName _config); - _config = (configfile >> "CfgMarkerColors") >> _color; + _x setMarkerTypeLocal configName _config; + + _config = configfile >> "CfgMarkerColors" >> _colorClassname; + if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); - _config == (configFile >> "CfgMarkerColors" >> "Default"); + _config = configFile >> "CfgMarkerColors" >> "Default"; }; - _x setMarkerColorLocal (configName _config); + + _x setMarkerColorLocal configName _config; _x setMarkerPosLocal _pos; _x setMarkerDirLocal _dir; }; -} forEach allMapMarkers; + false +} count allMapMarkers; deleteVehicle _logic; diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf index c56a1fb93c..9d6d2d8ecf 100644 --- a/addons/markers/functions/fnc_setMarkerNetwork.sqf +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -17,38 +17,37 @@ */ #include "script_component.hpp" -private ["_config"]; - params ["_marker", "_data"]; -_data params ["_markerClassname", "_colorClassname", "_markerPos", "_markerDir"]; TRACE_2("params",_marker,_data); +_data params ["_markerClassname", "_colorClassname", "_pos", "_dir"]; +private _config = configfile >> "CfgMarkers" >> _markerClassname; -_config = (configfile >> "CfgMarkers") >> _markerClassname; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); - _config == (configFile >> "CfgMarkers" >> "MilDot"); + _config = configFile >> "CfgMarkers" >> "MilDot"; }; -_marker setMarkerTypeLocal (configName _config); -_config = (configfile >> "CfgMarkerColors") >> _colorClassname; +_marker setMarkerTypeLocal configName _config; + +_config = configfile >> "CfgMarkerColors" >> _colorClassname; + if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); - _config == (configFile >> "CfgMarkerColors" >> "Default"); + _config = configFile >> "CfgMarkerColors" >> "Default"; }; + _marker setMarkerColorLocal configName _config; -_marker setMarkerPosLocal _markerPos; -_marker setMarkerDirLocal _markerDir; +_marker setMarkerPosLocal _pos; +_marker setMarkerDirLocal _dir; // save properties on server machine for JIP, marker editing ready if (isMultiplayer && {isServer}) then { - private ["_allMapMarkers", "_allMapMarkersProperties", "_index"]; + private _allMapMarkers = GETGVAR(allMapMarkers,[]); + private _allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]); - _allMapMarkers = GETGVAR(allMapMarkers,[]); - _allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]); - - _index = _allMapMarkers find _marker; + private _index = _allMapMarkers find _marker; if (_index == -1) then { _allMapMarkers pushBack _marker; diff --git a/addons/markers/script_component.hpp b/addons/markers/script_component.hpp index 2b1cb586a7..80ffa23b5b 100644 --- a/addons/markers/script_component.hpp +++ b/addons/markers/script_component.hpp @@ -9,4 +9,13 @@ #define DEBUG_SETTINGS DEBUG_ENABLED_MARKERS #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" + +#define CHANNEL_NAMES [ \ + localize "str_channel_global", \ + localize "str_channel_side", \ + localize "str_channel_command", \ + localize "str_channel_group", \ + localize "str_channel_vehicle", \ + localize "str_channel_direct" \ +] diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index 2912c87011..48cf6c87dc 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -16,7 +16,6 @@ class ACE_Head { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical @@ -28,7 +27,6 @@ class ACE_Head { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -95,7 +93,6 @@ class ACE_Torso { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; enableInside = 1; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -107,7 +104,6 @@ class ACE_Torso { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = ""; enableInside = 1; }; class TriageCard { @@ -118,7 +114,6 @@ class ACE_Torso { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = ""; enableInside = 1; icon = PATHTOF(UI\icons\triageCard.paa); }; @@ -130,7 +125,6 @@ class ACE_Torso { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = ""; }; @@ -143,7 +137,6 @@ class ACE_Torso { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; enableInside = 1; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -208,7 +201,6 @@ class ACE_ArmLeft { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -221,7 +213,6 @@ class ACE_ArmLeft { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -366,7 +357,6 @@ class ACE_ArmRight { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -379,7 +369,6 @@ class ACE_ArmRight { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -521,7 +510,6 @@ class ACE_LegLeft { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -535,7 +523,6 @@ class ACE_LegLeft { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -664,7 +651,6 @@ class ACE_LegRight { EXCEPTIONS showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -678,7 +664,6 @@ class ACE_LegRight { EXCEPTIONS showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp index 0f85930f51..4217e43e91 100644 --- a/addons/medical/ACE_Medical_SelfActions.hpp +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -1,7 +1,6 @@ class Medical { displayName = CSTRING(Actions_Medical); runOnHover = 1; - hotkey = "M"; exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); condition = "true"; @@ -24,7 +23,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; // Advanced medical @@ -36,7 +34,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -84,7 +81,6 @@ class Medical { modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction)); showDisabled = 1; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { @@ -95,7 +91,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -107,7 +102,6 @@ class Medical { statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); showDisabled = 1; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\triageCard.paa); }; @@ -120,7 +114,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -162,7 +155,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -175,7 +167,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -264,7 +255,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -277,7 +267,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -362,7 +351,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -376,7 +364,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { @@ -449,7 +436,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); showDisabled = 1; priority = 2; - hotkey = "B"; icon = PATHTOF(UI\icons\bandage.paa); }; @@ -463,7 +449,6 @@ class Medical { statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); showDisabled = 0; priority = 2; - hotkey = ""; icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index ea9e03974a..51fb4ca701 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -27,7 +27,10 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; + litter[] = { + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}} + }; }; class Morphine: Bandage { displayName = CSTRING(Inject_Morphine); @@ -163,12 +166,19 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; + litter[] = { + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}} + }; }; class PackingBandage: fieldDressing { displayName = CSTRING(Actions_PackingBandage); items[] = {"ACE_packingBandage"}; - litter[] = { {"All", "", {"ACE_MedicalLitter_packingBandage"}}}; + litter[] = { + {"All", "", {"ACE_MedicalLitter_packingBandage"}}, + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}} + }; }; class ElasticBandage: fieldDressing { displayName = CSTRING(Actions_ElasticBandage); @@ -177,7 +187,11 @@ class ACE_Medical_Actions { class QuikClot: fieldDressing { displayName = CSTRING(Actions_QuikClot); items[] = {"ACE_quikclot"}; - litter[] = { {"All", "", {"ACE_MedicalLitter_QuickClot"}}}; + litter[] = { + {"All", "", {"ACE_MedicalLitter_QuickClot"}}, + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}} + }; }; class Tourniquet: fieldDressing { displayName = CSTRING(Apply_Tourniquet); @@ -254,7 +268,7 @@ class ACE_Medical_Actions { animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class SalineIV_500: SalineIV { - displayName = CSTRING(Actions_Saline4_500); + displayName = CSTRING(Actions_Saline4_500); items[] = {"ACE_salineIV_500"}; }; class SalineIV_250: SalineIV { @@ -296,9 +310,9 @@ class ACE_Medical_Actions { animationCallerSelf = ""; animationCallerSelfProne = ""; litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, - {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, - {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, - {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}} }; }; class CheckPulse: fieldDressing { @@ -670,7 +684,7 @@ class ACE_Medical_Advanced { }; class Treatment { class Bandaging { - class FieldDressing { + class FieldDressing { // How effect is the bandage for treating one wounds type injury effectiveness = 1; // What is the chance and delays (in seconds) of the treated default injury reopening @@ -683,198 +697,296 @@ class ACE_Medical_Advanced { reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class AbrasionMinor: Abrasion {}; + class AbrasionMedium: Abrasion {}; + class AbrasionLarge: Abrasion {}; class Avulsions: Abrasion { effectiveness = 0.3; reopeningChance = 0.5; reopeningMinDelay = 120; reopeningMaxDelay = 200; }; + class AvulsionsMinor: Avulsions {}; + class AvulsionsMedium: Avulsions {}; + class AvulsionsLarge: Avulsions {}; class Contusion: Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class ContusionMinor: Contusion {}; + class ContusionMedium: Contusion {}; + class ContusionLarge: Contusion {}; class CrushWound: Abrasion { effectiveness = 0.6; reopeningChance = 0.2; reopeningMinDelay = 120; reopeningMaxDelay = 200; }; + class CrushWoundMinor: CrushWound {}; + class CrushWoundMedium: CrushWound {}; + class CrushWoundLarge: CrushWound {}; class Cut: Abrasion { effectiveness = 0.4; reopeningChance = 0.5; reopeningMinDelay = 220; reopeningMaxDelay = 260; }; + class CutMinor: Cut {}; + class CutMedium: Cut {}; + class CutLarge: Cut {}; + class Laceration: Abrasion { effectiveness = 0.7; reopeningChance = 0.3; reopeningMinDelay = 120; reopeningMaxDelay = 260; }; + class LacerationMinor: Laceration {}; + class LacerationMedium: Laceration {}; + class LacerationLarge: Laceration {}; + class velocityWound: Abrasion { effectiveness = 0.3; reopeningChance = 0.8; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class velocityWoundMinor: velocityWound {}; + class velocityWoundMedium: velocityWound {}; + class velocityWoundLarge: velocityWound {}; class punctureWound: Abrasion { effectiveness = 0.5; reopeningChance = 0.8; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class punctureWoundMinor: punctureWound {}; + class punctureWoundMedium: punctureWound {}; + class punctureWoundLarge: punctureWound {}; }; class PackingBandage: fieldDressing { - class Abrasion { + class Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class AbrasionMinor: Abrasion {}; + class AbrasionMedium: Abrasion {}; + class AbrasionLarge: Abrasion {}; class Avulsions: Abrasion { effectiveness = 1; reopeningChance = 0.3; reopeningMinDelay = 120; reopeningMaxDelay = 200; }; + class AvulsionsMinor: Avulsions {}; + class AvulsionsMedium: Avulsions {}; + class AvulsionsLarge: Avulsions {}; class Contusion: Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class ContusionMinor: Contusion {}; + class ContusionMedium: Contusion {}; + class ContusionLarge: Contusion {}; class CrushWound: Abrasion { effectiveness = 0.6; reopeningChance = 0.2; reopeningMinDelay = 120; reopeningMaxDelay = 200; }; + class CrushWoundMinor: CrushWound {}; + class CrushWoundMedium: CrushWound {}; + class CrushWoundLarge: CrushWound {}; class Cut: Abrasion { effectiveness = 0.2; reopeningChance = 0.6; reopeningMinDelay = 30; reopeningMaxDelay = 260; }; + class CutMinor: Cut {}; + class CutMedium: Cut {}; + class CutLarge: Cut {}; class Laceration: Abrasion { effectiveness = 0.3; reopeningChance = 0.3; reopeningMinDelay = 120; reopeningMaxDelay = 260; }; + class LacerationMinor: Laceration {}; + class LacerationMedium: Laceration {}; + class LacerationLarge: Laceration {}; class velocityWound: Abrasion { effectiveness = 1; reopeningChance = 0.5; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class velocityWoundMinor: velocityWound {}; + class velocityWoundMedium: velocityWound {}; + class velocityWoundLarge: velocityWound {}; class punctureWound: Abrasion { effectiveness = 0.3; reopeningChance = 0.5; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class punctureWoundMinor: punctureWound {}; + class punctureWoundMedium: punctureWound {}; + class punctureWoundLarge: punctureWound {}; }; class ElasticBandage: fieldDressing { - class Abrasion { + class Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class AbrasionMinor: Abrasion {}; + class AbrasionMedium: Abrasion {}; + class AbrasionLarge: Abrasion {}; class Avulsions: Abrasion { effectiveness = 0.3; reopeningChance = 0.4; reopeningMinDelay = 120; reopeningMaxDelay = 200; }; + class AvulsionsMinor: Avulsions {}; + class AvulsionsMedium: Avulsions {}; + class AvulsionsLarge: Avulsions {}; class Contusion: Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class ContusionMinor: Contusion {}; + class ContusionMedium: Contusion {}; + class ContusionLarge: Contusion {}; class CrushWound: Abrasion { effectiveness = 1; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class CrushWoundMinor: CrushWound {}; + class CrushWoundMedium: CrushWound {}; + class CrushWoundLarge: CrushWound {}; class Cut: Abrasion { effectiveness = 1; reopeningChance = 0.2; reopeningMinDelay = 10; reopeningMaxDelay = 400; }; + class CutMinor: Cut {}; + class CutMedium: Cut {}; + class CutLarge: Cut {}; class Laceration: Abrasion { effectiveness = 1; reopeningChance = 0.3; reopeningMinDelay = 120; reopeningMaxDelay = 260; }; + class LacerationMinor: Laceration {}; + class LacerationMedium: Laceration {}; + class LacerationLarge: Laceration {}; class velocityWound: Abrasion { effectiveness = 0.5; reopeningChance = 0.5; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class velocityWoundMinor: velocityWound {}; + class velocityWoundMedium: velocityWound {}; + class velocityWoundLarge: velocityWound {}; class punctureWound: Abrasion { effectiveness = 0.85; reopeningChance = 0.5; reopeningMinDelay = 20; reopeningMaxDelay = 300; }; + class punctureWoundMinor: punctureWound {}; + class punctureWoundMedium: punctureWound {}; + class punctureWoundLarge: punctureWound {}; }; class QuikClot: fieldDressing { - class Abrasion { + class Abrasion { effectiveness = 0.7; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class AbrasionMinor: Abrasion {}; + class AbrasionMedium: Abrasion {}; + class AbrasionLarge: Abrasion {}; class Avulsions: Abrasion { effectiveness = 0.2; reopeningChance = 0.1; reopeningMinDelay = 300; reopeningMaxDelay = 350; }; + class AvulsionsMinor: Avulsions {}; + class AvulsionsMedium: Avulsions {}; + class AvulsionsLarge: Avulsions {}; class Contusion: Abrasion { effectiveness = 0.7; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class ContusionMinor: Contusion {}; + class ContusionMedium: Contusion {}; + class ContusionLarge: Contusion {}; class CrushWound: Abrasion { effectiveness = 0.7; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class CrushWoundMinor: CrushWound {}; + class CrushWoundMedium: CrushWound {}; + class CrushWoundLarge: CrushWound {}; class Cut: Abrasion { effectiveness = 0.7; reopeningChance = 0.2; reopeningMinDelay = 100; reopeningMaxDelay = 400; }; + class CutMinor: Cut {}; + class CutMedium: Cut {}; + class CutLarge: Cut {}; class Laceration: Abrasion { effectiveness = 0.7; reopeningChance = 0; reopeningMinDelay = 0; reopeningMaxDelay = 0; }; + class LacerationMinor: Laceration {}; + class LacerationMedium: Laceration {}; + class LacerationLarge: Laceration {}; class velocityWound: Abrasion { effectiveness = 0.7; reopeningChance = 0.1; reopeningMinDelay = 200; reopeningMaxDelay = 300; }; + class velocityWoundMinor: velocityWound {}; + class velocityWoundMedium: velocityWound {}; + class velocityWoundLarge: velocityWound {}; class punctureWound: Abrasion { effectiveness = 0.5; reopeningChance = 0.1; reopeningMinDelay = 200; reopeningMaxDelay = 300; }; + class punctureWoundMinor: punctureWound {}; + class punctureWoundMedium: punctureWound {}; + class punctureWoundLarge: punctureWound {}; }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 351d285c7e..e673b27908 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -429,43 +429,42 @@ class CfgVehicles { }; }; - #define ARM_LEG_ARMOR_DEFAULT 3 - #define ARM_LEG_ARMOR_BETTER 5 - #define ARM_LEG_ARMOR_CSAT 4 + #define ARM_LEG_ARMOR_DEFAULT 1 + #define ARM_LEG_ARMOR_BETTER 1 + #define ARM_LEG_ARMOR_CSAT 1 - class Land; - class Man: Land { - class HitPoints; - }; + #define ADD_ACE_HITPOINTS(ARM_ARMOR,LEG_ARMOR) \ + class HitLeftArm { \ + armor = ARM_ARMOR; \ + material = -1; \ + name = "hand_l"; \ + passThrough = 1; \ + radius = 0.08; \ + explosionShielding = 1; \ + visual = "injury_hands"; \ + minimalHit = 0.01; \ + }; \ + class HitRightArm: HitLeftArm { \ + name = "hand_r"; \ + }; \ + class HitLeftLeg { \ + armor = LEG_ARMOR; \ + material = -1; \ + name = "leg_l"; \ + passThrough = 1; \ + radius = 0.1; \ + explosionShielding = 1; \ + visual = "injury_legs"; \ + minimalHit = 0.01; \ + }; \ + class HitRightLeg: HitLeftLeg { \ + name = "leg_r"; \ + }; + class Man; class CAManBase: Man { - class HitPoints: HitPoints { // custom hitpoints. addons might want to adjust these accordingly - class HitLeftArm { - armor = ARM_LEG_ARMOR_DEFAULT; - material = -1; - name = "hand_l"; // @todo hopefully these still include the whole arm + hands - passThrough = 1; - radius = 0.08; - explosionShielding = 1; - visual = "injury_hands"; - minimalHit = 0.01; - }; - class HitRightArm: HitLeftArm { - name = "hand_r"; // @todo hopefully these still include the whole arm + hands - }; - class HitLeftLeg { - armor = ARM_LEG_ARMOR_DEFAULT; - material = -1; - name = "leg_l"; - passThrough = 1; - radius = 0.1; - explosionShielding = 1; - visual = "injury_legs"; - minimalHit = 0.01; - }; - class HitRightLeg: HitLeftLeg { - name = "leg_r"; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_DEFAULT,ARM_LEG_ARMOR_DEFAULT) }; class ACE_SelfActions { @@ -497,7 +496,7 @@ class CfgVehicles { class GVAR(loadPatient) { displayName = CSTRING(LoadPatient); distance = 5; - condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target == _target); + condition = QUOTE(_target getVariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target == _target); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionLoadUnit)); showDisabled = 0; priority = 2; @@ -507,7 +506,7 @@ class CfgVehicles { class GVAR(UnLoadPatient) { displayName = CSTRING(UnloadPatient); distance = 5; - condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target != _target); + condition = QUOTE(_target getVariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target != _target); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionUnloadUnit)); showDisabled = 0; priority = 2; @@ -525,174 +524,82 @@ class CfgVehicles { class B_Soldier_base_F: SoldierWB {}; class B_Soldier_04_f: B_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_BETTER,ARM_LEG_ARMOR_BETTER) }; }; class B_Soldier_05_f: B_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_BETTER,ARM_LEG_ARMOR_BETTER) }; }; class I_Soldier_base_F: SoldierGB {}; class I_Soldier_03_F: I_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_BETTER,ARM_LEG_ARMOR_BETTER) }; }; class I_Soldier_04_F: I_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_BETTER; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_BETTER,ARM_LEG_ARMOR_BETTER) }; }; class O_Soldier_base_F: SoldierEB { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_CSAT,ARM_LEG_ARMOR_BETTER) + }; + }; + + class O_Soldier_diver_base_F: O_Soldier_base_F { + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_CSAT,ARM_LEG_ARMOR_BETTER) }; }; class O_Soldier_02_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_CSAT,ARM_LEG_ARMOR_BETTER) }; }; class O_officer_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = ARM_LEG_ARMOR_CSAT; // @todo is that suppossed to be the case? - }; - class HitRightArm: HitRightArm { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitLeftLeg: HitLeftLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; - class HitRightLeg: HitRightLeg { - armor = ARM_LEG_ARMOR_CSAT; - }; + class HitPoints { + ADD_ACE_HITPOINTS(ARM_LEG_ARMOR_CSAT,ARM_LEG_ARMOR_BETTER) }; }; - class O_Protagonist_VR_F: O_Soldier_base_F { - class HitPoints: HitPoints { - class HitHead; - class HitBody; - class HitHands; - class HitLegs; - class HitLeftArm: HitLeftArm { - armor = 2; - }; - class HitRightArm: HitRightArm { - armor = 2; - }; - class HitLeftLeg: HitLeftLeg { - armor = 2; - }; - class HitRightLeg: HitRightLeg { - armor = 2; - }; - }; - }; + //These VR guys already have limb hitpoints that we should be able to use + //Note: the selections are a little weird, eg: class leg_l {name = "leg_l";}; + // class B_Soldier_VR_F: B_Soldier_base_F { { + // class HitPoints { + //Has class hand_l, hand_r, leg_l, leg_r Hitpoints already + // }; + // }; + // class O_Soldier_VR_F: O_Soldier_base_F { { + // class HitPoints { + //Has class hand_l, hand_r, leg_l, leg_r Hitpoints already + // }; + // }; + // class I_Soldier_VR_F: I_Soldier_base_F { { + // class HitPoints { + //Has class hand_l, hand_r, leg_l, leg_r Hitpoints already + // }; + // }; + // class C_Soldier_VR_F: C_man_1 { + // class HitPoints { + //Has class hand_l, hand_r, leg_l, leg_r Hitpoints already + // }; + // }; + // class O_Protagonist_VR_F: O_Soldier_base_F { + // class HitPoints { + //Has class hand_l, hand_r, leg_l, leg_r Hitpoints already + // }; + // }; class MapBoard_altis_F; class ACE_bodyBagObject: MapBoard_altis_F { diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 064f78682f..d833e44740 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -160,7 +160,7 @@ GVAR(lastHeartBeatSound) = ACE_time; if (GVAR(level) == 1) then { _heartRate = 60 + 40 * _pain; }; - if (_heartRate <= 0) exitwith {}; + if (_heartRate <= 0) exitWith {}; _interval = 60 / (_heartRate min 40); if ((ACE_player getVariable ["ACE_isUnconscious", false])) then { @@ -175,11 +175,11 @@ GVAR(lastHeartBeatSound) = ACE_time; // Pain effect, no pain effect in zeus camera if (isNull curatorCamera) then { - _strength = ((_pain - (ACE_player getvariable [QGVAR(painSuppress), 0])) max 0) min 1; + _strength = ((_pain - (ACE_player getVariable [QGVAR(painSuppress), 0])) max 0) min 1; _strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]); if (GVAR(painEffectType) == 1) then { GVAR(effectPainCC) ppEffectEnable false; - if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { + if (_pain > (ACE_player getVariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { _strength = _strength * 0.15; GVAR(effectPainCA) ppEffectEnable true; GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false]; @@ -201,7 +201,7 @@ GVAR(lastHeartBeatSound) = ACE_time; }; } else { GVAR(effectPainCA) ppEffectEnable false; - if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { + if (_pain > (ACE_player getVariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { _strength = _strength * 0.9; GVAR(effectPainCC) ppEffectEnable true; GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]]; @@ -246,24 +246,24 @@ GVAR(lastHeartBeatSound) = ACE_time; }; ["SettingsInitialized", { - if (GVAR(level) == 2) exitwith { + if (GVAR(level) == 2) exitWith { [ - {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, - {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, + {(((_this select 0) getVariable [QGVAR(bloodVolume), 100]) < 65)}, + {(((_this select 0) getVariable [QGVAR(pain), 0]) - ((_this select 0) getVariable [QGVAR(painSuppress), 0])) > 0.9}, {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, - {((_this select 0) getvariable [QGVAR(inReviveState), false])}, - {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, - {((_this select 0) getvariable ["ACE_isDead", false])}, - {(((_this select 0) getvariable [QGVAR(airwayStatus), 100]) < 80)} + {((_this select 0) getVariable [QGVAR(inReviveState), false])}, + {((_this select 0) getVariable [QGVAR(inCardiacArrest), false])}, + {((_this select 0) getVariable ["ACE_isDead", false])}, + {(((_this select 0) getVariable [QGVAR(airwayStatus), 100]) < 80)} ] call FUNC(addUnconsciousCondition); }; [ - {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 40)}, - {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.6}, + {(((_this select 0) getVariable [QGVAR(bloodVolume), 100]) < 40)}, + {(((_this select 0) getVariable [QGVAR(pain), 0]) - ((_this select 0) getVariable [QGVAR(painSuppress), 0])) > 0.6}, {(([_this select 0] call FUNC(getBloodLoss)) > 0.1)}, - {((_this select 0) getvariable [QGVAR(inReviveState), false])}, - {((_this select 0) getvariable ["ACE_isDead", false])} + {((_this select 0) getVariable [QGVAR(inReviveState), false])}, + {((_this select 0) getVariable ["ACE_isDead", false])} ] call FUNC(addUnconsciousCondition); }] call EFUNC(common,addEventHandler); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 9563752d92..5deaf77ceb 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -12,6 +12,7 @@ PREP(actionPlaceInBodyBag); PREP(actionRemoveTourniquet); PREP(actionLoadUnit); PREP(actionUnloadUnit); +PREP(addDamageToUnit); PREP(addHeartRateAdjustment); PREP(addToInjuredCollection); PREP(addToLog); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 16d9573fc9..910a086364 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -17,7 +17,7 @@ class CfgPatches { #include "CfgFactionClasses.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" -#include "CFgSounds.hpp" +#include "CfgSounds.hpp" #include "ACE_Medical_Treatments.hpp" #include "ACE_Settings.hpp" #include "UI\RscTitles.hpp" diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 24b5bf4c6e..0fd9394f92 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -60,6 +60,6 @@ if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC( ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); - [_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 94f3e6ad34..83852f8042 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -17,7 +17,7 @@ private ["_heartRateOutput", "_heartRate", "_logOutPut"]; params ["_caller", "_unit", "_selectionName"]; -_heartRate = _unit getvariable [QGVAR(heartRate), 80]; +_heartRate = _unit getVariable [QGVAR(heartRate), 80]; if (!alive _unit) then { _heartRate = 0; }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 6910545a9d..d69fa90c86 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -21,5 +21,5 @@ _output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsi ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); -[_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target,"quick_view",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"activity",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"quick_view",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index 072b9b1a7e..ffb2583a15 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -21,25 +21,25 @@ _genericMessages = [LSTRING(diagnoseMessage)]; _genericMessages pushBack ([_target] call EFUNC(common,getName)); if (alive _target) then { - _genericMessages pushback LSTRING(diagnoseAlive); + _genericMessages pushBack LSTRING(diagnoseAlive); } else { - _genericMessages pushback LSTRING(diagnoseDead); + _genericMessages pushBack LSTRING(diagnoseDead); }; -if (_target getvariable[QGVAR(hasLostBlood), 0] > 0) then { - if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { - _genericMessages pushback LSTRING(lostBloodALot); - } else { - _genericMessages pushback LSTRING(lostBlood); - }; +if (_target getVariable[QGVAR(hasLostBlood), 0] > 0) then { + if (_target getVariable[QGVAR(hasLostBlood), 0] > 1) then { + _genericMessages pushBack LSTRING(lostBloodALot); + } else { + _genericMessages pushBack LSTRING(lostBlood); + }; } else { - _genericMessages pushback LSTRING(noBloodloss); + _genericMessages pushBack LSTRING(noBloodloss); }; if (alive _target) then { - if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback LSTRING(inPain); + if (_target getVariable[QGVAR(hasPain), false]) then { + _genericMessages pushBack LSTRING(inPain); } else { - _genericMessages pushback LSTRING(noPain); + _genericMessages pushBack LSTRING(noPain); }; }; diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index 42a94997d8..41970e23d2 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -17,7 +17,7 @@ private "_vehicle"; params ["_caller", "_target"]; -if ([_target] call EFUNC(common,isAwake)) exitwith { +if ([_target] call EFUNC(common,isAwake)) exitWith { ["displayTextStructured", [_caller], [[LSTRING(CanNotLoaded), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); }; if ([_target] call FUNC(isBeingCarried)) then { diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index f416535701..bf8bc0289f 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -28,10 +28,12 @@ _spinePos = _target modelToWorldVisual (_target selectionPosition "Spine3"); _dirVect = _headPos vectorFromTo _spinePos; _direction = _dirVect call CBA_fnc_vectDir; -deleteVehicle _target; - _bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, "CAN_COLLIDE"]; +["placedInBodyBag", [_target, _bodyBag]] call EFUNC(common,globalEvent); + +deleteVehicle _target; + // prevent body bag from flipping _bodyBag setPosASL _position; _bodyBag setDir _direction; diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index b920f276f0..81412f60c4 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -20,17 +20,17 @@ params ["_caller", "_target", "_selectionName"]; // grab the required data _part = [_selectionName] call FUNC(selectionNameToNumber); -_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; +_tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; // Check if there is a tourniquet on this bodypart -if ((_tourniquets select _part) == 0) exitwith { +if ((_tourniquets select _part) == 0) exitWith { _output = LSTRING(noTourniquetOnBodyPart); ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); }; // Removing the tourniquet _tourniquets set[_part, 0]; -_target setvariable [QGVAR(tourniquets), _tourniquets, true]; +_target setVariable [QGVAR(tourniquets), _tourniquets, true]; // Adding the tourniquet item to the caller _caller addItem "ACE_tourniquet"; diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index 6bb4f5beed..3d6d1d964c 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -18,7 +18,7 @@ params ["_caller", "_target", ["_drag", false]]; // cannot unload a unit not in a vehicle. -if (vehicle _target == _target) exitwith {}; -if (([_target] call EFUNC(common,isAwake))) exitwith {}; +if (vehicle _target == _target) exitWith {}; +if (([_target] call EFUNC(common,isAwake))) exitWith {}; ["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent) diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf new file mode 100644 index 0000000000..a11cc4689f --- /dev/null +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -0,0 +1,63 @@ +/* + * Author: PabstMirror + * Manually Apply Damage to a unit (can cause lethal damage) + * NOTE: because of caching, this will not have instant effects (~3 frame delay) + * + * Arguments: + * 0: The Unit + * 1: Damage to Add + * 2: Selection ("head", "body", "hand_l", "hand_r", "leg_l", "leg_r") + * 3: Projectile Type + * + * Return Value: + * HandleDamage's return + * + * Example: + * [player, 0.8, "leg_r", "bullet"] call ace_medical_fnc_addDamageToUnit + * [cursorTarget, 1, "body", "stab"] call ace_medical_fnc_addDamageToUnit + * + * Public: Yes + */ +// #define DEBUG_MODE_FULL +// #define DEBUG_TESTRESULTS +#include "script_component.hpp" + +params [["_unit", objNull, [objNull]], ["_damageToAdd", -1, [0]], ["_selection", "", [""]], ["_typeOfDamage", "", [""]]]; +TRACE_4("params",_unit,_damageToAdd,_selection,_typeOfDamage); + +_selection = toLower _selection; +if ((isNull _unit) || {!local _unit} || {!alive _unit}) exitWith {ACE_LOGERROR_1("addDamageToUnit - badUnit %1", _this); -1}; +if (_damageToAdd < 0) exitWith {ACE_LOGERROR_1("addDamageToUnit - bad damage %1", _this); -1}; +if (!(_selection in GVAR(SELECTIONS))) exitWith {ACE_LOGERROR_1("addDamageToUnit - bad selection %1", _this); -1}; + +//Get the hitpoint and the index +private _hitpoint = [_unit, _selection, true] call ace_medical_fnc_translateSelections; +(getAllHitPointsDamage _unit) params [["_allHitPoints", []]]; +private _hitpointIndex = -1; +{ //case insensitive find + if (_x == _hitpoint) exitWith {_hitpointIndex = _forEachIndex;}; +} forEach _allHitPoints; +if (_hitpointIndex < 0) exitWith {ACE_LOGERROR_1("addDamageToUnit - bad hitpointIndex %1", _this); -1}; + +private _currentDamage = _unit getHitIndex _hitpointIndex; + +#ifdef DEBUG_TESTRESULTS +private _checkAtFrame = diag_frameno + 5; +private _partNumber = [_selection] call FUNC(selectionNameToNumber); +private _startDmg = (_unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _partNumber; +private _debugCode = { + params ["", "_unit", "_startDmg", "_damageToAdd", "_partNumber"]; + private _endDmg = (_unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _partNumber; + if ((!alive _unit) || {_endDmg > _startDmg}) then { + ACE_LOGINFO_6("addDamageToUnit - PASSED - [unit:%1, partNo:%2, addDmg:%3] results:[alive:%4 old:%5 new:%6]", _unit, _partNumber, _damageToAdd, alive _unit, _startDmg, _endDmg); + } else { + ACE_LOGERROR_6("addDamageToUnit - FAILED - [unit:%1, partNo:%2, addDmg:%3] results:[alive:%4 old:%5 new:%6]", _unit, _partNumber, _damageToAdd, alive _unit, _startDmg, _endDmg); + }; +}; +[{diag_frameno > (_this select 0)}, _debugCode, [_checkAtFrame, _unit, _startDmg, _damageToAdd, _partNumber]] call EFUNC(common,waitUntilAndExecute); +#endif + +private _return = [_unit, _selection, (_currentDamage + _damageToAdd), _unit, _typeOfDamage, _hitpointIndex] call FUNC(handleDamage); +TRACE_1("handleDamage called",_return); + +_return diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index 9f2e7a8bf9..cc8c093071 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -19,7 +19,7 @@ params [["_unit", objNull, [objNull]], ["_value", 0, [0]], ["_time", 1, [0]], ["_callBack", {}, [{}]]]; -_adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; -_adjustment pushback [_value, _time, _callBack]; -_unit setvariable [QGVAR(heartRateAdjustments), _adjustment ]; +_adjustment = _unit getVariable [QGVAR(heartRateAdjustments), []]; +_adjustment pushBack [_value, _time, _callBack]; +_unit setVariable [QGVAR(heartRateAdjustments), _adjustment ]; ["Medical_onHeartRateAdjustmentAdded", [_unit, _value, _time]] call EFUNC(common,localEvent); diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index 0ed9b9747f..48e400f7b2 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -17,12 +17,12 @@ params ["_unit", ["_force", false]]; if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { - if !(local _unit) exitwith { + if !(local _unit) exitWith { [[_unit, _force], QUOTE(DFUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; - if ((_unit getvariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitwith{}; - _unit setvariable [QGVAR(addedToUnitLoop), true, true]; + if ((_unit getVariable[QGVAR(addedToUnitLoop),false] || !alive _unit) && !_force) exitWith{}; + _unit setVariable [QGVAR(addedToUnitLoop), true, true]; [{ params ["_args", "_idPFH"]; @@ -34,17 +34,17 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { [_idPFH] call CBA_fnc_removePerFrameHandler; if (!local _unit) then { if (GVAR(level) >= 2) then { - _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 80], true]; - _unit setvariable [QGVAR(bloodPressure), _unit getvariable [QGVAR(bloodPressure), [80, 120]], true]; + _unit setVariable [QGVAR(heartRate), _unit getVariable [QGVAR(heartRate), 80], true]; + _unit setVariable [QGVAR(bloodPressure), _unit getVariable [QGVAR(bloodPressure), [80, 120]], true]; }; - _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 100], true]; + _unit setVariable [QGVAR(bloodVolume), _unit getVariable [QGVAR(bloodVolume), 100], true]; }; } else { [_unit, _interval] call FUNC(handleUnitVitals); private "_pain"; - _pain = _unit getvariable [QGVAR(pain), 0]; - if (_pain > (_unit getvariable [QGVAR(painSuppress), 0])) then { + _pain = _unit getVariable [QGVAR(pain), 0]; + if (_pain > (_unit getVariable [QGVAR(painSuppress), 0])) then { // This introduces wierd unconscious behaviour for basic medical and possibly also advanced. // TODO This is disabled as it's considered non critical code. // We will need to decide if we want unconscious triggered on high pain levels or if we can get rid of this entirely. diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 0e341792c9..8d1b337514 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -19,7 +19,7 @@ private ["_moment", "_logVarName", "_log","_newLog", "_logs"]; params ["_unit", "_type", "_message", "_arguments"]; -if (!local _unit) exitwith { +if (!local _unit) exitWith { [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; @@ -29,24 +29,24 @@ _moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute]; _logVarName = format[QGVAR(logFile_%1), _type]; -_log = _unit getvariable [_logVarName, []]; +_log = _unit getVariable [_logVarName, []]; if (count _log >= 8) then { _newLog = []; { // ensure the first element will not be added - if (_foreachIndex > 0) then { - _newLog pushback _x; + if (_forEachIndex > 0) then { + _newLog pushBack _x; }; - } foreach _log; + } forEach _log; _log = _newLog; }; -_log pushback [_message, _moment, _type, _arguments]; +_log pushBack [_message, _moment, _type, _arguments]; -_unit setvariable [_logVarName, _log, true]; +_unit setVariable [_logVarName, _log, true]; ["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call EFUNC(common,localEvent); -_logs = _unit getvariable [QGVAR(allLogs), []]; +_logs = _unit getVariable [QGVAR(allLogs), []]; if !(_logVarName in _logs) then { - _logs pushback _logVarName; - _unit setvariable [QGVAR(allLogs), _logs, true]; + _logs pushBack _logVarName; + _unit setVariable [QGVAR(allLogs), _logs, true]; }; diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index b1df46f751..bd988fa84c 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -17,28 +17,28 @@ private ["_log", "_inList", "_amount"]; params ["_unit", "_newItem"]; -if (!local _unit) exitwith { +if (!local _unit) exitWith { [_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -_log = _unit getvariable [QGVAR(triageCard), []]; +_log = _unit getVariable [QGVAR(triageCard), []]; _inList = false; _amount = 1; { - if ((_x select 0) == _newItem) exitwith { + if ((_x select 0) == _newItem) exitWith { private "_info"; - _info = _log select _foreachIndex; + _info = _log select _forEachIndex; _info set [1,(_info select 1) + 1]; _info set [2, ACE_gameTime]; - _log set [_foreachIndex, _info]; + _log set [_forEachIndex, _info]; _amount = (_info select 1); _inList = true; }; -} foreach _log; +} forEach _log; if (!_inList) then { - _log pushback [_newItem, 1, ACE_gameTime]; + _log pushBack [_newItem, 1, ACE_gameTime]; }; -_unit setvariable [QGVAR(triageCard), _log, true]; +_unit setVariable [QGVAR(triageCard), _log, true]; ["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call EFUNC(common,localEvent); diff --git a/addons/medical/functions/fnc_addUnconsciousCondition.sqf b/addons/medical/functions/fnc_addUnconsciousCondition.sqf index 6a867088da..195cd557d7 100644 --- a/addons/medical/functions/fnc_addUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_addUnconsciousCondition.sqf @@ -15,9 +15,9 @@ if (isnil QGVAR(unconsciousConditions)) then { GVAR(unconsciousConditions) = []; }; -if (typeName _this == typeName []) then { +if (_this isEqualType []) then { { - if (typeName _x == typeName {}) then { + if (_x isEqualType {}) then { GVAR(unconsciousConditions) pushback _x; }; } foreach _this; diff --git a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf index 2aecfb9a12..e6856335cc 100644 --- a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf +++ b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf @@ -17,14 +17,14 @@ private ["_accessLevel", "_return"]; params ["_caller", "_target"]; -_accessLevel = _target getvariable [QGVAR(allowSharedEquipmentAccess), -1]; +_accessLevel = _target getVariable [QGVAR(allowSharedEquipmentAccess), -1]; _return = false; if (_accessLevel >= 0) then { - if (_accessLevel == 0) exitwith { _return = true; }; - if (_accessLevel == 1) exitwith { _return = (side _target == side _caller); }; - if (_accessLevel == 2) exitwith { _return = (group _target == group _caller); }; + if (_accessLevel == 0) exitWith { _return = true; }; + if (_accessLevel == 1) exitWith { _return = (side _target == side _caller); }; + if (_accessLevel == 2) exitWith { _return = (group _target == group _caller); }; }; _return; diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 60685ee20a..1d9fadf455 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -37,7 +37,7 @@ _medicRequired = if (isNumber (_config >> "requiredMedic")) then { } else { // Check for required class if (isText (_config >> "requiredMedic")) exitwith { - missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0] + missionNamespace getVariable [(getText (_config >> "requiredMedic")), 0] }; 0; }; @@ -55,9 +55,9 @@ if (getText (_config >> "condition") != "") then { if (isnil _condition) then { _condition = compile _condition; } else { - _condition = missionNamespace getvariable _condition; + _condition = missionNamespace getVariable _condition; }; - if (typeName _condition == "BOOL") then { + if (_condition isEqualType false) then { _return = _condition; } else { _return = [_caller, _target, _selectionName, _className] call _condition; @@ -66,7 +66,7 @@ if (getText (_config >> "condition") != "") then { if (!_return) exitwith { false }; _patientStateCondition = if (isText(_config >> "patientStateCondition")) then { - missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] + missionNamespace getVariable [getText(_config >> "patientStateCondition"), 0] } else { getNumber(_config >> "patientStateCondition") }; @@ -85,8 +85,8 @@ _medVeh = {([_caller] call FUNC(isInMedicalVehicle)) || ([_target] call FUNC(isI if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; if !(isnil _x) exitwith { private "_val"; - _val = missionNamespace getvariable _x; - if (typeName _val == "SCALAR") then { + _val = missionNamespace getVariable _x; + if (_val isEqualType 0) then { _return = switch (_val) do { case 0: {true}; //AdvancedMedicalSettings_anywhere case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle diff --git a/addons/medical/functions/fnc_copyDeadBody.sqf b/addons/medical/functions/fnc_copyDeadBody.sqf index 9cd43dada6..af601d9f33 100644 --- a/addons/medical/functions/fnc_copyDeadBody.sqf +++ b/addons/medical/functions/fnc_copyDeadBody.sqf @@ -17,15 +17,15 @@ private ["_newUnit", "_class", "_group", "_position", "_side", "_name"]; params ["_oldBody", "_caller"]; -if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies +if (alive _oldBody) exitWith {_oldBody}; // we only want to do this for dead bodies -_name = _oldBody getvariable ["ACE_name", "unknown"]; -_class = typeof _oldBody; +_name = _oldBody getVariable ["ACE_name", "unknown"]; +_class = typeOf _oldBody; _side = side _caller; _group = createGroup _side; _position = getPos _oldBody; -_newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; +_newUnit = _group createUnit [typeOf _oldBody, _position, [], 0, "NONE"]; _newUnit setVariable ["ACE_name", _name, true]; _newUnit disableAI "TARGET"; @@ -71,12 +71,12 @@ if (isMultiplayer) then { hideObject _oldBody; }; -_newUnit setvariable [QGVAR(copyOfUnit), _oldBody, true]; -_oldBody setvariable [QGVAR(hasCopy), _newUnit, true]; -_newUnit setvariable ["ACE_isDead", true, true]; -_newUnit setvariable ["ACE_isUnconscious", true, true]; -_newUnit setvariable [QGVAR(disableInteraction), true, true]; -_oldBody setvariable [QGVAR(disableInteraction), true, true]; +_newUnit setVariable [QGVAR(copyOfUnit), _oldBody, true]; +_oldBody setVariable [QGVAR(hasCopy), _newUnit, true]; +_newUnit setVariable ["ACE_isDead", true, true]; +_newUnit setVariable ["ACE_isUnconscious", true, true]; +_newUnit setVariable [QGVAR(disableInteraction), true, true]; +_oldBody setVariable [QGVAR(disableInteraction), true, true]; [_newUnit, 0.89] call FUNC(setStructuralDamage); _newUnit; diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 54fd6694dd..61931b9765 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -9,7 +9,7 @@ * 3: The treatment classname * 4: ? * 5: Users of Items - * 6: Previous Damage + * 6: Blood Loss on selection (previously called _previousDamage) * * Return Value: * None @@ -22,7 +22,10 @@ #define MIN_ENTRIES_LITTER_CONFIG 3 private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"]; -params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"]; +params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_bloodLossOnSelection"]; + +//Ensures comptibilty with other possible medical treatment configs +private _previousDamage = _bloodLossOnSelection; if !(GVAR(allowLitterCreation)) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; @@ -59,7 +62,7 @@ _createLitter = { _createdLitter = []; { - if (typeName _x == "ARRAY") then { + if (_x isEqualType []) then { if (count _x < MIN_ENTRIES_LITTER_CONFIG) exitwith {}; _x params ["_selection", "_litterCondition", "_litterOptions"]; @@ -69,18 +72,18 @@ _createdLitter = []; if (isnil _litterCondition) then { _litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}}; } else { - _litterCondition = missionNamespace getvariable _litterCondition; - if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; + _litterCondition = missionNamespace getVariable _litterCondition; + if (!(_litterCondition isEqualType {})) then {_litterCondition = {false}}; }; - if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {}; + if !([_caller, _target, _selectionName, _className, _usersOfItems, _bloodLossOnSelection] call _litterCondition) exitwith {}; - if (typeName _litterOptions == "ARRAY") then { + if (_litterOptions isEqualType []) then { // Loop through through the litter options and place the litter { - if (typeName _x == "ARRAY" && {(count _x > 0)}) then { + if (_x isEqualType [] && {(count _x > 0)}) then { [_target, _x select (floor(random(count _x)))] call _createLitter; }; - if (typeName _x == "STRING") then { + if (_x isEqualType "") then { [_target, _x] call _createLitter; }; } foreach _litterOptions; diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf index 7fc4823202..8be0e00903 100644 --- a/addons/medical/functions/fnc_determineIfFatal.sqf +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -25,29 +25,29 @@ private ["_damageThreshold", "_damageBodyPart", "_chanceFatal"]; params ["_unit", "_part", ["_withDamage", 0]]; -if (!alive _unit) exitwith {true}; -if (_part < 0 || _part > 5) exitwith {false}; -if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; +if (!alive _unit) exitWith {true}; +if (_part < 0 || _part > 5) exitWith {false}; +if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitWith { true }; // Find the correct Damage threshold for unit. _damageThreshold = [1,1,1]; if ([_unit] call EFUNC(common,IsPlayer)) then { - _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(playerDamageThreshold), GVAR(playerDamageThreshold), GVAR(playerDamageThreshold) * 1.7]]; + _damageThreshold =_unit getVariable[QGVAR(unitDamageThreshold), [GVAR(playerDamageThreshold), GVAR(playerDamageThreshold), GVAR(playerDamageThreshold) * 1.7]]; } else { - _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(AIDamageThreshold), GVAR(AIDamageThreshold), GVAR(AIDamageThreshold) * 1.7]]; + _damageThreshold =_unit getVariable[QGVAR(unitDamageThreshold), [GVAR(AIDamageThreshold), GVAR(AIDamageThreshold), GVAR(AIDamageThreshold) * 1.7]]; }; _damageThreshold params ["_thresholdHead", "_thresholdTorso", "_thresholdLimbs"]; -_damageBodyPart = ((_unit getvariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage; +_damageBodyPart = ((_unit getVariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage; // Check if damage to body part is higher as damage head -if (_part == 0) exitwith { +if (_part == 0) exitWith { _chanceFatal = CHANGE_FATAL_HEAD + ((INCREASE_CHANCE_HEAD * (_damageBodyPart - _thresholdHead)) * 10); (_damageBodyPart >= _thresholdHead && {(_chanceFatal >= random(1))}); }; // Check if damage to body part is higher as damage torso -if (_part == 1) exitwith { +if (_part == 1) exitWith { _chanceFatal = CHANGE_FATAL_TORSO + ((INCREASE_CHANCE_TORSO * (_damageBodyPart - _thresholdTorso)) * 10); (_damageBodyPart >= _thresholdTorso && {(_chanceFatal >= random(1))}); }; diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index 222de4463f..279bbf060d 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -46,7 +46,7 @@ if (_show) then { }; disableSerialization; - _display = uiNamespace getvariable QGVAR(DisplayInformation); + _display = uiNamespace getVariable QGVAR(DisplayInformation); if (isnil "_display") exitwith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; @@ -59,26 +59,26 @@ if (_show) then { _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; }; - if (_target getvariable[QGVAR(isBleeding), false]) then { + if (_target getVariable[QGVAR(isBleeding), false]) then { _genericMessages pushback [localize LSTRING(Status_Bleeding), [1, 0.1, 0.1, 1]]; }; - if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { + if (_target getVariable[QGVAR(hasLostBlood), 0] > 1) then { _genericMessages pushback [localize LSTRING(Status_Lost_Blood), [1, 0.1, 0.1, 1]]; }; - if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { + if (((_target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { _genericMessages pushback [localize LSTRING(Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; - if (_target getvariable[QGVAR(hasPain), false]) then { + if (_target getVariable[QGVAR(hasPain), false]) then { _genericMessages pushback [localize LSTRING(Status_Pain), [1, 1, 1, 1]]; }; _totalIvVolume = 0; { private "_value"; - _value = _target getvariable _x; + _value = _target getVariable _x; if !(isnil "_value") then { - _totalIvVolume = _totalIvVolume + (_target getvariable [_x, 0]); + _totalIvVolume = _totalIvVolume + (_target getVariable [_x, 0]); }; } foreach GVAR(IVBags); if (_totalIvVolume >= 1) then { @@ -88,7 +88,7 @@ if (_show) then { _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0,0,0,0,0,0]; if (GVAR(level) >= 2 && {([_target] call FUNC(hasMedicalEnabled))}) then { - _openWounds = _target getvariable [QGVAR(openWounds), []]; + _openWounds = _target getVariable [QGVAR(openWounds), []]; private "_amountOf"; { _x params ["", "_x1", "_selectionX", "_amountOf", "_x4"]; @@ -110,7 +110,7 @@ if (_show) then { }; } foreach _openWounds; - _bandagedwounds = _target getvariable [QGVAR(bandagedWounds), []]; + _bandagedwounds = _target getVariable [QGVAR(bandagedWounds), []]; { _x params ["", "", "_selectionX", "_amountOf", "_x4"]; // Find how much this bodypart is bleeding @@ -133,10 +133,10 @@ if (_show) then { } else { _damaged = [true, true, true, true, true, true]; { - _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; - - if (_target getHitPointDamage _x > 0 && {_forEachIndex == _selectionN}) then { - _pointDamage = _target getHitPointDamage _x; + private _hitPoint = [_target, _x, true] call FUNC(translateSelections); + _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _hitPoint]; + if (_target getHitPointDamage _hitPoint > 0 && {_forEachIndex == _selectionN}) then { + _pointDamage = _target getHitPointDamage _hitPoint; _severity = switch (true) do { case (_pointDamage > 0.5): {localize LSTRING(HeavilyWounded)}; case (_pointDamage > 0.1): {localize LSTRING(LightlyWounded)}; @@ -152,7 +152,7 @@ if (_show) then { ] select _forEachIndex); _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; - } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + } forEach GVAR(SELECTIONS); }; // Handle the body image coloring @@ -200,7 +200,7 @@ if (_show) then { lbClear _logCtrl; private ["_logs", "_message", "_moment", "_arguments", "_lbCtrl"]; - _logs = _target getvariable [QGVAR(logFile_Activity), []]; + _logs = _target getVariable [QGVAR(logFile_Activity), []]; { // [_message,_moment,_type, _arguments] _x params ["_message", "_moment", "_type", "_arguments"]; @@ -209,7 +209,7 @@ if (_show) then { }; { - if (typeName _x == "STRING" && {isLocalized _x}) then { + if (_x isEqualType "" && {isLocalized _x}) then { _arguments set [_foreachIndex, localize _x]; }; } foreach _arguments; diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index 9849242de1..47af145055 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -27,13 +27,13 @@ if (_show) then { private ["_target", "_display", "_alphaLevel", "_alphaLevel", "_lbCtrl"]; params ["_args", "_idPFH"]; _args params ["_target"]; - if (GVAR(TriageCardTarget) != _target) exitwith { + if (GVAR(TriageCardTarget) != _target) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; disableSerialization; - _display = uiNamespace getvariable QGVAR(triageCard); - if (isnil "_display") exitwith { + _display = uiNamespace getVariable QGVAR(triageCard); + if (isNil "_display") exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; @@ -43,7 +43,7 @@ if (_show) then { _lbCtrl = (_display displayCtrl 200); lbClear _lbCtrl; - _log = _target getvariable [QGVAR(triageCard), []]; + _log = _target getVariable [QGVAR(triageCard), []]; { _x params ["_item", "_amount"]; _message = _item; @@ -54,15 +54,15 @@ if (_show) then { _message = localize _message; }; }; - _triageCardTexts pushback format["%1x - %2", _amount, _message]; - } foreach _log; + _triageCardTexts pushBack format["%1x - %2", _amount, _message]; + } forEach _log; if (count _triageCardTexts == 0) then { _lbCtrl lbAdd (localize LSTRING(TriageCard_NoEntry)); }; { _lbCtrl lbAdd _x; - } foreach _triageCardTexts; + } forEach _triageCardTexts; _triageStatus = [_target] call FUNC(getTriageStatus); diff --git a/addons/medical/functions/fnc_dropDownTriageCard.sqf b/addons/medical/functions/fnc_dropDownTriageCard.sqf index d207c7f9a4..e7a4d3c0a9 100644 --- a/addons/medical/functions/fnc_dropDownTriageCard.sqf +++ b/addons/medical/functions/fnc_dropDownTriageCard.sqf @@ -17,8 +17,8 @@ private ["_ctrl", "_display", "_idc", "_pos"]; params ["_show"]; disableSerialization; -_display = uiNamespace getvariable QGVAR(triageCard); -if (isnil "_display") exitwith {}; +_display = uiNamespace getVariable QGVAR(triageCard); +if (isNil "_display") exitWith {}; _pos = [0,0,0,0]; if (_show) then { diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index a3fdbd5b94..26727d3d8e 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -22,8 +22,8 @@ _totalBloodLoss = 0; // Advanced medical bloodloss handling if (GVAR(level) >= 2) then { - _tourniquets = _unit getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; - _openWounds = _unit getvariable [QGVAR(openWounds), []]; + _tourniquets = _unit getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; + _openWounds = _unit getVariable [QGVAR(openWounds), []]; //_cardiacOutput = [_unit] call FUNC(getCardiacOutput); { @@ -33,17 +33,17 @@ if (GVAR(level) >= 2) then { // (((BLOODLOSS_SMALL_WOUNDS * (_x select 0))) + ((BLOODLOSS_MEDIUM_WOUNDS * (_x select 1))) + ((BLOODLOSS_LARGE_WOUNDS * (_x select 2))) * (_cardiacOutput / DEFAULT_CARDIAC_OUTPUT)); }; - } foreach _openWounds; + } forEach _openWounds; - _internalWounds = _unit getvariable [QGVAR(internalWounds), []]; + _internalWounds = _unit getVariable [QGVAR(internalWounds), []]; { _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); - } foreach _internalWounds; + } forEach _internalWounds; // cap the blood loss to be no greater as the current cardiac output //(_totalBloodLoss min _cardiacOutput); } else { - { _totalBloodLoss = _totalBloodLoss + _x } forEach (_unit getvariable [QGVAR(bodyPartStatus), []]); + { _totalBloodLoss = _totalBloodLoss + _x } forEach (_unit getVariable [QGVAR(bodyPartStatus), []]); _totalBloodLoss = (_totalBloodLoss / 6) * BLOODLOSSRATE_BASIC; }; _totalBloodLoss * ((_unit getVariable [QGVAR(bleedingCoefficient), GVAR(bleedingCoefficient)]) max 0); diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf index 659949d716..3fdc4f9d52 100644 --- a/addons/medical/functions/fnc_getBloodPressure.sqf +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -25,7 +25,7 @@ private ["_bloodPressureLow", "_bloodPressureHigh", "_cardiacOutput", "_resistan params ["_unit"]; _cardiacOutput = [_unit] call FUNC(getCardiacOutput); -_resistance = _unit getvariable [QGVAR(peripheralResistance), 100]; +_resistance = _unit getVariable [QGVAR(peripheralResistance), 100]; _bloodPressureHigh = (_cardiacOutput * MODIFIER_BP_HIGH) * _resistance; _bloodPressureLow = (_cardiacOutput * MODIFIER_BP_LOW) * _resistance; diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index 3524e15cb5..1737bb3b98 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -31,23 +31,23 @@ private ["_bloodVolume", "_bloodVolumeChange", "_ivVolume"]; params ["_unit"]; -_bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100]; +_bloodVolume = _unit getVariable [QGVAR(bloodVolume), 100]; _bloodVolumeChange = -([_unit] call FUNC(getBloodLoss)); if (_bloodVolume < 100.0) then { { - if ((_unit getvariable [_x, 0]) > 0) then { + if ((_unit getVariable [_x, 0]) > 0) then { _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; - _ivVolume = (_unit getvariable [_x, 0]) + IV_CHANGE_PER_SECOND; - _unit setvariable [_x,_ivVolume]; + _ivVolume = (_unit getVariable [_x, 0]) + IV_CHANGE_PER_SECOND; + _unit setVariable [_x,_ivVolume]; }; - } foreach GVAR(IVBags); + } forEach GVAR(IVBags); } else { { - if ((_unit getvariable [_x, 0]) > 0) then { - _unit setvariable [_x, 0]; // lets get rid of exessive IV volume + if ((_unit getVariable [_x, 0]) > 0) then { + _unit setVariable [_x, 0]; // lets get rid of exessive IV volume }; - } foreach GVAR(IVBags); + } forEach GVAR(IVBags); }; _bloodVolumeChange; diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf index f24aa438ca..d07319e8b5 100644 --- a/addons/medical/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -24,4 +24,4 @@ params ["_unit"]; -((_unit getvariable [QGVAR(bloodVolume), 100])/MODIFIER_CARDIAC_OUTPUT) + ((_unit getvariable [QGVAR(heartRate), 80])/80-1); +((_unit getVariable [QGVAR(bloodVolume), 100])/MODIFIER_CARDIAC_OUTPUT) + ((_unit getVariable [QGVAR(heartRate), 80])/80-1); diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index d46733452a..3ba4b7875f 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -19,11 +19,11 @@ private ["_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjust params ["_unit"]; _hrIncrease = 0; -if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { - _heartRate = _unit getvariable [QGVAR(heartRate), 80]; +if (!(_unit getVariable [QGVAR(inCardiacArrest),false])) then { + _heartRate = _unit getVariable [QGVAR(heartRate), 80]; _bloodLoss = [_unit] call FUNC(getBloodLoss); - _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; + _adjustment = _unit getVariable [QGVAR(heartRateAdjustments), []]; { _x params ["_values", "_time", "_callBack"]; if (abs _values > 0) then { @@ -35,22 +35,22 @@ if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { if ( (_time - 1) <= 0) then { _time = 0; - _adjustment set [_foreachIndex, ObjNull]; + _adjustment set [_forEachIndex, ObjNull]; [_unit] call _callBack; } else { _time = _time - 1; - _adjustment set [_foreachIndex, [_values - _change, _time]]; + _adjustment set [_forEachIndex, [_values - _change, _time]]; }; } else { - _adjustment set [_foreachIndex, ObjNull]; + _adjustment set [_forEachIndex, ObjNull]; [_unit] call _callBack; }; - } foreach _adjustment; + } forEach _adjustment; _adjustment = _adjustment - [ObjNull]; - _unit setvariable [QGVAR(heartRateAdjustments), _adjustment]; + _unit setVariable [QGVAR(heartRateAdjustments), _adjustment]; - _bloodVolume = _unit getvariable [QGVAR(bloodVolume), 100]; + _bloodVolume = _unit getVariable [QGVAR(bloodVolume), 100]; if (_bloodVolume > 75) then { if (_bloodLoss >0.0) then { if (_bloodLoss <0.5) then { diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf index 4dcef530a3..79af660407 100644 --- a/addons/medical/functions/fnc_getTriageStatus.sqf +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -17,7 +17,7 @@ private ["_unit","_return","_status"]; params ["_unit"]; -_status = _unit getvariable [QGVAR(triageLevel), -1]; +_status = _unit getVariable [QGVAR(triageLevel), -1]; _return = switch (_status) do { case 1: {[localize LSTRING(Triage_Status_Minor), 1, [0, 0.5, 0, 0.9]]}; case 2: {[localize LSTRING(Triage_Status_Delayed), 2, [0.7, 0.5, 0, 0.9]]}; diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 7a351e0b77..56cb8f75ef 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -17,7 +17,7 @@ params ["_typeOfProjectile"]; if (_typeOfProjectile isKindOf "BulletBase") exitWith {"bullet"}; -if (_typeOfProjectile isKindOf "ShotgunBase") exitwith {"bullet"}; +if (_typeOfProjectile isKindOf "ShotgunBase") exitWith {"bullet"}; if (_typeOfProjectile isKindOf "GrenadeCore") exitWith {"grenade"}; if (_typeOfProjectile isKindOf "TimeBombCore") exitWith {"explosive"}; if (_typeOfProjectile isKindOf "MineCore") exitWith {"explosive"}; diff --git a/addons/medical/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf index c354dd6ebd..cf8cc86c22 100644 --- a/addons/medical/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_getUnconsciousCondition.sqf @@ -22,7 +22,7 @@ if (isnil QGVAR(unconsciousConditions)) then { _return = false; { - if (typeName _x == typeName {} && {([_unit] call _x)}) exitwith { + if ((_x isEqualType {}) && {([_unit] call _x)}) exitwith { _return = true; }; } foreach GVAR(unconsciousConditions); diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index 4a32adb9e5..84ffa01258 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -36,22 +36,27 @@ if (isClass (_config >> _bandage)) then { _reopeningChance = getNumber (_config >> "reopeningChance"); _reopeningMinDelay = getNumber (_config >> "reopeningMinDelay"); _reopeningMaxDelay = getNumber (_config >> "reopeningMaxDelay") max _reopeningMinDelay; +} else { + ACE_LOGWARNING_2("No config for bandage [%1] config base [%2]", _bandage, _config); }; if (isClass (_config >> _className)) then { _woundTreatmentConfig = (_config >> _className); if (isNumber (_woundTreatmentConfig >> "reopeningChance")) then { _reopeningChance = getNumber (_woundTreatmentConfig >> "reopeningChance"); - }; + }; if (isNumber (_woundTreatmentConfig >> "reopeningMinDelay")) then { _reopeningMinDelay = getNumber (_woundTreatmentConfig >> "reopeningMinDelay"); - }; + }; if (isNumber (_woundTreatmentConfig >> "reopeningMaxDelay")) then { _reopeningMaxDelay = getNumber (_woundTreatmentConfig >> "reopeningMaxDelay") max _reopeningMinDelay; }; +} else { + ACE_LOGWARNING_2("No config for wound type [%1] config base [%2]", _className, _config); }; +TRACE_5("configs",_bandage,_className,_reopeningChance,_reopeningMinDelay,_reopeningMaxDelay); -_bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; +_bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; _injuryType = _injury select 1; _exist = false; _bandagedInjury = []; @@ -72,24 +77,25 @@ if !(_exist) then { _bandagedWounds pushback _bandagedInjury; }; -_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; +_target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true]; +TRACE_1("",_reopeningChance); // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { _delay = _reopeningMinDelay + random(_reopeningMaxDelay - _reopeningMinDelay); + TRACE_1("Will open",_delay); [{ private ["_bandage", "_openWounds", "_selectedInjury","_bandagedWounds","_exist"]; params ["_target", "_impact", "_part", "_injuryIndex", "_injury"]; + TRACE_5("params",_target,_impact,_part,_injuryIndex,_injury); //if (alive _target) then { - _openWounds = _target getvariable [QGVAR(openWounds), []]; + _openWounds = _target getVariable [QGVAR(openWounds), []]; if ((count _openWounds)-1 < _injuryIndex) exitwith {}; _selectedInjury = _openWounds select _injuryIndex; if (_selectedInjury select 1 == _injury select 1 && (_selectedInjury select 2) == (_injury select 2)) then { // matching the IDs - _selectedInjury set [3, (_selectedInjury select 3) + _impact]; - _openWounds set [_injuryIndex, _selectedInjury]; - _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; + _bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; _exist = false; _injuryId = _injury select 1; { @@ -102,11 +108,14 @@ if (random(1) <= _reopeningChance) then { } foreach _bandagedWounds; if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; - _target setvariable [QGVAR(openWounds), _openWounds, true]; + TRACE_2("Reopening Wound",_bandagedWounds,_openWounds); + _selectedInjury set [3, (_selectedInjury select 3) + _impact]; + _openWounds set [_injuryIndex, _selectedInjury]; + _target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + _target setVariable [QGVAR(openWounds), _openWounds, true]; }; }; // Otherwise something went wrong, we we don't reopen them.. //}; - }, [_target, _impact, _part, _injuryIndex, +_injury], _delay, 0] call EFUNC(common,waitAndExecute); + }, [_target, _impact, _part, _injuryIndex, +_injury], _delay] call EFUNC(common,waitAndExecute); }; diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index 31e65218c2..c87d51a7e1 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -16,7 +16,7 @@ if(!hasInterface) exitWith { false }; -params ["_litterClass", "_position", "_unit"]; +params ["_litterClass", "_position", "_direction"]; private["_litterObject", "_maxLitterCount"]; //IGNORE_PRIVATE_WARNING(_values); @@ -52,12 +52,12 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { { deleteVehicle _x; } forEach _objects; - GVAR(allCreatedLitter) set[_foreachIndex, objNull]; + GVAR(allCreatedLitter) set[_forEachIndex, objNull]; }; } forEach GVAR(allCreatedLitter); GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; - if ( (count GVAR(allCreatedLitter)) == 0) exitwith { + if ( (count GVAR(allCreatedLitter)) == 0) exitWith { [(_this select 1)] call CBA_fnc_removePerFrameHandler; GVAR(litterPFHRunning) = false; }; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 6d955e72fd..628c1cb92e 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -8,6 +8,7 @@ * 2: Amount Of Damage * 3: Shooter * 4: Projectile + * 5: HitPointIndex (-1 for structural) * * Return Value: * Damage To Be Inflicted @@ -28,7 +29,7 @@ if !(local _unit) exitWith { private ["_damageReturn", "_typeOfDamage", "_minLethalDamage", "_newDamage", "_typeIndex", "_preventDeath"]; // bug, assumed fixed, @todo excessive testing, if nothing happens remove -if (typeName _projectile == "OBJECT") then { +if (_projectile isEqualType objNull) then { _projectile = typeOf _projectile; _this set [4, _projectile]; }; @@ -38,6 +39,7 @@ TRACE_3("ACE_DEBUG: HandleDamage",_selection,_damage,_unit); // If damage is in dummy hitpoints, "hands" and "legs", don't change anything if (_selection == "hands") exitWith {_unit getHit "hands"}; if (_selection == "legs") exitWith {_unit getHit "legs"}; +if (_selection == "arms") exitWith {_unit getHit "arms"}; // Deal with the new hitpoint and selection names introduced with Arma v1.50 and later. // This will convert new selection names into selection names that the medical system understands @@ -46,8 +48,8 @@ if (_selection == "legs") exitWith {_unit getHit "legs"}; _selection = [_unit, _selection, _hitPointIndex] call FUNC(translateSelections); _this set [1, _selection]; // ensure that the parameters are set correctly -// If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "?" -if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; //@todo "neck", "pelvis", "spine1", "spine2", "spine3" +// If the damage is being weird, we just tell it to fuck off. Ignore: "hands", "legs", "arms" +if (_selection != "" && {!(_selection in GVAR(SELECTIONS))}) exitWith {0}; // Exit if we disable damage temporarily if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith { @@ -85,7 +87,7 @@ if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectio if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { _damageReturn = 0.9; }; - if ([_unit] call FUNC(setDead)) then { + if ([_unit, false, true] call FUNC(setDead)) then { _damageReturn = 1; } else { _damageReturn = _damageReturn min 0.89; @@ -109,8 +111,8 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW }; if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith { - if (_unit getvariable ["ACE_isUnconscious", false]) exitwith { - [_unit] call FUNC(setDead); + if (_unit getVariable ["ACE_isUnconscious", false]) exitwith { + [_unit, false, true] call FUNC(setDead); 0.89; }; if (_delayedUnconsicous) then { @@ -131,7 +133,7 @@ if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_dam if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then { [_unit] call EFUNC(common,unloadPerson); }; - [_unit] call FUNC(setDead); + [_unit, false, true] call FUNC(setDead); 0.89; }; diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 5035fbe282..33b1d3f7ee 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -23,14 +23,14 @@ private ["_typeOfProjectile", "_part", "_damageBodyParts", "_hitPoints"]; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfProjectile", "_hitPointNumber", "_newDamage"]; _part = [_selectionName] call FUNC(selectionNameToNumber); -if (_part < 0) exitwith {}; +if (_part < 0) exitWith {}; _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; // Sorting out the damage -_damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; +_damageBodyParts = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; -_unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; +_unit setVariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); @@ -47,7 +47,7 @@ _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); // [_unit,_selectionName,_newDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_internalInjuries); //}; -if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { +if (alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { [_unit] call FUNC(setUnconscious); diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index bac5a32976..e42e6be725 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -15,7 +15,7 @@ params ["_unit"]; -if (!local _unit) exitwith {}; +if (!local _unit) exitWith {}; private "_bodyStatus"; diff --git a/addons/medical/functions/fnc_handleDamage_airway.sqf b/addons/medical/functions/fnc_handleDamage_airway.sqf index 8b627faae1..ace7041cb5 100644 --- a/addons/medical/functions/fnc_handleDamage_airway.sqf +++ b/addons/medical/functions/fnc_handleDamage_airway.sqf @@ -21,12 +21,12 @@ private "_bodyPartn"; params ["_unit", "_selectionName", "_amountOfDamage", "_sourceOfDamage", "_typeOfDamage"]; _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); -if (_bodyPartn > 1) exitwith {}; +if (_bodyPartn > 1) exitWith {}; if (_amountOfDamage > 0.5) then { if (random(1) >= 0.8) then { - if !(_unit getvariable[QGVAR(airwayCollapsed), false]) then { - _unit setvariable [QGVAR(airwayCollapsed), true, true]; + if !(_unit getVariable[QGVAR(airwayCollapsed), false]) then { + _unit setVariable [QGVAR(airwayCollapsed), true, true]; }; }; }; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 92fc97c717..04dceff84d 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -16,7 +16,7 @@ private ["_damageBodyParts", "_cache_params", "_cache_damages"]; params ["_target"]; TRACE_1("ACE_DEBUG: HandleDamage_BASIC Called",_target); -_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; +_damageBodyParts = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _cache_params = _target getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _target getVariable QGVAR(cachedDamages); @@ -24,6 +24,7 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c { _x params ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"]; + TRACE_6("_x",_unit,_selectionName,_amountOfDamage,_sourceOfDamage,_typeOfProjectile,_typeOfDamage); if !(isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) then { _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part < 0) exitwith {}; @@ -31,9 +32,9 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c private ["_newDamage", "_pain"]; _newDamage = (_cache_damages select _foreachIndex); _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; - _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts]; + _unit setVariable [QGVAR(bodyPartStatus), _damageBodyParts]; - if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { + if (alive _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { // If it reaches this, we can assume that the hit did not kill this unit, as this function is called 3 frames after the damage has been passed. if ([_unit, _part, if (_part > 1) then {_newDamage * 1.3} else {_newDamage * 2}] call FUNC(determineIfFatal)) then { [_unit, true, 0.5+random(10)] call FUNC(setUnconscious); @@ -46,8 +47,8 @@ TRACE_4("ACE_DEBUG: HandleDamage BASIC",_unit, _damageBodyParts,_cache_params,_c }foreach _cache_params; // We broadcast the value across the net here, in order to avoid broadcasting it multiple times earlier in the above code block -_target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; -TRACE_2("ACE_DEBUG: HandleDamage BASIC Broadcast value here",_unit, _target getvariable QGVAR(bodyPartStatus)); +_target setVariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; +TRACE_2("ACE_DEBUG: HandleDamage BASIC Broadcast value here",_unit, _target getVariable QGVAR(bodyPartStatus)); EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); _target setHitPointDamage ["hitHead", _headDamage min 0.95]; @@ -56,5 +57,6 @@ _target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95] _target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; { - _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; -}foreach GVAR(HITPOINTS); + private _hitPointName = [_target, _x, true] call FUNC(translateSelections); + _target setHitPointDamage [_hitPointName, (_damageBodyParts select _foreachIndex) min 0.95]; +}foreach GVAR(SELECTIONS); diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 910221a850..1eae9544ad 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -8,29 +8,25 @@ * 2: Amount Of Damage * 3: Shooter * 4: Projectile - * 5: Current damage to be returned + * 5: HitPointIndex (-1 for structural) * * Return Value: * * * Public: No */ - #include "script_component.hpp" private ["_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; -params ["_unit", "_selectionName", "_damage", "_source", "_projectile"]; -TRACE_8("ACE_DEBUG: HandleDamage_Caching Called",_unit, _selectionName, _damage, _source, _projectile,GVAR(SELECTIONS),GVAR(HITPOINTS),damage _unit); +params ["_unit", "_selectionName", "_damage", "_source", "_projectile", "_hitPointIndex"]; + _hitSelections = GVAR(SELECTIONS); -_hitPoints = GVAR(HITPOINTS); -// Calculate change in damage. +// Calculate change in damage - use getHitIndex because selection is translated (hitdiaphragm->body) _newDamage = _damage - (damage _unit); -if (_selectionName in _hitSelections) then { - _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName))); -}; +if (_hitPointIndex >= 0) then {_newDamage = _damage - (_unit getHitIndex _hitPointIndex)}; -//_damage = _damage + _newDamage; +TRACE_7("ACE_DEBUG: HandleDamage_Caching Called",_unit, _selectionName, _damage, _source, _projectile,_hitPointIndex,_newDamage); // Check for vehicle crash if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then { @@ -45,8 +41,14 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN // Handle falling damage _impactVelocity = (velocity _unit) select 2; if (_impactVelocity < -5 && {vehicle _unit == _unit}) then { + TRACE_1("Starting isFalling", time); _unit setVariable [QGVAR(isFalling), true]; _unit setVariable [QGVAR(impactVelocity), _impactVelocity]; +} else { + if ((_unit getVariable [QGVAR(isFalling), false]) && {diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2}) then { + TRACE_1("Ending isFalling", time); + _unit setVariable [QGVAR(isFalling), false]; + }; }; if (_unit getVariable [QGVAR(isFalling), false]) then { if !(_selectionName in ["", "leg_l", "leg_r"]) then { @@ -85,9 +87,9 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = _unit getVariable QGVAR(cachedDamages); { - _params = _x + [_cache_damages select _foreachIndex]; + _params = _x + [_cache_damages select _forEachIndex]; _params call FUNC(handleDamage_advanced); - } foreach _cache_params; + } forEach _cache_params; [_unit] call FUNC(handleDamage_advancedSetDamage); }; [_idPFH] call CBA_fnc_removePerFrameHandler; @@ -106,7 +108,7 @@ if (_selectionName != "") then { private ["_index","_otherDamage"]; _index = _cache_projectiles find _projectile; // Check if the current projectile has already been handled once - if (_index >= 0 && {_projectile != "falling"}) exitwith { + if (_index >= 0 && {_projectile != "falling"}) exitWith { _cache_damages = _unit getVariable QGVAR(cachedDamages); // Find the previous damage this projectile has done _otherDamage = (_cache_damages select _index); @@ -119,10 +121,10 @@ if (_selectionName != "") then { private ["_hitPoint", "_restore"]; // Restore the damage before the previous damage was processed _hitPoint = _cache_hitpoints select _index; - _restore = ((_unit getHitPointDamage _hitPoint) - _otherDamage) max 0; - _unit setHitPointDamage [_hitPoint, _restore]; + _restore = ((_unit getHitIndex _hitPoint) - _otherDamage) max 0; + _unit setHitIndex [_hitPoint, _restore]; - _cache_hitpoints set [_index, (_hitPoints select (_hitSelections find _selectionName))]; + _cache_hitpoints set [_index, _hitPointIndex]; _cache_damages set [_index, _newDamage]; _cache_params set[_index, _this]; @@ -139,7 +141,7 @@ if (_selectionName != "") then { // This is an unhandled projectile _cache_projectiles pushBack _projectile; - _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); + _cache_hitpoints pushBack _hitPointIndex; _cache_damages pushBack _newDamage; _cache_params pushBack _this; diff --git a/addons/medical/functions/fnc_handleDamage_fractures.sqf b/addons/medical/functions/fnc_handleDamage_fractures.sqf index 46000dbbdf..5292781420 100644 --- a/addons/medical/functions/fnc_handleDamage_fractures.sqf +++ b/addons/medical/functions/fnc_handleDamage_fractures.sqf @@ -59,12 +59,12 @@ if (_amountOfDamage > 0.05) then { }; private ["_fractures", "_fractureID", "_amountOf"]; - _fractures = _unit getvariable[QGVAR(fractures), []]; + _fractures = _unit getVariable[QGVAR(fractures), []]; _fractureID = 1; _amountOf = count _fractures; if (_amountOf > 0) then { _fractureID = (_fractures select (_amountOf - 1) select 0) + 1; }; - _fractures pushback [_fractureID, _fractureType, _bodyPartn, 1 /* percentage treated */]; - _unit setvariable [QGVAR(fractures), _fractures, true]; + _fractures pushBack [_fractureID, _fractureType, _bodyPartn, 1 /* percentage treated */]; + _unit setVariable [QGVAR(fractures), _fractures, true]; }; diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index ae032e6d64..38665a0e40 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -22,8 +22,8 @@ params ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamag TRACE_6("ACE_DEBUG: HandleDamage Called",_unit, _selectionName, _damage, _shooter, _typeOfProjectile,_typeOfDamage); // Administration for open wounds and ids -_openWounds = _unit getvariable[QGVAR(openWounds), []]; -_woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; +_openWounds = _unit getVariable[QGVAR(openWounds), []]; +_woundID = _unit getVariable[QGVAR(lastUniqueWoundID), 1]; _extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; @@ -37,28 +37,28 @@ _foundIndex = -1; _bodyPartNToAdd = _x select 2; { // Check if we have an id of the given class on the given bodypart already - if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { - _foundIndex = _foreachIndex; + if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitWith { + _foundIndex = _forEachIndex; }; - } foreach _openWounds; + } forEach _openWounds; if (_foundIndex < 0) then { // Since it is a new injury, we will have to add it to the open wounds array to store it - _openWounds pushback _x; + _openWounds pushBack _x; } else { // We already have one of these, so we are just going to increase the number that we have of it with a new one. _injury = _openWounds select _foundIndex; _injury set [3, (_injury select 3) + 1]; }; -} foreach _woundsCreated; +} forEach _woundsCreated; -_unit setvariable [QGVAR(openWounds), _openWounds, true]; +_unit setVariable [QGVAR(openWounds), _openWounds, true]; // Only update if new wounds have been created if (count _woundsCreated > 0) then { - _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; + _unit setVariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -_painLevel = _unit getvariable [QGVAR(pain), 0]; -_unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; -TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getvariable QGVAR(pain), _unit getvariable QGVAR(openWounds),_woundsCreated); +_painLevel = _unit getVariable [QGVAR(pain), 0]; +_unit setVariable [QGVAR(pain), _painLevel + _painToAdd]; +TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getVariable QGVAR(pain), _unit getVariable QGVAR(openWounds),_woundsCreated); diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf index dc21012dd6..4384dce2d7 100644 --- a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -23,10 +23,10 @@ TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD Called",_unit, _selectionName, _damag // Convert the selectionName to a number and ensure it is a valid selection. _bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); -if (_bodyPartn < 0) exitwith {}; +if (_bodyPartn < 0) exitWith {}; // Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes] -_injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; +_injuryTypeInfo = missionNamespace getVariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; // This are the available injuries for this damage type. Format [[classtype, selections, bloodloss, minimalDamage, pain], ..] _allInjuriesForDamageType = _injuryTypeInfo select 2; @@ -34,7 +34,7 @@ _allInjuriesForDamageType = _injuryTypeInfo select 2; if (count _allInjuriesForDamageType == 0) then { // grabbing the configuration for unknown damage type - _injuryTypeInfo = missionNamespace getvariable [QGVAR(woundInjuryType_unknown),[[], false, []]]; + _injuryTypeInfo = missionNamespace getVariable [QGVAR(woundInjuryType_unknown),[[], false, []]]; _allInjuriesForDamageType = _injuryTypeInfo select 2; }; @@ -59,27 +59,27 @@ _allPossibleInjuries = []; // Find the wound which has the highest minimal damage, so we can use this later on for adding the correct injuries if (_minDamage > _highestPossibleDamage) then { - _highestPossibleSpot = _foreachIndex; + _highestPossibleSpot = _forEachIndex; _highestPossibleDamage = _minDamage; }; // Store the valid possible injury for the damage type, damage amount and selection - _allPossibleInjuries pushback _x; + _allPossibleInjuries pushBack _x; }; }; -} foreach _allInjuriesForDamageType; +} forEach _allInjuriesForDamageType; // No possible wounds available for this damage type or damage amount. -if (_highestPossibleSpot < 0) exitwith {}; +if (_highestPossibleSpot < 0) exitWith {}; // Administration for open wounds and ids -_openWounds = _unit getvariable[QGVAR(openWounds), []]; -_woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; +_openWounds = _unit getVariable[QGVAR(openWounds), []]; +_woundID = _unit getVariable[QGVAR(lastUniqueWoundID), 1]; _painToAdd = 0; _woundsCreated = []; { - if (_x select 0 <= _damage) exitwith { + if (_x select 0 <= _damage) exitWith { for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do { // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage] @@ -92,10 +92,10 @@ _woundsCreated = []; if ((_injuryTypeInfo select 1)) then { { // Check if we have an id of the given class on the given bodypart already - if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { - _foundIndex = _foreachIndex; + if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitWith { + _foundIndex = _forEachIndex; }; - } foreach _openWounds; + } forEach _openWounds; }; _injury = []; @@ -104,7 +104,7 @@ _woundsCreated = []; _injury = [_woundID, _toAddInjury select 0, _bodyPartNToAdd, 1, _toAddInjury select 2]; // Since it is a new injury, we will have to add it to the open wounds array to store it - _openWounds pushback _injury; + _openWounds pushBack _injury; // New injuries will also increase the wound ID _woundID = _woundID + 1; @@ -114,21 +114,21 @@ _woundsCreated = []; _injury set [3, (_injury select 3) + 1]; }; // Store the injury so we can process it later correctly. - _woundsCreated pushback _injury; + _woundsCreated pushBack _injury; // Collect the pain that is caused by this injury _painToAdd = _painToAdd + (_toAddInjury select 3); }; }; -} foreach (_injuryTypeInfo select 0); // foreach damage thresholds +} forEach (_injuryTypeInfo select 0); // forEach damage thresholds -_unit setvariable [QGVAR(openWounds), _openWounds, true]; +_unit setVariable [QGVAR(openWounds), _openWounds, true]; // Only update if new wounds have been created if (count _woundsCreated > 0) then { - _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; + _unit setVariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -_painLevel = _unit getvariable [QGVAR(pain), 0]; -_unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; -TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getvariable QGVAR(pain), _unit getvariable QGVAR(openWounds),_woundsCreated); +_painLevel = _unit getVariable [QGVAR(pain), 0]; +_unit setVariable [QGVAR(pain), _painLevel + _painToAdd]; +TRACE_6("ACE_DEBUG: HandleDamage_WoundsOLD",_unit, _painLevel, _painToAdd, _unit getVariable QGVAR(pain), _unit getVariable QGVAR(openWounds),_woundsCreated); diff --git a/addons/medical/functions/fnc_handleKilled.sqf b/addons/medical/functions/fnc_handleKilled.sqf index d6a4440d76..c8d08cbde2 100644 --- a/addons/medical/functions/fnc_handleKilled.sqf +++ b/addons/medical/functions/fnc_handleKilled.sqf @@ -15,11 +15,11 @@ private "_openWounds"; params ["_unit"]; -if (!local _unit) exitwith {}; +if (!local _unit) exitWith {}; -_unit setvariable [QGVAR(pain), 0]; +_unit setVariable [QGVAR(pain), 0]; if (GVAR(level) >= 2) then { - _unit setvariable [QGVAR(heartRate), 0]; - _unit setvariable [QGVAR(bloodPressure), [0, 0]]; - _unit setvariable [QGVAR(airwayStatus), 0]; + _unit setVariable [QGVAR(heartRate), 0]; + _unit setVariable [QGVAR(bloodPressure), [0, 0]]; + _unit setVariable [QGVAR(airwayStatus), 0]; }; diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index 50a30e90e8..91689f311f 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -17,17 +17,17 @@ params ["_unit", "_local"]; if (_local) then { - if (_unit getvariable[QGVAR(addedToUnitLoop),false]) then { + if (_unit getVariable[QGVAR(addedToUnitLoop),false]) then { [_unit, true] call FUNC(addToInjuredCollection); }; - if ((_unit getvariable ["ACE_isUnconscious",false]) && {count (_unit getvariable [QGVAR(unconsciousArguments), []]) >= 6}) then { + if ((_unit getVariable ["ACE_isUnconscious",false]) && {count (_unit getVariable [QGVAR(unconsciousArguments), []]) >= 6}) then { private "_arguments"; - _arguments = (_unit getvariable [QGVAR(unconsciousArguments), []]); + _arguments = (_unit getVariable [QGVAR(unconsciousArguments), []]); _arguments set [2, ACE_time]; [DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler; - _unit setvariable [QGVAR(unconsciousArguments), nil, true]; + _unit setVariable [QGVAR(unconsciousArguments), nil, true]; }; }; diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index fddf5489da..6159351cc9 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -18,58 +18,58 @@ params ["_unit", "_interval"]; TRACE_3("ACE_DEBUG",_unit,_interval,_unit); if (_interval == 0) exitWith {}; -_lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; +_lastTimeValuesSynced = _unit getVariable [QGVAR(lastMomentValuesSynced), 0]; _syncValues = (ACE_time - _lastTimeValuesSynced >= (10 + floor(random(10))) && GVAR(keepLocalSettingsSynced)); if (_syncValues) then { - _unit setvariable [QGVAR(lastMomentValuesSynced), ACE_time]; + _unit setVariable [QGVAR(lastMomentValuesSynced), ACE_time]; }; -_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 100]) + ([_unit] call FUNC(getBloodVolumeChange)); +_bloodVolume = (_unit getVariable [QGVAR(bloodVolume), 100]) + ([_unit] call FUNC(getBloodVolumeChange)); _bloodVolume = _bloodVolume max 0; -_unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; +_unit setVariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; TRACE_3("ACE_DEBUG",_bloodVolume,_syncValues,_unit); // Set variables for synchronizing information across the net if (_bloodVolume < 100) then { if ((_bloodVolume < 90 && (GVAR(level) == 2)) || _bloodVolume <= 45) then { TRACE_4("ACE_DEBUG_ADVANCED",_bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); - if (_unit getvariable [QGVAR(hasLostBlood), 0] != 2) then { - _unit setvariable [QGVAR(hasLostBlood), 2, true]; + if (_unit getVariable [QGVAR(hasLostBlood), 0] != 2) then { + _unit setVariable [QGVAR(hasLostBlood), 2, true]; }; } else { TRACE_4("ACE_DEBUG", _bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); - if (_unit getvariable [QGVAR(hasLostBlood), 0] != 1) then { - _unit setvariable [QGVAR(hasLostBlood), 1, true]; + if (_unit getVariable [QGVAR(hasLostBlood), 0] != 1) then { + _unit setVariable [QGVAR(hasLostBlood), 1, true]; }; } } else { TRACE_4("ACE_DEBUG",_bloodVolume,_unit getVariable QGVAR(hasLostBlood),_syncValues,_unit); - if (_unit getvariable [QGVAR(hasLostBlood), 0] != 0) then { - _unit setvariable [QGVAR(hasLostBlood), 0, true]; + if (_unit getVariable [QGVAR(hasLostBlood), 0] != 0) then { + _unit setVariable [QGVAR(hasLostBlood), 0, true]; }; }; TRACE_3("ACE_DEBUG",[_unit] call FUNC(getBloodLoss),_unit getVariable QGVAR(isBleeding),_unit); if (([_unit] call FUNC(getBloodLoss)) > 0) then { - if !(_unit getvariable [QGVAR(isBleeding), false]) then { - _unit setvariable [QGVAR(isBleeding), true, true]; + if !(_unit getVariable [QGVAR(isBleeding), false]) then { + _unit setVariable [QGVAR(isBleeding), true, true]; }; } else { - if (_unit getvariable [QGVAR(isBleeding), false]) then { - _unit setvariable [QGVAR(isBleeding), false, true]; + if (_unit getVariable [QGVAR(isBleeding), false]) then { + _unit setVariable [QGVAR(isBleeding), false, true]; }; }; -_painStatus = _unit getvariable [QGVAR(pain), 0]; +_painStatus = _unit getVariable [QGVAR(pain), 0]; TRACE_4("ACE_DEBUG",_painStatus,_unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(painSuppress),_unit); -if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { - if !(_unit getvariable [QGVAR(hasPain), false]) then { - _unit setvariable [QGVAR(hasPain), true, true]; +if (_painStatus > (_unit getVariable [QGVAR(painSuppress), 0])) then { + if !(_unit getVariable [QGVAR(hasPain), false]) then { + _unit setVariable [QGVAR(hasPain), true, true]; }; } else { - if (_unit getvariable [QGVAR(hasPain), false]) then { - _unit setvariable [QGVAR(hasPain), false, true]; + if (_unit getVariable [QGVAR(hasPain), false]) then { + _unit setVariable [QGVAR(hasPain), false, true]; }; }; @@ -98,7 +98,7 @@ if (GVAR(level) == 1) then { // handle advanced medical, with vitals if (GVAR(level) >= 2) then { TRACE_6("ACE_DEBUG_ADVANCED_VITALS",_painStatus,_bloodVolume, _unit getVariable QGVAR(hasPain),_unit getVariable QGVAR(morphine),_syncValues,_unit); - if (_bloodVolume < 30) exitwith { + if (_bloodVolume < 30) exitWith { [_unit] call FUNC(setDead); }; @@ -111,11 +111,11 @@ if (GVAR(level) >= 2) then { }; // Set the vitals - _heartRate = (_unit getvariable [QGVAR(heartRate), 80]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); - _unit setvariable [QGVAR(heartRate), _heartRate max 0, _syncValues]; + _heartRate = (_unit getVariable [QGVAR(heartRate), 80]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); + _unit setVariable [QGVAR(heartRate), _heartRate max 0, _syncValues]; _bloodPressure = [_unit] call FUNC(getBloodPressure); - _unit setvariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; + _unit setVariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; if (_painStatus > 0 && {_painStatus < 10}) then { _painReduce = if (_painStatus > 5) then {0.002} else {0.001}; @@ -125,15 +125,15 @@ if (GVAR(level) >= 2) then { // TODO Disabled until implemented fully // Handle airway /*if (GVAR(setting_allowAirwayInjuries)) then { - _airwayStatus = _unit getvariable [QGVAR(airwayStatus), 100]; - if (((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) && !((_unit getvariable [QGVAR(airwaySecured), false]))) then { + _airwayStatus = _unit getVariable [QGVAR(airwayStatus), 100]; + if (((_unit getVariable [QGVAR(airwayOccluded), false]) || (_unit getVariable [QGVAR(airwayCollapsed), false])) && !((_unit getVariable [QGVAR(airwaySecured), false]))) then { if (_airwayStatus >= 0.5) then { - _unit setvariable [QGVAR(airwayStatus), _airwayStatus - 0.5 * _interval, _syncValues]; + _unit setVariable [QGVAR(airwayStatus), _airwayStatus - 0.5 * _interval, _syncValues]; }; } else { - if !((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) then { + if !((_unit getVariable [QGVAR(airwayOccluded), false]) || (_unit getVariable [QGVAR(airwayCollapsed), false])) then { if (_airwayStatus < 100) then { - _unit setvariable [QGVAR(airwayStatus), (_airwayStatus + 1.5 * _interval) min 100, _syncValues]; + _unit setVariable [QGVAR(airwayStatus), (_airwayStatus + 1.5 * _interval) min 100, _syncValues]; }; }; }; @@ -149,7 +149,7 @@ if (GVAR(level) >= 2) then { // TODO check for in revive state instead of variable _bloodPressure params ["_bloodPressureL", "_bloodPressureH"]; - if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { + if (!(_unit getVariable [QGVAR(inCardiacArrest),false])) then { if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then { [_unit, true, 10+ random(20)] call FUNC(setUnconscious); // safety check to ensure unconsciousness for units if they are not dead already. }; @@ -183,10 +183,10 @@ if (GVAR(level) >= 2) then { TRACE_3("ACE_DEBUG_IVBAGS_SYNC",GVAR(IVBags),_syncValues,_unit); { private "_value"; - _value = _unit getvariable _x; - if !(isnil "_value") then { - _unit setvariable [_x,(_unit getvariable [_x, 0]), true]; + _value = _unit getVariable _x; + if !(isNil "_value") then { + _unit setVariable [_x,(_unit getVariable [_x, 0]), true]; }; - } foreach GVAR(IVBags); + } forEach GVAR(IVBags); }; }; diff --git a/addons/medical/functions/fnc_hasItem.sqf b/addons/medical/functions/fnc_hasItem.sqf index df1a3828f5..3eb2f1e5f0 100644 --- a/addons/medical/functions/fnc_hasItem.sqf +++ b/addons/medical/functions/fnc_hasItem.sqf @@ -18,14 +18,14 @@ private ["_medic", "_patient", "_item", "_return", "_crew"]; params ["_medic", "_patient", "_item"]; -if (isnil QGVAR(setting_allowSharedEquipment)) then { +if (isNil QGVAR(setting_allowSharedEquipment)) then { GVAR(setting_allowSharedEquipment) = true; }; -if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { +if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith { true }; -if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { +if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { true }; @@ -33,10 +33,10 @@ _return = false; if ((vehicle _medic != _medic) && {[vehicle _medic] call FUNC(isMedicalVehicle)}) then { _crew = crew vehicle _medic; { - if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { + if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith { _return = true; }; - } foreach _crew; + } forEach _crew; }; _return diff --git a/addons/medical/functions/fnc_hasItems.sqf b/addons/medical/functions/fnc_hasItems.sqf index dd53cb3337..7937b6a157 100644 --- a/addons/medical/functions/fnc_hasItems.sqf +++ b/addons/medical/functions/fnc_hasItems.sqf @@ -21,10 +21,10 @@ params ["_medic", "_patient", "_items"]; _return = true; { // - if (typeName _x == "ARRAY" && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith { + if (_x isEqualType [] && {({[_medic, _patient, _x] call FUNC(hasItem)}count _x == 0)}) exitwith { _return = false; }; - if (typeName _x == "STRING" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith { + if (_x isEqualType "" && {!([_medic, _patient, _x] call FUNC(hasItem))}) exitwith { _return = false; }; }foreach _items; diff --git a/addons/medical/functions/fnc_hasMedicalEnabled.sqf b/addons/medical/functions/fnc_hasMedicalEnabled.sqf index cbf40078fd..5e2d73f925 100644 --- a/addons/medical/functions/fnc_hasMedicalEnabled.sqf +++ b/addons/medical/functions/fnc_hasMedicalEnabled.sqf @@ -19,9 +19,9 @@ private "_medicalEnabled"; params ["_unit"]; -_medicalEnabled = _unit getvariable QGVAR(enableMedical); -if (isnil "_medicalEnabled") exitwith { - (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1) +_medicalEnabled = _unit getVariable QGVAR(enableMedical); +if (isNil "_medicalEnabled") exitWith { + (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getVariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1) }; _medicalEnabled diff --git a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf index 955665233a..abbe512d74 100644 --- a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf +++ b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf @@ -16,4 +16,4 @@ params ["_target", "_selectionName"]; -(((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select ([_selectionName] call FUNC(selectionNameToNumber))) > 0); +(((_target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select ([_selectionName] call FUNC(selectionNameToNumber))) > 0); diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index bd97203f33..ad58a0126e 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -22,26 +22,26 @@ _unit setVariable ["ACE_isUnconscious", false, true]; // advanced // tourniquets -_unit setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; +_unit setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; // wounds and injuries -_unit setvariable [QGVAR(openWounds), [], true]; -_unit setvariable [QGVAR(bandagedWounds), [], true]; +_unit setVariable [QGVAR(openWounds), [], true]; +_unit setVariable [QGVAR(bandagedWounds), [], true]; _unit setVariable [QGVAR(internalWounds), [], true]; -_unit setvariable [QGVAR(lastUniqueWoundID), 1, true]; +_unit setVariable [QGVAR(lastUniqueWoundID), 1, true]; // vitals _unit setVariable [QGVAR(heartRate), 80]; -_unit setvariable [QGVAR(heartRateAdjustments), []]; -_unit setvariable [QGVAR(bloodPressure), [80, 120]]; +_unit setVariable [QGVAR(heartRateAdjustments), []]; +_unit setVariable [QGVAR(bloodPressure), [80, 120]]; _unit setVariable [QGVAR(peripheralResistance), 100]; // fractures _unit setVariable [QGVAR(fractures), [], true]; // triage card and logs -_unit setvariable [QGVAR(triageLevel), 0, true]; -_unit setvariable [QGVAR(triageCard), [], true]; +_unit setVariable [QGVAR(triageLevel), 0, true]; +_unit setVariable [QGVAR(triageCard), [], true]; // IVs _unit setVariable [QGVAR(salineIVVolume), 0, true]; @@ -49,36 +49,36 @@ _unit setVariable [QGVAR(plasmaIVVolume), 0, true]; _unit setVariable [QGVAR(bloodIVVolume), 0, true]; // damage storage -_unit setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; +_unit setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; // airway -_unit setvariable [QGVAR(airwayStatus), 100]; +_unit setVariable [QGVAR(airwayStatus), 100]; _unit setVariable [QGVAR(airwayOccluded), false]; -_unit setvariable [QGVAR(airwayCollapsed), false]; +_unit setVariable [QGVAR(airwayCollapsed), false]; // generic medical admin -_unit setvariable [QGVAR(addedToUnitLoop), false, true]; -_unit setvariable [QGVAR(inCardiacArrest), false, true]; -_unit setvariable [QGVAR(hasLostBlood), 0, true]; -_unit setvariable [QGVAR(isBleeding), false, true]; -_unit setvariable [QGVAR(hasPain), false, true]; -_unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; -_unit setvariable [QGVAR(painSuppress), 0, true]; +_unit setVariable [QGVAR(addedToUnitLoop), false, true]; +_unit setVariable [QGVAR(inCardiacArrest), false, true]; +_unit setVariable [QGVAR(hasLostBlood), 0, true]; +_unit setVariable [QGVAR(isBleeding), false, true]; +_unit setVariable [QGVAR(hasPain), false, true]; +_unit setVariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; +_unit setVariable [QGVAR(painSuppress), 0, true]; private ["_allUsedMedication", "_logs"]; // medication _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; { - _unit setvariable [_x select 0, nil]; -} foreach _allUsedMedication; + _unit setVariable [_x select 0, nil]; +} forEach _allUsedMedication; _unit setVariable [QGVAR(allUsedMedication), [], true]; -_logs = _unit getvariable [QGVAR(allLogs), []]; +_logs = _unit getVariable [QGVAR(allLogs), []]; { - _unit setvariable [_x, nil]; -} foreach _logs; -_unit setvariable [QGVAR(allLogs), [], true]; + _unit setVariable [_x, nil]; +} forEach _logs; +_unit setVariable [QGVAR(allLogs), [], true]; // items [{ diff --git a/addons/medical/functions/fnc_isInMedicalFacility.sqf b/addons/medical/functions/fnc_isInMedicalFacility.sqf index 34f1cf4244..330a1e5ea3 100644 --- a/addons/medical/functions/fnc_isInMedicalFacility.sqf +++ b/addons/medical/functions/fnc_isInMedicalFacility.sqf @@ -39,16 +39,16 @@ _medicalFacility = _objects = (lineIntersectsWith [_unit modelToWorldVisual [0, 0, (_eyePos select 2)], _unit modelToWorldVisual [0, 0, (_eyePos select 2) +10], _unit]); { - if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { + if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith { _isInBuilding = true; }; -} foreach _objects; +} forEach _objects; if (!_isInBuilding) then { _objects = position _unit nearObjects 7.5; { - if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { + if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitWith { _isInBuilding = true; }; - } foreach _objects; + } forEach _objects; }; _isInBuilding; diff --git a/addons/medical/functions/fnc_isInStableCondition.sqf b/addons/medical/functions/fnc_isInStableCondition.sqf index 763185640c..e0298ed054 100644 --- a/addons/medical/functions/fnc_isInStableCondition.sqf +++ b/addons/medical/functions/fnc_isInStableCondition.sqf @@ -16,15 +16,15 @@ private ["_openWounds", "_openWounds"]; params ["_unit"]; -if (GVAR(level) <= 1) exitwith { +if (GVAR(level) <= 1) exitWith { ([_unit] call FUNC(getBloodloss)) == 0; }; _totalBloodLoss = 0; -_openWounds = _unit getvariable [QGVAR(openWounds), []]; +_openWounds = _unit getVariable [QGVAR(openWounds), []]; { // total bleeding ratio * percentage of injury left _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); -} foreach _openWounds; +} forEach _openWounds; (_totalBloodLoss == 0); diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index d16ab762d5..02e5985297 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -19,9 +19,9 @@ params ["_target", "_player", "_selectionN", "_actionData"]; -if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith { +if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitWith { private ["_pointDamage"]; - _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; + _pointDamage = (_target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; if (_pointDamage >= 0.8) exitWith { _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; @@ -32,10 +32,10 @@ if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith { }; private ["_openWounds", "_amountOf"]; -_openWounds = _target getvariable [QGVAR(openWounds), []]; +_openWounds = _target getVariable [QGVAR(openWounds), []]; { _x params ["", "", "_selectionX", "_amountOf", "_x4"]; - if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitwith { + if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitWith { _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; }; -} foreach _openWounds; +} forEach _openWounds; diff --git a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf index 7a219f2559..368b065908 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf @@ -18,13 +18,13 @@ private ["_setting", "_objects"]; params [["_logic", objNull, [objNull]]]; if (!isNull _logic) then { - _setting = _logic getvariable ["class",0]; + _setting = _logic getVariable ["class",0]; _objects = synchronizedObjects _logic; { if (local _x) then { - _x setvariable[QGVAR(isMedicalFacility), true, true]; + _x setVariable[QGVAR(isMedicalFacility), true, true]; }; - } foreach _objects; + } forEach _objects; }; true; diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index 6bef38fa27..8eb55b3d1b 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -22,27 +22,27 @@ private ["_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds params ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_viscosityChange", "_painReduce"]; _foundEntry = false; -_allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []]; +_allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; { _x params ["_variableX", "_allMedsFromClassname"]; - if (_variableX== _variable) exitwith { + if (_variableX== _variable) exitWith { if !(_className in _allMedsFromClassname) then { - _allMedsFromClassname pushback _className; + _allMedsFromClassname pushBack _className; _x set [1, _allMedsFromClassname]; - _allUsedMedication set [_foreachIndex, _x]; - _target setvariable [QGVAR(allUsedMedication), _allUsedMedication]; + _allUsedMedication set [_forEachIndex, _x]; + _target setVariable [QGVAR(allUsedMedication), _allUsedMedication]; }; _foundEntry = true; }; -} foreach _allUsedMedication; +} forEach _allUsedMedication; if (!_foundEntry) then { - _allUsedMedication pushback [_variable, [_className]]; - _target setvariable [QGVAR(allUsedMedication), _allUsedMedication]; + _allUsedMedication pushBack [_variable, [_className]]; + _target setVariable [QGVAR(allUsedMedication), _allUsedMedication]; }; -_usedMeds = _target getvariable [_variable, 0]; +_usedMeds = _target getVariable [_variable, 0]; if (_usedMeds >= floor (_maxDosage + round(random(2))) && _maxDosage >= 1 && GVAR(enableOverdosing)) then { [_target] call FUNC(setDead); }; @@ -55,8 +55,8 @@ _hasOverDosed = 0; if ({_x == _med} count _classNamesUsed > _limit) then { _hasOverDosed = _hasOverDosed + 1; }; - } foreach _allUsedMedication; -} foreach _incompatabileMeds; + } forEach _allUsedMedication; +} forEach _incompatabileMeds; if (_hasOverDosed > 0 && GVAR(enableOverdosing)) then { _medicationConfig = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Medication"); @@ -68,7 +68,7 @@ if (_hasOverDosed > 0 && GVAR(enableOverdosing)) then { if (isNil _onOverDose) then { _onOverDose = compile _onOverDose; } else { - _onOverDose = missionNamespace getvariable _onOverDose; + _onOverDose = missionNamespace getVariable _onOverDose; }; [_target, _className] call _onOverDose; }; @@ -80,15 +80,15 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem; params ["_args", "_idPFH"]; _args params ["_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_viscosityAdjustment", "_painReduce"]; private "_usedMeds"; - _usedMeds = _target getvariable [_variable, 0]; + _usedMeds = _target getVariable [_variable, 0]; _usedMeds = _usedMeds - _decreaseAmount; - _target setvariable [_variable, _usedMeds]; + _target setVariable [_variable, _usedMeds]; _amountDecreased = _amountDecreased + _decreaseAmount; // Restoring the viscosity while the medication is leaving the system - _target setvariable [QGVAR(peripheralResistance), ((_target getvariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment) max 0]; - _target setvariable [QGVAR(painSuppress), ((_target getvariable [QGVAR(painSuppress), 0]) - _painReduce) max 0]; + _target setVariable [QGVAR(peripheralResistance), ((_target getVariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment) max 0]; + _target setVariable [QGVAR(painSuppress), ((_target getVariable [QGVAR(painSuppress), 0]) - _painReduce) max 0]; if (_amountDecreased >= 1 || (_usedMeds <= 0) || !alive _target) then { [_idPFH] call CBA_fnc_removePerFrameHandler; diff --git a/addons/medical/functions/fnc_onPropagateWound.sqf b/addons/medical/functions/fnc_onPropagateWound.sqf index f8b361ad17..84fc33dec2 100644 --- a/addons/medical/functions/fnc_onPropagateWound.sqf +++ b/addons/medical/functions/fnc_onPropagateWound.sqf @@ -18,19 +18,19 @@ private ["_unit", "_injury", "_openWounds", "_injuryID", "_exists"]; params ["_unit", "_injury"]; if (!local _unit) then { - _openWounds = _unit getvariable[QGVAR(openWounds), []]; + _openWounds = _unit getVariable[QGVAR(openWounds), []]; _injuryID = _injury select 0; _exists = false; { - if (_x select 0 == _injuryID) exitwith { + if (_x select 0 == _injuryID) exitWith { _exists = true; - _openWounds set [_foreachIndex, _injury]; + _openWounds set [_forEachIndex, _injury]; }; - } foreach _openWounds; + } forEach _openWounds; if (!_exists) then { - _openWounds pushback _injury; + _openWounds pushBack _injury; }; - _unit setvariable [QGVAR(openWounds), _openWounds]; + _unit setVariable [QGVAR(openWounds), _openWounds]; }; diff --git a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf index 091bea7ef8..dff59fb2cf 100644 --- a/addons/medical/functions/fnc_onWoundUpdateRequest.sqf +++ b/addons/medical/functions/fnc_onWoundUpdateRequest.sqf @@ -17,8 +17,8 @@ private ["_unit", "_openWounds", "_originOfrequest"]; params ["_unit", "_originOfrequest"]; if (local _unit && !(local _originOfrequest)) then { - _openWounds = _unit getvariable [QGVAR(openWounds), []]; + _openWounds = _unit getVariable [QGVAR(openWounds), []]; { ["medical_propagateWound", [_originOfrequest], [_unit, _x]] call EFUNC(common,targetEvent); - } foreach _openWounds; + } forEach _openWounds; }; diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 764d0bf591..42dd98dc1f 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -25,14 +25,14 @@ GVAR(minLethalDamages) = []; for "_i" from 0 to (count _configDamageTypes -1) /* step +1 */ do { // Only get the subclasses in damageType class if (isClass(_configDamageTypes select _i)) then { - _allFoundDamageTypes pushback (configName (_configDamageTypes select _i)); + _allFoundDamageTypes pushBack (configName (_configDamageTypes select _i)); _minLethalDamage = if (isNumber((_configDamageTypes select _i) >> "lethalDamage")) then { getNumber((_configDamageTypes select _i) >> "lethalDamage"); } else { _defaultMinLethalDamage }; - GVAR(minLethalDamages) pushback _minLethalDamage; + GVAR(minLethalDamages) pushBack _minLethalDamage; }; }; GVAR(allAvailableDamageTypes) = _allFoundDamageTypes; @@ -43,7 +43,7 @@ GVAR(fractureClassNames) = []; // function for parsing a sublcass of an injury _parseForSubClassWounds = { _subClass = _this select 0; - if (isClass (_entry >> _subClass)) exitwith { + if (isClass (_entry >> _subClass)) exitWith { _subClassConfig = (_entry >> _subClass); _subClasstype = _classType + (configName _subClassConfig); _subClassselections = if (isArray(_subClassConfig >> "selections")) then { getArray(_subClassConfig >> "selections");} else { _selections }; @@ -54,8 +54,8 @@ _parseForSubClassWounds = { _subClasscauses = if (isArray(_subClassConfig >> "causes")) then { getArray(_subClassConfig >> "causes");} else { _causes }; _subClassDisplayName = if (isText(_subClassConfig >> "name")) then { getText(_subClassConfig >> "name");} else {_classDisplayName + " " + _subClass}; if (count _selections > 0 && {count _causes > 0}) then { - GVAR(woundClassNames) pushback _subClasstype; - _allWoundClasses pushback [_classID, _subClassselections, _subClassbloodLoss, _subClasspain, [_subClassminDamage, _subClassmaxDamage], _subClasscauses, _subClassDisplayName]; + GVAR(woundClassNames) pushBack _subClasstype; + _allWoundClasses pushBack [_classID, _subClassselections, _subClassbloodLoss, _subClasspain, [_subClassminDamage, _subClassmaxDamage], _subClasscauses, _subClassDisplayName]; _classID = _classID + 1; }; true; @@ -82,12 +82,12 @@ if (isClass _woundsConfig) then { _classDisplayName = if (isText(_entry >> "name")) then { getText(_entry >> "name");} else {_classType}; // TODO instead of hardcoding minor, medium and large just go through all sub classes recursively until none are found - if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitwith {}; // continue to the next one + if (["Minor"] call _parseForSubClassWounds || ["Medium"] call _parseForSubClassWounds || ["Large"] call _parseForSubClassWounds) exitWith {}; // continue to the next one // There were no subclasses, so we will add this one instead. if (count _selections > 0 && count _causes > 0) then { - GVAR(woundClassNames) pushback _classType; - _allWoundClasses pushback [_classID, _selections, _bloodLoss, _pain, [_minDamage, _maxDamage], _causes, _classDisplayName]; + GVAR(woundClassNames) pushBack _classType; + _allWoundClasses pushBack [_classID, _selections, _bloodLoss, _pain, [_minDamage, _maxDamage], _causes, _classDisplayName]; _classID = _classID + 1; }; true; @@ -107,16 +107,16 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); { // Check if this type is in the causes of a wound class, if so, we will store the wound types for this damage type if (_type in (_x select 5)) then { - _woundTypes pushback _x; + _woundTypes pushBack _x; }; - } foreach _allWoundClasses; + } forEach _allWoundClasses; _typeThresholds = _thresholds; _selectionSpecificType = _selectionSpecific; if (isClass(_damageTypesConfig >> _x)) then { if (isArray(_damageTypesConfig >> _x >> "thresholds")) then { _typeThresholds = getArray(_damageTypesConfig >> _x >> "thresholds");}; if (isNumber(_damageTypesConfig >> _x >> "selectionSpecific")) then { _selectionSpecificType = getNumber(_damageTypesConfig >> _x >> "selectionSpecific");}; }; - missionNamespace setvariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]]; + missionNamespace setVariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]]; private ["_minDamageThresholds", "_amountThresholds"]; // extension loading @@ -129,11 +129,11 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); _minDamageThresholds = _minDamageThresholds + ":"; _amountThresholds = _amountThresholds + ":"; }; - } foreach _typeThresholds; + } forEach _typeThresholds; - "ace_medical" callExtension format ["addDamageType,%1,%2,%3,%4,%5", _type, GVAR(minLethalDamages) select _foreachIndex, _minDamageThresholds, _amountThresholds, _selectionSpecificType]; + "ace_medical" callExtension format ["addDamageType,%1,%2,%3,%4,%5", _type, GVAR(minLethalDamages) select _forEachIndex, _minDamageThresholds, _amountThresholds, _selectionSpecificType]; -} foreach _allFoundDamageTypes; +} forEach _allFoundDamageTypes; // Extension loading @@ -151,7 +151,7 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); if (_forEachIndex < (count _selections) - 1) then { _allowedSelections = _allowedSelections + ":"; }; - } foreach _selections; + } forEach _selections; _causes = ""; @@ -160,11 +160,11 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); if (_forEachIndex < (count _causesArray) - 1) then { _causes = _causes + ":"; }; - } foreach _causesArray; + } forEach _causesArray; _classDisplayName = _x select 6; "ace_medical" callExtension format["addInjuryType,%1,%2,%3,%4,%5,%6,%7,%8,%9", _classID, _className, _allowedSelections, _bloodLoss, _pain, _minDamage, _maxDamage, _causes, _classDisplayName]; -} foreach _allWoundClasses; +} forEach _allWoundClasses; "ace_medical" callExtension "ConfigComplete"; diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index 4792f879ec..bcb590143d 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -18,14 +18,14 @@ private ["_unit","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound", "_pain"]; params ["_unit", "_pain"]; -if (!local _unit || !GVAR(enableScreams)) exitwith{}; +if (!local _unit || !GVAR(enableScreams)) exitWith{}; // Lock if the unit is already playing a sound. -if ((_unit getvariable [QGVAR(playingInjuredSound),false])) exitwith {}; -_unit setvariable [QGVAR(playingInjuredSound),true]; +if ((_unit getVariable [QGVAR(playingInjuredSound),false])) exitWith {}; +_unit setVariable [QGVAR(playingInjuredSound),true]; // Play the sound if there is any damage present. -if (_pain > 0 && {[_unit] call EFUNC(common,isAwake)}) exitwith { +if (_pain > 0 && {[_unit] call EFUNC(common,isAwake)}) exitWith { // Classnames of the available sounds. _availableSounds_A = [ "WoundedGuyA_01", @@ -75,9 +75,9 @@ if (_pain > 0 && {[_unit] call EFUNC(common,isAwake)}) exitwith { // Clean up the lock [{ - (_this select 0) setvariable [QGVAR(playingInjuredSound),nil]; + (_this select 0) setVariable [QGVAR(playingInjuredSound),nil]; }, [_unit], _delay, _delay] call EFUNC(common,waitAndExecute); }; // Clean up in case there has not been played any sounds. -_unit setvariable [QGVAR(playingInjuredSound),nil]; +_unit setVariable [QGVAR(playingInjuredSound),nil]; diff --git a/addons/medical/functions/fnc_requestWoundSync.sqf b/addons/medical/functions/fnc_requestWoundSync.sqf index 31cf726214..1d7d6de53f 100644 --- a/addons/medical/functions/fnc_requestWoundSync.sqf +++ b/addons/medical/functions/fnc_requestWoundSync.sqf @@ -16,7 +16,7 @@ params [ "_target", "_caller"]; -if (local _target || GVAR(level) < 2) exitwith {}; // if the target is local, we already got the most update to date information -if (_target getvariable [QGVAR(isWoundSynced), false]) exitwith {}; -_target setvariable [QGVAR(isWoundSynced), true]; +if (local _target || GVAR(level) < 2) exitWith {}; // if the target is local, we already got the most update to date information +if (_target getVariable [QGVAR(isWoundSynced), false]) exitWith {}; +_target setVariable [QGVAR(isWoundSynced), true]; ["medical_woundUpdateRequest", [_target], [_target, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index 017befcaad..7b2c195f10 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -17,9 +17,9 @@ private "_timeInCardiacArrest"; params ["_unit"]; -if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; -_unit setvariable [QGVAR(inCardiacArrest), true,true]; -_unit setvariable [QGVAR(heartRate), 0]; +if (_unit getVariable [QGVAR(inCardiacArrest),false]) exitWith {}; +_unit setVariable [QGVAR(inCardiacArrest), true,true]; +_unit setVariable [QGVAR(heartRate), 0]; ["Medical_onEnteredCardiacArrest", [_unit]] call EFUNC(common,localEvent); @@ -31,14 +31,14 @@ _timeInCardiacArrest = 120 + round(random(600)); params ["_args", "_idPFH"]; _args params ["_unit", "_startTime", "_timeInCardiacArrest"]; - _heartRate = _unit getvariable [QGVAR(heartRate), 80]; - if (_heartRate > 0 || !alive _unit) exitwith { + _heartRate = _unit getVariable [QGVAR(heartRate), 80]; + if (_heartRate > 0 || !alive _unit) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; - _unit setvariable [QGVAR(inCardiacArrest), nil,true]; + _unit setVariable [QGVAR(inCardiacArrest), nil,true]; }; - if (ACE_time - _startTime >= _timeInCardiacArrest) exitwith { + if (ACE_time - _startTime >= _timeInCardiacArrest) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; - _unit setvariable [QGVAR(inCardiacArrest), nil,true]; + _unit setVariable [QGVAR(inCardiacArrest), nil,true]; [_unit] call FUNC(setDead); }; }, 1, [_unit, ACE_time, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index c8c81a699e..030945daaf 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -4,19 +4,21 @@ * * Arguments: * 0: The unit that will be killed + * 1: Force Dead (ignore revive setting) + * 1: Delay setDamage for a frame * * ReturnValue: - * None + * Did he died? * * Public: yes */ #include "script_component.hpp" -private ["_unit", "_force", "_reviveVal", "_lifesLeft"]; -params ["_unit", ["_force", false]]; +private ["_reviveVal", "_lifesLeft"]; +params ["_unit", ["_force", false], ["_delaySetDamage", false]]; -if (!alive _unit) exitwith{true}; +if ((!alive _unit) || {_unit getVariable ["ACE_isDead", false]}) exitWith {true}; if (!local _unit) exitwith { [[_unit, _force], QUOTE(DFUNC(setDead)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ false; @@ -24,9 +26,9 @@ if (!local _unit) exitwith { _reviveVal = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == 2)) && !_force) exitwith { - if (_unit getvariable [QGVAR(inReviveState), false]) exitwith { + if (_unit getVariable [QGVAR(inReviveState), false]) exitwith { if (GVAR(amountOfReviveLives) > 0) then { - _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; + _lifesLeft = _unit getVariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; if (_lifesLeft == 0) then { [_unit, true] call FUNC(setDead); }; @@ -35,48 +37,56 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == false; }; - _unit setvariable [QGVAR(inReviveState), true, true]; - _unit setvariable [QGVAR(reviveStartTime), ACE_time]; + _unit setVariable [QGVAR(inReviveState), true, true]; + _unit setVariable [QGVAR(reviveStartTime), ACE_time]; [_unit, true] call FUNC(setUnconscious); [{ private "_startTime"; params ["_args", "_idPFH"]; _args params ["_unit"]; - _startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; + _startTime = _unit getVariable [QGVAR(reviveStartTime), 0]; if (GVAR(maxReviveTime) > 0 && {ACE_time - _startTime > GVAR(maxReviveTime)}) exitwith { [_idPFH] call CBA_fnc_removePerFrameHandler; - _unit setvariable [QGVAR(inReviveState), nil, true]; - _unit setvariable [QGVAR(reviveStartTime), nil]; + _unit setVariable [QGVAR(inReviveState), nil, true]; + _unit setVariable [QGVAR(reviveStartTime), nil]; [_unit, true] call FUNC(setDead); }; - if !(_unit getvariable [QGVAR(inReviveState), false]) exitwith { + if !(_unit getVariable [QGVAR(inReviveState), false]) exitwith { // revived without dieing, so in case we have lifes, remove one. if (GVAR(amountOfReviveLives) > 0) then { - _lifesLeft = _unit getvariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; - _unit setvariable [QGVAR(amountOfReviveLives), _lifesLeft - 1, true]; + _lifesLeft = _unit getVariable[QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives)]; + _unit setVariable [QGVAR(amountOfReviveLives), _lifesLeft - 1, true]; }; - _unit setvariable [QGVAR(reviveStartTime), nil]; + _unit setVariable [QGVAR(reviveStartTime), nil]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (GVAR(level) >= 2) then { - if (_unit getvariable [QGVAR(heartRate), 60] > 0) then { - _unit setvariable [QGVAR(heartRate), 0]; + if (_unit getVariable [QGVAR(heartRate), 60] > 0) then { + _unit setVariable [QGVAR(heartRate), 0]; }; }; }, 1, [_unit] ] call CBA_fnc_addPerFrameHandler; false; }; -_unit setvariable ["ACE_isDead", true, true]; +_unit setVariable ["ACE_isDead", true, true]; if (isPLayer _unit) then { - _unit setvariable ["isDeadPlayer", true, true]; + _unit setVariable ["isDeadPlayer", true, true]; }; ["medical_onSetDead", [_unit]] call EFUNC(common,localEvent); -[_unit, 1] call FUNC(setStructuralDamage); +//Delay a frame before killing the unit via scripted damage +//to avoid triggering the "Killed" Event twice (and having the wrong killer) + +if (!_delaySetDamage) then { + [_unit, 1] call FUNC(setStructuralDamage); +} else { + [FUNC(setStructuralDamage), [_unit, 1]] call EFUNC(common,execNextFrame); +}; + true; diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index aac48a8641..910745d7bb 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -32,17 +32,17 @@ params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", // No change, fuck off. (why is there no xor?) if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {}; -if !(_set) exitwith { - _unit setvariable ["ACE_isUnconscious", false, true]; +if !(_set) exitWith { + _unit setVariable ["ACE_isUnconscious", false, true]; }; -if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{}; +if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitWith{}; -if (!local _unit) exitwith { +if (!local _unit) exitWith { [[_unit, _set, _minWaitingTime, _force], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -_unit setvariable ["ACE_isUnconscious", true, true]; +_unit setVariable ["ACE_isUnconscious", true, true]; _unit setUnconscious true; if (_unit == ACE_player) then { diff --git a/addons/medical/functions/fnc_translateSelections.sqf b/addons/medical/functions/fnc_translateSelections.sqf index f2fe4c1de9..b377b3004d 100644 --- a/addons/medical/functions/fnc_translateSelections.sqf +++ b/addons/medical/functions/fnc_translateSelections.sqf @@ -6,15 +6,18 @@ * Arguments: * 0: Unit * 1: selection name - * 2: HitPoint Index + * 2: HitPoint Index/True to get hitpoint * * Return Value: - * translated selection name + * translated selection/hitpoint name * * Example: * [bob, "pelvis", 4] call ace_medical_fnc_translateSelections * Returns "body" * + * [bob, "body", true] call ace_medical_fnc_translateSelections + * Returns "HitBody" + * * Public: No */ #include "script_component.hpp" @@ -35,14 +38,44 @@ params ["_unit", "_selection", "_hitPointIndex"]; if (_selection == "") exitWith {""}; + +//Get Selection from standard selection ["head","body","hand_l","hand_r","leg_l","leg_r"] +if (_hitPointIndex isEqualTo true) exitWith { + private _returnHitPoint = GVAR(HITPOINTS) select (GVAR(SELECTIONS) find _selection); + //If the selection is a valid hitpoint just return it: + if (!isNil {_unit getHitPointDamage _returnHitPoint}) exitWith { + _returnHitPoint; + }; + + //Those VR fuckers have weird limb hitpoints + private _hitPoints = switch (_selection) do { + case ("hand_l"): {L_ARM_HITPOINTS}; + case ("hand_r"): {R_ARM_HITPOINTS}; + case ("leg_l"): {L_LEG_HITPOINTS}; + case ("leg_r"): {R_LEG_HITPOINTS}; + case ("head"): {HEAD_HITPOINTS}; + case ("body"): {TORSO_HITPOINTS}; + default {[]}; + }; + { + if (!isNil {_unit getHitPointDamage _x}) exitWith { + _returnHitPoint = _x; + }; + } forEach _hitPoints; + _returnHitPoint +}; + + +//Get Selection from Selection/HitIndex: + if (_selection in HEAD_SELECTIONS) exitWith {"head"}; if (_selection in TORSO_SELECTIONS) exitWith {"body"}; // Not necessary unless we get more hitpoints variants in an next arma update -/*if (_selection in L_ARM_SELECTIONS) exitwith {"hand_l"}; -if (_selection in R_ARM_SELECTIONS) exitwith {"hand_r"}; -if (_selection in L_LEG_SELECTIONS) exitwith {"leg_l"}; -if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/ +/*if (_selection in L_ARM_SELECTIONS) exitWith {"hand_l"}; +if (_selection in R_ARM_SELECTIONS) exitWith {"hand_r"}; +if (_selection in L_LEG_SELECTIONS) exitWith {"leg_l"}; +if (_selection in R_LEG_SELECTIONS) exitWith {"leg_r"};*/ //Backup method to detect weird selections/hitpoints if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith { diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 2d0e44d488..d7f80edc35 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -42,7 +42,7 @@ _medicRequired = if (isNumber (_config >> "requiredMedic")) then { } else { // Check for required class if (isText (_config >> "requiredMedic")) exitwith { - missionNamespace getvariable [(getText (_config >> "requiredMedic")), 0]; + missionNamespace getVariable [(getText (_config >> "requiredMedic")), 0]; }; 0; }; @@ -63,9 +63,9 @@ if (isText (_config >> "Condition")) then { if (isnil _condition) then { _condition = compile _condition; } else { - _condition = missionNamespace getvariable _condition; + _condition = missionNamespace getVariable _condition; }; - if (typeName _condition == "BOOL") then { + if (_condition isEqualType false) then { _return = _condition; } else { _return = [_caller, _target, _selectionName, _className] call _condition; @@ -75,7 +75,7 @@ if (isText (_config >> "Condition")) then { if (!_return) exitwith {false}; _patientStateCondition = if (isText(_config >> "patientStateCondition")) then { - missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] + missionNamespace getVariable [getText(_config >> "patientStateCondition"), 0] } else { getNumber(_config >> "patientStateCondition") }; @@ -97,8 +97,8 @@ if ("All" in _locations) then { if (_x == "MedicalVehicle" && _medVeh) exitwith {_return = true;}; if !(isnil _x) exitwith { private "_val"; - _val = missionNamespace getvariable _x; - if (typeName _val == "SCALAR") then { + _val = missionNamespace getVariable _x; + if (_val isEqualType 0) then { _return = switch (_val) do { case 0: {true}; //AdvancedMedicalSettings_anywhere case 1: {call _medVeh}; //AdvancedMedicalSettings_vehicle @@ -119,7 +119,7 @@ _consumeItems = if (isNumber (_config >> "itemConsumed")) then { } else { // Check for required class if (isText (_config >> "itemConsumed")) exitwith { - missionNamespace getvariable [(getText (_config >> "itemConsumed")), 0]; + missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0]; }; 0; }; @@ -135,19 +135,19 @@ if (_callbackProgress == "") then { if (isNil _callbackProgress) then { _callbackProgress = compile _callbackProgress; } else { - _callbackProgress = missionNamespace getvariable _callbackProgress; + _callbackProgress = missionNamespace getVariable _callbackProgress; }; // Patient Animation _patientAnim = getText (_config >> "animationPatient"); -if (_target getvariable ["ACE_isUnconscious", false] && GVAR(allowUnconsciousAnimationOnTreatment)) then { +if (_target getVariable ["ACE_isUnconscious", false] && GVAR(allowUnconsciousAnimationOnTreatment)) then { if !(animationState _target in (getArray (_config >> "animationPatientUnconsciousExcludeOn"))) then { _patientAnim = getText (_config >> "animationPatientUnconscious"); }; }; if (_caller != _target && {vehicle _target == _target} && {_patientAnim != ""}) then { - if (_target getvariable ["ACE_isUnconscious", false]) then { + if (_target getVariable ["ACE_isUnconscious", false]) then { [_target, _patientAnim, 2, true] call EFUNC(common,doAnimation); } else { [_target, _patientAnim, 1, true] call EFUNC(common,doAnimation); @@ -160,7 +160,7 @@ if (_caller == _target) then { _callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE"); }; -_caller setvariable [QGVAR(selectedWeaponOnTreatment), (weaponState _caller)]; +_caller setVariable [QGVAR(selectedWeaponOnTreatment), (weaponState _caller)]; // Cannot use secondairy weapon for animation if (currentWeapon _caller == secondaryWeapon _caller) then { @@ -184,12 +184,12 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { if ((stance _caller) == "STAND") then { switch (_wpn) do {//If standing, end in a crouched animation based on their current weapon - case ("rfl"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; - case ("pst"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWpstDnon"];}; - case ("non"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSnonWnonDnon"];}; + case ("rfl"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; + case ("pst"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWpstDnon"];}; + case ("non"): {_caller setVariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSnonWnonDnon"];}; }; } else { - _caller setvariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; + _caller setVariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; }; [_caller, _callerAnim] call EFUNC(common,doAnimation); }; @@ -203,9 +203,9 @@ _treatmentTime = if (isNumber (_config >> "treatmentTime")) then { if (isnil _treatmentTimeConfig) then { _treatmentTimeConfig = compile _treatmentTimeConfig; } else { - _treatmentTimeConfig = missionNamespace getvariable _treatmentTimeConfig; + _treatmentTimeConfig = missionNamespace getVariable _treatmentTimeConfig; }; - if (typeName _treatmentTimeConfig == "SCALAR") exitwith { + if (_treatmentTimeConfig isEqualType 0) exitwith { _treatmentTimeConfig; }; [_caller, _target, _selectionName, _className] call _treatmentTimeConfig; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index f09de600ae..f86e620625 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -18,7 +18,7 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"]; -if (alive _target && {(_target getvariable [QGVAR(inCardiacArrest), false] || _target getvariable [QGVAR(inReviveState), false])}) then { +if (alive _target && {(_target getVariable [QGVAR(inCardiacArrest), false] || _target getVariable [QGVAR(inReviveState), false])}) then { [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 9024489a3b..07431ac66d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -17,20 +17,20 @@ private "_reviveStartTime"; params ["_caller","_target"]; -if (_target getvariable [QGVAR(inReviveState), false]) then { - _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; +if (_target getVariable [QGVAR(inReviveState), false]) then { + _reviveStartTime = _target getVariable [QGVAR(reviveStartTime),0]; if (_reviveStartTime > 0) then { - _target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time]; + _target setVariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time]; }; }; if (GVAR(level) > 1 && {(random 1) >= 0.6}) then { - _target setvariable [QGVAR(inCardiacArrest), nil,true]; - _target setvariable [QGVAR(heartRate), 40]; - _target setvariable [QGVAR(bloodPressure), [50,70]]; + _target setVariable [QGVAR(inCardiacArrest), nil,true]; + _target setVariable [QGVAR(heartRate), 40]; + _target setVariable [QGVAR(bloodPressure), [50,70]]; }; -[_target, "activity", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index cf18475866..bb69a1e45a 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -19,10 +19,10 @@ #include "script_component.hpp" params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_specificSpot", -1]]; -[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message -if !([_target] call FUNC(hasMedicalEnabled)) exitwith { +if !([_target] call FUNC(hasMedicalEnabled)) exitWith { _this call FUNC(treatmentBasic_bandage); }; @@ -31,6 +31,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { if (_x != "") then { [_target, _x] call FUNC(addToTriageCard); }; -}foreach _items;*/ +}forEach _items;*/ true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf index 2ef1174e63..5c02ecc0cb 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandageLocal.sqf @@ -20,11 +20,11 @@ params ["_target", "_bandage", "_selectionName", ["_specificClass", -1]]; // Ensure it is a valid bodypart _part = [_selectionName] call FUNC(selectionNameToNumber); -if (_part < 0) exitwith {false}; +if (_part < 0) exitWith {false}; // Get the open wounds for this unit -_openWounds = _target getvariable [QGVAR(openWounds), []]; -if (count _openWounds == 0) exitwith {false}; // nothing to do here! +_openWounds = _target getVariable [QGVAR(openWounds), []]; +if (count _openWounds == 0) exitWith {false}; // nothing to do here! // Get the default effectiveness for the used bandage _config = (ConfigFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Bandaging"); @@ -48,6 +48,7 @@ _exit = false; // Select the classname from the wound classname storage _className = GVAR(woundClassNames) select _classID; + // Check if this wound type has attributes specified for the used bandage if (isClass (_config >> _className)) then { // Collect the effectiveness from the used bandage for this wound type @@ -55,12 +56,14 @@ _exit = false; if (isNumber (_woundTreatmentConfig >> "effectiveness")) then { _woundEffectivenss = getNumber (_woundTreatmentConfig >> "effectiveness"); }; + } else { + ACE_LOGWARNING_2("No config for wound type [%1] config base [%2]", _className, _config); }; TRACE_2("Wound classes: ", _specificClass, _classID); - if (_specificClass == _classID) exitwith { + if (_specificClass == _classID) exitWith { _effectivenessFound = _woundEffectivenss; - _mostEffectiveSpot = _foreachIndex; + _mostEffectiveSpot = _forEachIndex; _mostEffectiveInjury = _x; _exit = true; }; @@ -68,14 +71,14 @@ _exit = false; // Check if this is the currently most effective found. if (_woundEffectivenss * ((_x select 4) * (_x select 3)) > _effectivenessFound * ((_mostEffectiveInjury select 4) * (_mostEffectiveInjury select 3))) then { _effectivenessFound = _woundEffectivenss; - _mostEffectiveSpot = _foreachIndex; + _mostEffectiveSpot = _forEachIndex; _mostEffectiveInjury = _x; }; }; - if (_exit) exitwith {}; -} foreach _openWounds; + if (_exit) exitWith {}; +} forEach _openWounds; -if (_effectivenessFound == -1) exitwith {}; // Seems everything is patched up on this body part already.. +if (_effectivenessFound == -1) exitWith {}; // Seems everything is patched up on this body part already.. // TODO refactor this part @@ -84,7 +87,7 @@ _impact = if ((_mostEffectiveInjury select 3) >= _effectivenessFound) then {_eff _mostEffectiveInjury set [ 3, ((_mostEffectiveInjury select 3) - _impact) max 0]; _openWounds set [_mostEffectiveSpot, _mostEffectiveInjury]; -_target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; +_target setVariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; if (USE_WOUND_EVENT_SYNC) then { ["medical_propagateWound", [_target, _mostEffectiveInjury]] call EFUNC(common,globalEvent); diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index ed5eb0858d..1bb3f23b15 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -13,24 +13,24 @@ private "_allUsedMedication"; params ["_caller", "_target"]; -if (alive _target) exitwith { +if (alive _target) exitWith { _target setVariable [QGVAR(pain), 0, true]; _target setVariable [QGVAR(morphine), 0, true]; _target setVariable [QGVAR(bloodVolume), 100, true]; // tourniquets - _target setvariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; + _target setVariable [QGVAR(tourniquets), [0,0,0,0,0,0], true]; // wounds and injuries - _target setvariable [QGVAR(openWounds), [], true]; - _target setvariable [QGVAR(bandagedWounds), [], true]; + _target setVariable [QGVAR(openWounds), [], true]; + _target setVariable [QGVAR(bandagedWounds), [], true]; _target setVariable [QGVAR(internalWounds), [], true]; // vitals _target setVariable [QGVAR(heartRate), 80]; - _target setvariable [QGVAR(heartRateAdjustments), []]; - _target setvariable [QGVAR(bloodPressure), [80, 120]]; + _target setVariable [QGVAR(heartRateAdjustments), []]; + _target setVariable [QGVAR(bloodPressure), [80, 120]]; _target setVariable [QGVAR(peripheralResistance), 100]; // fractures @@ -42,32 +42,32 @@ if (alive _target) exitwith { _target setVariable [QGVAR(bloodIVVolume), 0]; // damage storage - _target setvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; + _target setVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0], true]; // airway - _target setvariable [QGVAR(airwayStatus), 100, true]; + _target setVariable [QGVAR(airwayStatus), 100, true]; _target setVariable [QGVAR(airwayOccluded), false, true]; - _target setvariable [QGVAR(airwayCollapsed), false, true]; + _target setVariable [QGVAR(airwayCollapsed), false, true]; // generic medical admin - _target setvariable [QGVAR(addedToUnitLoop), false, true]; - _target setvariable [QGVAR(inCardiacArrest), false, true]; - _target setvariable [QGVAR(inReviveState), false, true]; + _target setVariable [QGVAR(addedToUnitLoop), false, true]; + _target setVariable [QGVAR(inCardiacArrest), false, true]; + _target setVariable [QGVAR(inReviveState), false, true]; _target setVariable ["ACE_isUnconscious", false, true]; - _target setvariable [QGVAR(hasLostBlood), 0, true]; - _target setvariable [QGVAR(isBleeding), false, true]; - _target setvariable [QGVAR(hasPain), false, true]; - _target setvariable [QGVAR(painSuppress), 0, true]; + _target setVariable [QGVAR(hasLostBlood), 0, true]; + _target setVariable [QGVAR(isBleeding), false, true]; + _target setVariable [QGVAR(hasPain), false, true]; + _target setVariable [QGVAR(painSuppress), 0, true]; // medication _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; { - _target setvariable [_x select 0, nil]; - } foreach _allUsedMedication; + _target setVariable [_x select 0, nil]; + } forEach _allUsedMedication; // Resetting damage _target setDamage 0; - [_target, "activity", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); - [_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message + [_target, "activity", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index b5b0af1401..5949f53780 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -24,10 +24,10 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"]; { if (_x != "") then { [_target, _x] call FUNC(addToTriageCard); - [_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); - [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); + [_target, "activity", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); }; -} foreach _items; +} forEach _items; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index c2797d825d..952f245da9 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -20,9 +20,9 @@ params ["_target", "_className"]; // We have added a new dose of this medication to our system, so let's increase it _varName = format[QGVAR(%1_inSystem), _className]; -_currentInSystem = _target getvariable [_varName, 0]; +_currentInSystem = _target getVariable [_varName, 0]; _currentInSystem = _currentInSystem + 1; -_target setvariable [_varName, _currentInSystem]; +_target setVariable [_varName, _currentInSystem]; // Find the proper attributes for the used medication _medicationConfig = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "Medication"); @@ -51,11 +51,11 @@ if (isClass (_medicationConfig >> _className)) then { if (isNil _hrCallback) then { _hrCallback = compile _hrCallback; } else { - _hrCallback = missionNamespace getvariable _hrCallback; + _hrCallback = missionNamespace getVariable _hrCallback; }; // Adjust the heart rate based upon config entry -_heartRate = _target getvariable [QGVAR(heartRate), 70]; +_heartRate = _target getVariable [QGVAR(heartRate), 70]; if (alive _target) then { if (_heartRate > 0) then { if (_heartRate <= 45) then { @@ -72,17 +72,17 @@ if (alive _target) then { if (_painReduce > 0) then { // Reduce pain - _painSuppress = _target getvariable [QGVAR(painSuppress), 0]; - _target setvariable [QGVAR(painSuppress), (_painSuppress + _painReduce) max 0]; + _painSuppress = _target getVariable [QGVAR(painSuppress), 0]; + _target setVariable [QGVAR(painSuppress), (_painSuppress + _painReduce) max 0]; if (!GVAR(painIsOnlySuppressed)) then { - _pain = _target getvariable [QGVAR(pain), 0]; - _target setvariable [QGVAR(pain), (_pain - _painReduce) max 0, true]; + _pain = _target getVariable [QGVAR(pain), 0]; + _target setVariable [QGVAR(pain), (_pain - _painReduce) max 0, true]; }; }; -_resistance = _target getvariable [QGVAR(peripheralResistance), 100]; +_resistance = _target getVariable [QGVAR(peripheralResistance), 100]; _resistance = _resistance + _viscosityChange; -_target setvariable [QGVAR(peripheralResistance), _resistance max 0]; +_target setVariable [QGVAR(peripheralResistance), _resistance max 0]; // Call back to ensure that the medication is decreased over time [_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange, _painReduce] call FUNC(onMedicationUsage); diff --git a/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf index ee04decfbd..73b40f8a9b 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bandageLocal.sqf @@ -18,7 +18,7 @@ params ["_target", "_selectionName"]; -_damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; +_damageBodyParts = _target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; // Ensure it is a valid bodypart _part = [_selectionName] call FUNC(selectionNameToNumber); @@ -33,8 +33,8 @@ if ((_damageBodyParts select _part) > 0) then { _damageOnPart = _damageOnPart - BANDAGEHEAL; }; _damageBodyParts set [_part, _damageOnPart max 0]; - _target setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; - TRACE_2("ACE_DEBUG: Treatment BASIC Bandage Broadcast value here",_unit, _target getvariable QGVAR(bodyPartStatus)); + _target setVariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; + TRACE_2("ACE_DEBUG: Treatment BASIC Bandage Broadcast value here",_unit, _target getVariable QGVAR(bodyPartStatus)); }; EXPLODE_6_PVT(_damageBodyParts,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); @@ -44,7 +44,8 @@ _target setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95] _target setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; { - _target setHitPointDamage [_x, (_damageBodyParts select _foreachIndex) min 0.95]; -}foreach GVAR(HITPOINTS); + private _hitPointName = [_target, _x, true] call FUNC(translateSelections); + _target setHitPointDamage [_hitPointName, (_damageBodyParts select _foreachIndex) min 0.95]; +}foreach GVAR(SELECTIONS); true; diff --git a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf index d387e91f89..f15dbd0c71 100644 --- a/addons/medical/functions/fnc_treatmentBasic_epipen.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_epipen.sqf @@ -19,6 +19,6 @@ params ["_caller", "_target","_className"]; [_target, false] call FUNC(setUnconscious); -if (_target getvariable [QGVAR(inReviveState), false]) then { - _target setvariable [QGVAR(inReviveState), nil, true]; +if (_target getVariable [QGVAR(inReviveState), false]) then { + _target setVariable [QGVAR(inReviveState), nil, true]; }; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index 2a7bbc6adf..ebf33c75c7 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -19,12 +19,12 @@ private "_removeItem"; params ["_caller", "_target", "_selectionName", "_className", "_items"]; -if (count _items == 0) exitwith {false}; +if (count _items == 0) exitWith {false}; _removeItem = _items select 0; [[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 37cba2ad1b..ef8a83af65 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -18,8 +18,8 @@ private ["_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; params ["_target", "_treatmentClassname"]; -_bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; -if (_bloodVolume >= 100) exitwith {}; +_bloodVolume = _target getVariable [QGVAR(bloodVolume), 100]; +if (_bloodVolume >= 100) exitWith {}; // Find the proper attributes for the used IV _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); @@ -35,9 +35,9 @@ if (isClass (_config >> _treatmentClassname)) then { }; _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; -_target setvariable [_varName, (_target getvariable [_varName, 0]) + _volumeAdded, true]; +_target setVariable [_varName, (_target getVariable [_varName, 0]) + _volumeAdded, true]; if !(_varName in GVAR(IVBags)) then { - GVAR(IVBags) pushback _varName; + GVAR(IVBags) pushBack _varName; publicVariable QGVAR(IVBags); }; diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 5d3ba6e1d4..1c5c9282db 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -24,16 +24,16 @@ _selectionName = _this select 2; _className = _this select 3; _items = _this select 4; -if (count _items == 0) exitwith {false}; +if (count _items == 0) exitWith {false}; _part = [_selectionName] call FUNC(selectionNameToNumber); -if (_part == 0 || _part == 1) exitwith { +if (_part == 0 || _part == 1) exitWith { // ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent); false; }; -_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; -if ((_tourniquets select _part) > 0) exitwith { +_tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; +if ((_tourniquets select _part) > 0) exitWith { _output = "There is already a tourniquet on this body part!"; // TODO localization ["displayTextStructured", [_caller], [_output, 1.5, _caller]] call EFUNC(common,targetEvent); false; @@ -43,8 +43,8 @@ _removeItem = _items select 0; [[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); -[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message +[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index d1ffd34e4b..be9b03c9f1 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -21,26 +21,26 @@ params ["_target", "_tourniquetItem", "_selectionName"]; _part = [_selectionName] call FUNC(selectionNameToNumber); // Place a tourniquet on the bodypart -_tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; +_tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; _applyingTo = (_tourniquets select _part) + 1 + round(random(100)); _tourniquets set[_part, _applyingTo]; -_target setvariable [QGVAR(tourniquets), _tourniquets, true]; +_target setVariable [QGVAR(tourniquets), _tourniquets, true]; [{ params ["_args", "_idPFH"]; _args params ["_target", "_applyingTo", "_part", "_time"]; - if (!alive _target) exitwith { + if (!alive _target) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; - _tourniquets = _target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; - if !((_tourniquets select _part) == _applyingTo) exitwith { + _tourniquets = _target getVariable [QGVAR(tourniquets), [0,0,0,0,0,0]]; + if !((_tourniquets select _part) == _applyingTo) exitWith { // Tourniquet has been removed [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (ACE_time - _time > 120) then { - _target setvariable [QGVAR(pain), (_target getvariable [QGVAR(pain), 0]) + 0.005]; + _target setVariable [QGVAR(pain), (_target getVariable [QGVAR(pain), 0]) + 0.005]; }; }, 5, [_target, _applyingTo, _part, ACE_time] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 4aac0eda6a..4029721566 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -25,7 +25,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; + _lastAnim = _caller getVariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); switch (toLower _lastAnim) do { @@ -38,9 +38,9 @@ if (vehicle _caller == _caller) then { [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; -_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; +_caller setVariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]); +_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]); if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { for "_index" from 0 to 99 do { _caller action ["SwitchWeapon", _caller, _caller, _index]; @@ -55,7 +55,7 @@ if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") { _x params ["_unit", "_item"]; _unit addItem _item; -} foreach _usersOfItems; +} forEach _usersOfItems; // Record specific callback _config = (configFile >> "ACE_Medical_Actions" >> "Basic" >> _className); @@ -67,7 +67,7 @@ _callback = getText (_config >> "callbackFailure"); _callback = if (isNil _callback) then { compile _callback } else { - missionNamespace getvariable _callback + missionNamespace getVariable _callback }; _args call _callback; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index c2347c59ee..55ddfa394e 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -25,7 +25,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { _caller removeWeapon "ACE_FakePrimaryWeapon"; }; if (vehicle _caller == _caller) then { - _lastAnim = _caller getvariable [QGVAR(treatmentPrevAnimCaller), ""]; + _lastAnim = _caller getVariable [QGVAR(treatmentPrevAnimCaller), ""]; //Don't play another medic animation (when player is rapidily treating) TRACE_2("Reseting to old animation", animationState player, _lastAnim); switch (toLower _lastAnim) do { @@ -38,9 +38,9 @@ if (vehicle _caller == _caller) then { [_caller, _lastAnim, 2] call EFUNC(common,doAnimation); }; -_caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; +_caller setVariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]); +_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnTreatment), []]); if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { for "_index" from 0 to 99 do { _caller action ["SwitchWeapon", _caller, _caller, _index]; @@ -62,26 +62,35 @@ _callback = getText (_config >> "callbackSuccess"); if (isNil _callback) then { _callback = compile _callback; } else { - _callback = missionNamespace getvariable _callback; + _callback = missionNamespace getVariable _callback; }; -//Get current damage before treatment (for litter) -_previousDamage = switch (toLower _selectionName) do { - case ("head"): {_target getHitPointDamage "HitHead"}; - case ("body"): {_target getHitPointDamage "HitBody"}; - case ("hand_l"): {_target getHitPointDamage "HitLeftArm"}; - case ("hand_r"): {_target getHitPointDamage "HitRightArm"}; - case ("leg_l"): {_target getHitPointDamage "HitLeftLeg"}; - case ("leg_r"): {_target getHitPointDamage "HitRightLeg"}; - default {damage _target}; +//Get current blood loose on limb (for "bloody" litter) +private _bloodLossOnSelection = 0; +private _partNumber = ([_selectionName] call FUNC(selectionNameToNumber)) max 0; +if ((GVAR(level) >= 2) && {([_target] call FUNC(hasMedicalEnabled))}) then { + //Advanced Medical - Add all bleeding from wounds on selection + private _openWounds = _target getvariable [QGVAR(openWounds), []]; + { + _x params ["", "", "_selectionX", "_amountOf", "_bleedingRatio"]; + if (_selectionX == _partNumber) then { + _bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _bleedingRatio); + }; + } forEach _openWounds; + TRACE_1("advanced",_bloodLossOnSelection); +} else { + //Basic Medical (just use blodyPartStatus): + private _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; + _bloodLossOnSelection = _damageBodyParts select _partNumber + TRACE_1("basic",_bloodLossOnSelection); }; _args call _callback; -_args pushBack _previousDamage; +_args pushBack _bloodLossOnSelection; _args call FUNC(createLitter); //If we're not already tracking vitals, start: -if (!(_target getvariable [QGVAR(addedToUnitLoop),false])) then { +if (!(_target getVariable [QGVAR(addedToUnitLoop),false])) then { [_target] call FUNC(addToInjuredCollection); }; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index 0e8c424ca3..2922cae465 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -25,7 +25,7 @@ _args params ["_unit", "_originalPos", "_startingTime", "_minWaitingTime", "_has TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _originalPos, _startingTime, _minWaitingTime, _hasMovedOut, _parachuteCheck); -if (!alive _unit) exitwith { +if (!alive _unit) exitWith { if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { TRACE_1("Removing fake weapon [on death]",_unit); _unit removeWeapon "ACE_FakePrimaryWeapon"; @@ -47,8 +47,8 @@ if (!alive _unit) exitwith { }; // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation -if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { - TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getvariable QGVAR(unconsciousArguments),animationState _unit); +if !(_unit getVariable ["ACE_isUnconscious",false]) exitWith { + TRACE_7("ACE_DEBUG_Unconscious_PFH",_unit, _args, [_unit] call FUNC(isBeingCarried), [_unit] call FUNC(isBeingDragged), _idPFH, _unit getVariable QGVAR(unconsciousArguments),animationState _unit); // TODO, handle this with carry instead, so we can remove the PFH here. // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { @@ -128,17 +128,17 @@ if (_parachuteCheck) then { }; }; -if (!local _unit) exitwith { - TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getvariable QGVAR(unconsciousArguments)); +if (!local _unit) exitWith { + TRACE_6("ACE_DEBUG_Unconscious_PFH",_unit, _args, _startingTime, _minWaitingTime, _idPFH, _unit getVariable QGVAR(unconsciousArguments)); _args set [3, _minWaitingTime - (ACE_time - _startingTime)]; - _unit setvariable [QGVAR(unconsciousArguments), _args, true]; + _unit setVariable [QGVAR(unconsciousArguments), _args, true]; [_idPFH] call CBA_fnc_removePerFrameHandler; }; // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs -if ((ACE_time - _startingTime) >= _minWaitingTime) exitwith { +if ((ACE_time - _startingTime) >= _minWaitingTime) exitWith { TRACE_2("ACE_DEBUG_Unconscious_Temp knock outs",_unit, [_unit] call FUNC(getUnconsciousCondition)); if (!([_unit] call FUNC(getUnconsciousCondition))) then { - _unit setvariable ["ACE_isUnconscious", false, true]; + _unit setVariable ["ACE_isUnconscious", false, true]; }; }; diff --git a/addons/medical/functions/fnc_useItem.sqf b/addons/medical/functions/fnc_useItem.sqf index 770d8b6ea7..7abf80c464 100644 --- a/addons/medical/functions/fnc_useItem.sqf +++ b/addons/medical/functions/fnc_useItem.sqf @@ -19,16 +19,16 @@ private ["_return","_crew"]; params ["_medic", "_patient", "_item"]; -if (isnil QGVAR(setting_allowSharedEquipment)) then { +if (isNil QGVAR(setting_allowSharedEquipment)) then { GVAR(setting_allowSharedEquipment) = true; }; -if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { +if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitWith { [[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [true, _patient]; }; -if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { +if ([_medic, _item] call EFUNC(common,hasItem)) exitWith { [[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [true, _medic]; }; @@ -37,11 +37,11 @@ _return = [false, objNull]; if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) then { _crew = crew vehicle _medic; { - if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { + if ([_medic, _x] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitWith { _return = [true, _x]; [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; - } foreach _crew; + } forEach _crew; }; _return diff --git a/addons/medical/functions/fnc_useItems.sqf b/addons/medical/functions/fnc_useItems.sqf index 0d937c0938..ce45d752a9 100644 --- a/addons/medical/functions/fnc_useItems.sqf +++ b/addons/medical/functions/fnc_useItems.sqf @@ -21,18 +21,18 @@ params ["_medic", "_patient", "_items"]; _itemsUsedBy = []; { // handle a one of type use item - if (typeName _x == "ARRAY") then { + if (_x isEqualType []) then { { _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; - } foreach _x; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; + } forEach _x; }; // handle required item - if (typeName _x == "STRING") then { + if (_x isEqualType "") then { _itemUsedInfo = [_medic, _patient, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushBack [(_itemUsedInfo select 1), _x]}; }; -} foreach _items; +} forEach _items; [count _items == count _itemsUsedBy, _itemsUsedBy]; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 5c3d03a85d..a3ae483065 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -44,7 +44,7 @@ Устанавливает количество мусора, который появляется после использования мед. препаратов. Большое количество мусора может уменьшить производительность, поэтому данная настройка локальна для клиента. Il livello di dettagli della simulazione dei rifiuti indica il numero di rifiuti che verranno creati localmente nel client. La creazione di troppi rifiuti in aree locali potrebbe causare lag e calo di FPS. Questo è un settaggio client. Le niveau de simulation des détritus règle la quantité de déchets qui vont être créés localement chez le client. Des quantitées excessive chez certains clients peuvent causer des chutes de FPS, c'est donc une option client uniquement. - Die Einstellung für das Abfall-Detaillevel stellt die Menge der lokal erzeugten medizinischen Abfälle ein. Zuviel erzeugte Abfälle können FPS-Einbrüche erzeugen, deswegen ist diese Einstellung nur clientseitig. + Die Einstellung für das Abfall-Detaillevel stellt die Menge des lokal angezeigten medizinischen Abfalls ein. Zuviel Abfall kann FPS-Einbrüche erzeugen, weswegen diese Einstellung nur clientseitig ist. A hulladékszimuláció részletessége megszabja a kliens által megjelenített hulladékobjektumok mennyiségét. Súlyos mennyiségek izolált területeken alacsony FPS-t okozhatnak, így ez egy kliensoldali beállítás. O nível de detalhe de sujeira determina o número de itens que irão aparecer no cliente. Quantidades excessivas em áreas locais podem aumentar o lag do FPS, então esta é uma opção somente para o cliente. Počet zobrazených předmětů po použití zdravotnického materiálu ovlivňuje počet objektů, které budou zobrazeny klientovi v místě použití zdravotnického materiálu. Vyšší množství objektů může způsobovat poklesy FPS a proto je toto nastavení čistě na klientovi. @@ -699,7 +699,7 @@ Almost no breathing - Fast keine Atmung + Beinahe keine Atmung Дыхание очень слабое Casi sin respiración Respiration faible @@ -895,7 +895,7 @@ Reduce la velocidad de pérdida de sangre Ralentit le saignement Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. Nie może być noszony zbyt długo ze względu na narastający ból z kończyny. - Verringert den Blutverlust während einer Blutung + Verringert den Blutverlust Lelassítja a vérvesztést vérzés esetén Rallenta la perdita di sangue in caso di sanguinamento Reduz a velocidade da perda de sangue @@ -907,7 +907,7 @@ Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pérdida de sangre Un dispositif permettant de compresser les artères et veines afin de réduire la perte de sang. Opaska uciskowa CAT służy do tamowanie krwotoków w sytuacji zranienia kończyn z masywnym krwawieniem tętniczym lub żylnym. - Ein Gerät, das Druck auf Venen und Arterien ausübt und so den Blutfluss verringert. + Ein Hilfsmittel, das Druck auf Venen und Arterien ausübt und so den Blutfluss verringert. Egy szűkítőeszköz, mely a vénás és artériás nyomás keringés helyi összenyomására szolgál, ezzel lelassítva vagy megállítva az adott területen a vérkeringést. Ez csökkenti a vérvesztés mértékét. Un laccio emostatico usato per comprimere le vene e arterie per bloccare o rallentare la circolazione del sangue e quindi rallentare dissanguamenti. A aparelho que comprime as artérias e veias para diminuir a perda de sangue. @@ -1483,7 +1483,7 @@ Артериальное давление не определяется No puedes encontrar presión arterial Nie udało Ci się sprawdzić ciśnienia krwi - Blutdruck konnte nicht gefunden werden + Du konntest keinen Blutdruck feststellen Nem sikerült a vérnyomás megmérése Manca strumento per misurare pressione sanguigna Você falhou em aferir a Pressão Arterial @@ -1982,7 +1982,7 @@ Load Patient Into - Patient Einladen + Patient einladen Cargar al paciente en Załaduj pacjenta Naložit pacianta do @@ -1994,7 +1994,7 @@ Unload Patient - Patient Ausladen + Patient ausladen Descargar al paciente Wyładuj pacjenta Vyložit pacienta @@ -2008,7 +2008,7 @@ Unload patient Descargar al paciente Выгрузить пациента - Patient Ausladen + Patient ausladen Wyładuj pacjenta Débarquer le patient Sebesült kihúzása @@ -2020,7 +2020,7 @@ Load patient Cargar al paciente en Погрузить пациента - Patient Einladen + Patient einladen Załaduj pacjenta Embarquer le patient Sebesült berakása @@ -2044,7 +2044,7 @@ Placing body in bodybag Colocando cuerpo en bolsa para cadáveres Упаковка тела ... - Verstaue Körper in Leichensack + Körper wird in Leichensack gepackt Pakowanie ciała do worka na zwłoki ... Placement du corps dans la housse Test hullazsákba helyezése ... @@ -2102,15 +2102,19 @@ %1 performed CPR + %1 hat eine HLW durchgeführt %1 wykonał cykl RKO %1 провел сердечно-легочную реанимацию %1 realicó RCP %1 realizou RCP + %1 provádí CPR %1 used Personal Aid Kit + %1 hat das eigene Erste-Hilfe-Set verwendet %1 użył apteczki %1 utilizou KPS + %1 používá PAK %1 использовал аптечку @@ -2279,7 +2283,7 @@ Style of menu (Medical) Styl menu medycznego Style de menu (Médical) - Menü-Stil (Medical) + Menüstil (Medizin) Вид меню (медицина) Tipo de menú (Medico) Styl menu (Zdravotní) @@ -2291,7 +2295,7 @@ Select the type of menu you prefer; default 3d selections or radial. Wybierz rodzaj menu, który preferujesz: domyślne pozycje 3D lub radialne Selctionne le type de menu préféré; par défaut la sélection 3D ou radiale - Wähle den Menü-Stil: Standard 3D-Selektion oder kreisförmig. + Wähle den Menüstil: Standard 3D-Auswahl oder kreisförmig. Выберите тип меню: стандартный вариант (3D) или радиальный Selecciona el tipo de menú que prefieres: selecciones 3d por defecto o radial. Selecione o tipo de menu que você prefere; padrão seleções 3d ou radial. @@ -2303,7 +2307,7 @@ Selections (3d) Pozycje (3D) sélections (3D) - 3D-Selektion + 3D-Auswahl Стандартный (3D) Selecciones (3d) Seleção (3d) @@ -2759,7 +2763,7 @@ Настройки медицины [ACE] Ustawienia medyczne Ajustes médicos [ACE] - Medizinische Einstellungen [ACE] + Sanitätseinstellungen [ACE] Lékařské nastavení [ACE] Ajustes médicos [ACE] Option médicale [ACE] @@ -2770,7 +2774,7 @@ Сложность медицины Poziom medyczny Nivel médico - Medizinisches Level + Stufe des Sanitätssystem Úroveň medického Nível médico Niveau de simulation médicale @@ -2814,7 +2818,7 @@ Настройки медиков Poziom medyków Configuración médica - Medizinische Einstellungen + Sanitätseinstellungen Úroveň zdravotníků Configuração médica Paramètre des infirmiers @@ -2822,6 +2826,7 @@ What is the level of detail prefered for medics? + Wie hoch soll das Simulationslevel für Sanitäter sein? Каков уровень подробностей для медиков? Jaki jest poziom detali medycznych wyświetlanych dla medyków? ¿Cuál es el nivel de detalle preferido para los médicos? @@ -2964,7 +2969,7 @@ Allow AI to go unconscious - Позволить ботам терять сознание (вместо мгновенной смерти) + Позволить ботам терять сознание Czy AI może być nieprzytomne od odniesionych obrażeń? Permita a la IA caer inconsciente KI kann bewusstlos werden @@ -2975,6 +2980,7 @@ Remote Controlled AI + Ferngesteuerte KI-Einheiten IA controlada remotamente IA controlada remotamente Zdalnie sterowane AI @@ -2985,6 +2991,7 @@ Treat remote controlled units as AI not players? + Behandle ferngesteuerte Einheiten als KI und nicht als Spieler? ¿Tratar unidades remotamente controladas como IA? Tratar unidades remotamente controladas como IA? Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy? @@ -3086,7 +3093,7 @@ Включает медицинскую систему как для игроков, так и для ботов. Moduł ten dostarcza system medyczny dla graczy oraz AI. Proporciona un sistema médico para jugadores e IA. - Aktiviert ein medizinisches System für Spieler und KI. + Aktiviert ein Sanitätssystem für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona o sistema médico para os jogadores e a IA. Fourni un système médical pour les joueurs tout comme pour les IA. @@ -3097,7 +3104,7 @@ Настройки усложненной медицины [ACE] Zaawansowane ustawienia medyczne Ajustes médicos avanzados [ACE] - Erweiterte medizinische Einstellungen [ACE] + Erweiterte Sanitätseinstellungen [ACE] Pokročilé zdravotnické nastavení [ACE] Ajustes médicos avançados [ACE] Paramètres des soins avancés @@ -3119,7 +3126,7 @@ Выберите, на кого будет распространяться усложненная система медицины Wybierz dla kogo zaawansowany system medyczny będzie aktywny Seleccione para qué unidades será habilitado el sistema médico avanzado - Wähle aus welche Einheiten das erweiterte medizinische System haben + Wähle aus, welche Einheiten unter das erweiterte Sanitätssystem fallen Vyberte, pro jaké jednotky bude pokročilý zdravotní systém povolen Selecione quais unidades o sistema médico avançado será habilitado Sélectionne pour quelle unité le système de soin avancé est activé @@ -3185,7 +3192,7 @@ Должны ли юниты получать повреждения от аварий на транспорте? Czy jednostki otrzymują obrażenia w wyniku kolizji pojazdów? ¿Las unidades reciben daño de un accidente de tráfico? - Bekommen Einheiten von Fahrzeugunfällen Schaden? + Verursacht ein Fahrzeugunfall Verletzungen Dostane jednotka poškození při autonehodě? As unidades recebem dano de uma batida de veículo? Les unités subissent des dégats lors d'accident @@ -3292,6 +3299,7 @@ Condition PAK + Voraussetzungen für das Erste-Hilfe-Set Podmínka osobní lékárničky Condición EPA Condition d'utilisation du KPS @@ -3302,6 +3310,7 @@ When can the PAK be used? + Wann kann das Erste-Hilfe-Set verwendet werden? Kde může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? Quand peut être utilisé le Kit de Premier Secours @@ -3326,7 +3335,7 @@ В медицинском транспорте Pojazdy medyczne Vehiculos médicos - Medizinische Fahrzeuge + Sanitätsfahrzeuge Zdravotnická vozidla Veículos médcos Dans les véhicules médicals @@ -3381,7 +3390,7 @@ Удалять хирургический набор (усл.) Usuń zest. chir. po użyciu Eliminar equipo quirúrgico (Avanzado) - Enrtferne Operationskasten (erweitert) + Entferne Operationskasten (erweitert) Odebrat chirurgickou soupravu (Pokr.) Remover kit cirúrgico (avançado) Supprimer les kit de chirurgie (Avancé) @@ -3422,6 +3431,7 @@ Condition Surgical Kit (Adv) + Voraussetzungen für den Operationskasten (erweitert) Podmínka chirurgické soupravy (Pokr.) Condición de equipo quirúrgico (Av) Conditions d'utilisation du kit de chirurgie @@ -3432,6 +3442,7 @@ When can the Surgical Kit be used? + Wann kann der Operationskasten verwendet werden? Kde může být použita chirurgická souprava? ¿Cuando se puede utilizar el equipo quirúrgico? Quand peut être utilisé les kit de chirurgie @@ -3442,6 +3453,7 @@ Heal hitpoints + Heile Trefferpunkte Lecz hitpointy Curar puntos de vida Исцелять части тела @@ -3449,6 +3461,7 @@ Heal fully bandaged hitpoints + Heile verbundene Trefferpunkte Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność. Curar miembros totalmente vendados Исцелять полностью перебинтованные части тела @@ -3467,7 +3480,7 @@ Pain is only temporarily suppressed, not removed - Schmerzen werden nur vorübergehend unterdrückt, nicht entfernt + Schmerzen werden nur vorübergehend unterdrückt, nicht deren Ursache geheilt. Ból jest tylko tymczasowo zwalczany, nie jest usuwany trwale Bolest je potlačena, ale jen dočastně El dolor se suprime solo temporalmente, no se elimina. @@ -3481,7 +3494,7 @@ Настройка лечения в медицинской системе ACE Skonfiguruj zaawansowane ustawienia leczenia systemu medycznego ACE Configure las opciones de tratamiento del ACE Médico - Behandlungseinstellungen vom ACE-Medical konfigurieren + Behandlungseinstellungen vom ACE-Medizin konfigurieren Konfigurace nastavení léčby ze zdravotnické systému ACE Configure as opções de tratamento do ACE Médico Configure les paramètres de traitement du système de soin ACE @@ -3547,7 +3560,7 @@ Макс. кол-во жизней Maks. ilość wskrzeszeń Vidas máximas de resucitado - Maximale Leben bei Wiederbelebung + Maximale Anzahl der Wiederbelebungen Maximální počet oživení Vidas máximas do reavivado Nombre maximum de revive @@ -3558,7 +3571,7 @@ Максимальное количество жизней у бойца. Чтобы отключить, укажите 0 или -1. Maksymalna ilość wskrzeszeń. Wpisz 0 lub -1 aby wyłączyć. Cantidad máxima de vidas por unidad. 0 o -1 es desactivado. - Maximale Anzahl von Leben einer Einheit. 0 or -1 bedeutet deaktiviert. + Anzahl der Leben einer Einheit. 0 oder -1 bedeutet deaktiviert. Maximální počet životu pro jednotku. 0 nebo -1 je zakázáno. Quantidade máxima de vidas por unidade. 0 ou -1 é desativado. Nombre de vie maximale d'une unité. 0 ou -1 désactive @@ -3569,7 +3582,7 @@ Включает медицинскую систему как для игроков, так и для ботов. Moduł ten aktywuje podstawowy system wskrzeszania. Jednostka po otrzymaniu śmiertelnych obrażeń przechodzi do stanu agonii, która trwa określoną długość czasu. W tym czasie aby wskrzesić i jednocześnie odratować jednostkę należy opatrzeć jej rany i wykonać RKO. Proporciona un sistema médico para jugadores e IA. - Aktiviert das Medicsystem für Spieler und KI. + Aktiviert das Sanitätssystem für Spieler und KI. Poskytuje zdravotní systém pro hráče a AI. Proporciona um sistema médico para jogadores e IA. Fourni un sytème médical pour les joueurs et les IAs @@ -3602,7 +3615,7 @@ Список имен юнитов, которые будут считаться медиками (через запятую). Lista nazw jednostek, które są sklasyfikowane jako medycy, oddzielone przecinkami. Lista de los nombres de las unidades que se clasifican como médico, separados por comas. - Liste von Namen, die als Sanitäter verwendet werden. Wird durch Kommas getrennt. + Aufzählung von Einheiten, die als Sanitäter gelten. Werden durch Kommata getrennt. Seznam osob které budou klasifikovány jako zdravotník, oddělené čárkami. Lista dos nomes das unidades que se classificam como médicos, separados por vírgulas. Liste d'unité qui seront listées comme infirmier, séparation par virgule @@ -3622,7 +3635,7 @@ This module allows you to assign the medic class to selected units. Moduł ten pozwala przypisać klasę medyczną wybranym jednostkom. - Dieses Modul legt fest welche Einheit ein Sanitäter ist. + Dieses Modul legt fest, welche Einheiten Sanitäter sind. Tento modul určuje, která jednotka je zdravotník. Este módulo determina qual unidade é um paramédico. Ce module permet d'assigner la classe médicale à une unité sélectionnée @@ -3657,7 +3670,7 @@ Врач (только усложн.) Doktor (tylko zaawansowani medycy) Doctor (Solo medicina avanzada) - Arzt (nur erweiterte Sanitäter) + Arzt (Nur erweitertes Sanitätssystem) Doktor (Pouze pokročilý zdravotníci) Doutor (Somente médicos avançados) Médecin (traitements avancés uniquement) @@ -3668,7 +3681,7 @@ Задает юниту класс медика Moduł ten przypisuje klasę medyka ACE do jednostek. Asigna la clase médico ACE a una unidad - Weise die ACE-Sanitäterklasse einer Einheit zu + Weise die ACE-Sanitäterklasse einer Einheit zu. Přiřadí ACE třídu zdravotníka do jednotky Atribui a classe médica do ACE a uma unidade Assigner la classe médicale à une unité @@ -3679,7 +3692,7 @@ Сделать мед. транспортом [ACE] Ustaw pojazd medyczny Establecer vehículos médicos [ACE] - Setze medizinisches Fahrzeug [ACE] + Setze Sanitätsfahrzeug [ACE] Určit zdravotnické vozidlo [ACE] Definir veículo médico [ACE] Définir comme véhicule médical [ACE] @@ -3701,7 +3714,7 @@ Список транспортных средств, которые будут считаться медицинским транспортом (через запятую). Lista nazw pojazdów, które są sklasyfikowane jako pojazdy medyczne, oddzielone przecinkami. Lista de los vehículos que se clasifican como vehículo médicos, separados por comas. - Liste von Fahrzeugen, die als medizinische Fahrzeuge verwendet werden. Wird durch Kommas getrennt. + Aufzählung von Fahrzeugen, die als Sanitätsfahrzeug gelten. Werden durch Kommata getrennt. Seznam vozidel které budou klasifikovány jako zdravotnická vozidla, oddělené čárkami. Lista de veículos que serão classificados como veículos médicos, separados por vírgulas. Liste de véhicule classé comme véhicule médical, séparation par virgule. @@ -3723,7 +3736,7 @@ Будут ли объекты в списке считаться медицинским транспортом. Czy pojazdy z tej listy są pojazdami medycznymi? Cualquiera de la lista o fuera de ella será un vehículo médico. - Leg fest ob das Objekt in der Liste ein medizinisches Fahrzeug ist. + Legt fest, ob das Objekt in der Liste ein Sanitätsfahrzeug ist. Ať už jsou nebo nejsou objekty v seznamu budou zdravotnická vozidla. Se serão ou não os objetos dessa lista veículos médicos. Quoi qu'il arrive les objets de la liste seront des véhicules médical @@ -3778,7 +3791,7 @@ Определяет объект в качестве госпиталя. Позволяет оказывать более сложную помощь. Может применяться к зданиям и технике. Moduł ten pozwala przypisać status budynku medycznego danemu obiektowi. Budynek taki pozwala na wykonywanie zaawansowanych zabiegów medycznych. Może być użyte na pojazdach i budynkach. Define un objeto como un centro médico. Esto permite tratamientos más avanzados. Se puede utilizar en edificios y vehículos. - Definiert ein Objekt als medizinische Einrichtung. Das ermöglicht weitere Behandlungen. Kann bei Gebäuden und Fahrzeugen verwendet werden. + Definiert ein Objekt als medizinische Einrichtung. Hier werden weitere, tiefgreifende Behandlungen ermöglicht. Kann Fahrzeugen oder Gebäuden zugewiesen werden. Definuje objekt jako zdravotnické zařízení. To umožňuje více pokročilé léčení. Může být použito na budovy nebo na vozidla. Define um objeto como instalação médica. Isso permite tratamentos mais avançados. Pode ser utilizado em edifícios e veículos. Définir un objet comme équipement médical. Cela permet les traitements avancés. Peut être utilisé sur les batiments et les véhicules @@ -3789,7 +3802,7 @@ [ACE] Ящик с медикаментами (базовая медицина) [ACE] Skrzynka z zapasami medycznymi (podstawowa) [ACE] Caja de suministros médicos (Básica) - [ACE] Medizinische Kiste (standard) + [ACE] Sanitätskiste (standard) [ACE] Zdravotnické zásoby (základní) [ACE] Caixa com suprimentos médicos [ACE] Caisse médicale (basique) @@ -3800,7 +3813,7 @@ [ACE] Ящик с медикаментами (усложн. медицина) [ACE] Skrzynka z zapasami medycznymi (zaawansowana) [ACE] Caja de suministros médicos (Avanzada) - [ACE] Medizinische Kiste (erweitert) + [ACE] Sanitätskiste (erweitert) [ACE] Zdravotnické zásoby (pokročilé) [ACE] Caixa com suprimentos médicos (Avançados) [ACE] Caisse médicale (avancée) @@ -3808,6 +3821,7 @@ Anytime + Jederzeit Kdykoli Siempre Tout le temps @@ -3818,6 +3832,7 @@ Stable + Stabil Stabilní Estable Stable @@ -3840,24 +3855,30 @@ Distance to %1 has become to far for treatment + Die Entfernung zu %1 ist zu groß für eine Behandlung %1 odszedł zbyt daleko, nie można kontynuować leczenia Расстояние до %1 стало слишком большим для лечения A distância de %1 está muito longe para tratamento La distancia hasta %1 se ha agrandado demasiado para el tratamiento + %1 je příliš daleko, léčba není možná This person (%1) is awake and cannot be loaded + Diese Person (%1) ist wach und kann nicht verladen werden Ta osoba (%1) jest przytomna i nie może zostać załadowana Esta persona (%1) está despierto y no puede ser cargado Боец (%1) в сознании и не может быть погружен Esta pessoa (%1) está acordada e não pode ser carregada + Tato osoba (%1) je vzhůru a nemůže být naložena There is no tourniquet on this body part! + An diesem Körperteil befindet sich kein Tourniquet Na tej części ciała nie ma stazy! No hay torniquete en esta parte del cuerpo! Нет жгута на этой части тела! Não existe nenhum torniquete nesta parte do corpo! + Žádné škrtidlo na této části těla! \ No newline at end of file diff --git a/addons/medical/ui/RscTitles.hpp b/addons/medical/ui/RscTitles.hpp index 06d1dda866..b81643990c 100644 --- a/addons/medical/ui/RscTitles.hpp +++ b/addons/medical/ui/RscTitles.hpp @@ -59,7 +59,7 @@ class Rsctitles { style = 0x00 + 0x100; // ST_LEFT + ST_SHADOW font = "PuristaMedium"; colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = CSTRING(Injuries); }; class InjuryList: ACE_gui_listBoxBase { diff --git a/addons/medical/ui/triagecard.hpp b/addons/medical/ui/triagecard.hpp index f8b0b21a71..d07da4337e 100644 --- a/addons/medical/ui/triagecard.hpp +++ b/addons/medical/ui/triagecard.hpp @@ -113,7 +113,7 @@ class GVAR(triageCard) { animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; - action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',0,true)];); + action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',0,true)];); }; class selectTriageStatusMinor: selectTriageStatus { idc = 2003; @@ -131,7 +131,7 @@ class GVAR(triageCard) { animTextureFocused = "#(argb,8,8,3)color(0,0.5,0,0.9)"; animTexturePressed = "#(argb,8,8,3)color(0,0.5,0,0.9)"; animTextureDefault = "#(argb,8,8,3)color(0,0.5,0,0.9)"; - action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',1,true)];); + action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',1,true)];); }; class selectTriageStatusDelayed: selectTriageStatus { idc = 2004; @@ -149,7 +149,7 @@ class GVAR(triageCard) { animTextureFocused = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; animTexturePressed = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; animTextureDefault = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; - action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel',2,true)];); + action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',2,true)];); }; class selectTriageStatusImmediate: selectTriageStatus { idc = 2005; @@ -167,7 +167,7 @@ class GVAR(triageCard) { animTextureFocused = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; animTexturePressed = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; animTextureDefault = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; - action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel', 3, true)];); + action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel', 3, true)];); }; class selectTriageStatusDeceased: selectTriageStatus { idc = 2006; @@ -185,7 +185,7 @@ class GVAR(triageCard) { animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; - action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setvariable [ARR_3('ACE_medical_triageLevel', 4, true)];); + action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel', 4, true)];); }; }; }; \ No newline at end of file diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf index ad1acabdb3..92e2af341f 100644 --- a/addons/medical_menu/XEH_postInit.sqf +++ b/addons/medical_menu/XEH_postInit.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -if (!hasInterface) exitwith {}; +if (!hasInterface) exitWith {}; GVAR(MenuPFHID) = -1; GVAR(lastOpenedOn) = -1; @@ -24,7 +24,7 @@ GVAR(pendingReopen) = false; // Conditions: canInteract if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; // Statement [_target] call FUNC(openMenu); diff --git a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf index 2bb4499753..8cbbe2d32f 100644 --- a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf +++ b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf @@ -21,7 +21,7 @@ params ["_player", "_target", "_name"]; private ["_actions", "_collectedActions", "_bodyPart"]; -if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; +if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {[]}; _actions = if (EGVAR(medical,level) == 2) then { GVAR(actionsAdvanced); diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf index e5b49e58bc..67e295e22e 100644 --- a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -19,7 +19,7 @@ #define END_IDC 27 #define AMOUNT_OF_ENTRIES (count _entries) -if (!hasInterface) exitwith{}; +if (!hasInterface) exitWith{}; private ["_entries", "_display", "_newTarget", "_ctrl", "_code"]; @@ -28,9 +28,9 @@ params ["_name"]; disableSerialization; _display = uiNamespace getVariable QGVAR(medicalMenu); -if (isNil "_display") exitwith {}; // no valid dialog present +if (isNil "_display") exitWith {}; // no valid dialog present -if (_name isEqualTo "toggle") exitwith { +if (_name isEqualTo "toggle") exitWith { _newTarget = ACE_player; //If we are on the player, and only if our old target is still valid, switch to it: if ((GVAR(INTERACTION_TARGET) == ACE_player) && @@ -61,11 +61,11 @@ GVAR(LatestDisplayOptionMenu) = _name; // The triage card has no options available lbClear 212; -if (_name isEqualTo "triage") exitwith { +if (_name isEqualTo "triage") exitWith { ctrlEnable [212, true]; private ["_log", "_triageCardTexts", "_message"]; - _log = GVAR(INTERACTION_TARGET) getvariable [QEGVAR(medical,triageCard), []]; + _log = GVAR(INTERACTION_TARGET) getVariable [QEGVAR(medical,triageCard), []]; _triageCardTexts = []; { _x params ["_item", "_amount", "_time"]; @@ -77,11 +77,11 @@ if (_name isEqualTo "triage") exitwith { _message = localize _message; }; }; - _triageCardTexts pushback format["%1x - %2 (%3m)", _amount, _message, round((ACE_gameTime - _time) / 60)]; + _triageCardTexts pushBack format["%1x - %2 (%3m)", _amount, _message, round((ACE_gameTime - _time) / 60)]; nil; } count _log; - if (count _triageCardTexts == 0) exitwith { + if (count _triageCardTexts == 0) exitWith { lbAdd [212,(localize ELSTRING(medical,TriageCard_NoEntry))]; }; { @@ -96,7 +96,7 @@ _entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTreatmentO { //player sidechat format["TRIGGERED: %1",_x]; - if (_forEachIndex > END_IDC) exitwith {}; + if (_forEachIndex > END_IDC) exitWith {}; _ctrl = (_display displayCtrl (START_IDC + _forEachIndex)); if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then { _ctrl ctrlSetText (_x select 0); diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 2b47312453..d8d1fde35a 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -20,7 +20,7 @@ private "_target"; params ["_display"]; -if (isNil "_display") exitwith {}; +if (isNil "_display") exitWith {}; if (EGVAR(interact_menu,menuBackground)==1) then {[QGVAR(id), true] call EFUNC(common,blurScreen);}; if (EGVAR(interact_menu,menuBackground)==2) then {0 cutRsc[QEGVAR(interact_menu,menuBackground), "PLAIN", 1, false];}; @@ -77,11 +77,11 @@ GVAR(MenuPFHID) = [{ [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); //Check that it's valid to stay open: - if !(([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + if !(([ACE_player, GVAR(INTERACTION_TARGET), ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call FUNC(canOpenMenu)}) then { closeDialog 314412; //If we failed because of distance check, show UI message: if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then { - ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + ["displayTextStructured", [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 2, ACE_player]] call EFUNC(common,localEvent); }; }; diff --git a/addons/medical_menu/functions/fnc_openMenu.sqf b/addons/medical_menu/functions/fnc_openMenu.sqf index 1c77da6a5a..a8a51ff028 100644 --- a/addons/medical_menu/functions/fnc_openMenu.sqf +++ b/addons/medical_menu/functions/fnc_openMenu.sqf @@ -17,7 +17,7 @@ params ["_interactionTarget"]; -if (dialog || {isNull _interactionTarget}) exitwith { +if (dialog || {isNull _interactionTarget}) exitWith { disableSerialization; private ["_display", "_handled"]; diff --git a/addons/medical_menu/functions/fnc_setTriageStatus.sqf b/addons/medical_menu/functions/fnc_setTriageStatus.sqf index 7e7c764aee..8a85eeb950 100644 --- a/addons/medical_menu/functions/fnc_setTriageStatus.sqf +++ b/addons/medical_menu/functions/fnc_setTriageStatus.sqf @@ -15,4 +15,4 @@ params ["_target", "_status"]; -_target setvariable [QEGVAR(medical,triageLevel), _status, true]; +_target setVariable [QEGVAR(medical,triageLevel), _status, true]; diff --git a/addons/medical_menu/functions/fnc_updateActivityLog.sqf b/addons/medical_menu/functions/fnc_updateActivityLog.sqf index 92e8474b4b..50acb12e94 100644 --- a/addons/medical_menu/functions/fnc_updateActivityLog.sqf +++ b/addons/medical_menu/functions/fnc_updateActivityLog.sqf @@ -31,7 +31,7 @@ lbClear _logCtrl; }; { - if (typeName _x == "STRING" && {isLocalized _x}) then { + if (_x isEqualType "" && {isLocalized _x}) then { _arguments set [_foreachIndex, localize _x]; }; } forEach _arguments; diff --git a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf index 49da12e7f4..900e375fb7 100644 --- a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf +++ b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf @@ -31,7 +31,7 @@ lbClear _logCtrl; }; { - if (typeName _x == "STRING" && {isLocalized _x}) then { + if (_x isEqualType "" && {isLocalized _x}) then { _arguments set [_foreachIndex, localize _x]; }; } forEach _arguments; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index 56a22689db..412a2045e6 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -23,7 +23,7 @@ private["_allInjuryTexts", "_bandagedwounds", "_damaged", "_genericMessages", "_ if (isNil "_display" || {isNull _display}) exitWith {ERROR("No display");}; _selectionN = GVAR(selectedBodyPart); -if (_selectionN < 0 || {_selectionN > 5}) exitwith {}; +if (_selectionN < 0 || {_selectionN > 5}) exitWith {}; _genericMessages = []; _partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN; @@ -128,7 +128,7 @@ if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnab ] select _forEachIndex); _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; - } forEach (_target getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]); + } forEach (_target getVariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]); }; [_selectionBloodLoss, _damaged, _display] call FUNC(updateBodyImage); diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml index 9e3bbc4c2b..619cfb8507 100644 --- a/addons/medical_menu/stringtable.xml +++ b/addons/medical_menu/stringtable.xml @@ -1,36 +1,45 @@ - - - + + + Medical Menu + Sanitätsmenü Menu medyczne Menu médico Медицинское меню Menú médico + Zdravotnikcá nabídka Allow Medical Menu + Erlaube Sanitätsmenü Akt. menu medyczne Permitir menu médico Разрешить мед. меню Permitir menú médico + Povolit zdravotnickou nabídku Allow clients to use the medical menu + Erlaube Clients das Sanitätsmenü zu verwenden Zezwalaj graczom korzystać z menu medycznego Permite que clientes utilizem o menu médico Разрешает клиентам использовать медицинское меню Permitir a los clientes utilizar el menú médico + Povolit klientům používat zdravotnickou nabídku Use Medical menu + Verwende Sanitätsmenü Użyj menu medycznego Usar o menu médico Использовать медицинское меню Utiliza el menú médico + Použít zdravotnickou nabídku If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu + Wenn vom Server erlaubt, aktiviert diese Einstellung das Sanitätsmenü, welches durch Tastenkombination oder Interaktionsmenü aufgerufen werden kann. Jeżeli zezwolone przez serwer, aktywuj menu medyczne poprzez skrót klawiszowy i menu interakcji. Se permitido pelo servidor, ativa a opção de usar o menu médico por atalhos de teclas e menu de interação Если разрешено сервером, включает опцию использования медицинского меню с помощью горячих главиш или меню взаимодействия @@ -38,41 +47,52 @@ Re-open Medical menu + Sanitätsmenü offen lassen Otwieraj ponownie menu medyczne Reabrir menu médico Переоткрывать мед. меню Reabrir menú médico + Znovu otevřít zdravotnickou nabídku Re-open the medical menu after succesful treatment + Öffnet das Sanitätsmenü nach einer erfolgreichen Behandlung erneut Otwórz ponownie menu medyczne po udanym zakończeniu leczenia Reabre o menu médico depois de um tratamento bem sucedido Переоткрывать медицинское меню после удачного лечения Reabre el menú médico despues de un tratamiento con éxito + Znovu otevřít zdravotnickou nabídku po úspěšné léčbě Open Medical Menu + Öffne Sanitätsmenü Otwórz menu medyczne Abrir menu médico Открыть медицинское меню Abrir menú médico + Otevřít zdravotnickou nabídku Medical Menu Settings + Sanitätsmenü Einstellungen Ustawienia menu medycznego Preferências do menu médico Настройки медицинского меню Ajustes del mení médico + Nastavení zdravotnické nabídky Configure the usage of the Medical Menu + Stelle die Verwendung des Sanitätsmenüs ein Skonfiguruj opcje menu medycznego Configura o uso do menu médico Настройки использования медицинского меню Configurar el uso del menú médico + Konfigurace využití zdravotnické nabídky EXAMINE & TREATMENT + Untersuchung & Behandlung ОСМОТР И ЛЕЧЕНИЕ EXAMINAR & TRATAMIENTO EXAMINER & TRAITEMENTS @@ -82,6 +102,7 @@ STATUS + STATUS СОСТОЯНИЕ ESTADO ÉTATS @@ -91,6 +112,7 @@ OVERVIEW + ÜBERSICHT ОБЩАЯ ИНФОРМАЦИЯ DESCRIPCIÓN DESCRIPTION @@ -100,6 +122,7 @@ ACTIVITY LOG + AKTIVITÄTSVERLAUF ПРОВЕДЕННЫЕ МАНИПУЛЯЦИИ REGISTRO DE ACTIVIDAD REGISTRE DES SOINS @@ -109,6 +132,7 @@ QUICK VIEW + SCHNELLANSICHT БЫСТРЫЙ ОСМОТР VISTA RÁPIDA VUE RAPIDE @@ -118,35 +142,43 @@ View triage Card + Zeige Triagekarte Смотреть первичную карточку Ver Triage Voir Carte de Triage Pokaż kartę segregacyjną Ver cartão de triagem + Zkontrolovat štítek Examine Patient + Untersuche Patient Осмотреть пациента Examinar Paciente Examiner Patient Zbadaj pacjenta Examinar paciente + Zkontrolovat pacienta Bandage / Fractures + Bandagen / Brüche Раны / переломы Vendajes/Fracturas Bandages / Fractures Bandaże / Złamania Bandagens / Fraturas + Bandáž / Zlomeniny Medication + Medikamentation Медикаменты Medicación Médications Leki Medicação + Léky Airway Management @@ -155,17 +187,21 @@ Gestion Des Voie REspiratoire Drogi oddechowe Vias aéreas + Dýchací systém Advanced Treatments + Erweiterte Behandlungen Специальная медпомощь Tratamientos Avanzados Traitement Avancé Zaawansowane zabiegi Tratamentos avançados + Pokročilé ošetření Drag/Carry + Ziehen/Tragen Тащить/нести Arrastrar/Cargar Glisser/Porter @@ -175,22 +211,27 @@ Toggle (Self) + Umschalter (Selbst) Лечить себя/другого раненого Activer (sois) Przełącz (na siebie) Alternar Alternar (Si mesmo) + Přepnout (na sebe) Select triage status + Setze Status auf der Triagekarte Сортировка Seleccionar estado de Triage Selectioner l'état de Triage Wybierz priorytet Selecionar estado de triagem + Vybrat prioritu Select Head + Wähle Kopf Выбрать голову Seleccionar Cabeza Selectioner Tête @@ -200,6 +241,7 @@ Select Torso + Wähle Torso Выбрать торс Seleccionar Torso Selectioner Torse @@ -209,6 +251,7 @@ Select Left Arm + Wähle linken Arm Выбрать левую руку Seleccionar Brazo Izquierdo Selectioner Bras Gauche @@ -218,6 +261,7 @@ Select Right Arm + Wähle rechten Arm Выбрать правую руку Seleccionar Brazo Derecho Selectioner Bras Droit @@ -227,6 +271,7 @@ Select Left Leg + Wähle linkes Bein Выбрать левую ногу Seleccionar Pierna Izquierda Selectioner Jambe Gauche @@ -236,6 +281,7 @@ Select Right Leg + Wähle rechtes Bein Выбрать правую ногу Seleccionar Pierna Derecha Selectioner Jambe Droite @@ -245,6 +291,7 @@ Head + Kopf Голова Cabeza Tête @@ -254,6 +301,7 @@ Torso + Torso Торс Torse Tors @@ -263,6 +311,7 @@ Left Arm + Linker Arm Левая рука Brazo Izquierdo Bras Gauche @@ -272,6 +321,7 @@ Right Arm + Rechter Arm Правая рука Brazo Derecho Bras Droit @@ -281,6 +331,7 @@ Left Leg + Linkes Bein Левая нога Pierna Izquierda Jambe Gauche @@ -290,6 +341,7 @@ Right Leg + Rechtes Bein Правая нога Pierna Derecha Jambe Droite @@ -299,94 +351,117 @@ Body Part: %1 + Körperteil: %1 Часть тела: %1 Parte del cuerpo: %1 Partie du corps: %1 Część ciała: %1 Parte do corpo: %1 + Část těla: %1 Small + Klein малого размера Pequeña Petite małym Pequeno + Malý Medium + Mittel среднего размера Mediana moyenne średnim Médio + Střední Large + Groß большого размера Grande Grande dużym Grande + Velký There are %2 %1 Open Wounds + Er hat %2 offene Wunden (%1) %2 открытые раны %1 Hay %2 Heridas Abiertas %1 Il y a %2 %1 Blessure Ouverte Widzisz otwarte rany w ilości %2 o %1 rozmiarze Existem %2 ferimentos abertos %1 + Jsou zde %2 %1 otevřené rány There is 1 %1 Open Wound + Er hat 1 offene Wunde (%1) Открытая рана %1 Hay 1 Herida Abierta %1 Il y a 1 blessure ouverte %1 Widzisz 1 otwartą ranę o %1 rozmiarze Existe 1 %1 ferimento aberto + Je zde 1 %1 otevřená rána There is a partial %1 Open wound + Er hat eine zum Teil offene Wunde (%1) Частично открытая рана %1 Hay una herida parcial abierta %1 Il y a une Blessure Patiellement Ouverte %1 Widzisz częściowo otwartą ranę o %1 rozmiarze Existe um ferimento parcial aberto %1 + Je zde částečně %1 otevřená rána There are %2 %1 Bandaged Wounds + Er hat %2 verbundene Wunden (%1) %2 перевязанные раны %1 Hay %2 Heridas %1 Vendadas Il y a %2 %1 Blessure Bandée Widzisz %2 zabandażowanych ran o %1 rozmiarze Existem %2 ferimentos %1 tratados + Jsou zde %2 %1 ovázané rány There is 1 %1 Bandaged Wound + Er hat 1 verbundene Wunde (%1) 1 перевязанная рана %1 Hay 1 Herida Vendada %1 Il y a 1 %1 Blessure Bandée Widzisz 1 zabandażowaną ranę o %1 rozmiarze Existe 1 ferimento %1 tratado + Je zde 1 %1 ovázaná rána There is a partial %1 Bandaged wound + Er hat eine zum Teil verbundene Wunde (%1) Частично перевязанная рана %1 Hay una Herida parcial %1 Vendada Il y a %1 Blessure Partielment Bandée Widzisz 1 częściowo zabandażowaną ranę o %1 rozmiarze Existe um ferimento parcial tratado %1 + Je zde částěčně %1 ovázaná rána Normal breathing + Normale Atmung Дыхание в норме Respiración normal Respiration Normale Normalny oddech Respiração normal + Normální dýchání No breathing + Keine Atmung Дыхания нет No respira Apnée @@ -396,6 +471,7 @@ Difficult breathing + Schwere Atmung Дыхание затруднено Dificultad para respirar Difficultée Respiratoire @@ -405,6 +481,7 @@ Almost no breathing + Beinahe keine Atmung Дыхания почти нет Casi sin respirar Respiration Faible @@ -414,6 +491,7 @@ Bleeding + Blutung Кровотечение Sangrando Seignement @@ -423,15 +501,17 @@ in Pain + hat Schmerzen Испытывает боль Con Dolor A De La Douleur W bólu Com dor - v Bolestech + v bolestech Lost a lot of Blood + hat sehr viel Blut verloren Большая кровопотеря Mucha Sangre perdida A Perdu Bcp de Sang @@ -441,19 +521,23 @@ Tourniquet [CAT] + Tourniquet [CAT] Жгут Torniquete [CAT] Garot [CAT] Opaska uciskowa [CAT] Torniquete [CAT] + Škrtidlo [CAT] Nasopharyngeal Tube [NPA] + Nasen-Rachen-Rohr Назотрахеальная трубка Torniquete [CAT] Canule Naseaupharyngée [NPA] Rurka nosowo-gardłowa [NPA] Tubo nasofaríngeo [NPA] + Nasofaryngeální trubice [NPA] - + \ No newline at end of file diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp index 29247b6071..5968a643ff 100644 --- a/addons/medical_menu/ui/menu.hpp +++ b/addons/medical_menu/ui/menu.hpp @@ -19,8 +19,8 @@ class GVAR(medicalMenu) { y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; text = "#(argb,8,8,3)color(0,0,0,0.8)"; - colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; }; class BottomBackground: CenterBackground { y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; @@ -40,7 +40,7 @@ class GVAR(medicalMenu) { font = "PuristaMedium"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = ""; }; diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 826ea55e6c..4b609085a8 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -171,6 +171,9 @@ case (APP_MODE_WAYPOINTS): { _currentIndex = (_currentIndex max 0) min (count _waypoints); _wpListBox lbSetCurSel _currentIndex; + + //Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked + ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON); }; case (APP_MODE_SETUP): { @@ -190,5 +193,8 @@ case (APP_MODE_SETUP): { } else { _settingListBox lbSetTextRight [1, (localize LSTRING(settingOff))]; }; + + //Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked + ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON); }; }; diff --git a/addons/microdagr/gui.hpp b/addons/microdagr/gui.hpp index 2eeb99563c..fe15bb7bb2 100644 --- a/addons/microdagr/gui.hpp +++ b/addons/microdagr/gui.hpp @@ -59,11 +59,16 @@ class GVAR(TheDialog) { //Redfine Scaling for the RscTitle -#define PROFILE_X (profilenamespace getvariable ['IGUI_GRID_GPS_X', 0]) -#define PROFILE_Y (profilenamespace getvariable ['IGUI_GRID_GPS_Y', 0]) -#define PROFILE_W (profilenamespace getvariable ['IGUI_GRID_GPS_W', 1]) -#define PROFILE_H ((16/9) * (profilenamespace getvariable ['IGUI_GRID_GPS_W', 1])) +#define PROFILE_X (profilenamespace getVariable ['IGUI_GRID_GPS_X', 0]) +#define PROFILE_Y (profilenamespace getVariable ['IGUI_GRID_GPS_Y', 0]) +#define PROFILE_W (profilenamespace getVariable ['IGUI_GRID_GPS_W', 1]) +#define PROFILE_H ((16/9) * (profilenamespace getVariable ['IGUI_GRID_GPS_W', 1])) +//Need undef's for pboProject +#undef X_PART +#undef Y_PART +#undef W_PART +#undef H_PART #define X_PART(num) QUOTE((num) / 25 * PROFILE_W + PROFILE_X) #define Y_PART(num) QUOTE((num) / 25 * PROFILE_H + PROFILE_Y) #define W_PART(num) QUOTE((num) / 25 * PROFILE_W) diff --git a/addons/microdagr/gui_controls.hpp b/addons/microdagr/gui_controls.hpp index 270a3325bd..a8fbb8f83f 100644 --- a/addons/microdagr/gui_controls.hpp +++ b/addons/microdagr/gui_controls.hpp @@ -140,7 +140,7 @@ class controlsBackground { class controls { class TopMenuClick: GVAR(RscActiveTextPicture) { - idc = -1; + idc = IDC_TOPMENUBUTTON; text = "#(argb,8,8,3)color(0,0,0,0)"; x = X_PART(0); y = Y_PART(0); diff --git a/addons/microdagr/README.md b/addons/microdagr/readme.md similarity index 100% rename from addons/microdagr/README.md rename to addons/microdagr/readme.md diff --git a/addons/microdagr/script_component.hpp b/addons/microdagr/script_component.hpp index 72c5c125bc..0710649aaa 100644 --- a/addons/microdagr/script_component.hpp +++ b/addons/microdagr/script_component.hpp @@ -54,6 +54,7 @@ #define IDC_MODEDISPLAY_TARGETRANGENUM 144023 #define IDC_MODEDISPLAY_TARGETELEVATIONNUM 144024 #define IDC_MODEDISPLAY_TARGETNAME 144025 +#define IDC_TOPMENUBUTTON 144030 #define IDC_MODECOMPASS 144100 #define IDC_MODECOMPASS_HEADING 144110 diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 64146b8e7e..fc0546f797 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -26,7 +26,7 @@ class CfgAmmo { thrustTime = 1.07; thrust = 530; fuseDistance = 2; - + effectsMissileInit = "MissileDAR1"; effectsMissile = "missile2"; whistleDist = 4; @@ -34,34 +34,34 @@ class CfgAmmo { // Turn off arma crosshair-guidance manualControl = 0; - + // ACE uses these values trackOversteer = 1; trackLead = 0; - + // Begin ACE guidance Configs class ADDON { enabled = 1; - + minDeflection = 0.00025; // Minium flap deflection for guidance maxDeflection = 0.001; // Maximum flap deflection for guidance incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode - + // Guidance type for munitions defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - + seekerLockModes[] = { "LOAL", "LOBL" }; + seekerAngle = 90; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier - + seekerMinRange = 1; seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - + // Attack profile type selection defaultAttackProfile = "LIN"; attackProfiles[] = { "LIN", "DIR", "MID", "HI" }; @@ -71,10 +71,12 @@ class CfgAmmo { class ACE_Hydra70_DAGR: M_PG_AT { displayName = CSTRING(Hydra70_DAGR); displayNameShort = CSTRING(Hydra70_DAGR_Short); - + description = CSTRING(Hydra70_DAGR_Desc); descriptionShort = CSTRING(Hydra70_DAGR_Desc); + EGVAR(rearm,caliber) = 70; + //Explicity add guidance config class ADDON: ADDON {}; }; @@ -82,14 +84,14 @@ class CfgAmmo { class ACE_Hellfire_AGM114K: ACE_Hydra70_DAGR { displayName = CSTRING(Hellfire_AGM114K); displayNameShort = CSTRING(Hellfire_AGM114K_Short); - + description = CSTRING(Hellfire_AGM114K_desc); descriptionShort = CSTRING(Hellfire_AGM114K_desc); - + // @TODO: placeholder model to at least make it look different model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F"; - + hit = 1400; indirectHit = 71; indirectHitRange = 4.5; @@ -98,7 +100,7 @@ class CfgAmmo { //Explicity add guidance config class ADDON: ADDON {}; }; - + // Titan class M_Titan_AT: MissileBase {}; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 78f48250dd..122d690bae 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -13,7 +13,7 @@ _args = _this select 0; EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [(_this select 1)] call CBA_fnc_removePerFrameHandler; }; _launchParams = _args select 1; diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 3a416007f4..c59c36fd50 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -30,7 +30,7 @@ Misil Hydra-70 DAGR Hydra-70 DAGR Hydra-70 DAGR - Hydra-70 DAGR Rackete + Hydra-70 DAGR Rakete Hydra-70 DAGR Missile Hydra-70 DAGR Míssil Hydra-70 DAGR diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 26f605e347..8e1de2cb3d 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -71,7 +71,7 @@ if (_activated && local _logic) then { _args params ["_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers", "_lastTimePlayed"]; if (!alive _logic) exitWith { - [_pfhHandle] call cba_fnc_removePerFrameHandler; + [_pfhHandle] call CBA_fnc_removePerFrameHandler; }; if (ACE_time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { diff --git a/addons/mk6mortar/RscInGameUI.hpp b/addons/mk6mortar/RscInGameUI.hpp index 740334886c..a114896044 100644 --- a/addons/mk6mortar/RscInGameUI.hpp +++ b/addons/mk6mortar/RscInGameUI.hpp @@ -9,8 +9,8 @@ class RscInGameUI { idc = 80085; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0.1}; - x = "(profilenamespace getvariable ['IGUI_GRID_WEAPON_X', ((safezoneX + safezoneW) - (12.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])"; - y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; + x = "(profilenamespace getVariable ['IGUI_GRID_WEAPON_X', ((safezoneX + safezoneW) - (12.4 * (((safezoneW / safezoneH) min 1.2) / 40)) - 0.5 * (((safezoneW / safezoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf index 6c2875d75e..d22b0efa47 100644 --- a/addons/mk6mortar/functions/fnc_handleFired.sqf +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -59,8 +59,8 @@ if (_newMuzzleVelocityCoefficent != 1) then { PARAMS_2(_args,_pfID); EXPLODE_4_PVT(_args,_shell,_airFriction,_time,_relativeDensity); - if (isNull _shell || {!alive _shell}) exitwith { - [_pfID] call cba_fnc_removePerFrameHandler; + if (isNull _shell || {!alive _shell}) exitWith { + [_pfID] call CBA_fnc_removePerFrameHandler; }; _deltaT = ACE_time - _time; diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index 1935714dc8..0b8cc67842 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -9,22 +9,22 @@ { [_x] call { params ["_logic"]; - private _logicType = typeof _logic; + private _logicType = typeOf _logic; _logic hideobject true; - if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; + if (_logic getVariable [QGVAR(initalized), false]) exitWith {}; private _config = (configFile >> "CfgVehicles" >> _logicType); - if !(isClass _config) exitwith {}; + if !(isClass _config) exitWith {}; private _isGlobal = getNumber (_config >> "isGlobal") > 0; private _isDisposable = getNumber (_config >> "isDisposable") > 0; private _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; private _isSingular = getNumber (_config >> "isSingular") > 0; private _function = getText (_config >> "function"); - if (isnil _function) then { + if (isNil _function) then { _function = compile _function; } else { - _function = missionNamespace getvariable _function; + _function = missionNamespace getVariable _function; }; if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit? ACE_LOGWARNING_1("Module [%1] - More than 1 singular module placed", _logicType); @@ -36,7 +36,7 @@ }; if !(_isPersistent) then { - _logic setvariable [QGVAR(initalized), true]; + _logic setVariable [QGVAR(initalized), true]; }; if (_isDisposable) then { diff --git a/addons/modules/functions/fnc_moduleInit.sqf b/addons/modules/functions/fnc_moduleInit.sqf index 30d8046d81..5d42b4fa87 100644 --- a/addons/modules/functions/fnc_moduleInit.sqf +++ b/addons/modules/functions/fnc_moduleInit.sqf @@ -15,5 +15,5 @@ #include "script_component.hpp" if ((_this select 0) isKindOf "Module_F") then { - GVAR(moduleInitCollection) pushback (_this select 0); + GVAR(moduleInitCollection) pushBack (_this select 0); }; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index ebe97e879d..7825134af3 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -6,15 +6,14 @@ if (!hasInterface) exitWith {}; ["inventoryDisplayLoaded", { [{ - private "_dialog"; - - _dialog = _this select 0; + disableSerialization; + params ["_dialog"]; if (isNull _dialog) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; + _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player, false, true] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; @@ -32,4 +31,4 @@ if (!hasInterface) exitWith {}; true }, {false}, -[47, [false, true, false]], false] call cba_fnc_addKeybind; //DIK_V + CTRL//STRG +[47, [false, true, false]], false] call CBA_fnc_addKeybind; //DIK_V + CTRL//STRG diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index 671ab0b808..ec4202dbd5 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -15,33 +15,30 @@ */ #include "script_component.hpp" -private ["_pos", "_dir"]; +params ["_unit"]; -PARAMS_1(_unit); +private _pos = getPosASL _unit; +private _dir = getDir _unit; -_pos = getPosASL _unit; -_dir = getDir _unit; _dir = [sin _dir, cos _dir, 0]; -private ["_checkPos0beg", "_checkPos0end", "_checkPos1beg", "_checkPos1end"]; +private _checkPos0beg = _pos vectorAdd [0, 0, 0.9]; +private _checkPos0end = _checkPos0beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos0beg = _pos vectorAdd [0, 0, 0.9]; -_checkPos0end = _checkPos0beg vectorAdd (_dir vectorMultiply 1.3); +private _checkPos1beg = _pos vectorAdd [0, 0, 1.75]; +private _checkPos1end = _checkPos1beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos1beg = _pos vectorAdd [0, 0, 1.75]; -_checkPos1end = _checkPos1beg vectorAdd (_dir vectorMultiply 1.3); +private _checkPos2beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 2.0]; +private _checkPos2end = _checkPos2beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos2beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 2.0]; -_checkPos2end = _checkPos2beg vectorAdd (_dir vectorMultiply 1.3); +private _checkPos3beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 2.0]; +private _checkPos3end = _checkPos3beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos3beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 2.0]; -_checkPos3end = _checkPos3beg vectorAdd (_dir vectorMultiply 1.3); +private _checkPos4beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 1.5]; +private _checkPos4end = _checkPos4beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos4beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 1.5]; -_checkPos4end = _checkPos4beg vectorAdd (_dir vectorMultiply 1.3); - -_checkPos5beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 1.5]; -_checkPos5end = _checkPos5beg vectorAdd (_dir vectorMultiply 1.3); +private _checkPos5beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 1.5]; +private _checkPos5end = _checkPos5beg vectorAdd (_dir vectorMultiply 1.3); /* drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [0,1,0,1]]; diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index a395e834b8..57df4e5991 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -15,9 +15,7 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; if !([_unit] call FUNC(canClimb)) exitWith { [localize LSTRING(CanNotClimb)] call EFUNC(common,displayTextStructured); @@ -26,10 +24,10 @@ if !([_unit] call FUNC(canClimb)) exitWith { if !(_unit getVariable [QGVAR(isClimbInit), false]) then { _unit addEventHandler ["AnimChanged", { if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then { - // abort climb animation - if !(_this call FUNC(canClimb)) then { - [_this select 0, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); - }; + // abort climb animation + if !(_this call FUNC(canClimb)) then { + [_this select 0, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); + }; }; }]; diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 6941173fde..11dd8c4ee6 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -15,11 +15,9 @@ */ #include "script_component.hpp" -private ["_unit", "_weight"]; +params ["_unit"]; -_unit = _this select 0; - -_weight = loadAbs _unit * 0.1; +private _weight = loadAbs _unit * 0.1; if (GVAR(useImperial)) then { _weight = format ["%1lb", (round (_weight * 100)) / 100]; diff --git a/addons/movement/functions/fnc_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf index 39ca9b1e92..e6d8fed12c 100644 --- a/addons/movement/functions/fnc_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -16,12 +16,10 @@ */ #include "script_component.hpp" -private ["_unit", "_anim", "_pos"]; +params ["_unit", "_anim"]; -_unit = _this select 0; -_anim = _this select 1; +private _pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); -_pos = _unit modelToWorldVisual (_unit selectionPosition "camera"); [_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); _pos = _pos vectorDiff (_unit selectionPosition "camera"); diff --git a/addons/nametags/RscTitles.hpp b/addons/nametags/RscTitles.hpp index 7f0ddc2135..f0d5678603 100644 --- a/addons/nametags/RscTitles.hpp +++ b/addons/nametags/RscTitles.hpp @@ -27,10 +27,10 @@ class RscTitles { size = 0.018; colorBackground[] = { 0, 0, 0, 0 }; colortext[] = { - "(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])", - "(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])", - "(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])", - "(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])" + "(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])", + "(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])", + "(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])", + "(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])" }; text = ""; class Attributes { diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index b828d70005..46d0e287d8 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -20,43 +20,7 @@ GVAR(showNamesTime) = -10; false }, {false}, -[29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key - -// Monitor the assigned teams, and propegate them appropriately for the player -// This allows for assigned team colors to match across the entire group -[{ - private["_leader", "_playerIsLeader", "_unitTeam"]; - if (!(isNull ACE_player) && { alive ACE_player } ) then { - _leader = leader (group ACE_player); - _playerIsLeader = false; - - if(alive _leader) then { - if(_leader == ACE_player) then { - _playerIsLeader = true; - }; - }; - - if (_playerIsLeader) then { - { - if(alive _x) then { - _unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"]; - if (_unitTeam != assignedTeam _x) then { - _x setVariable [QGVAR(teamAssignment), assignedTeam _x,true]; - }; - }; - } forEach units (group ACE_player); - } else { - { - if(alive _x) then { - _unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"]; - if (_unitTeam != assignedTeam _x) then { - _x assignTeam _unitTeam; - }; - }; - } forEach units (group ACE_player); - }; - }; -}, 5, []] call CBA_fnc_addPerFrameHandler; +[29, [false, false, false]], false] call CBA_fnc_addKeybind; //LeftControl Key // Wait until the colors are defined before starting to draw the nametags ["SettingsInitialized", { diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index 7c98be16ed..ac28a427d5 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -22,7 +22,7 @@ params ["_player", "_target", "_alpha", "_heightOffset", "_iconType"]; -if (_iconType == ICON_NONE) exitWith {}; //Don't waste time if not visable +if ((_iconType == ICON_NONE) || {isObjectHidden _target}) exitWith {}; //Don't waste time if not visable private ["_position", "_color", "_name", "_size", "_icon", "_scale"]; @@ -30,7 +30,7 @@ private ["_position", "_color", "_name", "_size", "_icon", "_scale"]; _icon = ""; _size = 0; if (_iconType in [ICON_NAME_SPEAK, ICON_SPEAK]) then { - _icon = QUOTE(PATHTOF(UI\soundwave)) + str (floor (random 10)) + ".paa"; + _icon = format ["%1%2%3",QUOTE(PATHTOF(UI\soundwave)), floor (random 10), ".paa"]; _size = 1; _alpha = (_alpha max 0.2) + 0.2;//Boost alpha when speaking } else { @@ -44,7 +44,7 @@ if (_alpha < 0) exitWith {}; //Don't waste time if not visable //Set Text: _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { - [_target, true] call EFUNC(common,getName) + [_target, true, true] call EFUNC(common,getName) } else { "" }; @@ -57,20 +57,24 @@ if ((group _target) != (group _player)) then { _color = [[1, 1, 1, _alpha], [1, 0, 0, _alpha], [0, 1, 0, _alpha], [0, 0, 1, _alpha], [1, 1, 0, _alpha]] select ((["MAIN", "RED", "GREEN", "BLUE", "YELLOW"] find (assignedTeam _target)) max 0); }; +if (isNil "_color") then { + _color = [1, 1, 1, _alpha]; +}; + // Convert position to ASLW (expected by drawIcon3D) and add height offsets _position = _target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .3)]); _scale = [0.333, 0.5, 0.666, 0.83333, 1] select GVAR(tagSize); drawIcon3D [ -_icon, -_color, -_position, -(_size * _scale), -(_size * _scale), -0, -_name, -2, -(0.05 * _scale), -"PuristaMedium" + _icon, + _color, + _position, + (_size * _scale), + (_size * _scale), + 0, + _name, + 2, + (0.05 * _scale), + "PuristaMedium" ]; diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 3b8aea497a..7f9ced67f7 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -37,14 +37,14 @@ if (!hasInterface) exitWith {}; }] call EFUNC(common,addEventHandler); -if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { +if (isClass (configFile >> "CfgPatches" >> "acre_api")) then { ACE_LOGINFO("ACRE Detected."); DFUNC(isSpeaking) = { params ["_unit"]; ([_unit] call acre_api_fnc_isSpeaking) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { - if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then { + if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { ACE_LOGINFO("TFR Detected."); DFUNC(isSpeaking) = { params ["_unit"]; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 61a2b3f5a2..9016988452 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -51,7 +51,7 @@ Show player ranks (requires player names) - Spielerränge anzeigen (benötig Spielernamen) + Spielerränge anzeigen (benötigt Spielernamen) Pokaż rangi graczy (wymagana opcja Pokaż imiona graczy) Mostrar rango de los jugadores (requiere Mostrar nombres de jugadores) Grade des joueurs (si noms affichés) @@ -87,7 +87,7 @@ Show SoundWaves (requires player names) - Schallwellen anzeigen (benötigt Spielernamen) + Sprechsymbol anzeigen (benötigt Spielernamen) Mostrar onda sonora (requiere Mostrar nombres de jugadores) Индикатор разговора (при вкл. именах) Zobrazit SoundWaves (vyžaduje jména hráčů) @@ -113,7 +113,7 @@ Name Tags Ustawienia imion Etiquetas de nombre - Namensanzeigen + Zeige Spielernamen Jmenovky Etiquetas de nome NameTags @@ -124,7 +124,7 @@ Player Names View Dist. Zasięg imion graczy Distancia de vision para nombres de jugadores - Spielernamen-Distanz + Sichtweite der Spielernamen Vzdálenost zobrazení jména hráčů Distância de visão dos nomes dos jogadores Distance de vue des noms de joueurs @@ -135,7 +135,7 @@ Distance in meters at which player names are shown. Default: 5 Dystans w metrach, na którym wyświetlane są imiona graczy. Domyślnie: 5 Distancia en metros a la que se muestran los nombres de los jugadores. Por defecto: 5 - Distanz in Metern bei der Spielernamen angezeigt werden. Standard: 5 + Entfernung in Metern, bei der Spielernamen angezeigt werden. Standard: 5 Vzdálenost v metrech pro zobrazení jména. Výchozí: 5 Distância em metros que os nomes dos jogadores são mostrados. Padrão: 5 Distance en mètres au delà de laquelle les noms de joueurs ne sont plus affichés. Défaut: 5 @@ -146,7 +146,7 @@ Show name tags for AI? Imiona AI ¿Mostrar nombres para la IA? - Zeige Namensanzeigen für KI? + Zeige KI-Namen? Zobrazit jmenovky pro AI? Mostrar nomes para IA? Afficher les noms pour les IA? @@ -157,7 +157,7 @@ Show the name and rank tags for friendly AI units? Default: Do not force Pokaż imiona i rangi przyjaznych jednostek AI? Domyślnie: Nie wymuszaj Muestra etiquetas de nombre y rango para las unidades IA amigas? Por defecto: No forzar - Zeige den Namen und Rang für freundliche KI-Einheiten? Standard: nicht erwzingen + Zeige den Namen und Rang für freundliche KI-Einheiten? Standard: nicht erzwingen Zobrazit jména a hodnosti pro spřátelené AI jednotky? Výchozí: Nevynucovat Mostra o nome e patente para unidades IA aliadas? Padrão: Não forçar Affiche le nom et le rang pour les IA alliées? Défaut : ne pas forcer @@ -179,7 +179,7 @@ Force Show Wymuś wyświetlanie Mostrar forzado - Anzeigen erzwingen + Anzeige erzwingen Vynuceno zobrazit Mostrar forçado Forcer l'affichage @@ -190,7 +190,7 @@ Show crew info? Pokaż załogę ¿Mostrar información de la tripulación? - Zeige Besatzungsinfo? + Zeige Besatzungsstatus? Zobrazit informace o posádce? Mostrar informação de tripulação? Afficher les informations de l'équipage? @@ -201,7 +201,7 @@ Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force Pokaż informacje o obsadzie pojazdu, lub pozwól graczom ustawić tą opcje według własnego uznania. Domyślnie: Nie wymuszaj Muestra información de la tripulación, o por defecto permite a los jugadores elegirlo. Por defecto: No forzar - Zeige Fahrzeugbesatzungsinfo oder erlaube Spielern es auszuwählen. Standard: nicht erzwingen. + Zeige Status der Fahrzeugbesatzung oder erlaube Spielern ihn auszuwählen. Standard: nicht erzwingen. Zobrazit informace o posádce, nebo nechat aby si hráč vybral sám. Výchozí: Nevynucovat Mostrar informações de tripulação ou por padrão permitir a escolha dos jogadores. Padrão: Não forçar. Afficher les informations sur l'équipage d'un véhicule. Défaut: ne pas forcer @@ -223,7 +223,7 @@ Show cursor NameTag for vehicle commander (only if client has name tags enabled) Default: No Pokazuj imię dowódcy pojazdu nad pojazdem (tylko jeżeli klient ma włączone imiona graczy). Domyślnie: Nie Muestra etiquetas de nombre en el cursor para el comandante del vehiculo (solo si el cliente tiene las etiquetas de nombre activadas) Por defecto: No - Zeige Maus-Namensanzeigen für Fahrzeugkommandanten (nur wenn der Client Namensanzeigen aktiviert hat). Standard: Nein + Zeige Maus-Spielernamen für Fahrzeugkommandanten (nur wenn der Client Namensanzeigen aktiviert hat). Standard: Nein Zobrazit jmenovky pro velitele vozidla (pouze pokud má klient jmenovky povolené). Výchozí: Ne Mostrar o nome no cursor para o comandante do veículo (somente se o cliente tiver etiquetas de nomes ativada). Padrão: Não Показывать имя командира техники (только, если клиент включил отображение имен). По-умолчанию: Нет @@ -310,7 +310,7 @@ Use Nametag settings Użyj ustawień imion Usar ajustes de etiquetas de nombre - Verwende Namenanzeigen + Verwende Spielernamen Použít nastavení jmenovky Usar ajustes de etiquetas de nome Utiliser les paramètre des NamesTags @@ -344,7 +344,7 @@ Opcja ta pozwala dostosować sposób wyświetlania efektu fal dźwiękowych nad głowami mówiących graczy, wyświetlanych po przytrzymaniu klawisza PTT. Opcja ta współpracuje z TFAR oraz ACRE2. Efecto de ondas sonoras encima de las cabezas de los jugadores que hablan después de mantener la tecla PTT. Esta opción funciona con TFAR y ACRE2. Efekt zvukových vln nad hlavami hráčů když mluví skrz PTT klávesu. Tato volba funguje s TFAR a ACRE2. - Es wird ein Schallwellensymbol über den Köpfen von sprechenden Spielern angezeigt, die ihre Push-to-Talk-Taste drücken. Diese Option funktioniert mit TFAR und ACRE2. + Es wird ein Schallwellensymbol über den Köpfen von sprechenden Spielern angezeigt, die ihre Push-to-Talk-Taste drücken. Diese Option funktioniert mit "TFAR" und "ACRE2". Efeito de ondas sonoras acima das cabeças dos jogadores que falam depois mantendo pressionada a tecla PTT. Esta opção funciona com TFAR e ACRE2. Icone au dessus de la tête du joueur qui parle après avoir utilisé la touche de PTT. Option compatible avec ACRE2 et TFAR Hanghullám-effekt a beszélő játékosok feje felett a PTT-gomb lenyomásakor. Ez a beállítás TFAR és ACRE2 alatt működik. @@ -355,7 +355,7 @@ Rozmiar imion Tamaño de las Etiquetas de nombre Velikost jmenovky - Namensschildgröße + Größe der Spielernamen Tamanho das etiquetas de nome Taille des noms Névcímkék mérete diff --git a/addons/nightvision/ACE_Settings.hpp b/addons/nightvision/ACE_Settings.hpp new file mode 100644 index 0000000000..32dbab7fff --- /dev/null +++ b/addons/nightvision/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(disableNVGsWithSights) { + displayName = CSTRING(DisableNVGsWithSights_DisplayName); + description = CSTRING(DisableNVGsWithSights_description); + typeName = "BOOL"; + value = 0; + }; +}; diff --git a/addons/nightvision/CfgVehicles.hpp b/addons/nightvision/CfgVehicles.hpp index 84e7105f0b..8b489ad64f 100644 --- a/addons/nightvision/CfgVehicles.hpp +++ b/addons/nightvision/CfgVehicles.hpp @@ -14,4 +14,28 @@ class CfgVehicles { MACRO_ADDITEM(ACE_NVG_Wide,6); }; }; + + class ACE_Module; + class GVAR(ModuleSettings): ACE_Module { + scope = 2; + displayName = CSTRING(Module_DisplayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_ca.paa)); + category = "ACE"; + function = QUOTE(FUNC(initModule)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "BaerMitUmlaut"; + class Arguments { + class disableNVGsWithSights { + displayName = CSTRING(DisableNVGsWithSights_DisplayName); + description = CSTRING(DisableNVGsWithSights_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; + }; }; diff --git a/addons/nightvision/UI/Icon_Module_ca.paa b/addons/nightvision/UI/Icon_Module_ca.paa new file mode 100644 index 0000000000..556adaf30c Binary files /dev/null and b/addons/nightvision/UI/Icon_Module_ca.paa differ diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 2839f6e5f9..0df7270317 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -30,9 +30,15 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Setup the event handlers ["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); -["playerVisionModeChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["playerVisionModeChanged", { + _this call FUNC(updatePPEffects); + _this call FUNC(onVisionModeChanged); +}] call EFUNC(common,addEventHandler); ["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); -["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["cameraViewChanged", { + _this call FUNC(updatePPEffects); + _this call FUNC(onCameraViewChanged); +}] call EFUNC(common,addEventHandler); ["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); @@ -49,7 +55,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; true }, {false}, -[201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT +[201, [false, false, true]], false] call CBA_fnc_addKeybind; //PageUp + ALT ["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { @@ -63,4 +69,4 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; true }, {false}, -[209, [false, false, true]], false] call cba_fnc_addKeybind; //PageDown + ALT +[209, [false, false, true]], false] call CBA_fnc_addKeybind; //PageDown + ALT diff --git a/addons/nightvision/XEH_preInit.sqf b/addons/nightvision/XEH_preInit.sqf index 27f8ea7d48..ed02b9524e 100644 --- a/addons/nightvision/XEH_preInit.sqf +++ b/addons/nightvision/XEH_preInit.sqf @@ -4,6 +4,9 @@ ADDON = false; PREP(blending); PREP(changeNVGBrightness); +PREP(initModule); +PREP(onCameraViewChanged); +PREP(onVisionModeChanged); PREP(updatePPEffects); ADDON = true; diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index 4e6aa2e39a..1edeca6e5b 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "ACE_Settings.hpp" diff --git a/addons/nightvision/functions/fnc_initModule.sqf b/addons/nightvision/functions/fnc_initModule.sqf new file mode 100644 index 0000000000..6831a29edf --- /dev/null +++ b/addons/nightvision/functions/fnc_initModule.sqf @@ -0,0 +1,21 @@ +/* + * Author: BaerMitUmlaut + * Initializes the settings for the disable NVGs in sight module. + * + * Arguments: + * 0: Module + * + * Return Value: + * None + * + * Example: + * [_module] call ace_nightvision_fnc_initModule + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_module"]; + +[_module, QGVAR(disableNVGsWithSights), "disableNVGsWithSights"] call EFUNC(common,readSettingFromModule); diff --git a/addons/nightvision/functions/fnc_onCameraViewChanged.sqf b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf new file mode 100644 index 0000000000..5384d6924c --- /dev/null +++ b/addons/nightvision/functions/fnc_onCameraViewChanged.sqf @@ -0,0 +1,38 @@ +/* + * Author: BaerMitUmlaut + * Disables/re-enables NVGs when the player starts/stops aiming down his sight. + * + * Arguments: + * 0: Unit + * 1: New camera view + * + * Return Value: + * None + * + * Example: + * [player, "GUNNER"] call ace_nightvision_fnc_onCameraViewChanged + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit", "_cameraView"]; + +if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { + if ((vehicle _unit == _unit) + || {isTurnedOut _unit} + || {!([_unit] call EFUNC(common,hasHatch)) + && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} + }) then { + if ((_cameraView == "GUNNER") && {currentVisionMode _unit == 1}) then { + _unit action ["NVGogglesOff", _unit]; + _unit setVariable [QGVAR(reenableNVGs), true]; + } else { + if (_unit getVariable [QGVAR(reenableNVGs), false] && {_cameraView != "GUNNER"}) then { + _unit action ["NVGoggles", _unit]; + _unit setVariable [QGVAR(reenableNVGs), false]; + }; + }; + }; +}; diff --git a/addons/nightvision/functions/fnc_onVisionModeChanged.sqf b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf new file mode 100644 index 0000000000..64f77a69bc --- /dev/null +++ b/addons/nightvision/functions/fnc_onVisionModeChanged.sqf @@ -0,0 +1,32 @@ +/* + * Author: BaerMitUmlaut + * Disables turning on NVGs while the player aims down his sight. + * + * Arguments: + * 0: Unit + * 1: New vision mode + * + * Return Value: + * None + * + * Example: + * [player, 1] call ace_nightvision_fnc_onVisionModeChanged + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit", "_visionMode"]; + +if (GVAR(disableNVGsWithSights) && {(hmd _unit) != ""}) then { + if ((vehicle _unit == _unit) + || {isTurnedOut _unit} + || {!([_unit] call EFUNC(common,hasHatch)) + && {[_unit] call EFUNC(common,getTurretIndex) in ([vehicle _unit] call EFUNC(common,getTurretsFFV))} + }) then { + if ((cameraView == "GUNNER") && {_visionMode > 0}) then { + _unit action ["NVGogglesOff", _unit]; + }; + }; +}; diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 050945d5d8..2a38b86c54 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -133,5 +133,29 @@ Diminuir Luminosidade do EVN Riduci la luminosità dell'NVG + + Nightvision + Nachtsicht + Ночное виденье + Visão Noturna + + + Settings for night vision. + Einstellungen für Nachtsichtgeräte. + Настройки ночного виденья + Ajustes para visão noturna. + + + Disable NVGs in scope + Deakt. NVGs mit Visier + Убирать ПНВ при прицеливании + Desabilitar visão noturna nas lunetas + + + Blocks the usage of night vision goggles whilst aiming down the sight. + Blockiert das Benutzen von Nachtsichtbrillen beim Benutzen des Visiers. + Блокирует использование головного ПНВ при прицеливании через прицел. + Bloqueia o uso de visão noturna ao utilizar a mira. + \ No newline at end of file diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index 6214178ac9..2048db76c6 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -6,8 +6,13 @@ if (!hasInterface) exitWith {}; GVAR(camera) = objNull; 0 = 0 spawn { - waituntil {!isNull ACE_player}; - waituntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0 && {isNull curatorCamera}}; + // Workarround for the ThreeDen Editor Camera + if ((!isNil {is3DEN}) && {is3DEN}) exitWith { + ACE_LOGINFO("Eden detected: disabling Optics PIP Camera"); + }; + + waitUntil {!isNull ACE_player}; + waitUntil {sleep 1; {_x != GVAR(camera)} count allMissionObjects "camera" == 0 && {isNull curatorCamera}}; GVAR(camera) cameraEffect ["TERMINATE", "BACK"]; camDestroy GVAR(camera); diff --git a/addons/optics/functions/fnc_onDrawScope.sqf b/addons/optics/functions/fnc_onDrawScope.sqf index 26cbe235b2..d977149c95 100644 --- a/addons/optics/functions/fnc_onDrawScope.sqf +++ b/addons/optics/functions/fnc_onDrawScope.sqf @@ -10,7 +10,7 @@ _display = _this select 0; _control = _display displayCtrl 1713154; if (!ctrlShown (_display displayCtrl 154)) exitWith { - _control ctrlShow false; + _control ctrlShow false; }; private ["_sizeX", "_sizeY"]; diff --git a/addons/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf index a981c34e0b..4736d72623 100644 --- a/addons/optionsmenu/XEH_postInit.sqf +++ b/addons/optionsmenu/XEH_postInit.sqf @@ -2,10 +2,10 @@ #include "script_component.hpp" ["SettingsInitialized", { - GVAR(categories) pushback ""; //Ensure All Catagories is at top + GVAR(categories) pushBack ""; //Ensure All Catagories is at top { if !(_x select 8 in GVAR(categories)) then { - GVAR(categories) pushback (_x select 8); + GVAR(categories) pushBack (_x select 8); }; - }foreach EGVAR(common,settings); + }forEach EGVAR(common,settings); }] call EFUNC(common,addEventHandler); diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf index 755982e569..be771f7a3a 100644 --- a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -67,7 +67,7 @@ _text = format [" { _var = missionNamespace getVariable [_x, nil]; - if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then { + if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)]; [_text] call _outputText; }; @@ -77,7 +77,7 @@ _text = format [" _unit = _x; { _var = _unit getVariable [_x, nil]; - if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then { + if(!isnil "_var" && {_var isEqualType []} && {(count _var) > MIN_ARRAY_SIZE}) then { _text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)]; [_text] call _outputText; }; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 172a95808e..e798784871 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -39,7 +39,7 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize _defaultValue = _x select 6; if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { - _value = missionNamespace getvariable [_name, _defaultValue]; + _value = missionNamespace getVariable [_name, _defaultValue]; _formatedValue = switch (toLower _typeName) do { case ("scalar"): { format['value = %1;', _value]; @@ -48,8 +48,8 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize format['value = "%1";', _value]; }; case ("bool"): { - if (typeName _value != "BOOL") then {ERROR("weird bool typename??");}; - _value = if (((typeName _value) == "BOOL") && {_value}) then {1} else {0}; + if (!(_value isEqualType false)) then {ERROR("weird bool typename??");}; + _value = if ((_value isEqualType false) && {_value}) then {1} else {0}; format ['value = %1;', _value]; }; case ("color"): { diff --git a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf index d756a0ef83..5b302a510d 100644 --- a/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf +++ b/addons/optionsmenu/functions/fnc_moduleAllowConfigExport.sqf @@ -16,9 +16,9 @@ private ["_logic"]; _logic = _this select 0; -if (isMultiplayer) exitwith {}; +if (isMultiplayer) exitWith {}; -if (_logic getvariable ["allowconfigurationExport", false]) then { +if (_logic getVariable ["allowconfigurationExport", false]) then { GVAR(serverConfigGeneration) = 1; } else { GVAR(serverConfigGeneration) = 0; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 6c0cb56519..8e09608e07 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -18,7 +18,7 @@ private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"]; -if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;}; +if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitWith {closeDialog 145246;}; // Filter only user setable setting GVAR(serverSideOptions) = []; @@ -57,7 +57,7 @@ GVAR(serverSideValues) = []; [{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); disableSerialization; -_menu = uiNamespace getvariable "ACE_serverSettingsMenu"; +_menu = uiNamespace getVariable "ACE_serverSettingsMenu"; (_menu displayCtrl 1003) ctrlEnable false; if (GVAR(ClientSettingsExportIncluded)) then { diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index c71a26a6e7..104d8195cf 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -44,7 +44,7 @@ GVAR(clientSideColors) = []; [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); disableSerialization; -_menu = uiNamespace getvariable "ACE_settingsMenu"; +_menu = uiNamespace getVariable "ACE_settingsMenu"; (_menu displayCtrl 1002) ctrlEnable false; (_menu displayCtrl 1003) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 87532aaf86..dfffbca6a6 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -57,7 +57,7 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; - { lbAdd [400, _x]; } foreach _possibleValues; + { lbAdd [400, _x]; } forEach _possibleValues; }; (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index fc745c37be..9718da3988 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -50,7 +50,7 @@ switch (GVAR(optionMenu_openTab)) do { _added = _ctrlList lnbAddRow [_settingName, _settingsText]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - }foreach GVAR(serverSideOptions); + }forEach GVAR(serverSideOptions); }; case (MENU_TAB_SERVER_COLORS): { { @@ -70,7 +70,7 @@ switch (GVAR(optionMenu_openTab)) do { _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - }foreach GVAR(serverSideColors); + }forEach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { @@ -81,13 +81,13 @@ switch (GVAR(optionMenu_openTab)) do { (_x select 0); }; _settingsValue = _x select 9; - if (typeName _settingsValue != "STRING") then { + if (!(_settingsValue isEqualType "")) then { _settingsValue = format["%1", _settingsValue]; }; _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - }foreach GVAR(serverSideValues); + }forEach GVAR(serverSideValues); }; }; if (_updateKeyView) then { diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 64f45121e5..defef99395 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -58,7 +58,7 @@ if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; - { lbAdd [400, _x]; } foreach _possibleValues; + { lbAdd [400, _x]; } forEach _possibleValues; }; (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 96a45a1b83..4ab0bf83fa 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -38,12 +38,17 @@ switch (GVAR(optionMenu_openTab)) do { _settingsText = if ((_x select 1) == "BOOL") then { [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; } else { - (_x select 5) select _settingsValue; + private _values = _x select 5; + if !((!isNil "_values") && {_values isEqualType []} && {_settingsValue >= 0} && {_settingsValue < (count _values)}) exitWith { + ACE_LOGERROR_3("Setting (%1) has bad values (%2) for index (%3)", _settingName, _values, _settingsValue); + "ERROR" + }; + _values select _settingsValue; }; _added = _ctrlList lnbAddRow [_settingName, _settingsText]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - } foreach GVAR(clientSideOptions); + } forEach GVAR(clientSideOptions); }; case (MENU_TAB_COLORS): { { @@ -59,7 +64,7 @@ switch (GVAR(optionMenu_openTab)) do { _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - }foreach GVAR(clientSideColors); + }forEach GVAR(clientSideColors); }; }; if (_updateKeyView) then { diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf index 1493f76445..09e1357a31 100644 --- a/addons/optionsmenu/functions/fnc_stringEscape.sqf +++ b/addons/optionsmenu/functions/fnc_stringEscape.sqf @@ -25,7 +25,7 @@ _isEven = { if (_forEachIndex <= _index && {_x == 39}) then { _count = _count + 1; }; - }foreach _array; + }forEach _array; _count %2 == 0; }; @@ -35,9 +35,9 @@ _isEven = { _array = toArray _str; { if (_x == 34) then { - _array set [_foreachIndex, 39]; + _array set [_forEachIndex, 39]; }; -}foreach _array; +}forEach _array; _maxIndex = count _array; for "_i" from 0 to _maxIndex /* step +1 */ do { @@ -52,8 +52,8 @@ for "_i" from 0 to _maxIndex /* step +1 */ do { { if (_x == 34) then { - _array set [_foreachIndex, 39]; + _array set [_forEachIndex, 39]; }; -}foreach _array; +}forEach _array; toString _array; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index 25fa06c604..7374d1f2c1 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -38,7 +38,7 @@ switch (_type) do { } ; }; - } foreach GVAR(clientSideOptions); + } forEach GVAR(clientSideOptions); }; case (MENU_TAB_COLORS): { { @@ -46,7 +46,7 @@ switch (_type) do { _changed = true; _x set [9, _newValue]; }; - } foreach GVAR(clientSideColors); + } forEach GVAR(clientSideColors); }; case (MENU_TAB_SERVER_OPTIONS): { { @@ -62,7 +62,7 @@ switch (_type) do { } ; }; - } foreach GVAR(serverSideOptions); + } forEach GVAR(serverSideOptions); }; case (MENU_TAB_SERVER_COLORS): { { @@ -70,7 +70,7 @@ switch (_type) do { _changed = true; _x set [9, _newValue]; }; - } foreach GVAR(serverSideColors); + } forEach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { @@ -78,14 +78,14 @@ switch (_type) do { _changed = true; _x set [9, _newValue]; }; - } foreach GVAR(serverSideValues); + } forEach GVAR(serverSideValues); }; }; if (_changed) then { if (GVAR(serverConfigGeneration) > 0) then { if !(isMultiplayer) then { - missionNamespace setvariable [_name, _newValue]; + missionNamespace setVariable [_name, _newValue]; }; } else { profileNamespace setVariable [_name, _newValue]; diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index 513692eaab..3333c5476f 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -166,8 +166,8 @@ class RscDisplayMain: RscStandardDisplay { fontBold = "PuristaLight"; }; colorBold[] = {0.6,0.6,0.6,1}; - colorLink[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; - colorLinkActive[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorLink[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])",1}; + colorLinkActive[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])",1}; }; }; }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index cd65eb966d..37950b1c42 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -33,15 +33,15 @@ class ACE_settingsMenu { font = "PuristaMedium"; SizeEx = H_PART(1); colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; text = ""; }; class CenterBackground: HeaderBackground { y = Y_PART(2.1); h = H_PART(2.5); text = ""; - colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; }; class LeftBackground: CenterBackground { y = Y_PART(4.8); diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index cd4cc429b0..129f995cd7 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -398,6 +398,7 @@ Affiche les nouveautés sur l'écran principal Hírek mutatása a főmenüben Показывать новости в Главном Меню + Zobrazit zprávy v hlavním menu All Categories diff --git a/addons/overheating/CfgVehicles.hpp b/addons/overheating/CfgVehicles.hpp index a198ef71b6..ec9b07f36c 100644 --- a/addons/overheating/CfgVehicles.hpp +++ b/addons/overheating/CfgVehicles.hpp @@ -11,7 +11,6 @@ class CfgVehicles { showDisabled = 0; priority = 3; icon = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); - hotkey = "B"; }; class ACE_CheckTemperature { displayName = CSTRING(CheckTemperatureShort); @@ -21,7 +20,6 @@ class CfgVehicles { showDisabled = 0; priority = 2.9; icon = QUOTE(PATHTOF(UI\temp_ca.paa)); - hotkey = "P"; }; }; }; @@ -117,4 +115,4 @@ class CfgVehicles { // Czech class I_Soldier_02_F; class I_Soldier_AR_F:I_Soldier_02_F {MACRO_ADDSPAREBARREL}; class I_Soldier_support_base_F; class I_Soldier_AAR_F:I_Soldier_support_base_F {MACRO_ADDSPAREBARREL}; -}; \ No newline at end of file +}; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 1b64d7f0b0..c1212af0e8 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -18,4 +18,4 @@ if (!hasInterface) exitWith {}; true }, {false}, -[19, [true, false, false]], false] call cba_fnc_addKeybind; //R Key +[19, [true, false, false]], false] call CBA_fnc_addKeybind; //R Key diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index fd3081f7eb..000cd44021 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -34,7 +34,7 @@ _fnc_stopCurrentBurst = { if (diag_frameno == _startFrame) exitWith {}; // Remove the PFH on the second execution - [_pfhId] call cba_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; _unit setAmmo [_weapon, _ammo]; }; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index d7f40c4d91..6680b759c4 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -161,7 +161,7 @@ if (stance _unit == "PRONE") then { }; }; -if ("Jam" in (missionNamespace getvariable ["ACE_Debug", []])) then { +if ("Jam" in (missionNamespace getVariable ["ACE_Debug", []])) then { _jamChance = 0.5; }; diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index e457e023c6..4641e36eb8 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -48,7 +48,7 @@ _affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange]; // Damage to the firer private "_distance"; -_distance = [_position, _direction, _backblastRange, _firer] call FUNC(getDistance); +_distance = 2 * ([_position, _direction, _backblastRange, _firer] call FUNC(getDistance)); TRACE_1("Distance",_distance); @@ -62,7 +62,7 @@ if (_distance < _backblastRange) then { [_damage * 100] call BIS_fnc_bloodEffect; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then { - [_firer, "body", ((_firer getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); + [_firer, _damage, "body", "backblast"] call EFUNC(medical,addDamageToUnit); } else { _firer setDamage (damage _firer + _damage); }; @@ -95,7 +95,7 @@ if (_distance < _backblastRange) then { ] call EFUNC(common,addLineToDebugDraw); [ _position, - _position vectorAdd (_direction vectorMultiply (_distance min _backblastRange)), + _position vectorAdd (_direction vectorMultiply ((_distance/2) min _backblastRange)), [1,0,0,1] ] call EFUNC(common,addLineToDebugDraw); #endif diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index f9c58050e0..b1c8a5c574 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -56,7 +56,7 @@ TRACE_4("Parameters:",_overpressureAngle,_overpressureRange,_overpressureDamage, if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then { - [_x, "body", ((_x getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); + [_x, _damage, "body", "backblast"] call EFUNC(medical,addDamageToUnit); } else { _x setDamage (damage _x + _damage); }; diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index aefadf2e63..c0f1676eb2 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -20,7 +20,6 @@ class CfgVehicles { showDisabled = 0; priority = 2.9; icon = QUOTE(PATHTOF(UI\cut_ca.paa)); - hotkey = "C"; // Did this realy Work? }; }; }; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 46dd21b99c..598661a3da 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -30,7 +30,7 @@ if (!hasInterface) exitWith {}; true }, {false}, -[24, [false, false, false]], false] call cba_fnc_addKeybind; +[24, [false, false, false]], false] call CBA_fnc_addKeybind; GVAR(PFH) = false; ["playerVehicleChanged",{ diff --git a/addons/parachute/functions/fnc_checkCutParachute.sqf b/addons/parachute/functions/fnc_checkCutParachute.sqf index 8301007fa3..dfe22b4bc0 100644 --- a/addons/parachute/functions/fnc_checkCutParachute.sqf +++ b/addons/parachute/functions/fnc_checkCutParachute.sqf @@ -16,4 +16,4 @@ #include "script_component.hpp" private["_unit"]; _unit = _this select 0; -(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getvariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) \ No newline at end of file +(vehicle _unit isKindOf 'ParachuteBase' && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) \ No newline at end of file diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 7a90a1f12c..cc32724e9d 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -22,6 +22,6 @@ _unit setVariable [QGVAR(chuteIsCut), false, true]; [{ if (ACE_time >= ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + [(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler); }; }, 1, [ACE_time,_unit]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/parachute/functions/fnc_onEachFrame.sqf b/addons/parachute/functions/fnc_onEachFrame.sqf index dbfab16452..94d5a99748 100644 --- a/addons/parachute/functions/fnc_onEachFrame.sqf +++ b/addons/parachute/functions/fnc_onEachFrame.sqf @@ -16,16 +16,16 @@ #include "script_component.hpp" private "_player"; _player = ACE_player; -if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);}; -if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;}; -if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;}; -if (isTouchingGround _player) exitWith {[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);GVAR(PFH) = false;}; +if (!GVAR(PFH)) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);}; +if (isNull _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; +if !((vehicle _player) isKindOf "ParachuteBase") exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; +if (isTouchingGround _player) exitWith {[(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler);GVAR(PFH) = false;}; private ["_pos"]; _pos = getPosASL (vehicle _player); if ((lineIntersects [_pos, _pos vectorAdd [0,0,-0.5], vehicle _player, _player]) || {((ASLtoATL _pos) select 2) < 0.75}) then { - [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); + [(_this select 1)] call CALLSTACK(CBA_fnc_removePerFrameHandler); GVAR(PFH) = false; // I believe this will not work for Zeus units. deleteVehicle (vehicle _player); diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 6f4159e85d..466abfb77e 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -23,10 +23,10 @@ if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {} GVAR(AltimeterActive) = true; [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler)}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(CBA_fnc_removePerFrameEventHandler)}; disableSerialization; (_this select 0) params ["_display", "_unit", "_oldHeight", "_prevTime"]; - if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)}; + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(CBA_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)}; private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime", "_timeDiff"]; diff --git a/addons/parachute/functions/fnc_storeParachute.sqf b/addons/parachute/functions/fnc_storeParachute.sqf index baa93bbae0..42ad18b304 100644 --- a/addons/parachute/functions/fnc_storeParachute.sqf +++ b/addons/parachute/functions/fnc_storeParachute.sqf @@ -18,7 +18,7 @@ private ["_unit","_backpack"]; _unit = _this select 0; _backpack = (_this select 1) select 6; -if ((vehicle _unit) isKindOf "ParachuteBase" && backpack _unit == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then { +if ((vehicle _unit) isKindOf "ParachuteBase" && backpack _unit == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getVariable [QGVAR(hasReserve),false])) then { _unit addBackpackGlobal (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]); } else { if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then { diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index fbf1e37226..4865186563 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -138,7 +138,7 @@ M-ATV (SMG) M-ATV (HMG) M-ATV (CKM) - M-ATV (TK) + M-ATV (HMG) M-ATV (HMG) M-ATV (Пулемёт) M-ATV (HMG) @@ -150,7 +150,7 @@ M-ATV (GMW) M-ATV (GMG) M-ATV (GMG) - M-ATV (Granátomet) + M-ATV (GMG) M-ATV (GMG) M-ATV (Гранатомёт) M-ATV (GMG) @@ -258,7 +258,7 @@ HEMTT Transport HEMTT de transporte HEMTT Transportowy - HEMTT Valník + HEMTT (valník) HEMTT Transport HEMTT Транспортный HEMTT Transporte @@ -270,7 +270,7 @@ HEMTT Transport (bedeckt) HEMTT de transporte (cubierto) HEMTT Transportowy (zakryty) - HEMTT Valník (krytý) + HEMTT (valník-krytý) HEMTT Transport (bâché) HEMTT Транспортный (крытый) HEMTT Transporte (coberto) @@ -294,7 +294,7 @@ HEMTT Container HEMTT con contenedor HEMTT Kontener - HEMTT Skříňový + HEMTT (skříňový) HEMTT Conteneur HEMTT Контейнер HEMTT Contêiner @@ -306,7 +306,7 @@ HEMTT Sanitäter HEMTT médico HEMTT Medyczny - HEMTT Zdravotnický + HEMTT (zdravotnický) HEMTT Médical HEMTT Медицинский HEMTT Médico @@ -318,7 +318,7 @@ HEMTT Munition HEMTT de munición HEMTT Amunicyjny - HEMTT Muniční + HEMTT (muniční) HEMTT Munitions HEMTT Боеприпасы HEMTT Munições @@ -330,7 +330,7 @@ HEMTT Treibstoff HEMTT de combustible HEMTT Cysterna - HEMTT Cisterna + HEMTT (cisterna) HEMTT Citerne HEMTT Заправщик HEMTT Combustível @@ -342,7 +342,7 @@ HEMTT Instandsetzung HEMTT de reparación HEMTT Naprawczy - HEMTT Opravárenský + HEMTT (opravárenský) HEMTT Réparation HEMTT Ремонтный HEMTT Reparador @@ -366,7 +366,7 @@ Fennek (SMG) Fennek (HMG) Fennek (CKM) - Fennek (TK) + Fennek (HMG) Fennek (HMG) Феннек (Пулемёт) Fennek (HMG) @@ -378,7 +378,7 @@ Fennek (GMW) Fennek (GMG) Fennek (GMG) - Fennek (granátomet) + Fennek (GMG) Fennek (GMG) Феннек (Гранатомёт) Fennek (GMG) @@ -426,7 +426,7 @@ KamAZ Transport KamAZ de transporte KamAZ transportowy - KamAZ Valník + KamAZ-5350 (valník) KamAZ Transport КамАЗ Транспортный KamAZ Transporte @@ -438,7 +438,7 @@ KamAZ Transport (bedeckt) KamAZ de transporte (cubierto) KamAZ Transportowy (zakryty) - KamAZ Valník (krytý) + KamAZ-5350 (valník-krytý) KamAZ Transport (bâché) КамАЗ Транспортный (крытый) KamAZ Transporte (coberto) @@ -450,7 +450,7 @@ KamAZ Munition KamAZ de munición KamAZ Amunicyjny - KamAZ Muniční + KamAZ-5350 (muniční) KamAZ Munitions КамАЗ Боеприпасы KamAZ Munições @@ -462,7 +462,7 @@ KamAZ Treibstoff KamAZ de combustible KamAZ cysterna - KamAZ Cisterna + KamAZ-5350 (cisterna) KamAZ Citerne КамАЗ Заправщик KamAZ Combustível @@ -474,7 +474,7 @@ KamAZ Instandsetzung KamAZ de reparación KamAZ Naprawczy - KamAZ Opravárenský + KamAZ-5350 (opravárenský) KamAZ Réparation КамАЗ Ремонтный KamAZ Reparador @@ -486,7 +486,7 @@ KamAZ Sanitäter KamAZ médico KamAZ Medyczny - KAMAZ Zdravotnický + KamAZ-5350 (zdravotnický) KamAZ Médical КамАЗ Медицинский KamAZ Médico @@ -510,7 +510,7 @@ Punisher (SMG) Punisher (HMG) Punisher (CKM) - Punisher (TK) + Punisher (HMG) Punisher (HMG) Kаратель (Пулемёт) Punisher (HMG) @@ -522,7 +522,7 @@ Punisher (GMW) Punisher (GMG) Punisher (GMG) - Punisher (granátomet) + Punisher (GMG) Punisher (GMG) Kаратель (Гранатомёт) Punisher (GMG) @@ -594,7 +594,7 @@ Typhoon Transport Typhoon de transporte Typhoon Transportowy - Typhoon valník + KamAZ-63968 Typhoon (valník) Typhoon Transport Тайфун Транспортный Typhoon Transporte @@ -606,7 +606,7 @@ Typhoon Transport (bedeckt) Typhoon de transporte (cubierto) Typhoon Transportowy (przykryty) - Typhoon valník (krytý) + KamAZ-63968 Typhoon (valník-krytý) Typhoon Transport (bâché) Тайфун Транспортный (крытый) Typhoon Transporte (coberto) @@ -618,7 +618,7 @@ Typhoon Gerät Typhoon con dispositivo Typhoon Urządzenie - Typhoon zařízení + KamAZ-63968 Typhoon (zařízení) Typhoon Dispositif Тайфун Устройство Typhoon Dispositivo @@ -630,7 +630,7 @@ Typhoon Munition Typhoon de munición Typhoon Amunicyjny - Typhoon muniční + KamAZ-63968 Typhoon (muniční) Typhoon Munitions Тайфун Боеприпасы Typhoon Munições @@ -642,7 +642,7 @@ Typhoon Treibstoff Typhoon de combustible Typhoon Cysterna - Typhoon cisterna + KamAZ-63968 Typhoon (cisterna) Typhoon Citerne Тайфун Заправщик Typhoon Combustível @@ -654,7 +654,7 @@ Typhoon Instandsetzung Typhoon de reparación Typhoon Naprawczy - Typhoon opravárenský + KamAZ-63968 Typhoon (opravárenský) Typhoon Réparation Тайфун Ремонтный Typhoon Reparador @@ -666,7 +666,7 @@ Typhoon Sanitäter Typhoon médico Typhoon Medyczny - Typhoon zdravotnický + KamAZ-63968 Typhoon (zdravotnický) Typhoon Médical Тайфун Медицинский Typhoon Médico @@ -881,7 +881,7 @@ M18A1 Claymore M18A1 Claymore Mina kierunkowa M18A1 Claymore - Mina Claymore M18A1 + M18A1 Claymore M18A1 Claymore M18A1 Клеймор M18A1 Claymore @@ -1013,7 +1013,7 @@ M15 Panzerabwehrmine Mina antitanque M15 Mina przeciwpancerna M15 - Protitanková mina M15 + M15 Protitanková mina M15 Mine antichar M15 противотанковая мина M15 Mina anticarro @@ -1025,7 +1025,7 @@ VS-50 Antipersonenmine Mina antipersona VS-50 Mina przeciwpiechotna VS-50 - Protipěchotní mina VS-50 + VS-50 Protipěchotní mina VS-50 Mine AP VS-50 Противопехотная мина VS-50 Mina antipessoal @@ -1037,7 +1037,7 @@ M26 Antipersonensprungmine Mina antipersona M26 Mina przeciwpiechotna M26 - Šrapnelová mina M26 + M26 Protipěchotní mina M26 Mine AP bondissante M26 Противопехотная мина M26 Mina saltadora antipessoal @@ -1049,7 +1049,7 @@ PMR-3 Antipersonenstolperdrahtmine Mina antipersona de alambre PMR-3 Mina przeciwpiechotna PMR-3 - Nástražná mina PMR-3 + PMR-3 Protipěchotní mina (drát) PMR-3 Mine AP à traction PMR-3 Противопехотная мина PMR-3 Mina antipessoal (armadilha) @@ -1192,7 +1192,7 @@ MX (Black) MX (Schwarz) MX (Czarny) - MX (Černý) + MX (Černá) MX (Noir) MX (Fekete) MX (Negro) @@ -1216,7 +1216,7 @@ MXC (Black) MXC (Schwarz) MXC (Czarny) - MXC (Černý) + MXC (Černá) MXC (Noir) MXC (Fekete) MXC (Negro) @@ -1240,7 +1240,7 @@ MX 3GL (Black) MX 3GL (Schwarz) MX 3GL (Czarny) - MX 3GL (Černý) + MX 3GL (Černá) MX 3GL (Noir) MX 3GL (Fekete) MX 3GL (Negro) @@ -1264,7 +1264,7 @@ MX LSW (Black) MX LSW (Schwarz) MX LSW (Czarny) - MX LSW (Černý) + MX LSW (Černá) MX LSW (Noir) MX LSW (Fekete) MX LSW (Negro) @@ -1288,7 +1288,7 @@ MXM (Black) MXM (Schwarz) MXM (Czarny) - MXM (Černý) + MXM (Černá) MXM (Noir) MXM (Fekete) MXM (Negro) @@ -1360,7 +1360,7 @@ F2000 Tactical (Camo) F2000 Tactical (Tarnmuster) F2000 Tactical (kamuflaż) - F2000 Tactical (Černý) + F2000 Tactical (Kamufláž) F2000 Tactical (Camo) F2000 Tactical (Terepmintás) F2000 Tactical (Camuflaje) @@ -1598,7 +1598,7 @@ Noreen "Bad News" ULR (Black) - Noreen "Bad News" ULR (Černý) + Noreen "Bad News" ULR (Černá) Noreen "Bad News" ULR (Noir) Noreen "Bad News" ULR (Negro) Noreen "Bad News" ULR (Чёрный) @@ -1622,7 +1622,7 @@ Noreen "Bad News" ULR (Sand) - Noreen "Bad News" ULR (Pouštní) + Noreen "Bad News" ULR (Písková) Noreen "Bad News" ULR (Beige) Noreen "Bad News" ULR (Arena) Noreen "Bad News" ULR (Песочный) @@ -1646,7 +1646,7 @@ SIG 556 (Black) - SIG 556 (Černý) + SIG 556 (Černá) SIG 556 (Noir) SIG 556 (Negro) SIG 556 (Чёрный) @@ -1670,7 +1670,7 @@ SIG 556 (Sand) - SIG 556 (Pouštní) + SIG 556 (Písková) SIG 556 (Beige) SIG 556 (Arena) SIG 556 (Песочный) @@ -1694,7 +1694,7 @@ SIG 556 (Woodland) - SIG 556 (Woodland) + SIG 556 (Lesní) SIG 556 (Woodland) SIG 556 (Bosque) SIG 556 (Лесной) @@ -1706,7 +1706,7 @@ SIG 556 (provisional) spotter - SIG 556 (Provizorní) spotter + SIG 556 (provizorní) spotter SIG 556 (provisoire) Observateur SIG 556 (provisional) observador SIG 556 (provisional) корректировщик @@ -1730,7 +1730,7 @@ ASP-1 Kir (Black) - ASP-1 Kir (Čený) + ASP-1 Kir (Čená) ASP-1 Kir (Noir) ASP-1 Kir (Negro) ASP-1 Kir (Чёрный) @@ -1742,7 +1742,7 @@ ASP-1 Kir (Tan) - ASP-1 Kir (Pouštní) + ASP-1 Kir (Tan) ASP-1 Kir (Tan) ASP-1 Kir (Tan) ASP-1 Kir (Бронзовый) @@ -1766,7 +1766,7 @@ Cyrus (Black) - Cyrus (Černý) + Cyrus (Černá) Cyrus (Noir) Cyrus (Negro) Cyrus (Чёрный) @@ -1790,7 +1790,7 @@ Cyrus (Tan) - Cyrus (Pouštní) + Cyrus (Tan) Cyrus (Tan) Cyrus (Tan) Cyrus (Бронза) @@ -1826,7 +1826,7 @@ M14 (Olive) - M14 (Olivový) + M14 (Olivová) M14 (Olive) M14 (Oliva) M14 (Олива) @@ -1862,7 +1862,7 @@ HK121 (Tan) - HK121 (Pouštní) + HK121 (Tan) HK121 (Tan) HK121 (Tan) HK121 (Бронза) @@ -1898,7 +1898,7 @@ LWMMG (Black) - LWMMG (Černý) + LWMMG (Černá) LWMMG (Noir) LWMMG (Negro) LWMMG (Чёрный) @@ -1910,7 +1910,7 @@ LWMMG (Sand) - LWMMG (Pouštní) + LWMMG (Písková) SPMG (Beige) LWMMG (Arena) LWMMG (Песочный) diff --git a/addons/rearm/$PBOPREFIX$ b/addons/rearm/$PBOPREFIX$ new file mode 100644 index 0000000000..7acbc38009 --- /dev/null +++ b/addons/rearm/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\rearm \ No newline at end of file diff --git a/addons/rearm/ACE_Settings.hpp b/addons/rearm/ACE_Settings.hpp new file mode 100644 index 0000000000..f4d6562807 --- /dev/null +++ b/addons/rearm/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(level) { + displayName = CSTRING(RearmSettings_level_DisplayName); + description = CSTRING(RearmSettings_level_Description); + value = 0; + typeName = "SCALAR"; + values[] = {CSTRING(RearmSettings_vehicle), CSTRING(RearmSettings_magazine), CSTRING(RearmSettings_caliber)}; + }; +}; diff --git a/addons/rearm/CfgAmmo.hpp b/addons/rearm/CfgAmmo.hpp new file mode 100644 index 0000000000..2443ab91a5 --- /dev/null +++ b/addons/rearm/CfgAmmo.hpp @@ -0,0 +1,200 @@ +class CfgAmmo { + + class BombCore; + class BombBase : BombCore { + GVAR(caliber) = 250; // Default caliber for bombs + }; + class LaserBombCore : BombCore { + GVAR(caliber) = 250; // Default caliber for bombs + }; + class MissileCore; + class MissileBase : MissileCore { + GVAR(caliber) = 250; // Default caliber for missiles + }; + class Missile_AA_04_F : MissileBase { + GVAR(dummy) = QGVAR(Missile_AA_04_F); + }; + class Missile_AA_03_F : Missile_AA_04_F { + GVAR(dummy) = QGVAR(Missile_AA_03_F); + }; + + class Rocket_04_HE_F : MissileBase { + GVAR(caliber) = 70; + GVAR(dummy) = QGVAR(Rocket_04_HE_F); + }; + class Rocket_03_HE_F : Rocket_04_HE_F { + GVAR(dummy) = QGVAR(Rocket_03_HE_F); + }; + class Rocket_04_AP_F : Rocket_04_HE_F { + GVAR(dummy) = QGVAR(Rocket_04_AP_F); + }; + class Rocket_03_AP_F : Rocket_04_AP_F { + GVAR(dummy) = QGVAR(Rocket_03_AP_F); + }; + class M_PG_AT : MissileBase { + GVAR(caliber) = 70; + GVAR(dummy) = QGVAR(M_PG_AT); + }; + class Missile_AGM_02_F : MissileBase { + GVAR(dummy) = QGVAR(Missile_AGM_02_F); + }; + class Missile_AGM_01_F : Missile_AGM_02_F { + GVAR(dummy) = QGVAR(Missile_AGM_01_F); + }; + + class RocketCore; + class RocketBase : RocketCore { + GVAR(caliber) = 70; // Default caliber for rockets + }; + class R_80mm_HE : RocketBase { + GVAR(caliber) = 80; + GVAR(dummy) = QGVAR(R_80mm_HE); + }; + class R_60mm_HE : R_80mm_HE { + GVAR(caliber) = 60; + GVAR(dummy) = QGVAR(R_60mm_HE); + }; + class R_Hydra_HE : RocketBase { + GVAR(dummy) = QGVAR(R_Hydra_HE); + }; + + class BulletBase; + class B_19mm_HE : BulletBase { + GVAR(caliber) = 19; + }; + + class B_20mm : BulletBase { + GVAR(caliber) = 20; + }; + + class B_25mm : BulletBase { + GVAR(caliber) = 25; + }; + + class B_30mm_AP : BulletBase { + GVAR(caliber) = 30; + }; + class B_30mm_HE : B_19mm_HE { + GVAR(caliber) = 30; + }; + class Gatling_30mm_HE_Plane_CAS_01_F : BulletBase { + GVAR(caliber) = 30; + }; + + class B_35mm_AA : BulletBase { + GVAR(caliber) = 35; + }; + + class B_30mm_APFSDS; + class B_40mm_APFSDS : B_30mm_APFSDS { + GVAR(caliber) = 40; + }; + + class B_40mm_GPR : B_30mm_HE { + GVAR(caliber) = 40; + }; + + class GrenadeBase; + class G_40mm_HE : GrenadeBase { + GVAR(caliber) = 39; + }; + + class ShellBase; + class R_230mm_fly : ShellBase { + GVAR(dummy) = QGVAR(R_230mm_fly); + }; + + class Sh_120mm_APFSDS : Shellbase { + GVAR(caliber) = 120; + }; + class Sh_105mm_APFSDS : Sh_120mm_APFSDS { + GVAR(caliber) = 105; + }; + class Sh_125mm_APFSDS : Sh_120mm_APFSDS { + GVAR(caliber) = 125; + }; + + class Sh_120mm_HE : ShellBase { + GVAR(caliber) = 120; + }; + class Sh_125mm_HE : Sh_120mm_HE { + GVAR(caliber) = 125; + }; + class Sh_125mm_HEAT : Sh_125mm_HE { + GVAR(caliber) = 125; + }; + class Sh_105mm_HEAT_MP : Sh_125mm_HEAT { + GVAR(caliber) = 105; + }; + + class Sh_155mm_AMOS : ShellBase { + GVAR(caliber) = 155; + }; + class Sh_82mm_AMOS : Sh_155mm_AMOS { + GVAR(caliber) = 82; + }; + + class Sh_82mm_AMOS_LG; + class Sh_155mm_AMOS_LG : Sh_82mm_AMOS_LG { + GVAR(caliber) = 155; + }; + + class ShotDeployBase; + class Smoke_82mm_AMOS_White : ShotDeployBase { + GVAR(caliber) = 82; + }; + + class FlareCore; + class Flare_82mm_AMOS_White : FlareCore { + GVAR(caliber) = 82; + }; + + class SmokeLauncherAmmo : BulletBase { + GVAR(caliber) = 250; + }; + + class CMflareAmmo : BulletBase { + GVAR(caliber) = 39; + }; + + class SubmunitionBase; + class Sh_82mm_AMOS_guided : SubmunitionBase { + GVAR(caliber) = 82; + }; + class Sh_155mm_AMOS_guided : Sh_82mm_AMOS_guided { + GVAR(caliber) = 155; + }; + class R_230mm_HE : SubmunitionBase { + GVAR(caliber) = 230; + }; + class Mine_155mm_AMOS_range : SubmunitionBase { + GVAR(caliber) = 155; + }; + class Cluster_155mm_AMOS : SubmunitionBase { + GVAR(caliber) = 155; + }; + class Smoke_120mm_AMOS_White : SubmunitionBase { + GVAR(caliber) = 155; + }; + class AT_Mine_155mm_AMOS_range : SubmunitionBase { + GVAR(caliber) = 155; + }; + + class Bo_Mk82 : BombCore { + GVAR(dummy) = QGVAR(Bo_Mk82); + }; + + class Bo_GBU12_LGB : LaserBombCore { + GVAR(caliber) = 250; // Default caliber for bombs + GVAR(dummy) = QGVAR(Bo_GBU12_LGB); + }; + + class Bomb_04_F : LaserBombCore { + GVAR(caliber) = 250; // Default caliber for bombs + GVAR(dummy) = QGVAR(Bomb_04_F); + }; + + class Bomb_03_F : Bomb_04_F { + GVAR(dummy) = QGVAR(Bomb_03_F); + }; +}; diff --git a/addons/rearm/CfgEventHandlers.hpp b/addons/rearm/CfgEventHandlers.hpp new file mode 100644 index 0000000000..93371889e1 --- /dev/null +++ b/addons/rearm/CfgEventHandlers.hpp @@ -0,0 +1,36 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + + +class Extended_Init_EventHandlers { + class GVAR(defaultCarriedObject) { // TODO check if we need to add all subclasses + class ADDON { + init = QUOTE(_this call DEFUNC(cargo,initObject)); + }; + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); + }; + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; diff --git a/addons/rearm/CfgMagazines.hpp b/addons/rearm/CfgMagazines.hpp new file mode 100644 index 0000000000..a509377182 --- /dev/null +++ b/addons/rearm/CfgMagazines.hpp @@ -0,0 +1,56 @@ +class CfgMagazines { + class CA_Magazine; + class 60Rnd_CMFlareMagazine : CA_Magazine { + displayName = CSTRING(Mag_60Rnd_CMFlareMagazine); + }; + + class VehicleMagazine; + class SmokeLauncherMag : VehicleMagazine { + displayName = CSTRING(Mag_SmokeLauncherMag); + }; + class SmokeLauncherMag_boat : VehicleMagazine { + displayName = CSTRING(Mag_SmokeLauncherMag); + }; + + class 1000Rnd_Gatling_30mm_Plane_CAS_01_F : VehicleMagazine { + displayName = CSTRING(Mag_1000Rnd_Gatling_30mm_Plane_CAS_01_F); + }; + class 500Rnd_Cannon_30mm_Plane_CAS_02_F : 1000Rnd_Gatling_30mm_Plane_CAS_01_F { + displayName = CSTRING(Mag_500Rnd_Cannon_30mm_Plane_CAS_02_F); + }; + + class 2Rnd_Missile_AA_04_F : VehicleMagazine { + displayName = CSTRING(Mag_2Rnd_Missile_AA_04_F); + }; + class 2Rnd_Missile_AA_03_F : 2Rnd_Missile_AA_04_F { + displayName = CSTRING(Mag_2Rnd_Missile_AA_03_F); + }; + + class 6Rnd_Missile_AGM_02_F : VehicleMagazine { + displayName = CSTRING(Mag_6Rnd_Missile_AGM_02_F); + }; + class 4Rnd_Missile_AGM_01_F : 6Rnd_Missile_AGM_02_F { + displayName = CSTRING(Mag_4Rnd_Missile_AGM_01_F); + }; + + class 7Rnd_Rocket_04_HE_F : VehicleMagazine { + displayName = CSTRING(Mag_7Rnd_Rocket_04_HE_F); + }; + class 20Rnd_Rocket_03_HE_F : 7Rnd_Rocket_04_HE_F { + displayName = CSTRING(Mag_20Rnd_Rocket_03_HE_F); + }; + + class 7Rnd_Rocket_04_AP_F : 7Rnd_Rocket_04_HE_F { + displayName = CSTRING(Mag_7Rnd_Rocket_04_AP_F); + }; + class 20Rnd_Rocket_03_AP_F : 7Rnd_Rocket_04_AP_F { + displayName = CSTRING(Mag_20Rnd_Rocket_03_AP_F); + }; + + class 4Rnd_Bomb_04_F : VehicleMagazine { + displayName = CSTRING(Mag_4Rnd_Bomb_04_F); + }; + class 2Rnd_Bomb_03_F : 4Rnd_Bomb_04_F { + displayName = CSTRING(Mag_2Rnd_Bomb_03_F); + }; +}; diff --git a/addons/rearm/CfgVehicles.hpp b/addons/rearm/CfgVehicles.hpp new file mode 100644 index 0000000000..30548aed76 --- /dev/null +++ b/addons/rearm/CfgVehicles.hpp @@ -0,0 +1,245 @@ +#define MACRO_REARM_ACTIONS \ + class ACE_Actions { \ + class ACE_MainActions { \ + class GVAR(Rearm) { \ + displayName = CSTRING(Rearm); \ + distance = REARM_ACTION_DISTANCE; \ + condition = QUOTE(_this call FUNC(canRearm)); \ + statement = QUOTE(_player call FUNC(rearm)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_rearm_interact.paa); \ + }; \ + }; \ + }; + +#define MACRO_REARM_TRUCK_ACTIONS \ + class ACE_Actions : ACE_Actions { \ + class ACE_MainActions : ACE_MainActions { \ + class GVAR(TakeAmmo) { \ + displayName = CSTRING(TakeAmmo); \ + distance = REARM_ACTION_DISTANCE; \ + condition = QUOTE(_this call FUNC(canTakeAmmo)); \ + insertChildren = QUOTE(_target call FUNC(addRearmActions)); \ + exceptions[] = {"isNotInside"}; \ + showDisabled = 0; \ + priority = 2; \ + icon = PATHTOF(ui\icon_rearm_interact.paa); \ + }; \ + class GVAR(StoreAmmo) { \ + displayName = CSTRING(StoreAmmo); \ + distance = REARM_ACTION_DISTANCE; \ + condition = QUOTE(_this call FUNC(canStoreAmmo)); \ + statement = QUOTE(_this call FUNC(storeAmmo)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_rearm_interact.paa); \ + }; \ + }; \ + }; + +class CfgVehicles { + class ACE_Module; + class ACE_moduleRearmSettings : ACE_Module { + scope = 2; + displayName = CSTRING(RearmSettings_Module_DisplayName); + icon = QUOTE(PATHTOF(ui\icon_module_rearm.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleRearmSettings); + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class level { + displayName = CSTRING(RearmSettings_level_DisplayName); + description = CSTRING(RearmSettings_level_Description); + typeName = "NUMBER"; + class values { + class vehicle { + name = CSTRING(RearmSettings_vehicle); + value = 0; + }; + class magazine { + name = CSTRING(RearmSettings_magazine); + value = 1; + }; + class caliber { + name = CSTRING(RearmSettings_caliber); + value = 2; + default = 1; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(RearmSettings_Module_Description); + }; + }; + + class LandVehicle; + class Car : LandVehicle { + MACRO_REARM_ACTIONS + }; + + class Tank : LandVehicle { + MACRO_REARM_ACTIONS + }; + + class StaticWeapon : LandVehicle { + MACRO_REARM_ACTIONS + }; + + class Air; + class Helicopter : Air { + MACRO_REARM_ACTIONS + }; + + class Plane : Air { + MACRO_REARM_ACTIONS + }; + + class Ship; + class Ship_F : Ship { + MACRO_REARM_ACTIONS + }; + + + // Ammo Vehicles (with full inheritance for granted ACE_Actions) + class Car_F : Car {}; + class Truck_F : Car_F {}; + + class Truck_03_base_F : Truck_F {}; + class O_Truck_03_ammo_F : Truck_03_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + class Truck_02_base_F : Truck_F {}; + class Truck_02_Ammo_base_F : Truck_02_base_F {}; + class I_Truck_02_ammo_F : Truck_02_Ammo_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + class O_Truck_02_Ammo_F : Truck_02_Ammo_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + class Truck_01_base_F : Truck_F {}; + class B_Truck_01_transport_F : Truck_01_base_F {}; + class B_Truck_01_mover_F : B_Truck_01_transport_F {}; + class B_Truck_01_ammo_F : B_Truck_01_mover_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + class Helicopter_Base_F : Helicopter {}; + class Helicopter_Base_H : Helicopter_Base_F {}; + class Heli_Transport_04_base_F : Helicopter_Base_H {}; + class O_Heli_Transport_04_ammo_F : Heli_Transport_04_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + class Pod_Heli_Transport_04_base_F: StaticWeapon {}; + class Land_Pod_Heli_Transport_04_ammo_F: Pod_Heli_Transport_04_base_F { + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + class Slingload_base_F; + class Slingload_01_Base_F: Slingload_base_F { + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + selection = ""; + distance = 10; + condition = "true"; + }; + }; + }; + + class B_Slingload_01_Ammo_F : Slingload_01_Base_F { + XEH_ENABLED; + transportAmmo = 0; + MACRO_REARM_TRUCK_ACTIONS + }; + + + // Dummy Vehicles + class ThingX; + class GVAR(defaultCarriedObject) : ThingX { + XEH_ENABLED; + displayName = QGVAR(dummy_obj); + scope = 1; + scopeCurator = 1; + model = "\A3\Weapons_F\AmmoBoxes\AmmoBox_F.p3d"; + EGVAR(cargo,size) = 1; + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(PickUpAmmo); + distance = REARM_ACTION_DISTANCE; + condition = QUOTE(_this call FUNC(canTakeAmmo)); + statement = QUOTE(_this call FUNC(grabAmmo)); + exceptions[] = {"isNotInside"}; + showDisabled = 0; + priority = 2; + icon = PATHTOF(ui\icon_rearm_interact.paa); + }; + }; + }; + class GVAR(Bo_GBU12_LGB) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F\Ammo\Bomb_01_F.p3d"; + }; + class GVAR(Bo_Mk82) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F\Ammo\Bomb_02_F"; + }; + class GVAR(Bomb_04_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Bomb_04_F.p3d"; + }; + class GVAR(Bomb_03_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Bomb_03_F.p3d"; + }; + class GVAR(Missile_AA_04_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Missile_AA_04_F.p3d"; + }; + class GVAR(Missile_AA_03_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Missile_AA_03_F.p3d"; + }; + class GVAR(Missile_AGM_02_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_02_F.p3d"; + }; + class GVAR(Missile_AGM_01_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Missile_AGM_01_F.p3d"; + }; + class GVAR(R_230mm_fly) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F\Ammo\Missile_AT_02_F"; + }; + class GVAR(R_230mm_HE) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F\Ammo\Missile_AT_02_F"; + }; + class GVAR(M_PG_AT) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F\Ammo\Rocket_01_F"; + }; + class GVAR(Rocket_04_HE_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_HE_F.p3d"; + }; + class GVAR(Rocket_03_HE_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d"; + }; + class GVAR(Rocket_04_AP_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_04_AP_F.p3d"; + }; + class GVAR(Rocket_03_AP_F) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_AP_F.p3d"; + }; + // Using wrong model + class GVAR(R_80mm_HE) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d"; + }; + class GVAR(R_60mm_HE) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d"; + }; + class GVAR(R_Hydra_HE) : GVAR(defaultCarriedObject) { + model = "\A3\Weapons_F_EPC\Ammo\Rocket_03_HE_F.p3d"; + }; +}; diff --git a/addons/rearm/README.md b/addons/rearm/README.md new file mode 100644 index 0000000000..4d6dc966a1 --- /dev/null +++ b/addons/rearm/README.md @@ -0,0 +1,11 @@ +ace_rearm +=============== + +The Rearm module introduces ability to rearm vehicles on different realistic levels. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [GitHawk] (https://github.com/GitHawk) +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf new file mode 100644 index 0000000000..607b768b15 --- /dev/null +++ b/addons/rearm/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventHandler); +["playerVehicleChanged", {params ["_unit"]; [_unit] call FUNC(dropAmmo)}] call EFUNC(common,addEventHandler); diff --git a/addons/rearm/XEH_preInit.sqf b/addons/rearm/XEH_preInit.sqf new file mode 100644 index 0000000000..c52423f67f --- /dev/null +++ b/addons/rearm/XEH_preInit.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addRearmActions); +PREP(canRearm); +PREP(canStoreAmmo); +PREP(canTakeAmmo); +PREP(createDummy); +PREP(dropAmmo); +PREP(getConfigMagazines); +PREP(getMaxMagazines); +PREP(getNeedRearmMagazines); +PREP(grabAmmo); +PREP(handleKilled); +PREP(handleUnconscious); +PREP(makeDummy); +PREP(moduleRearmSettings); +PREP(pickUpAmmo); +PREP(rearm); +PREP(rearmEntireVehicle); +PREP(rearmEntireVehicleSuccess); +PREP(rearmEntireVehicleSuccessLocal); +PREP(rearmSuccess); +PREP(rearmSuccessLocal); +PREP(storeAmmo); +PREP(takeAmmo); +PREP(takeSuccess); + +ADDON = true; diff --git a/addons/rearm/XEH_respawn.sqf b/addons/rearm/XEH_respawn.sqf new file mode 100644 index 0000000000..7f0d175d1c --- /dev/null +++ b/addons/rearm/XEH_respawn.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +private ["_unit"]; + +_unit = _this select 0; + +if !(local _unit) exitWith {}; + +_unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; +_unit setVariable [QGVAR(carriedMagazine), nil]; +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if !(isNull _dummy) then { + detach _dummy; + deleteVehicle _dummy; +}; +_unit setVariable [QGVAR(dummy), nil]; \ No newline at end of file diff --git a/addons/rearm/config.cpp b/addons/rearm/config.cpp new file mode 100644 index 0000000000..c15721c9df --- /dev/null +++ b/addons/rearm/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"GitHawk", "Jonpas"}; + authorUrl = "https://ace3mod.com"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/rearm/functions/fnc_addRearmActions.sqf b/addons/rearm/functions/fnc_addRearmActions.sqf new file mode 100644 index 0000000000..2011cc73de --- /dev/null +++ b/addons/rearm/functions/fnc_addRearmActions.sqf @@ -0,0 +1,98 @@ +/* + * Author: GitHawk + * Show the resupplyable ammunition of all surrounding vehicles. + * + * Argument: + * 0: Target + * + * Return value: + * ChildActions + * + * Example: + * [tank] call ace_rearm_fnc_addRearmActions + * + * Public: No + */ +#include "script_component.hpp" + +private ["_vehicleActions", "_actions", "_action", "_vehicles", "_vehicle", "_needToAdd", "_magazineHelper", "_turretPath", "_magazines", "_magazine", "_icon", "_cnt"]; +params ["_target"]; + +_vehicles = nearestObjects [_target, ["AllVehicles"], 20]; +if (count _vehicles < 2) exitWith {false}; // Rearming needs at least 2 vehicles + +_vehicleActions = []; +{ + _actions = []; + _vehicle = _x; + _needToAdd = false; + _action = []; + if !((_vehicle == _target) || (_vehicle isKindOf "CAManBase")) then { + _magazineHelper = []; + { + _turretPath = _x; + _magazines = []; + if (_turretPath isEqualTo [-1]) then { + _magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines); + } else { + _magazines = _vehicle magazinesTurret _turretPath; + }; + { + _magazine = _x; + _cnt = { _x == _magazine } count (_vehicle magazinesTurret _turretPath); + if ((_cnt < ([_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines))) && !(_magazine in _magazineHelper)) then { + _action = [_magazine, + getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"), + getText(configFile >> "CfgMagazines" >> _magazine >> "picture"), + {_this call FUNC(takeAmmo)}, + {true}, + {}, + [_magazine, _vehicle]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + _magazineHelper pushBack _magazine; + _needToAdd = true; + } else { + if (((_vehicle magazineTurretAmmo [_magazine, _turretPath]) < getNumber (configFile >> "CfgMagazines" >> _magazine >> "count")) && !(_magazine in _magazineHelper)) then { + _action = [_magazine, + getText(configFile >> "CfgMagazines" >> _magazine >> "displayName"), + getText(configFile >> "CfgMagazines" >> _magazine >> "picture"), + {_this call FUNC(takeAmmo)}, + {true}, + {}, + [_magazine, _vehicle]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + _magazineHelper pushBack _magazine; + _needToAdd = true; + }; + }; + } forEach _magazines; + } forEach REARM_TURRET_PATHS; + }; + if (_needToAdd && !(_vehicle getVariable [QGVAR(disabled), false])) then { + _icon = getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "Icon"); + if !((_icon select [0, 1]) == "\") then { + _icon = ""; + }; + if (GVAR(level) == 0) then { + _action = [_vehicle, + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"), + _icon, + {_this call FUNC(rearmEntireVehicle)}, + {true}, + {}, + _vehicle] call EFUNC(interact_menu,createAction); + _vehicleActions pushBack [_action, [], _target]; + } else { + _action = [_vehicle, + getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName"), + _icon, + {}, + {true}, + {}, + []] call EFUNC(interact_menu,createAction); + _vehicleActions pushBack [_action, _actions, _target]; + }; + }; +} forEach _vehicles; + +_vehicleActions diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf new file mode 100644 index 0000000000..834e6a9202 --- /dev/null +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -0,0 +1,29 @@ +/* + * Author: GitHawk, Jonpas + * Check if a unit can rearm. + * + * Arguments: + * 0: Target + * 1: Unit + * + * Return Value: + * Can Rearm + * + * Example: + * [player, tank] call ace_rearm_fnc_canRearm + * + * Public: No + */ +#include "script_component.hpp" + +private ["_dummy","_magazineClass"]; +params ["_target", "_unit"]; + +if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {_target distance _unit > REARM_ACTION_DISTANCE} || {_target getVariable [QGVAR(disabled), false]}) exitWith {false}; + +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if (isNull _dummy) exitwith {false}; +_magazineClass = _dummy getVariable QGVAR(magazineClass); +if (isNil "_magazineClass") exitWith {false}; + +([_target, _magazineClass] call FUNC(getNeedRearmMagazines)) select 0 diff --git a/addons/rearm/functions/fnc_canStoreAmmo.sqf b/addons/rearm/functions/fnc_canStoreAmmo.sqf new file mode 100644 index 0000000000..4018775d43 --- /dev/null +++ b/addons/rearm/functions/fnc_canStoreAmmo.sqf @@ -0,0 +1,25 @@ +/* + * Author: GitHawk + * Check if a unit can store ammo in an ammo truck. + * + * Arguments: + * 0: Target + * 1: Unit + * + * Return Value: + * Can Store Ammo + * + * Example: + * [player, tank] call ace_rearm_fnc_canStoreAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_unit"]; + +!(isNull _unit || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {(_target distance _unit) > REARM_ACTION_DISTANCE} || + {isNull (_unit getVariable [QGVAR(dummy), objNull])}) diff --git a/addons/rearm/functions/fnc_canTakeAmmo.sqf b/addons/rearm/functions/fnc_canTakeAmmo.sqf new file mode 100644 index 0000000000..43a96515e5 --- /dev/null +++ b/addons/rearm/functions/fnc_canTakeAmmo.sqf @@ -0,0 +1,25 @@ +/* + * Author: GitHawk + * Check if a unit can pick up ammo. + * + * Arguments: + * 0: Target + * 1: Unit + * + * Return Value: + * Can Pick Up Ammo + * + * Example: + * [player, tank] call ace_rearm_fnc_canTakeAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_unit"]; + +!(isNull _unit || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {(_target distance _unit) > REARM_ACTION_DISTANCE} || + {!isNull (_unit getVariable [QGVAR(dummy), objNull])}) diff --git a/addons/rearm/functions/fnc_createDummy.sqf b/addons/rearm/functions/fnc_createDummy.sqf new file mode 100644 index 0000000000..f9d335c08a --- /dev/null +++ b/addons/rearm/functions/fnc_createDummy.sqf @@ -0,0 +1,33 @@ +/* + * Author: GitHawk + * Creates a carryable ammunition dummy object. + * + * Arguments: + * 0: Unit + * 1: Magazine Classname + * + * Return Value: + * Created Dummy + * + * Example: + * ["500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_createDummy + * + * Public: No + */ +#include "script_component.hpp" + +private ["_ammo", "_dummyName", "_dummy"]; +params ["_unit", "_magazineClass"]; + +_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +_dummyName = getText (configFile >> "CfgAmmo" >> _ammo >> QGVAR(dummy)); +_dummy = objNull; +if !(_dummyName == "") then { + _dummy = _dummyName createVehicle (position _unit); +} else { + _dummy = QGVAR(defaultCarriedObject) createVehicle (position _unit); +}; +_dummy allowDamage false; +_dummy setVariable [QGVAR(magazineClass), _magazineClass, true]; + +_dummy diff --git a/addons/rearm/functions/fnc_dropAmmo.sqf b/addons/rearm/functions/fnc_dropAmmo.sqf new file mode 100644 index 0000000000..8fc9ba4945 --- /dev/null +++ b/addons/rearm/functions/fnc_dropAmmo.sqf @@ -0,0 +1,43 @@ +/* + * Author: GitHawk + * Drops a magazine, optionally deletes it and optionally unholsters the wepaon. + * + * Arguments: + * 0: Unit + * 1: Delete dummy object (optional) + * 2: Unholster Weapon (optional) + * + * Return Value: + * None + * + * Example: + * [player, true, true] call ace_rearm_fnc_dropAmmo + * + * Public: No + */ +#include "script_component.hpp" + +private ["_dummy", "_actionID"]; +params ["_unit", ["_delete", false], ["_unholster", true]]; + +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if !(isNull _dummy) then { + detach _dummy; + if (_delete) then { + deleteVehicle _dummy; + } else { + _dummy setVelocity [0,0,-0.1]; + }; + _unit setVariable [QGVAR(dummy), objNull]; + //_unit setVariable [QEGVAR(dragging,isCarrying), false, true]; // breaks things, since it hides interact menu on _target +}; +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; +if (_actionID != -1) then { + _unit removeAction _actionID; + _unit setVariable [QGVAR(ReleaseActionID), nil]; +}; +[_unit, QGVAR(vehRearm), false] call EFUNC(common,setForceWalkStatus); + +if (_unholster) then { + REARM_UNHOLSTER_WEAPON +}; diff --git a/addons/rearm/functions/fnc_getConfigMagazines.sqf b/addons/rearm/functions/fnc_getConfigMagazines.sqf new file mode 100644 index 0000000000..9662f30ce7 --- /dev/null +++ b/addons/rearm/functions/fnc_getConfigMagazines.sqf @@ -0,0 +1,53 @@ +/* + * Author: GitHawk, Jonpas + * Returns all magazines a turret can hold according to config. + * + * Arguments: + * 0: Target + * 1: Turret Path + * + * Return Value: + * Magazine classes in TurretPath + * + * Example: + * [vehicle, [0]] call ace_rearm_fnc_getConfigMagazines + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_turretPath"]; + +if (isNull _target) exitWith {[]}; + +_cfg = configFile >> "CfgVehicles" >> (typeOf _target) >> "Turrets"; + +if (count _turretPath == 1) then { + _turretPath params ["_subPath"]; + + if (_subPath == -1) exitWith { + _cfg = configFile >> "CfgVehicles" >> (typeOf _target); + }; + + if (count _cfg > _subPath) then { + _cfg = _cfg select _subPath; + } else { + _cfg = nil; + }; +} else { + _turretPath params ["", "_subPath"]; + if (count _cfg > 0) then { + _cfg = (_cfg select 0) >> "Turrets"; + if (count _cfg > _subPath) then { + _cfg = _cfg select _subPath; + } else { + _cfg = nil; + }; + } else { + _cfg = nil; + }; +}; + +if !(isClass _cfg) exitWith {[]}; + +getArray (_cfg >> "magazines") diff --git a/addons/rearm/functions/fnc_getMaxMagazines.sqf b/addons/rearm/functions/fnc_getMaxMagazines.sqf new file mode 100644 index 0000000000..632b5e5918 --- /dev/null +++ b/addons/rearm/functions/fnc_getMaxMagazines.sqf @@ -0,0 +1,26 @@ +/* + * Author: GitHawk, Jonpas + * Calculates the maximum number of magazines a turret can hold according to config. + * + * Arguments: + * 0: Target + * 1: Turret Path + * 2: Magazine Classname + * + * Return Value: + * Number of magazines on the turret path + * + * Example: + * [vehicle, [0], "500Rnd_127x99_mag_Tracer_Red"] call ace_rearm_fnc_getMaxMagazines + * + * Public: No + */ +#include "script_component.hpp" + +private ["_count", "_cfg"]; +params ["_target", "_turretPath", "_magazineClass"]; + +if (isNull _target) exitWith {0}; + +_count = {_x == _magazineClass} count ([_target, _turretPath] call FUNC(getConfigMagazines)); +_count diff --git a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf new file mode 100644 index 0000000000..7a591c6c32 --- /dev/null +++ b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf @@ -0,0 +1,49 @@ +/* + * Author: GitHawk, Jonpas + * Get rearm return value. + * + * Arguments: + * 0: Target + * 1: Magazine Classname + * + * Return Value: + * Return Value + * 0: Can Rearm + * 1: TurretPath + * 2: Magazine Classname + * + * Example: + * [tank, "mag"] call ace_rearm_fnc_getNeedRearmMagazines + * + * Public: No + */ +#include "script_component.hpp" + +private ["_return", "_magazines", "_cnt"]; +params ["_target", "_magazineClass"]; + +_return = [false, [], 0]; +{ + _magazines = []; + if (_x isEqualTo [-1]) then { + _magazines = [_target, _x] call FUNC(getConfigMagazines); + } else { + _magazines = _target magazinesTurret _x; + }; + + if (_magazineClass in _magazines) then { + _cnt = {_x == _magazineClass} count (_target magazinesTurret _x); + + if ((_target magazineTurretAmmo [_magazineClass, _x]) < getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count")) exitWith { + _return = [true, _x, _cnt]; + }; + + if (_cnt < ([_target, _x, _magazineClass] call FUNC(getMaxMagazines))) exitWith { + _return = [true, _x, _cnt]; + }; + }; + + if (_return select 0) exitWith {}; +} forEach REARM_TURRET_PATHS; + +_return diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf new file mode 100644 index 0000000000..9b09d1282d --- /dev/null +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -0,0 +1,53 @@ +/* + * Author: GitHawk + * Grabs an dummy ammo. + * + * Arguments: + * 0: Ammo Dummy + * 1: Unit + * + * Return Value: + * None + * + * Example: + * [dummy, player] call ace_rearm_fnc_grabAmmo + * + * Public: No + */ +#include "script_component.hpp" + +params ["_dummy", "_unit"]; + +REARM_HOLSTER_WEAPON +[_unit, QGVAR(vehRearm), true] call EFUNC(common,setForceWalkStatus); + +[ + 5, + [_dummy, _unit], + { + private ["_actionID"]; + params ["_args"]; + _args params ["_dummy", "_unit"]; + [_dummy, _unit] call FUNC(pickUpAmmo); + + _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + if (_actionID != -1) then { + _unit removeAction _actionID; + }; + _actionID = _unit addAction [ + format ["%1", localize ELSTRING(dragging,Drop)], + '(_this select 0) call FUNC(dropAmmo)', + nil, + 20, + false, + true, + "", + '!isNull (_target getVariable [QGVAR(dummy), objNull])' + ]; + _unit setVariable [QGVAR(ReleaseActionID), _actionID]; + }, + "", + localize LSTRING(GrabAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_handleKilled.sqf b/addons/rearm/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..b0cdabaed5 --- /dev/null +++ b/addons/rearm/functions/fnc_handleKilled.sqf @@ -0,0 +1,23 @@ +/* + * Author: GitHawk, Jonpas + * Handles medical on set dead event. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [unit] call ace_rearm_fnc_handleKilled + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (!local _unit) exitWith {}; + +_unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; +[_unit, false, false] call FUNC(dropAmmo); diff --git a/addons/rearm/functions/fnc_handleUnconscious.sqf b/addons/rearm/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..f9d703f4ec --- /dev/null +++ b/addons/rearm/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,23 @@ +/* + * Author: GitHawk, Jonpas + * Handles medical on unconscious event. + * + * Arguments: + * 0: Unit + * 1: Is Unconscious + * + * Return Value: + * None + * + * Example: + * [unit] call ace_rearm_fnc_handleUnconscious + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_isUnconscious"]; + +if (!local _unit || {!_isUnconscious}) exitWith {}; + +[_unit, false, false] call FUNC(dropAmmo); diff --git a/addons/rearm/functions/fnc_makeDummy.sqf b/addons/rearm/functions/fnc_makeDummy.sqf new file mode 100644 index 0000000000..97ab46fdbc --- /dev/null +++ b/addons/rearm/functions/fnc_makeDummy.sqf @@ -0,0 +1,23 @@ +/* + * Author: GitHawk + * Make a dummy object by disabling collision and turning it. + * + * Arguments: + * 0: Object + * 1: Vector dirAndUp + * + * Return Value: + * None + * + * Example: + * [dummy, [[1,0,0],[0,0,1]]] call ace_rearm_fnc_makeDummy + * + * Public: No + */ +#include "script_component.hpp" + +params ["_obj", "_dirAndUp"]; + +_obj setVectorDirAndUp _dirAndUp; +_obj allowDamage false; +player disableCollisionWith _obj; diff --git a/addons/rearm/functions/fnc_moduleRearmSettings.sqf b/addons/rearm/functions/fnc_moduleRearmSettings.sqf new file mode 100644 index 0000000000..ec5edd1666 --- /dev/null +++ b/addons/rearm/functions/fnc_moduleRearmSettings.sqf @@ -0,0 +1,26 @@ +/* + * Author: GitHawk + * Module for adjusting the refuel settings. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example; + * function = "ace_rearm_fnc_moduleRearmSettings" + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic", "", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(level), "level"] call EFUNC(common,readSettingFromModule); + +diag_log text format ["[ACE]: Rearm Module Initialized on level: %1", GVAR(level)]; diff --git a/addons/rearm/functions/fnc_pickUpAmmo.sqf b/addons/rearm/functions/fnc_pickUpAmmo.sqf new file mode 100644 index 0000000000..eaaa55ade6 --- /dev/null +++ b/addons/rearm/functions/fnc_pickUpAmmo.sqf @@ -0,0 +1,31 @@ +/* + * Author: GitHawk + * Starts progress bar for picking up a specific kind of magazine from the ground. + * + * Arguments: + * 0: Ammo Dummy + * 1: Unit + * + * Return Value: + * None + * + * Example: + * [target, player] call ace_rearm_fnc_pickUpAmmo + * + * Public: No + */ +#include "script_component.hpp" + +private ["_magazineClass"]; +params ["_target", "_unit"]; + +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if !(isNull _dummy) exitWith {}; + +//_target attachTo [_unit, [0,0.7,0], "pelvis"]; +_target attachTo [_unit, [0,1,0], "pelvis"]; +{ + [[_target, [[-1,0,0],[0,0,1]]], QFUNC(makeDummy), _x] call EFUNC(common,execRemoteFnc); +} count (position _unit nearObjects ["CAManBase", 100]); +_unit setVariable [QGVAR(dummy), _target]; +//_unit setVariable [QEGVAR(dragging,isCarrying), true, true]; // breaks things, since it hides interact menu on _target diff --git a/addons/rearm/functions/fnc_rearm.sqf b/addons/rearm/functions/fnc_rearm.sqf new file mode 100644 index 0000000000..3208dbfb6f --- /dev/null +++ b/addons/rearm/functions/fnc_rearm.sqf @@ -0,0 +1,75 @@ +/* + * Author: GitHawk + * Starts progress bar for rearming a vehicle. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_rearm_fnc_rearm + * + * Public: No + */ +#include "script_component.hpp" + +private ["_magazineClass", "_ammo", "_tmpCal", "_cal", "_idx", "_needRearmMags", "_magazineDisplayName"]; +params ["_unit"]; + +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if (isNull _dummy) exitwith {false}; +_magazineClass = _dummy getVariable QGVAR(magazineClass); +if (isNil "_magazineClass") exitWith {false}; + +_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber"); +_cal = 8; +if (_tmpCal > 0) then { + _cal = _tmpCal; +} else { + _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber)); + if (_tmpCal > 0) then { + _cal = _tmpCal; + } else { + diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)]; + if (_ammo isKindOf "BulletBase") then { + _cal = 8; + } else { + _cal = 100; + }; + }; +}; +_cal = round _cal; +_idx = REARM_CALIBERS find _cal; +if (_idx == -1) then { + _idx = 2; +}; + +// Get magazines that can be rearmed +_needRearmMags = [_target, _magazineClass] call FUNC(getNeedRearmMagazines); +_needRearmMags params ["_needRearm", "_turretPath", "_cnt"]; + +// Exit if no magazines need rearming +if (!_needRearm) exitWith { + diag_log format ["[ACE] ERROR: Could not find turret for %1 in %2", _magazineClass, typeOf _target]; +}; + +//hint format ["Magazine: %1\nAmmo: %2\nCaliber: %3\nIndex: %4\nTurretPath: %5\nREARM_DURATION_REARM: %6\nCount: %7", _magazine, _ammo, _cal, _idx, _turretPath, (REARM_DURATION_REARM select _idx), (REARM_COUNT select _idx)]; + +_magazineDisplayName = getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"); +if (_magazineDisplayName == "") then { + _magazineDisplayName = _magazineClass; + diag_log format ["[ACE] ERROR: Magazine is missing display name [%1]", _magazineClass]; +}; + +[ + (REARM_DURATION_REARM select _idx), + [_target, _unit, _turretPath, _cnt, _magazineClass, (REARM_COUNT select _idx)], + FUNC(rearmSuccess), + "", + format [localize LSTRING(RearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName"), _magazineDisplayName], + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_rearmEntireVehicle.sqf b/addons/rearm/functions/fnc_rearmEntireVehicle.sqf new file mode 100644 index 0000000000..c1c08dce52 --- /dev/null +++ b/addons/rearm/functions/fnc_rearmEntireVehicle.sqf @@ -0,0 +1,30 @@ +/* + * Author: GitHawk + * Starts progress bar for rearming an entire vehicle. + * + * Arguments: + * 0: Ammo Truck + * 1: Unit + * 2: Vehicle to be armed + * + * Return Value: + * None + * + * Example: + * [ammo_truck, player, tank] call ace_rearm_fnc_rearmEntireVehicle + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_unit", "_vehicle"]; // _target is for future possible finite ammo, _unit placeholder + +[ + 10, + _vehicle, + FUNC(rearmEntireVehicleSuccess), + "", + format [localize LSTRING(BasicRearmAction), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf new file mode 100644 index 0000000000..cddce3ac3a --- /dev/null +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccess.sqf @@ -0,0 +1,33 @@ +/* + * Author: GitHawk + * Rearm an entire vehicle. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [tank] call ace_rearm_fnc_rearmEntireVehicleSuccess + * + * Public: No + */ +#include "script_component.hpp" + +private ["_turretPath", "_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"]; +params ["_vehicle"]; + +if (isServer) then { + { + _turretOwnerID = _vehicle turretOwner _x; + if (_turretOwnerID == 0) then { + [[_vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), _target] call EFUNC(common,execRemoteFnc); + } else { + EGVAR(common,remoteFnc) = [[_vehicle, _x], QFUNC(rearmEntireVehicleSuccessLocal), 0]; + _turretOwnerID publicVariableClient QEGVAR(common,remoteFnc); + }; + } count REARM_TURRET_PATHS; +} else { + [_this, QFUNC(rearmEntireVehicleSuccess), 1] call EFUNC(common,execRemoteFnc); +}; diff --git a/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf new file mode 100644 index 0000000000..962ffa4c0a --- /dev/null +++ b/addons/rearm/functions/fnc_rearmEntireVehicleSuccessLocal.sqf @@ -0,0 +1,48 @@ +/* + * Author: GitHawk + * Rearm an entire turret locally. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [tank, [0]] call ace_rearm_fnc_rearmEntireVehicleSuccessLocal + * + * Public: No + */ +#include "script_component.hpp" + +private ["_magazines", "_magazine", "_currentMagazines", "_maxMagazines", "_maxRounds", "_currentRounds"]; +params ["_vehicle", "_turretPath"]; + +_magazines = []; +if (_turretPath isEqualTo [-1]) then { + _magazines = [_vehicle, _turretPath] call FUNC(getConfigMagazines); +} else { + _magazines = _vehicle magazinesTurret _turretPath; +}; +{ + _magazine = _x; + _currentMagazines = { _x == _magazine } count (_vehicle magazinesTurret _turretPath); + _maxMagazines = [_vehicle, _turretPath, _magazine] call FUNC(getMaxMagazines); + _maxRounds = getNumber (configFile >> "CfgMagazines" >> _magazine >> "count"); + _currentRounds = _vehicle magazineTurretAmmo [_magazine, _turretPath]; + + TRACE_7("Rearmed Turret",_vehicle,_turretPath,_currentMagazines,_maxMagazines,_currentRounds,_maxRounds,_magazine); + + if (_turretPath isEqualTo [-1] && _currentMagazines == 0) then { + // On driver, the empty magazine is still there, but is not returned by magazinesTurret + _currentMagazines = _currentMagazines + 1; + }; + if (_currentMagazines < _maxMagazines) then { + _vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath]; + for "_idx" from 1 to (_maxMagazines - _currentMagazines) do { + _vehicle addMagazineTurret [_magazine, _turretPath]; + }; + } else { + _vehicle setMagazineTurretAmmo [_magazine, _maxRounds, _turretPath]; + }; +} foreach _magazines; diff --git a/addons/rearm/functions/fnc_rearmSuccess.sqf b/addons/rearm/functions/fnc_rearmSuccess.sqf new file mode 100644 index 0000000000..7c9b151a39 --- /dev/null +++ b/addons/rearm/functions/fnc_rearmSuccess.sqf @@ -0,0 +1,44 @@ +/* + * Author: GitHawk + * Rearms a vehicle. + * + * Arguments: + * 0: Params + * 0: Target + * 1: Unit + * 2: Turret Path + * 3: Number of magazines + * 4: Magazine Classname + * 5: Number of rounds + * + * Return Value: + * None + * + * Example: + * [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccess + * + * Public: No + */ +#include "script_component.hpp" + +private ["_dummy", "_weaponSelect", "_turretOwnerID"]; +params ["_args"]; +_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"]; + +//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5", _target, _turretPath, _numMagazines, _magazineClass, _numRounds]; + +if (local _unit) then { + [_unit, true, true] call FUNC(dropAmmo); +}; + +if (isServer) then { + _turretOwnerID = _target turretOwner _turretPath; + if (_turretOwnerID == 0) then { + [_this, QFUNC(rearmSuccessLocal), _target] call EFUNC(common,execRemoteFnc); + } else { + EGVAR(common,remoteFnc) = [_this, QFUNC(rearmSuccessLocal), 0]; + _turretOwnerID publicVariableClient QEGVAR(common,remoteFnc); + }; +} else { + [_this, QFUNC(rearmSuccess), 1] call EFUNC(common,execRemoteFnc); +}; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf new file mode 100644 index 0000000000..f869690808 --- /dev/null +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -0,0 +1,82 @@ +/* + * Author: GitHawk + * Rearms a vehicle on the turret owner. + * + * Arguments: + * 0: Params + * 0: Target + * 1: Unit + * 2: Turret Path + * 3: Number of magazines + * 4: Magazine Classname + * 5: Number of rounds + * + * Return Value: + * None + * + * Example: + * [[vehicle, player, [-1], 2, "5000Rnd_762x51_Belt", 500]] call ace_rearm_fnc_rearmSuccess + * + * Public: No + */ +#include "script_component.hpp" + +private ["_rounds", "_currentRounds", "_maxMagazines", "_dummy", "_weaponSelect"]; +params ["_args"]; +_args params ["_target", "_unit", "_turretPath", "_numMagazines", "_magazineClass", "_numRounds"]; + +//hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMagazine: %4\nNumRounds: %5\nUnit: %6", _target, _turretPath, _numMagazines, _magazineClass, _numRounds, _unit]; + +_rounds = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "count"); +_currentRounds = 0; + +_maxMagazines = [_target, _turretPath, _magazineClass] call FUNC(getMaxMagazines); +if (_maxMagazines == 1) then { + if (GVAR(level) == 1) then { + // Fill magazine completely + _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds, + getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + } else { + // Fill only at most _numRounds + _target setMagazineTurretAmmo [_magazineClass, ((_target magazineTurretAmmo [_magazineClass, _turretPath]) + _numRounds) min _rounds, _turretPath]; + ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds, + getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + }; +} else { + for "_idx" from 1 to _maxMagazines do { + _currentRounds = _target magazineTurretAmmo [_magazineClass, _turretPath]; + if (_currentRounds > 0) exitWith { + if (GVAR(level) == 2) then { + //hint format ["Target: %1\nTurretPath: %2\nNumMagazines: %3\nMaxMagazines %4\nMagazine: %5\nNumRounds: %6\nMagazine: %7", _target, _turretPath, _numMagazines, _maxMagazines, _currentRounds, _numRounds, _magazineClass]; + // Fill only at most _numRounds + if ((_currentRounds + _numRounds) > _rounds) then { + _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + if (_numMagazines < _maxMagazines) then { + _target addMagazineTurret [_magazineClass, _turretPath]; + _target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds - _rounds, _turretPath]; + }; + } else { + _target setMagazineTurretAmmo [_magazineClass, _currentRounds + _numRounds, _turretPath]; + }; + ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _numRounds, + getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + } else { + // Fill current magazine completely and fill next magazine partially + _target setMagazineTurretAmmo [_magazineClass, _rounds, _turretPath]; + if (_numMagazines < _maxMagazines) then { + _target addMagazineTurret [_magazineClass, _turretPath]; + _target setMagazineTurretAmmo [_magazineClass, _currentRounds, _turretPath]; + }; + ["displayTextStructured", [_unit], [[LSTRING(Hint_RearmedTriple), _rounds, + getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), + getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], 3, _unit]] call EFUNC(common,targetEvent); + }; + }; + _target removeMagazineTurret [_magazineClass, _turretPath]; + _numMagazines = _numMagazines - 1; + }; +}; diff --git a/addons/rearm/functions/fnc_storeAmmo.sqf b/addons/rearm/functions/fnc_storeAmmo.sqf new file mode 100644 index 0000000000..e23efe0d7c --- /dev/null +++ b/addons/rearm/functions/fnc_storeAmmo.sqf @@ -0,0 +1,34 @@ +/* + * Author: GitHawk + * Stores ammo in an ammo truck. + * + * Arguments: + * 0: Target + * 1: Unit + * + * Return Value: + * None + * + * Example: + * [player, dummy] call ace_rearm_fnc_storeAmmo + * + * Public: No + */ +#include "script_component.hpp" + +private "_dummy"; +params ["_target", "_unit"]; + +_dummy = _unit getVariable [QGVAR(dummy), objNull]; +if (isNull _dummy) exitwith {}; + + +[ + 5, + _unit, + {params ["_unit"]; [_unit, true, true] call FUNC(dropAmmo)}, + "", + format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_dummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _target) >> "displayName")], + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_takeAmmo.sqf b/addons/rearm/functions/fnc_takeAmmo.sqf new file mode 100644 index 0000000000..4f3ef7c9ef --- /dev/null +++ b/addons/rearm/functions/fnc_takeAmmo.sqf @@ -0,0 +1,61 @@ +/* + * Author: GitHawk + * Starts progress bar for picking up a specific kind of magazine from an ammo truck. + * + * Arguments: + * 0: Ammo Truck + * 1: Unit + * 2: Params + * 0: Magazine Classname + * 1: Vehicle to be armed + * + * Return Value: + * None + * + * Example: + * [ammo_truck, player, ["500Rnd_127x99_mag_Tracer_Red", tank]] call ace_rearm_fnc_takeAmmo + * + * Public: No + */ +#include "script_component.hpp" + +private ["_ammo", "_tmpCal", "_cal", "_idx"]; + +params ["_target", "_unit", "_args"]; +_args params ["_magazineClass", "_vehicle"]; + +_ammo = getText (configFile >> "CfgMagazines" >> _magazineClass >> "ammo"); +_tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_caliber"); +_cal = 8; +if (_tmpCal > 0) then { + _cal = _tmpCal; +} else { + _tmpCal = getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(caliber)); + if (_tmpCal > 0) then { + _cal = _tmpCal; + } else { + diag_log format ["[ACE] ERROR: Undefined Ammo [%1 : %2]", _ammo, inheritsFrom (configFile >> "CfgAmmo" >> _ammo)]; + if (_ammo isKindOf "BulletBase") then { + _cal = 8; + } else { + _cal = 100; + }; + }; +}; +_cal = round _cal; +_idx = REARM_CALIBERS find _cal; +if (_idx == -1 ) then { + _idx = 2; +}; + +REARM_HOLSTER_WEAPON + +[ + (REARM_DURATION_TAKE select _idx), + [_unit, _magazineClass, _target], + FUNC(takeSuccess), + "", + format [localize LSTRING(TakeAction), getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")], + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf new file mode 100644 index 0000000000..952cfdee08 --- /dev/null +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -0,0 +1,39 @@ +/* + * Author: GitHawk + * Takes a magazine from an ammo truck. + * + * Arguments: + * 0: Params + * 0: Unit + * 1: Magazine Classname + * 2: Ammo Truck + * + * Return Value: + * None + * + * Example: + * [[player, "500Rnd_127x99_mag_Tracer_Red"]] call ace_rearm_fnc_takeSuccess + * + * Public: No + */ +#include "script_component.hpp" + +private ["_ammo", "_dummyName", "_dummy", "_actionID"]; +params ["_args"]; +_args params ["_unit", "_magazineClass", "_target"]; // _target is for future possible finite ammo + +[_unit, QGVAR(vehRearm), true] call EFUNC(common,setForceWalkStatus); +_dummy = [_unit, _magazineClass] call FUNC(createDummy); +[_dummy, _unit] call FUNC(pickUpAmmo); + +_actionID = _unit addAction [ + format ["%1", localize ELSTRING(dragging,Drop)], + '(_this select 0) call FUNC(dropAmmo)', + nil, + 20, + false, + true, + "", + '!isNull (_target getVariable [QGVAR(dummy), objNull])' +]; +_unit setVariable [QGVAR(ReleaseActionID), _actionID]; diff --git a/addons/rearm/functions/script_component.hpp b/addons/rearm/functions/script_component.hpp new file mode 100644 index 0000000000..515b56ddc7 --- /dev/null +++ b/addons/rearm/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\rearm\script_component.hpp" diff --git a/addons/rearm/script_component.hpp b/addons/rearm/script_component.hpp new file mode 100644 index 0000000000..e90e87a422 --- /dev/null +++ b/addons/rearm/script_component.hpp @@ -0,0 +1,31 @@ +#define COMPONENT rearm +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_REARM + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_REARM + #define DEBUG_SETTINGS DEBUG_SETTINGS_REARM +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + + +#define REARM_ACTION_DISTANCE 7 +#define REARM_TURRET_PATHS [[-1], [0], [0,0], [0,1], [1], [2], [0,2]] + +#define REARM_CALIBERS [ 6, 7, 8, 13, 19, 20, 25, 30, 35, 39, 40, 60, 70, 80, 82, 100, 105, 120, 122, 125, 155, 230, 250] +#define REARM_DURATION_TAKE [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 4, 5, 5, 5, 5, 13, 10] +#define REARM_DURATION_REARM [ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 7, 7, 7, 7, 7, 8, 10, 10, 10, 10, 27, 20] +#define REARM_COUNT [500, 500, 400, 100, 50, 50, 40, 25, 34, 24, 10, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1] + + +#define REARM_HOLSTER_WEAPON \ + _unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \ + _unit action ["SwitchWeapon", _unit, _unit, 99]; + +#define REARM_UNHOLSTER_WEAPON \ + _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \ + _unit selectWeapon _weaponSelect; \ + _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; diff --git a/addons/rearm/stringtable.xml b/addons/rearm/stringtable.xml new file mode 100644 index 0000000000..bbc7c36302 --- /dev/null +++ b/addons/rearm/stringtable.xml @@ -0,0 +1,230 @@ + + + + + Rearm Settings + Aufmunitioniereinstellungen + Ustawienia przezbrajania + Настройки перевооружения + Ajustes de rearme + + + This module allows you to tweak rearm system settings. + Mittels diesem Modul kann das Aufmunitioniersystem angepasst werden. + Ten moduł pozwala dostosować ustawienia przezbrajania. + Этот модуль позволяет изменить настройки системы перевооружения. + Este módulo permite que você ajuste o sistema de rearme. + + + Rearm Amount + Aufmunitioniermenge + Szybkość przezbrajania + Количество вооружения + Quantidade de rearme + + + How fast should a vehicle be rearmed? + Wie schnell soll ein Fahrzeug aufmunitioniert werden? + Jak szybko pojazd zostanie przezbrojony? + Как быстро техника должна перевооружаться? + Quão rápido o veículo deve ser rearmado? + + + Entire Vehicle + Gesamtes Fahrzeug + Cały pojazd + Полностью техника + Todo o veículo + + + Entire Magazine + Gesamtes Magazin + Cały magazynek + Полный магазин + Todo o carregador + + + Amount based on caliber + Kaliberbasierte Anzahl + Ilość zależna od kalibru + Количество зависит от калибра + Quantidade baseada no calibre + + + Rearm + Aufmunitionieren + Przezbrój + Перевооружить + Rearmar + + + Rearming %1 with %2 ... + Munitioniere %1 auf mit %2 ... + Przezbrajanie %1 przy pomocy %2 ... + Перевооружается %1 снарядами %2 ... + Rearmando %1 com %2 ... + + + Rearming %1 ... + Munitioniere %1 auf ... + Przezbrajanie %1 ... + Перевооружается %1 ... + Rearmando %1 ... + + + Taking %1 for %2 ... + Nehme %1 für %2 ... + Pobieranie %1 dla %2 ... + Забираем %1 для %2 ... + Pegando %1 para %2 ... + + + Take ammo + Munition nehmen + Pobierz amunicję + Взять боекомплект + Tomar munição + + + Pick up ammo + Munition aufnehmen + Podnieś amunicję + Поднять боекомплект + Pegar munição + + + Store ammo + Munition verstauen + Przechowaj amunicję + Сохранить боекомплект + Guardar munição + + + Storing %1 in %2 ... + Verstaue %1 in %2 ... + Przechowywanie %1 w %2 ... + Сохраняется %1 в %2 ... + Guardando %1 em %2 ... + + + Picking up ammo ... + Nehme Munition ... + Podnoszenie amunicji ... + Поднятие боекомплекта ... + Pegando munição ... + + + Rearmed %1 rounds of %2 on %3 + %3 wurde mit %1 Patronen %2 aufmunitioniert + Przezbrojono %1 pocisków %2 na %3 + Перевооружено %1 снарядов %2 на %3 + Rearmando %1 cartuchos de %2 em %3 + + + Smoke Screen + Kouřová clona + Écran de fumée + Rauchwand + Cortina fumogena + Zasłona dymna + Cortina de fumaça + Дым. завеса + Pantalla de humo + + + Flares + Světlice + Fusées + Leuchtkörper + Razzi luminosi + Flary + Sinalizadores + ЛТЦ + Bengalas + + + 30mm HEI + 30mm HEI + 30mm HEI + 30мм ОФЗ + 30mm HEI + + + 30mm HEI-T + 30mm HEI-T + 30mm HEI-T + 30мм ОФЗТ + 30mm HEI-T + + + AIM-9 Sidewinder + AIM-9 Sidewinder + AIM-9 Sidewinder + AIM-9 Sidewinder + AIM-9 Sidewinder + + + Wympel R-73 + Wympel R-73 + Wympel R-73 + Р-73 (Вымпел) + Wympel R-73 + + + AGM-65 Maverick + AGM-65 Maverick + AGM-65 Maverick + AGM-65 Maverick + AGM-65 Maverick + + + Kh-25MTP + Kh-25MTP + Ch-25MTP + Х-25МТП + Ch-25MTP + + + Hydra 70 HE + Hydra 70 HE + Hydra 70 HE + Hydra 70 HE + Hydra 70 HE + + + S-8 HE + S-8 HE + S-8 HE + С-8 ОФ + S-8 HE + + + Hydra 70 AP + Hydra 70 AP + Hydra 70 AP + Hydra 70 AP + Hydra 70 AP + + + S-8 AP + S-8 AP + S-8 AP + С-8КОМ + S-8 AP + + + GBU-12 + GBU-12 + GBU-12 + GBU-12 + GBU-12 + + + FAB-250M-54 + FAB-250M-54 + FAB-250M-54 + ФАБ-250М-54 + FAB-250M-54 + + + diff --git a/addons/rearm/ui/icon_module_rearm.paa b/addons/rearm/ui/icon_module_rearm.paa new file mode 100644 index 0000000000..173e3eaff7 Binary files /dev/null and b/addons/rearm/ui/icon_module_rearm.paa differ diff --git a/addons/rearm/ui/icon_rearm_interact.paa b/addons/rearm/ui/icon_rearm_interact.paa new file mode 100644 index 0000000000..fe2a9a1235 Binary files /dev/null and b/addons/rearm/ui/icon_rearm_interact.paa differ diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index 806d48760b..a8e1af75d9 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -1,7 +1,21 @@ -// TMR: Small Arms - Recoil initialization and functions -// (C) 2013 Ryan Schultz. See LICENSE. -// Edited prefixes for compatability in AGM_Realism by KoffeinFlummi -// Edited by commy2 +/* + * Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2 + * Adds camera shake when firing + * From TMR: Small Arms + * + * Arguments: + * 0: Unit + * 1: Weapon + * 3: Muzzle + * + * Return Value: + * Nothing + * + * Example: + * [player, (currentWeapon player), (currentMuzzle player)] call ace_recoil_fnc_camShake; + * + * Public: No + */ #include "script_component.hpp" #define BASE_POWER 0.40 @@ -9,59 +23,53 @@ #define BASE_FREQ 13 #define RECOIL_COEF 40 -private ["_unit", "_weapon", "_muzzle"]; - -_unit = _this select 0; -_weapon = _this select 1; -_muzzle = _this select 2; +params ["_unit", "_weapon", "_muzzle"]; if (toLower _weapon in ["throw", "put"]) exitWith {}; -private ["_powerMod", "_timeMod", "_freqMod"]; - -_powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); -_timeMod = 0; -_freqMod = 0; +private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); // to get camshake read kickback -private ["_config", "_recoil"]; +private _recoil = missionNamespace getVariable format [QGVAR(%1-%2), _weapon, _muzzle]; -_config = configFile >> "CfgWeapons" >> _weapon; -_recoil = if (_muzzle == _weapon) then { - getText (_config >> "recoil") -} else { - getText (_config >> _muzzle >> "recoil") -}; +if (isNil "_recoil") then { + private _config = configFile >> "CfgWeapons" >> _weapon; -if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { - _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); - if (count _recoil < 2) then { + if (_muzzle == _weapon) then { + _recoil = getText (_config >> "recoil") + } else { + _recoil = getText (_config >> _muzzle >> "recoil") + }; + + if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { + _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); + if (count _recoil < 2) then { + _recoil = [0, 0]; + }; + } else { _recoil = [0, 0]; }; -} else { - _recoil = [0, 0]; + + TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil); + + // parse numbers + _recoil set [0, call compile format ["%1", _recoil select 0]]; + _recoil set [1, call compile format ["%1", _recoil select 1]]; + + missionNamespace setVariable [format [QGVAR(%1-%2), _weapon, _muzzle], _recoil]; }; -// parse numbers -_recoil set [0, call compile format ["%1", _recoil select 0]]; -_recoil set [1, call compile format ["%1", _recoil select 1]]; - -private "_powerCoef"; -_powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; +private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; -private "_camshake"; -_camshake = [ +private _camshake = [ _powerCoef * (BASE_POWER + _powerMod) max 0, - BASE_TIME + _timeMod max 0, - BASE_FREQ + _freqMod max 0 + BASE_TIME, + BASE_FREQ ]; -/* - systemChat str _camshake; - copyToClipboard format ["addCamShake %1;", _camshake]; -*/ +TRACE_4("addCamShake",_recoil,_powerCoef,_powerMod,_camshake);\ addCamShake _camshake; diff --git a/addons/refuel/$PBOPREFIX$ b/addons/refuel/$PBOPREFIX$ new file mode 100644 index 0000000000..2a68bfaf74 --- /dev/null +++ b/addons/refuel/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\refuel \ No newline at end of file diff --git a/addons/refuel/ACE_Settings.hpp b/addons/refuel/ACE_Settings.hpp new file mode 100644 index 0000000000..0ae0accaad --- /dev/null +++ b/addons/refuel/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(rate) { + displayName = CSTRING(RefuelSettings_speed_DisplayName); + description = CSTRING(RefuelSettings_speed_Description); + value = 1; + typeName = "SCALAR"; + }; +}; diff --git a/addons/refuel/CfgEventHandlers.hpp b/addons/refuel/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f1a9f1a3c8 --- /dev/null +++ b/addons/refuel/CfgEventHandlers.hpp @@ -0,0 +1,27 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(call COMPILE_FILE(XEH_respawn)); + }; + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call FUNC(handleKilled)); + }; + }; +}; \ No newline at end of file diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp new file mode 100644 index 0000000000..ff91205434 --- /dev/null +++ b/addons/refuel/CfgVehicles.hpp @@ -0,0 +1,631 @@ +#define MACRO_REFUEL_ACTIONS \ + class ACE_Actions: ACE_Actions { \ + class ACE_MainActions: ACE_MainActions { \ + class GVAR(Refuel) { \ + displayName = CSTRING(Refuel); \ + distance = REFUEL_ACTION_DISTANCE; \ + condition = "true"; \ + statement = ""; \ + showDisabled = 0; \ + priority = 2; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + class GVAR(TakeNozzle) { \ + displayName = CSTRING(TakeNozzle); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeNozzle)); \ + statement = QUOTE([ARR_3(_player,_target,objNull)] call FUNC(TakeNozzle)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(CheckFuelCounter) { \ + displayName = CSTRING(CheckFuelCounter); \ + condition = "true"; \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(readFuelCounter)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(CheckFuel) { \ + displayName = CSTRING(CheckFuel); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckFuel)); \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkFuel)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(Connect) { \ + displayName = CSTRING(Connect); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canConnectNozzle)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(connectNozzle)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(Return) { \ + displayName = CSTRING(Return); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canReturnNozzle)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(returnNozzle)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + }; \ + }; \ + }; + +#define MACRO_CONNECT_ACTIONS \ + class ACE_Actions { \ + class ACE_MainActions { \ + class GVAR(Refuel) { \ + displayName = CSTRING(Refuel); \ + distance = REFUEL_ACTION_DISTANCE; \ + condition = "true"; \ + statement = ""; \ + showDisabled = 0; \ + priority = 2; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + class GVAR(Connect) { \ + displayName = CSTRING(Connect); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canConnectNozzle)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(connectNozzle)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + }; \ + }; \ + }; + +#define MACRO_NOZZLE_ACTIONS \ + class ACE_Actions { \ + class ACE_MainActions { \ + displayName = CSTRING(Refuel); \ + distance = REFUEL_ACTION_DISTANCE; \ + condition = "true"; \ + statement = ""; \ + showDisabled = 0; \ + priority = 2; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + class GVAR(PickUpNozzle) { \ + displayName = CSTRING(TakeNozzle); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeNozzle)); \ + statement = QUOTE([ARR_3(_player,objNull,_target)] call FUNC(TakeNozzle)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(TurnOn) { \ + displayName = CSTRING(TurnOn); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTurnOn)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(turnOn)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(TurnOff) { \ + displayName = CSTRING(TurnOff); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTurnOff)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(turnOff)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + class GVAR(Disconnect) { \ + displayName = CSTRING(Disconnect); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDisconnect)); \ + statement = QUOTE([ARR_2(_player,_target)] call DFUNC(disconnect)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ + }; \ + }; + +class CfgVehicles { + class ACE_Module; + class ACE_moduleRefuelSettings : ACE_Module { + scope = 2; + displayName = CSTRING(RefuelSettings_Module_DisplayName); + icon = QUOTE(PATHTOF(ui\icon_module_refuel.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleRefuelSettings); + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class rate { + displayName = CSTRING(RefuelSettings_speed_DisplayName); + description = CSTRING(RefuelSettings_speed_Description); + typeName = "NUMBER"; + defaultValue = 10; + }; + }; + }; + + class ThingX; + class ACE_refuel_fuelNozzle : ThingX { + XEH_ENABLED; + MACRO_NOZZLE_ACTIONS + displayName = QGVAR(fuelNozzle); + scope = 1; + scopeCurator = 1; + model = "\A3\Structures_F_Heli\VR\Helpers\Sign_sphere10cm_F.p3d"; + }; + + class All; + + class Static : All {}; + + class Building : Static {}; + + class NonStrategic : Building {}; + + class HouseBase: NonStrategic {}; + + class House: HouseBase {}; + + class House_F : House {}; + + class House_Small_F : House_F { + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + selection = ""; + distance = 10; + condition = "true"; + }; + }; + }; + + class AllVehicles : All { + GVAR(flowRate) = 1; + }; + class Land : AllVehicles {}; + class LandVehicle : Land {}; + class Car : LandVehicle { + MACRO_CONNECT_ACTIONS + }; + + class Tank : LandVehicle { + MACRO_CONNECT_ACTIONS + GVAR(flowRate) = 4; + }; + + class StaticWeapon : LandVehicle { + MACRO_CONNECT_ACTIONS + }; + + class Air : AllVehicles { + GVAR(flowRate) = 8; + }; + + class Helicopter : Air { + MACRO_CONNECT_ACTIONS + GVAR(fuelCapacity) = 1500; + }; + + class Helicopter_Base_F : Helicopter {}; + + class Helicopter_Base_H : Helicopter_Base_F { + GVAR(fuelCapacity) = 3000; + }; + + class Plane : Air { + MACRO_CONNECT_ACTIONS + GVAR(fuelCapacity) = 2000; + GVAR(flowRate) = 16; + }; + + class Plane_Base_F : Plane {}; + + class Ship : AllVehicles {}; + + class Ship_F : Ship { + MACRO_CONNECT_ACTIONS + GVAR(fuelCapacity) = 2000; + GVAR(flowRate) = 4; + }; + + class Boat_Civil_01_base_F : Ship_F { + GVAR(fuelCapacity) = 200; + }; + + class Boat_F : Ship_F { + GVAR(flowRate) = 1; + }; + + class Boat_Armed_01_base_F : Boat_F { + GVAR(fuelCapacity) = 300; + }; + class Rubber_duck_base_F : Boat_F { + GVAR(fuelCapacity) = 30; + }; + class SDV_01_base_F : Boat_F { + // SDV is using electrical propulsion + GVAR(fuelCapacity) = 0; + }; + + class Car_F : Car { + // Assuming large vehicle tank + GVAR(fuelCapacity) = 60; + }; + + class Kart_01_Base_F : Car_F { + GVAR(fuelCapacity) = 8; + }; + + class Offroad_01_base_F: Car_F {}; + + class Wheeled_APC_F: Car_F { + // Assuming average APC tank + GVAR(fuelCapacity) = 300; + }; + + class Hatchback_01_base_F: Car_F { + // Assume normal vehicle tank + GVAR(fuelCapacity) = 50; + }; + + class Quadbike_01_base_F : Car_F { + // Assuming usual Yamaha quad + GVAR(fuelCapacity) = 10; + }; + + class MRAP_01_base_F: Car_F { + // M-ATV + // No data, assuming similar to Fennek + GVAR(fuelCapacity) = 230; + }; + + class MRAP_02_base_F: Car_F { + // Punisher + // No data, assuming similar to Fennek + GVAR(fuelCapacity) = 230; + }; + + class MRAP_03_base_F: Car_F { + // Fennek + GVAR(fuelCapacity) = 230; + }; + + class APC_Wheeled_01_base_F: Wheeled_APC_F { + // Patria = LAV + GVAR(fuelCapacity) = 269; + }; + + class Truck_F : Car_F { + GVAR(fuelCapacity) = 400; + GVAR(flowRate) = 2; + }; + + class Truck_01_base_F: Truck_F { + // HEMTT + GVAR(fuelCapacity) = 583; + }; + + class B_Truck_01_transport_F : Truck_01_base_F {}; + + class B_Truck_01_mover_F: B_Truck_01_transport_F {}; + + class Truck_02_base_F: Truck_F { + // KamAZ + // Assuming similar to Ural + GVAR(fuelCapacity) = 400; + }; + + class Truck_03_base_F: Truck_F { + // Tempest + // Assuming heavier than KamAZ + GVAR(fuelCapacity) = 600; + }; + + class Van_01_base_F : Truck_F { + // Small Truck + // Assuming 80L as in Ford Transit + GVAR(fuelCapacity) = 80; + }; + + class Van_01_fuel_base_F: Van_01_base_F { + transportFuel = 0; //1k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{0.38,-3.17,-.7},{-0.41,-3.17,-.7}}; + GVAR(fuelCargo) = 2000; + }; + + class Tank_F: Tank { + GVAR(fuelCapacity) = 1200; + }; + + class APC_Tracked_01_base_F: Tank_F { + // Namer + // Assuming Merkava fuel + GVAR(fuelCapacity) = 1400; + }; + + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{-1.08,-4.81,-.8}}; + GVAR(fuelCargo) = 1000; + }; + + class APC_Tracked_02_base_F : Tank_F { + // BM-2T + // Assuming 1 L/km + GVAR(fuelCapacity) = 1000; + }; + + class APC_Tracked_03_base_F: Tank_F { + // FV 510 + // Assuming 1 L/km + GVAR(fuelCapacity) = 660; + }; + + class MBT_01_base_F: Tank_F { + // Merkava IV + GVAR(fuelCapacity) = 1400; + }; + + class MBT_02_base_F: Tank_F { + // T100 Black Eagle + // Assuming T80 + GVAR(fuelCapacity) = 1100; + }; + + class MBT_03_base_F: Tank_F { + // Leopard + GVAR(fuelCapacity) = 1160; + }; + + class MBT_01_arty_base_F : MBT_01_base_F { + // Assuming similar 2S3 + GVAR(fuelCapacity) = 830; + }; + + class MBT_02_arty_base_F : MBT_02_base_F { + // Assuming similar 2S3 + GVAR(fuelCapacity) = 830; + }; + + class Heli_Attack_01_base_F : Helicopter_Base_F { + // Commanche + }; + + class Heli_Attack_02_base_F : Helicopter_Base_F { + // Mi-48 Kajman + }; + + class Heli_Light_01_base_F : Helicopter_Base_H { + // MH-6 + GVAR(fuelCapacity) = 242; + }; + + class Heli_Light_02_base_F : Helicopter_Base_H { + // Ka-60 Kasatka + GVAR(fuelCapacity) = 1450; + }; + + class Heli_light_03_base_F : Helicopter_Base_F { + // AW159 + GVAR(fuelCapacity) = 1004; + }; + + class Heli_Transport_01_base_F : Helicopter_Base_H { + // Ghost Hawk + // Assuming similar UH60 + GVAR(fuelCapacity) = 1360; + }; + + class Heli_Transport_02_base_F : Helicopter_Base_H { + // AW101 + GVAR(fuelCapacity) = 3222; + }; + + class Heli_Transport_03_base_F : Helicopter_Base_H { + // Chinook 47I + GVAR(fuelCapacity) = 3914; + }; + + class Heli_Transport_04_base_F : Helicopter_Base_H { + // Mi-290 Taru + GVAR(fuelCapacity) = 3914; + }; + + class Plane_CAS_01_base_F : Plane_Base_F { + // Assuming similar to A10 + GVAR(fuelCapacity) = 6223; + }; + + class Plane_CAS_02_base_F : Plane_Base_F { + // Yak-130 + GVAR(fuelCapacity) = 2099; + }; + + class UAV_01_base_F : Helicopter_Base_F { + // Darter is electrical + GVAR(fuelCapacity) = 0; + }; + + class UAV : Plane {}; + + class UAV_02_base_F : UAV { + // Assuming similar YAHBON-R2 + GVAR(fuelCapacity) = 270; + }; + + class UGV_01_base_F : Car_F { + // Stomper + GVAR(fuelCapacity) = 100; + }; + + class Plane_Fighter_03_base_F : Plane_Base_F { + // L-159 ALCA + GVAR(fuelCapacity) = 1914; + }; + + // Vanilla fuel vehicles + class Truck_02_fuel_base_F : Truck_02_base_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{0.99,-3.47,-0.67},{-1.04,-3.47,-0.67}}; + GVAR(fuelCargo) = 10000; + }; + + class B_Truck_01_fuel_F : B_Truck_01_mover_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{.28,-4.99,-.3},{-.25,-4.99,-.3}}; + GVAR(fuelCargo) = 10000; + }; + + class O_Truck_03_fuel_F : Truck_03_base_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{1.3,-1.59,-.62},{-1.16,-1.59,-.62}}; + GVAR(fuelCargo) = 10000; + }; + + class Slingload_base_F; + class Slingload_01_Base_F: Slingload_base_F { + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + selection = ""; + distance = 10; + condition = "true"; + }; + }; + }; + + class B_Slingload_01_Fuel_F : Slingload_01_Base_F { + XEH_ENABLED; + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{0.55,3.02,-0.5},{-0.52,3.02,-0.5}}; + GVAR(fuelCargo) = 10000; + }; + + class O_Heli_Transport_04_fuel_F : Heli_Transport_04_base_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{-1.52,1.14,-1.18}}; + GVAR(fuelCargo) = 10000; + }; + + class Pod_Heli_Transport_04_base_F: StaticWeapon {}; + class Land_Pod_Heli_Transport_04_fuel_F: Pod_Heli_Transport_04_base_F { + transportFuel = 0; //3k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{-1.49,1.41,-.3}}; + GVAR(fuelCargo) = 10000; + }; + + // Vanilla buildings + class Land_Fuelstation_Feed_F : House_Small_F { + XEH_ENABLED; + transportFuel = 0; //50k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{0,0,-0.5}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + + class Land_fs_feed_F : House_Small_F { + XEH_ENABLED; + transportFuel = 0; //50k + MACRO_REFUEL_ACTIONS + GVAR(hooks[]) = {{-0.4,0.022,-.23}}; + GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; + }; + + /* // Barrels found in config \ + BarrelHelper : Misc_thing 100 + BarrelBase : BarrelHelper 100 + Barrels : BarrelBase 400 + Barrel1 : BarrelBase 100 + Barrel2 : BarrelBase 100 + Barrel3 : BarrelBase 100 + Barrel4 : BarrelBase 100 + Barrel5 : BarrelBase 100 + Barrel6 : BarrelBase 100 + Wooden_barrel : BarrelBase 100 + Wooden_barrels : Wooden_barrel 400 + */ + + // Trucks + // Src: HEMTT http://www.inetres.com/gp/military/cv/eng/M977.html 583L > 483km + // Src: https://en.wikipedia.org/wiki/Heavy_Expanded_Mobility_Tactical_Truck 587L > 483km + // Src: https://en.wikipedia.org/wiki/Kamaz_Typhoon ? > 1200km + // Src: https://en.wikipedia.org/wiki/Humvee 95L + // Src: https://en.wikipedia.org/wiki/RG-33 80 gal = 302 + // Src: MTVR http://oshkoshdefense.com/wp-content/uploads/2013/08/MTVR_StndCargo_SS_6-13-11.pdf 295L + // Src: M1078 http://tarakia.weebly.com/ta-vehicles.html 219L + // Src: https://en.wikipedia.org/wiki/Ural-4320 360L + // Src: http://www.automobile-catalog.com/car/2012/1024400/gaz_233011_tigr.html 138L + // Src: https://en.wikipedia.org/wiki/UAZ-469 78L + // Src: https://en.wikipedia.org/wiki/GAZ-66 210L + + // Tracked IFV + // Src: https://en.wikipedia.org/wiki/Marder_%28IFV%29 652L > 520km + // Src: https://en.wikipedia.org/wiki/Tanque_Argentino_Mediano ~250L > 500km (200L additional tank for 400km range boost) + // Src: https://en.wikipedia.org/wiki/ACEC_Cobra 309L > 600km + // Src: https://en.wikipedia.org/wiki/Egyptian_Infantry_Fighting_Vehicle 454L > 482km + // Src: https://en.wikipedia.org/wiki/Lazika 400L > 400-450km + // Src: https://en.wikipedia.org/wiki/Type_73_Armored_Personnel_Carrier 450L > 300km + // Src: https://en.wikipedia.org/wiki/BMP-1 462L > 500-600km + // Src: http://www.inetres.com/gp/military/cv/inf/BMP-1.html 460L > 600km + // Src: http://www.inetres.com/gp/military/cv/inf/BMP-2.html 460L > 600km + // Src: http://www.inetres.com/gp/military/cv/inf/M2.html 662L > 483-402km + // Src: https://en.wikipedia.org/wiki/2T_Stalker ? > 1000km + // Src: https://en.wikipedia.org/wiki/Namer ? > 500km + // Src: https://en.wikipedia.org/wiki/Warrior_tracked_armoured_vehicle ? > 660km + // Src: http://www.globalsecurity.org/military/systems/ground/m113-specs.htm 360L + // Src: http://afvdb.50megs.com/usa/m2bradley.html 746L + // Src: https://en.wikipedia.org/wiki/BMD-1 300L + // Trend: 1-2 L/km + + // Wheeled IFV/APC + // Src: https://en.wikipedia.org/wiki/BTR-60 290L > 500km + // Src: http://www.inetres.com/gp/military/cv/inf/BTR-70.html 350L > 600km + // Src: http://www.inetres.com/gp/military/cv/inf/BTR-80.html 300L > 600km + // Src: https://en.wikipedia.org/wiki/Mowag_Piranha 4x4 200L > 700km + // Src: https://en.wikipedia.org/wiki/Mowag_Piranha 6x6 200L > 500km + // Src: https://en.wikipedia.org/wiki/ERC_90_Sagaie 242L > 700km + // Src: https://en.wikipedia.org/wiki/V%C3%A9hicule_de_l%27Avant_Blind%C3%A9 310L > 1200km + // Src: https://en.wikipedia.org/wiki/Panhard_M3 165L > 600km + // Src: https://fr.wikipedia.org/wiki/V%C3%A9hicule_blind%C3%A9_de_combat_d%27infanterie 400L > 750km + // Src: https://de.wikipedia.org/wiki/Sp%C3%A4hwagen_Fennek 230L > 460-1000km + // Src: http://www.inetres.com/gp/military/cv/inf/LAV.html 269L > 660km + // Src: http://www.inetres.com/gp/military/cv/inf/M1126.html 200L > 531km + // Src: https://en.wikipedia.org/wiki/Patria_AMV ? > 600-850km + // Src: https://en.wikipedia.org/wiki/Otokar_Arma ? > 700km + // Trend: 0.3-0.6 L/km + + // MBT + // Src: http://www.inetres.com/gp/military/cv/tank/Leopard2.html 1200L > 550km + // Src: http://www.inetres.com/gp/military/cv/tank/M1.html 1909L > 479km + // Src: https://en.wikipedia.org/wiki/T-80 1100L > 335km + // Src: https://en.wikipedia.org/wiki/T-72 1200L > 490km + // Trend: 2-4 L/km + + // Artillery + // Src: http://www.inetres.com/gp/military/cv/arty/M109.html 511L > 349km + // Src: https://en.wikipedia.org/wiki/2S3_Akatsiya 830L > 500km + + // Other + // https://en.wikipedia.org/wiki/ZSU-23-4 515L + + // Helicopter + // Src: http://www.bga-aeroweb.com/Defense/UH-1Y-Venom.html 1172kg / 0.81 kg/L = 1447L + // Src: http://www.bga-aeroweb.com/Defense/AH-1Z-Viper.html 1296kg / 0.81 kg/L = 1600L + // Src: http://www.army-technology.com/projects/black_hawk/ 1360L + // Src: http://www.bga-aeroweb.com/Defense/CH-47-Chinook.html 3914L + // Src: http://helicopters.axlegeeks.com/l/61/Boeing-AH-64-Apache 375 gal = 1420L + // Src: https://en.wikipedia.org/wiki/Mil_Mi-8 3700l + // Src: Google Ka-52 1870L + // Src: http://www.airforce-technology.com/projects/hind/ 1500kg / 0.81 kg/L = 1851L + // Src: https://en.wikipedia.org/wiki/MD_Helicopters_MH-6_Little_Bird 242L + // Src: http://www.globalsecurity.org/military/world/europe/aw159-specs.htm 1004L + // Src: https://en.wikipedia.org/wiki/AgustaWestland_AW101 3 * 1074L = 3222L + // Src: http://www.aviastar.org/helicopters_eng/ka-62.php 1450L + + // Planes + // Src: http://www.theaviationzone.com/factsheets/c130j.asp 20820kg / 0.81 kg/L = 25704L + // Src: http://www.avialogs.com/viewer/avialogs-documentviewer.php?id=3298 p29 1644 gal = 6223L + // Src: http://www.airforce-technology.com/projects/su25/ 3600L + // Src: http://www.thaitechnics.com/aircraft/L159.html 1551kg / 0.81 kg/L = 1914L + // Src: https://en.wikipedia.org/wiki/Yakovlev_Yak-130 1700kg / 0.81 kg/L = 2099L + // Src: http://www.adcom-systems.com/ENG/UAV/YAHBON-R2/Overview.html 270L +}; diff --git a/addons/refuel/README.md b/addons/refuel/README.md new file mode 100644 index 0000000000..6e3d226693 --- /dev/null +++ b/addons/refuel/README.md @@ -0,0 +1,11 @@ +ace_refuel +=============== + +The Refuel module introduces ability to refuel vehicles on different realistic levels. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [GitHawk] (https://github.com/GitHawk) +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf new file mode 100644 index 0000000000..d823fcf039 --- /dev/null +++ b/addons/refuel/XEH_postInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventHandler); diff --git a/addons/refuel/XEH_preInit.sqf b/addons/refuel/XEH_preInit.sqf new file mode 100644 index 0000000000..691df0478d --- /dev/null +++ b/addons/refuel/XEH_preInit.sqf @@ -0,0 +1,32 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(canCheckFuel); +PREP(canConnectNozzle); +PREP(canDisconnect); +PREP(canReturnNozzle); +PREP(canTakeNozzle); +PREP(canTurnOff); +PREP(canTurnOn); +PREP(checkFuel); +PREP(connectNozzle); +PREP(connectNozzleAction); +PREP(disconnect); +PREP(dropNozzle); +PREP(getFuel); +PREP(handleKilled); +PREP(handleUnconscious); +PREP(makeJerryCan); +PREP(moduleRefuelSettings); +PREP(readFuelCounter); +PREP(refuel); +PREP(reset); +PREP(resetLocal); +PREP(returnNozzle); +PREP(setFuel); +PREP(takeNozzle); +PREP(turnOff); +PREP(turnOn); + +ADDON = true; diff --git a/addons/refuel/XEH_respawn.sqf b/addons/refuel/XEH_respawn.sqf new file mode 100644 index 0000000000..39225f2521 --- /dev/null +++ b/addons/refuel/XEH_respawn.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +private ["_unit"]; + +_unit = _this select 0; + +if !(local _unit) exitWith {}; + +[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); +_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; +_unit setVariable [QGVAR(isRefueling), false]; diff --git a/addons/refuel/config.cpp b/addons/refuel/config.cpp new file mode 100644 index 0000000000..6140cefe8c --- /dev/null +++ b/addons/refuel/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_refuel_fuelNozzle"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"GitHawk"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/refuel/functions/fnc_canCheckFuel.sqf b/addons/refuel/functions/fnc_canCheckFuel.sqf new file mode 100644 index 0000000000..a1584ea333 --- /dev/null +++ b/addons/refuel/functions/fnc_canCheckFuel.sqf @@ -0,0 +1,26 @@ +/* + * Author: Jonpas, GitHawk + * Checks if unit can check fuel. + * + * Arguments: + * 0: Unit + * 1: Fuel Truck/Station + * + * Return Value: + * Can Check Fuel + * + * Example: + * [player, truck] call ace_refuel_fnc_canCheckFuel + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target"]; + +!(isNull _unit || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {!alive _target} || + {(_target distance _unit) > REFUEL_ACTION_DISTANCE} || + {(_target call FUNC(getFuel) == REFUEL_INFINITE_FUEL)}) diff --git a/addons/refuel/functions/fnc_canConnectNozzle.sqf b/addons/refuel/functions/fnc_canConnectNozzle.sqf new file mode 100644 index 0000000000..812234818e --- /dev/null +++ b/addons/refuel/functions/fnc_canConnectNozzle.sqf @@ -0,0 +1,26 @@ +/* + * Author: GitHawk + * Check if a unit can connect a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Target + * + * Return Value: + * Can Connect Nozzle + * + * Example: + * [player, tank] call ace_refuel_fnc_canConnectNozzle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_nozzle"]; +params ["_unit", "_target"]; + +_nozzle = _unit getVariable [QGVAR(nozzle), objNull]; + +!(isNull _nozzle || + {(_target distance _unit) > REFUEL_ACTION_DISTANCE} || + {!isNull (_target getVariable [QGVAR(nozzle), objNull])}) // TODO verify cant connect multiple fuel lines diff --git a/addons/refuel/functions/fnc_canDisconnect.sqf b/addons/refuel/functions/fnc_canDisconnect.sqf new file mode 100644 index 0000000000..50d22702a0 --- /dev/null +++ b/addons/refuel/functions/fnc_canDisconnect.sqf @@ -0,0 +1,29 @@ +/* + * Author: GitHawk + * Check if a unit can disconnect a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * Can disconnect + * + * Example: + * [player, nozzle] call ace_refuel_fnc_canDisconnect + * + * Public: No + */ +#include "script_component.hpp" + +private ["_sink"]; +params ["_unit", "_nozzle"]; + +if (isNull _unit || + {isNull _nozzle} || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {(_nozzle distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; + +_sink = _nozzle getVariable [QGVAR(sink), objNull]; +!((isNull _sink) || {_nozzle getVariable [QGVAR(isRefueling), false]}) diff --git a/addons/refuel/functions/fnc_canReturnNozzle.sqf b/addons/refuel/functions/fnc_canReturnNozzle.sqf new file mode 100644 index 0000000000..139c921d34 --- /dev/null +++ b/addons/refuel/functions/fnc_canReturnNozzle.sqf @@ -0,0 +1,24 @@ +/* + * Author: GitHawk + * Check if a unit can return a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Fuel truck + * + * Return Value: + * Can Return Nozzle + * + * Example: + * [player, fuelTruck] call ace_refuel_fnc_canReturnNozzle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_nozzle"]; +params ["_unit", "_target"]; + +_nozzle = _unit getVariable QGVAR(nozzle); + +(_this call FUNC(canConnectNozzle)) && {_target == (_nozzle getVariable [QGVAR(source), objNull])} diff --git a/addons/refuel/functions/fnc_canTakeNozzle.sqf b/addons/refuel/functions/fnc_canTakeNozzle.sqf new file mode 100644 index 0000000000..85f5b815a5 --- /dev/null +++ b/addons/refuel/functions/fnc_canTakeNozzle.sqf @@ -0,0 +1,27 @@ +/* + * Author: GitHawk + * Check if a unit can take a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Fuel Station or Nozzle + * + * Return Value: + * Can connect + * + * Example: + * [player, nozzle] call ace_refuel_fnc_canTakeNozzle + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target"]; + +if (isNull _unit || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {!alive _target} || + {(_target distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; + +!(_target getVariable [QGVAR(isConnected), false]) && {!(_unit getVariable [QGVAR(isRefueling), false])} diff --git a/addons/refuel/functions/fnc_canTurnOff.sqf b/addons/refuel/functions/fnc_canTurnOff.sqf new file mode 100644 index 0000000000..7d2d3652e0 --- /dev/null +++ b/addons/refuel/functions/fnc_canTurnOff.sqf @@ -0,0 +1,27 @@ +/* + * Author: GitHawk + * Check if a unit can turn off a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * Can turn off + * + * Example: + * [player, nozzle] call ace_refuel_fnc_canTurnOff + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle"]; + +if (isNull _unit || + {isNull _nozzle} || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {(_nozzle distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; + +(_nozzle getVariable [QGVAR(isRefueling), false]) diff --git a/addons/refuel/functions/fnc_canTurnOn.sqf b/addons/refuel/functions/fnc_canTurnOn.sqf new file mode 100644 index 0000000000..3053e699a2 --- /dev/null +++ b/addons/refuel/functions/fnc_canTurnOn.sqf @@ -0,0 +1,30 @@ +/* + * Author: GitHawk + * Check if a unit can turn on a fuel nozzle + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * Can turn on + * + * Example: + * [player, nozzle] call ace_refuel_fnc_canTurnOn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle"]; + +if (isNull _unit || + {isNull _nozzle} || + {!(_unit isKindOf "CAManBase")} || + {!local _unit} || + {(_nozzle distance _unit) > REFUEL_ACTION_DISTANCE}) exitWith {false}; + +!(_nozzle getVariable [QGVAR(isRefueling), false]) && + {[_nozzle getVariable QGVAR(source)] call FUNC(getFuel) != 0} && + {!isNull (_nozzle getVariable [QGVAR(sink), objNull])} && + {(fuel (_nozzle getVariable QGVAR(sink))) < 1} diff --git a/addons/refuel/functions/fnc_checkFuel.sqf b/addons/refuel/functions/fnc_checkFuel.sqf new file mode 100644 index 0000000000..b50e9a8171 --- /dev/null +++ b/addons/refuel/functions/fnc_checkFuel.sqf @@ -0,0 +1,40 @@ +/* + * Author: GitHawk + * Get the remaining fuel amount + * + * Arguments: + * 0: Unit + * 1: Fuel Truck + * + * Return Value: + * None + * + * Example: + * [player, fuelTruck] call ace_refuel_fnc_checkFuel + * + * Public: No + */ +#include "script_component.hpp" +private ["_fuel"]; +params ["_unit", "_target"]; + +_fuel = [_target] call FUNC(getFuel); + +[ + 5, + [_unit, _target, _fuel], + { + params ["_args"]; + _args params ["_unit", "_target", "_fuel"]; + if (_fuel > 0 ) then { + ["displayTextStructured", [_unit], [[LSTRING(Hint_RemainingFuel), _fuel], 2, _unit]] call EFUNC(common,targetEvent); + } else { + ["displayTextStructured", [_unit], [LSTRING(Hint_Empty), 2, _unit]] call EFUNC(common,targetEvent); + }; + true + }, + {true}, + localize LSTRING(CheckFuelAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_connectNozzle.sqf b/addons/refuel/functions/fnc_connectNozzle.sqf new file mode 100644 index 0000000000..f5d8d35759 --- /dev/null +++ b/addons/refuel/functions/fnc_connectNozzle.sqf @@ -0,0 +1,65 @@ +/* + * Author: GitHawk et.al. + * Connect a fuel nozzle. + * With code from ace_attach + * + * Arguments: + * 0: Unit + * 1: Target + * + * Return Value: + * None + * + * Example: + * [player, tank] call ace_refuel_fnc_connectNozzle + * + * Public: No + */ +#include "script_component.hpp" + +#define PLACE_WAITING -1 +#define PLACE_CANCEL 0 +#define PLACE_APPROVE 1 + +private ["_nozzle", "_actionID"]; +params ["_unit", "_target"]; + +_nozzle = _unit getVariable [QGVAR(nozzle), objNull]; +if (isNull _nozzle) exitWith {}; + +GVAR(placeAction) = PLACE_WAITING; + +[{[localize LSTRING(Connect_Action), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame); +_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; + +_actionID = _unit addAction [format ["%1", localize LSTRING(Cancel)], {GVAR(placeAction) = PLACE_CANCEL;}]; + +[{ + private["_virtualPos", "_virtualPosASL", "_lineInterection"]; + params ["_args","_pfID"]; + _args params ["_unit", "_target", "_nozzle", "_actionID"]; + + _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); + if (cameraView == "EXTERNAL") then { + _virtualPosASL = _virtualPosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); + }; + _virtualPos = _virtualPosASL call EFUNC(common,ASLToPosition); + _lineInterection = lineIntersects [eyePos ace_player, _virtualPosASL, ace_player]; + + //Don't allow placing in a bad position: + if (_lineInterection && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;}; + + if ((GVAR(placeAction) != PLACE_WAITING) || + {_unit != ace_player} || + {!([_unit, _target, []] call EFUNC(common,canInteractWith))}) then { + + [_pfID] call CBA_fnc_removePerFrameHandler; + [] call EFUNC(interaction,hideMouseHint); + [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); + _unit removeAction _actionID; + + if (GVAR(placeAction) == PLACE_APPROVE) then { + [_unit, _target, _virtualPos, _nozzle] call FUNC(ConnectNozzleAction); + }; + }; // TODO add model like in attach/functions/fnc_attach +}, 0, [_unit, _target, _nozzle, _actionID] ] call cba_fnc_addPerFrameHandler; diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf new file mode 100644 index 0000000000..42190aacc6 --- /dev/null +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -0,0 +1,106 @@ +/* + * Author: GitHawk et.al. + * Calculates a connection for refueling. + * With code from ace_attach + * + * Arguments: + * 0: Unit + * 1: Target + * 2: Visual Position + * 3: Nozzle + * + * Return Value: + * None + * + * Example: + * [player, tank, [0,0,0], nozzle] call ace_refuel_fnc_connectNozzleAction + * + * Public: No + */ +#include "script_component.hpp" +private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_endASL", "_rate", "_maxFuel"]; + +params ["_unit", "_target", "_startingPosition", "_nozzle"]; +_startingOffset = _target worldToModel _startingPosition; + +_startDistanceFromCenter = vectorMagnitude _startingOffset; +_closeInUnitVector = vectorNormalized (_startingOffset vectorFromTo [0,0,0]); + +_closeInMax = _startDistanceFromCenter; +_closeInMin = 0; + +while {(_closeInMax - _closeInMin) > 0.01} do { + _closeInDistance = (_closeInMax + _closeInMin) / 2; + _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); + _endPosTestOffset set [2, (_startingOffset select 2)]; + _endPosTest = _target modelToWorldVisual _endPosTestOffset; + + _doesIntersect = false; + { + if (_doesIntersect) exitWith {}; + _startingPosShifted = _startingPosition vectorAdd _x; + _startASL = if (surfaceIsWater _startingPosShifted) then {_startingPosShifted} else {ATLtoASL _startingPosShifted}; + { + _endPosShifted = _endPosTest vectorAdd _x; + _endASL = if (surfaceIsWater _startingPosShifted) then {_endPosShifted} else {ATLtoASL _endPosShifted}; + + //Uncomment to see the lazor show, and see how the scanning works: + // drawLine3D [_startingPosShifted, _endPosShifted, [1,0,0,1]]; + if (_target in lineIntersectsWith [_startASL, _endASL, _unit]) exitWith {_doesIntersect = true}; + } forEach [[0,0,0.045], [0,0,-0.045], [0,0.045,0], [0,-0.045,0], [0.045,0,0], [-0.045,0,0]]; + } forEach [[0,0,0], [0,0,0.05], [0,0,-0.05]]; + + if (_doesIntersect) then { + _closeInMax = _closeInDistance; + } else { + _closeInMin = _closeInDistance; + }; +}; + +_closeInDistance = (_closeInMax + _closeInMin) / 2; + +//Checks (too close to center or can't attach) +if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_target, _unit, _itemClassname] call FUNC(canAttach))}) exitWith { + TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); + [localize LSTRING(Failed)] call EFUNC(common,displayTextStructured); +}; + +//Move it out slightly, for visibility sake (better to look a little funny than be embedded//sunk in the hull and be useless) +_closeInDistance = (_closeInDistance - 0.0085); + +_endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _closeInDistance); +_endPosTestOffset set [2, (_startingOffset select 2)]; + +[ + 2, + [_unit, _nozzle, _target, _endPosTestOffset], + { + private "_actionID"; + params ["_args"]; + _args params ["_unit", "_nozzle", "_target", "_endPosTestOffset"]; + _unit setVariable [QGVAR(nozzle), nil]; + _unit setVariable [QGVAR(isRefueling), false]; + [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); + REFUEL_UNHOLSTER_WEAPON + _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + if (_actionID != -1) then { + _unit removeAction _actionID; + _unit setVariable [QGVAR(ReleaseActionID), nil]; + }; + + detach _nozzle; + _nozzle attachTo [_target, _endPosTestOffset]; + _nozzle setVariable [QGVAR(sink), _target, true]; + _nozzle setVariable [QGVAR(isConnected), true, true]; + _target setVariable [QGVAR(nozzle), _nozzle, true]; + + _source = _nozzle getVariable QGVAR(source); + _source setVariable [QGVAR(fuelCounter), [_source] call FUNC(getFuel), true]; + + [_unit, _target, _nozzle, _endPosTestOffset] call FUNC(refuel); + }, + "", + localize LSTRING(ConnectAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_disconnect.sqf b/addons/refuel/functions/fnc_disconnect.sqf new file mode 100644 index 0000000000..e007ddf05f --- /dev/null +++ b/addons/refuel/functions/fnc_disconnect.sqf @@ -0,0 +1,30 @@ +/* + * Author: GitHawk + * Disconnect a fuel nozzle. + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * None + * + * Example: + * [player, nozzle] call ace_refuel_fnc_disconnect + * + * Public: No + */ +#include "script_component.hpp" + +private ["_sink"]; +params ["_unit", "_nozzle"]; + +_sink = _nozzle getVariable [QGVAR(sink), objNull]; +if (isNull _sink) exitWith {}; + +_sink setVariable [QGVAR(nozzle), objNull, true]; +_nozzle setVariable [QGVAR(sink), objNull, true]; +_nozzle setVariable [QGVAR(isConnected), false, true]; +[objNull, _nozzle, true] call FUNC(dropNozzle); + +[_unit, objNull, _nozzle] call FUNC(takeNozzle); diff --git a/addons/refuel/functions/fnc_dropNozzle.sqf b/addons/refuel/functions/fnc_dropNozzle.sqf new file mode 100644 index 0000000000..c44c20c059 --- /dev/null +++ b/addons/refuel/functions/fnc_dropNozzle.sqf @@ -0,0 +1,32 @@ +/* + * Author: GitHawk + * Detaches the fuel nozzle, drops it and removes player variables. + * + * Arguments: + * 0: Unit (optional) + * 1: Nozzle + * 2: Disconnect Only + * + * Return Value: + * None + * + * Example: + * [player, nozzle, false] call ace_refuel_fnc_dropNozzle + * [objNull, nozzle, false] call ace_refuel_fnc_dropNozzle + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle", ["_disconnectOnly", false]]; + +detach _nozzle; +_nozzle setVariable [QGVAR(isRefueling), false, true]; + +if (_disconnectOnly) exitWith {}; +_nozzle setVelocity [0, 0, 0]; +_nozzle setPosATL [(getPosATL _nozzle) select 0, (getPosATL _nozzle) select 1, 0.05]; + +if (isNull _unit) exitWith {}; +_unit setVariable [QGVAR(isRefueling), false, true]; +_unit setVariable [QGVAR(nozzle), objNull, true]; diff --git a/addons/refuel/functions/fnc_getFuel.sqf b/addons/refuel/functions/fnc_getFuel.sqf new file mode 100644 index 0000000000..9bbb4987be --- /dev/null +++ b/addons/refuel/functions/fnc_getFuel.sqf @@ -0,0 +1,28 @@ +/* + * Author: GitHawk, Jonpas + * Get the remaining fuel amount. + * + * Arguments: + * 0: Target + * + * Return Value: + * Fuel left (in liters) + * + * Example: + * [fuelTruck] call ace_refuel_fnc_getFuel + * + * Public: No + */ +#include "script_component.hpp" + +private ["_fuel"]; +params ["_target"]; + +_fuel = _target getVariable QGVAR(currentFuelCargo); + +if (isNil "_fuel") then { + _fuel = getNumber (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(fuelCargo)); + _target setVariable [QGVAR(currentFuelCargo), _fuel, true]; +}; + +_fuel diff --git a/addons/refuel/functions/fnc_handleKilled.sqf b/addons/refuel/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..897337c062 --- /dev/null +++ b/addons/refuel/functions/fnc_handleKilled.sqf @@ -0,0 +1,26 @@ +/* + * Author: GitHawk, Jonpas + * Handles medical on set dead event. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [player] call ace_refuel_fnc_handleKilled + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; + +if (!local _unit) exitWith {}; + +_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; +_nozzle = _unit getVariable [QGVAR(nozzle), objNull]; +if !(isNull _nozzle) then { + [_unit, _nozzle] call FUNC(dropNozzle); +}; diff --git a/addons/refuel/functions/fnc_handleUnconscious.sqf b/addons/refuel/functions/fnc_handleUnconscious.sqf new file mode 100644 index 0000000000..6a6e561230 --- /dev/null +++ b/addons/refuel/functions/fnc_handleUnconscious.sqf @@ -0,0 +1,29 @@ +/* + * Author: GitHawk, Jonpas + * Handles medical on unconscious event. + * + * Arguments: + * 0: Unit + * 1: Is Unconscious + * + * Return Value: + * None + * + * Example: + * [player, true] call ace_refuel_fnc_handleUnconscious + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_isUnconscious"]; + +if (!local _unit || {!_isUnconscious}) exitWith {}; + +private "_nozzle"; + +[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); +_nozzle = _unit getVariable [QGVAR(nozzle), objNull]; +if !(isNull _nozzle) then { + [_unit, _nozzle] call FUNC(dropNozzle); +}; diff --git a/addons/refuel/functions/fnc_makeJerryCan.sqf b/addons/refuel/functions/fnc_makeJerryCan.sqf new file mode 100644 index 0000000000..96bb058265 --- /dev/null +++ b/addons/refuel/functions/fnc_makeJerryCan.sqf @@ -0,0 +1,88 @@ +/* + * Author: GitHawk + * Makes an object into a jerry can. + * + * Arguments: + * 0: Target + * 1: Fuel amount (in liters) + * + * Return Value: + * None + * + * Example: + * [can] call ace_refuel_fnc_makeJerryCan + * + * Public: No + */ +#include "script_component.hpp" + +private ["_actions", "_action"]; +params ["_target", ["_fuelAmount", 20]]; + +if (isNull _target || + {_target isKindOf "AllVehicles"} || + {_target getVariable [QGVAR(jerryCan), false]}) exitWith {}; + +[_target, _fuelAmount] call FUNC(setFuel); +_target setVariable [QGVAR(jerryCan), true, true]; +_target setVariable [QGVAR(source), _target, true]; + +// Main Action +_action = [QGVAR(Refuel), + localize LSTRING(Refuel), + QUOTE(PATHTOF(ui\icon_refuel_interact.paa)), + {}, + {true}, + {}, + [], + [0, 0, 0], + REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); +[_target, 0, [], _action] call EFUNC(interact_menu,addActionToObject); + +// Add pickup +_action = [QGVAR(PickUpNozzle), + localize LSTRING(TakeNozzle), + QUOTE(PATHTOF(ui\icon_refuel_interact.paa)), + {[_player, objNull, _target] call FUNC(TakeNozzle)}, + {[_player, _target] call FUNC(canTakeNozzle)}, + {}, + [], + [0, 0, 0], + REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); +[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); + +// Add turnOn +_action = [QGVAR(TurnOn), + localize LSTRING(TurnOn), + QUOTE(PATHTOF(ui\icon_refuel_interact.paa)), + {[_player, _target] call FUNC(turnOn)}, + {[_player, _target] call FUNC(canTurnOn)}, + {}, + [], + [0, 0, 0], + REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); +[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); + +// Add turnOff +_action = [QGVAR(TurnOff), + localize LSTRING(TurnOff), + QUOTE(PATHTOF(ui\icon_refuel_interact.paa)), + {[_player, _target] call FUNC(turnOff)}, + {[_player, _target] call FUNC(canTurnOff)}, + {}, + [], + [0, 0, 0], + REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); +[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); + +// Add disconnect +_action = [QGVAR(Disconnect), + localize LSTRING(Disconnect), + QUOTE(PATHTOF(ui\icon_refuel_interact.paa)), + {[_player, _target] call FUNC(disconnect)}, + {[_player, _target] call FUNC(canDisconnect)}, + {}, + [], + [0, 0, 0], + REFUEL_ACTION_DISTANCE] call EFUNC(interact_menu,createAction); +[_target, 0, [QGVAR(Refuel)], _action] call EFUNC(interact_menu,addActionToObject); diff --git a/addons/refuel/functions/fnc_moduleRefuelSettings.sqf b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf new file mode 100644 index 0000000000..6cdc78b9f7 --- /dev/null +++ b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf @@ -0,0 +1,24 @@ +/* + * Author: GitHawk + * Module for adjusting the refuel settings. + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(rate), "rate"] call EFUNC(common,readSettingFromModule); + +diag_log text format ["[ACE]: Refuel Module Initialized with flow rate: %1", GVAR(rate)]; diff --git a/addons/refuel/functions/fnc_readFuelCounter.sqf b/addons/refuel/functions/fnc_readFuelCounter.sqf new file mode 100644 index 0000000000..af95c044e3 --- /dev/null +++ b/addons/refuel/functions/fnc_readFuelCounter.sqf @@ -0,0 +1,37 @@ +/* + * Author: GitHawk + * Reads the fuel counter. + * + * Arguments: + * 0: Unit + * 1: Fuel Truck + * + * Return Value: + * None + * + * Example: + * [player, fuelTruck] call ace_refuel_fnc_readFuelCounter + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target"]; + +[ + 2, + [_unit, _target], + { + private ["_currentFuel", "_fuelCounter"]; + params ["_args"]; + _args params ["_unit", "_target"]; + + _currentFuel = [_target] call FUNC(getFuel); + _fuelCounter = 0.01 * round (100 * ((_target getVariable [QGVAR(fuelCounter), _currentFuel]) - _currentFuel)); + [[LSTRING(Hint_FuelCounter), _fuelCounter], 1.5, _unit] call EFUNC(common,displayTextStructured); + }, + "", + localize LSTRING(CheckFuelCounterAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf new file mode 100644 index 0000000000..74697212b1 --- /dev/null +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -0,0 +1,99 @@ +/* + * Author: GitHawk + * Refuels the vehicle. + * + * Arguments: + * 0: Unit + * 1: Target + * 2: Nozzle + * 3: Connection Point + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +#define PFH_STEPSIZE 0.1 + +private ["_rate", "_maxFuel"]; +params ["_unit", "_target", "_nozzle", "_connectToPoint"]; + +_rate = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(flowRate)) * GVAR(rate) * PFH_STEPSIZE; +_maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(fuelCapacity)); + +[{ + private ["_source", "_tooFar", "_fuelInSource", "_fuelInSink", "_finished", "_fueling"]; + params ["_args", "_pfID"]; + _args params ["_source", "_sink", "_unit", "_nozzle", "_rate", "_startFuel", "_maxFuel", "_connectFromPoint", "_connectToPoint"]; + + if (!alive _source || {!alive _sink}) exitWith { + [objNull, _nozzle] call FUNC(dropNozzle); + _nozzle setVariable [QGVAR(isConnected), false, true]; + _nozzle setVariable [QGVAR(sink), objNull, true]; + _sink setVariable [QGVAR(nozzle), objNull, true]; + [_pfID] call cba_fnc_removePerFrameHandler; + }; + _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (REFUEL_HOSE_LENGTH - 2); + if (_tooFar && {!(_nozzle getVariable [QGVAR(jerryCan), false])}) exitWith { + [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); + + [objNull, _nozzle] call FUNC(dropNozzle); + _nozzle setVariable [QGVAR(isConnected), false, true]; + _nozzle setVariable [QGVAR(sink), objNull, true]; + _sink setVariable [QGVAR(nozzle), objNull, true]; + [_pfID] call cba_fnc_removePerFrameHandler; + }; + + _finished = false; + _fueling = _nozzle getVariable [QGVAR(isRefueling), false]; + if (_fueling) then { + _fuelInSource = [_source] call FUNC(getFuel); + if (_fuelInSource == 0) exitWith { + [LSTRING(Hint_SourceEmpty), 2, _unit] call EFUNC(common,displayTextStructured); + _nozzle setVariable [QGVAR(isRefueling), false, true]; + }; + if !(_fuelInSource == REFUEL_INFINITE_FUEL) then { + _fuelInSource = _fuelInSource - _rate; + }; + if (_fuelInSource < 0 && {_fuelInSource > -1}) then { + _fuelInSource = 0; + _finished = true; + [LSTRING(Hint_SourceEmpty), 2, _unit] call EFUNC(common,displayTextStructured); + }; + + _fuelInSink = (_unit getVariable [QGVAR(tempFuel), _startFuel]) + ( _rate / _maxFuel); + if (_fuelInSink > 1) then { + _fuelInSink = 1; + _finished = true; + [LSTRING(Hint_Completed), 2, _unit] call EFUNC(common,displayTextStructured); + }; + _unit setVariable [QGVAR(tempFuel), _fuelInSink]; + + if !(local _sink) then { + [[_sink, _fuelInSink], "{(_this select 0) setFuel (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc); + } else { + _sink setFuel _fuelInSink; + }; + [_source, _fuelInSource] call FUNC(setFuel); + } else { + _unit setVariable [QGVAR(tempFuel), fuel _sink]; + }; + + if (_finished) exitWith { + _nozzle setVariable [QGVAR(isRefueling), false, true]; + }; +}, +PFH_STEPSIZE, +[_nozzle getVariable QGVAR(source), + _target, + _unit, + _nozzle, + _rate, + fuel _target, + _maxFuel, + _nozzle getVariable [QGVAR(attachPos), [0,0,0]], + _connectToPoint] +] call cba_fnc_addPerFrameHandler; diff --git a/addons/refuel/functions/fnc_reset.sqf b/addons/refuel/functions/fnc_reset.sqf new file mode 100644 index 0000000000..f235180b0e --- /dev/null +++ b/addons/refuel/functions/fnc_reset.sqf @@ -0,0 +1,50 @@ +/* + * Author: GitHawk + * Resets a fuel vehicle in case is got bugged + * + * Arguments: + * 0: Fuel truck + * + * Return Value: + * None + * + * Example: + * [truck] call ace_refuel_fnc_reset + * + * Public: No + */ +#include "script_component.hpp" + +private ["_nozzle", "_nozzleTarget", "_rope"]; +params ["_target"]; + +if (local _target) then { + _target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]; +} else { + [[_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]], "{(_this select 0) setHitPointDamage (_this select 1)}", _target] call EFUNC(common,execRemoteFnc); +}; +_target setVariable [QGVAR(engineHit), nil, true]; +_target setVariable [QGVAR(isConnected), false, true]; + +_nozzle = _target getVariable [QGVAR(ownedNozzle), nil]; +if !(isNil "_nozzle") then { + _nozzleTarget = _nozzle getVariable [QGVAR(sink), nil]; + if !(isNil "_nozzleTarget") then { + _nozzleTarget setVariable [QGVAR(nozzle), nil, true]; + }; + + _rope = _nozzle getVariable [QGVAR(rope), nil]; + if !(isNil "_rope") then { + ropeDestroy _rope; + }; + + { + if (local _x) then { + [_x, _nozzle] call FUNC(resetLocal); + } else { + [[_x, _nozzle], "{_this call FUNC(resetLocal)}", _x] call EFUNC(common,execRemoteFnc); + }; + } count allPlayers; + deleteVehicle _nozzle; +}; +_target setVariable [QGVAR(ownedNozzle), nil, true]; diff --git a/addons/refuel/functions/fnc_resetLocal.sqf b/addons/refuel/functions/fnc_resetLocal.sqf new file mode 100644 index 0000000000..a8b0c184cc --- /dev/null +++ b/addons/refuel/functions/fnc_resetLocal.sqf @@ -0,0 +1,37 @@ +/* + * Author: GitHawk + * Resets a player + * + * Arguments: + * 0: Fuel nozzle + * + * Return Value: + * None + * + * Example: + * [nozzle] call ace_refuel_fnc_resetLocal + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle"]; + + +if (isNull _unit || + {isNull _nozzle} || + {!(_unit isKindOf "CAManBase")} || + {!local _unit}) exitWith {}; +private ["_attachedNozzle", "_actionID"]; +_attachedNozzle = _unit getVariable [QGVAR(nozzle), nil]; +if (isNil "_attachedNozzle") exitWith {}; + +if (_nozzle != _attachedNozzle) exitWith {}; + +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; +if (_actionID != -1) then { + _unit removeAction _actionID; + _unit setVariable [QGVAR(isRefueling), false, true]; + _unit setVariable [QGVAR(ReleaseActionID), nil]; + _unit setVariable [QGVAR(nozzle), nil]; +}; diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf new file mode 100644 index 0000000000..d3fca33021 --- /dev/null +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -0,0 +1,63 @@ +/* + * Author: GitHawk, Jonpas + * Returns the nozzle back to source vehicle. + * + * Arguments: + * 0: Unit + * 1: Fuel Truck + * + * Return Value: + * Returned Nozzle + * + * Example: + * [player, fuelTruck] call ace_refuel_fnc_returnNozzle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_nozzle", "_dummy", "_actionID"]; +params ["_unit", "_target"]; + +_nozzle = _unit getVariable [QGVAR(nozzle), objNull]; +_source = _nozzle getVariable QGVAR(source); + +if (isNull _nozzle || {_source != _target}) exitWith {false}; + +[ + 2, + [_unit, _nozzle, _target], + { + private "_actionID"; + params ["_args"]; + _args params ["_unit", "_nozzle", "_target"]; + _unit setVariable [QGVAR(nozzle), nil]; + detach _nozzle; + [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); + REFUEL_UNHOLSTER_WEAPON + _unit setVariable [QGVAR(isRefueling), false]; + _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + if (_actionID != -1) then { + _unit removeAction _actionID; + _unit setVariable [QGVAR(ReleaseActionID), nil]; + }; + + _target setVariable [QGVAR(isConnected), false, true]; + _target setVariable [QGVAR(ownedNozzle), nil, true]; + ropeDestroy (_nozzle getVariable QGVAR(rope)); + deleteVehicle _nozzle; + + if !(local _target) then { + [[_target, ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]], "{(_this select 0) setHitPointDamage (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc); + } else { + _target setHitPointDamage ["HitEngine", _target getVariable [QGVAR(engineHit), 0]]; + }; + _target setVariable [QGVAR(engineHit), nil, true]; + }, + "", + localize LSTRING(ReturnAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); + +true diff --git a/addons/refuel/functions/fnc_setFuel.sqf b/addons/refuel/functions/fnc_setFuel.sqf new file mode 100644 index 0000000000..a182d463ae --- /dev/null +++ b/addons/refuel/functions/fnc_setFuel.sqf @@ -0,0 +1,24 @@ +/* + * Author: GitHawk + * Set the remaining fuel amount. + * + * Arguments: + * 0: Fuel Truck + * 1: Amount (in liters) + * + * Return Value: + * None + * + * Example: + * [fuelTruck, 42] call ace_refuel_fnc_setFuel + * + * Public: No + */ +#include "script_component.hpp" +private ["_maxFuel"]; +params ["_target", "_fuel"]; + +if (isNull _target || + {isNil "_fuel"}) exitWith {}; + +_target setVariable [QGVAR(currentFuelCargo), _fuel, true]; diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf new file mode 100644 index 0000000000..3c52748efc --- /dev/null +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -0,0 +1,147 @@ +/* + * Author: GitHawk + * Take a fuel nozzle either from a fuel truck/station or from the ground. + * + * Arguments: + * 0: Unit + * 1: Fuel Truck + * 2: Nozzle (optional) + * + * Return Value: + * None + * + * Example: + * [player, fuelTruck] call ace_refuel_fnc_takeNozzle + * [player, objNull, nozzle] call ace_refuel_fnc_takeNozzle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_endPosOffset"], +params ["_unit", "_target", ["_nozzle", objNull]]; + +[_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); + +REFUEL_HOLSTER_WEAPON + +_endPosOffset = [0, 0, 0]; +if (isNull _nozzle) then { // func is called on fuel truck + _target setVariable [QGVAR(engineHit), _target getHitPointDamage "HitEngine", true]; + if !(local _target) then { + [[_target, ["HitEngine", 1]], "{(_this select 0) setHitPointDamage (_this select 1)}", _sink] call EFUNC(common,execRemoteFnc); + } else { + _target setHitPointDamage ["HitEngine", 1]; + }; + + _target setVariable [QGVAR(isConnected), true, true]; + _endPosOffset = getArray (configFile >> "CfgVehicles" >> typeOf _target >> "ace_refuel_hooks"); + if (count _endPosOffset == 2) then { + if (_unit distance (_target modelToWorld (_endPosOffset select 0)) < _unit distance (_target modelToWorld (_endPosOffset select 1))) then { + _endPosOffset = _endPosOffset select 0; + } else { + _endPosOffset = _endPosOffset select 1; + }; + } else { + _endPosOffset = _endPosOffset select 0; + }; + [ + 2, + [_unit, _target, _endPosOffset], + { + private ["_newNozzle", "_rope", "_actionID"]; + params ["_args"]; + _args params ["_unit", "_target", "_endPosOffset"]; + + _newNozzle = "ACE_refuel_fuelNozzle" createVehicle position _unit; + _newNozzle attachTo [_unit, [-0.02,-0.05,0], "righthandmiddle1"]; // TODO replace with right coordinates for real model + _unit setVariable [QGVAR(nozzle), _newNozzle]; + + _rope = ropeCreate [_target, _endPosOffset, _newNozzle, [0, 0, 0], REFUEL_HOSE_LENGTH]; + _newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true]; + _newNozzle setVariable [QGVAR(source), _target, true]; + _newNozzle setVariable [QGVAR(rope), _rope, true]; + _target setVariable [QGVAR(ownedNozzle), _newNozzle, true]; + + _unit setVariable [QGVAR(isRefueling), true]; + _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + if (_actionID != -1) then { + _unit removeAction _actionID; + }; + _actionID = _unit addAction [ + format ["%1", localize ELSTRING(dragging,Drop)], + '_unit = _this select 0; _nozzle = _unit getVariable QGVAR(nozzle); [_unit, _nozzle] call FUNC(dropNozzle); [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); REFUEL_UNHOLSTER_WEAPON', + nil, + 20, + false, + true, + "", + '!isNull (_target getVariable [QGVAR(nozzle), objNull])' + ]; + _unit setVariable [QGVAR(ReleaseActionID), _actionID]; + }, + "", + localize LSTRING(TakeNozzleAction), + {true}, + ["isnotinside"] + ] call EFUNC(common,progressBar); +} else { // func is called in muzzle either connected or on ground + [ + 2, + [_unit, _nozzle], + { + private ["_actionID"]; + params ["_args"]; + _args params ["_unit", "_nozzle"]; + if (_nozzle getVariable [QGVAR(jerryCan), false]) then { + _nozzle attachTo [_unit, [0,1,0], "pelvis"]; + } else { + _nozzle attachTo [_unit, [-0.02,-0.05,0], "righthandmiddle1"]; // TODO replace with right coordinates for real model + }; + _unit setVariable [QGVAR(nozzle), _nozzle]; + + _unit setVariable [QGVAR(isRefueling), true]; + _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + if (_actionID != -1) then { + _unit removeAction _actionID; + }; + _actionID = _unit addAction [ + format ["%1", localize ELSTRING(dragging,Drop)], + '_unit = _this select 0; _nozzle = _unit getVariable QGVAR(nozzle); [_unit, _nozzle] call FUNC(dropNozzle); [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); REFUEL_UNHOLSTER_WEAPON', + nil, + 20, + false, + true, + "", + '!isNull (_target getVariable [QGVAR(nozzle), objNull])' + ]; + _unit setVariable [QGVAR(ReleaseActionID), _actionID]; + }, + "", + localize LSTRING(TakeNozzleAction), + {true}, + ["isnotinside"] + ] call EFUNC(common,progressBar); + + _target = _nozzle getVariable QGVAR(source); + _endPosOffset = _nozzle getVariable QGVAR(attachPos); +}; +if !(_nozzle getVariable [QGVAR(jerryCan), false]) then { + [{ + private ["_nozzle"]; + params ["_args", "_pfID"]; + _args params ["_unit", "_source", "_endPosOffset"]; + + if (_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)) exitWith { + _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; + if !(isNull _nozzle) then { + [_unit, _nozzle] call FUNC(dropNozzle); + REFUEL_UNHOLSTER_WEAPON + + [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); + [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); + }; + [_pfID] call cba_fnc_removePerFrameHandler; + }; + }, 0, [_unit, _target, _endPosOffset]] call cba_fnc_addPerFrameHandler; +}; diff --git a/addons/refuel/functions/fnc_turnOff.sqf b/addons/refuel/functions/fnc_turnOff.sqf new file mode 100644 index 0000000000..115c1eabe2 --- /dev/null +++ b/addons/refuel/functions/fnc_turnOff.sqf @@ -0,0 +1,34 @@ +/* + * Author: GitHawk + * Turn off a fuel nozzle. + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * None + * + * Example: + * [nozzle] call ace_refuel_fnc_turnOff + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle"]; + +[ + 2, + [_unit, _nozzle], + { + params ["_args"]; + _args params ["_unit", "_nozzle"]; + _nozzle setVariable [QGVAR(isRefueling), false, true]; + [LSTRING(Hint_Stopped), 1.5, _unit] call EFUNC(common,displayTextStructured); + }, + "", + localize LSTRING(TurnOffAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/fnc_turnOn.sqf b/addons/refuel/functions/fnc_turnOn.sqf new file mode 100644 index 0000000000..017a8ee021 --- /dev/null +++ b/addons/refuel/functions/fnc_turnOn.sqf @@ -0,0 +1,35 @@ +/* + * Author: GitHawk + * Turn on a fuel nozzle. + * + * Arguments: + * 0: Unit + * 1: Nozzle + * + * Return Value: + * None + * + * Example: + * [player, nozzle] call ace_refuel_fnc_turnOn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_nozzle"]; + +[ + 2, + [_unit, _nozzle], + { + private "_source"; + params ["_args"]; + _args params ["_unit", "_nozzle"]; + _nozzle setVariable [QGVAR(isRefueling), true, true]; + [LSTRING(Hint_Started), 1.5, _unit] call EFUNC(common,displayTextStructured); + }, + "", + localize LSTRING(TurnOnAction), + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/refuel/functions/script_component.hpp b/addons/refuel/functions/script_component.hpp new file mode 100644 index 0000000000..167c1e614a --- /dev/null +++ b/addons/refuel/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\refuel\script_component.hpp" diff --git a/addons/refuel/script_component.hpp b/addons/refuel/script_component.hpp new file mode 100644 index 0000000000..e8c7514651 --- /dev/null +++ b/addons/refuel/script_component.hpp @@ -0,0 +1,25 @@ +#define COMPONENT refuel +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_REFUEL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_REFUEL + #define DEBUG_SETTINGS DEBUG_ENABLED_REFUEL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define REFUEL_INFINITE_FUEL -1 +#define REFUEL_ACTION_DISTANCE 7 +#define REFUEL_HOSE_LENGTH 12 + +#define REFUEL_HOLSTER_WEAPON \ + _unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; \ + _unit action ["SwitchWeapon", _unit, _unit, 99]; + +#define REFUEL_UNHOLSTER_WEAPON \ + _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRefuel); \ + _unit selectWeapon _weaponSelect; \ + _unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; diff --git a/addons/refuel/stringtable.xml b/addons/refuel/stringtable.xml new file mode 100644 index 0000000000..b0fb6ec0c6 --- /dev/null +++ b/addons/refuel/stringtable.xml @@ -0,0 +1,222 @@ + + + + + Refuel Settings + Betankungseinst. + Ustawienia tankowania + Настройки дозаправки + Ajustes de reabastecimento + + + Flow Rate + Fließrate + Szybkość przepływu + Скорость заправки + Velocidade da vazão + + + How fast should a vehicle be refueled? + Wie schnell soll ein Fahrzeug aufgetankt sein? + Jak szybko pojazd powinien zostać zatankowany? + Как быстро техника должна быть заправлена? + Quão rápido deve ser o veículo reabastecido? + + + Refuel + Betankung + Zatankuj + Дозаправка + Reabastecimento + + + Take fuel nozzle + Zapfpistole nehmen + Weź nalewak + Взять топливный шланг + Pegar o bocal de combustível + + + Taking fuel nozzle ... + Nehme Zapfpistole ... + Pobieranie nalewaka ... + Берем топливный шланг ... + Pegando o bocal de combustível... + + + Connect fuel nozzle + Zapfpistole anschließen + Podłącz nalewak + Присоединить топливный шланг + Conectar o bocal de combustível + + + Connecting fuel nozzle ... + Zapfpistole anschließen ... + Podłączanie nalewaka ... + Присоединяем топливный шланг ... + Conectando o bocal de combustível... + + + Disconnect fuel nozzle + Zapfpistole entfernen + Odepnij nalewak + Отсоединить топливный шланг + Desconectar o bocal de combustível + + + Connect + Anschließen + Podłącz + Присоединить + Conectar + + + Check remaining fuel + Verbleibenden Kraftstoff überprüfen + Sprawdź ilość paliwa + Проверить остаток топлива + Verificar combustível restante + + + Checking remaining fuel ... + Überprüfe verbleibenden Kraftstoff ... + Sprawdzanie ilości paliwa ... + Проверяем остаток топлива ... + Verificando combustível restante... + + + There are %1 liters left. + Es sind noch %1 Liter übrig. + Zostało %1 litrów. + Осталось %1 л. + Há %1 litros restantes. + + + There is no fuel left. + Es ist kein Kraftstoff übrig. + W zbiorniku nie ma paliwa. + Топлива нет. + Não há combustível + + + Cancel + Abbrechen + Anuluj + Отменить + Cancelar + + + Failed + Gescheitert + Porażka + Не удалось + Falhou + + + Stop fueling + Betankung stoppen + Zatrzymaj tankowanie + Остановить заправку + Parar reabastecimento + + + Stopping fueling ... + Stoppe Betankung ... + Zatrzymywanie tankowania ... + Останавливаем заправку ... + Parando reabastecimento... + + + Start fueling + Betankung beginnen + Rozpocznij tankowanie + Начать заправку + Começar reabastecimento + + + Starting fueling ... + Beginne Betankung ... + Rozpoczynanie tankowania ... + Начинаем заправку ... + Começando reabastecimento... + + + %1 Liters fueled + %1 Liters getankt + Zatankowano %1 litrów + %1 литров заправлено + %1 litros abastecidos + + + The fuel source is empty. + Die Treibstoffquelle ist leer. + Źródło paliwa jest puste. + Источник топлива пустой. + A fonte de combustível está vazia. + + + Maximum fuel hose length reached. + Maximale Schlauchlänge erreicht. + Osiągnięto maksymalną długość przewodu paliwowego. + Достигнута максимальная длина шланга. + Distância máxima da mangueira de combustível alcançada. + + + Fueling completed + Betankung abgeschlossen + Tankowanie ukończone + Заправка завершена + Reabastecimento completo + + + Fueling stopped + Betankung angehalten + Tankowanie zatrzymane + Заправка остановлена + Reabastecimento parado + + + Fueling started + Betankung begonnen + Tankowanie rozpoczęte + Заправка начата + Reabastecimento iniciado + + + Return fuel nozzle + Zapfpistole zurückstecken + Zwróć nalewak + Вернуть топливный шланг + Retornar bocal de combustível + + + Returning fuel nozzle ... + Stecke Zapfpistole zurück ... + Zwracanie nalewaka ... + Возвращаем топливный шланг ... + Retornando bocal de combustível... + + + Check fuel counter + Tankuhr ansehen + Sprawdź wskaźnik paliwa + Проверить счетчик топлива + Verificar contador de combustível + + + Checking fuel counter ... + Betrachte Tankuhr ... + Sprawdzanie wskaźnika paliwa ... + Проверяем счетчик топлива ... + Verificando contador de combustível... + + + %1 liters have been fueled. + %1 Liter wurden getankt. + %1 litrów zostało zatankowane. + Было заправлено %1 л. + %1 litros foram abastecidos. + + + \ No newline at end of file diff --git a/addons/refuel/ui/icon_module_refuel.paa b/addons/refuel/ui/icon_module_refuel.paa new file mode 100644 index 0000000000..84704c13d7 Binary files /dev/null and b/addons/refuel/ui/icon_module_refuel.paa differ diff --git a/addons/refuel/ui/icon_refuel_interact.paa b/addons/refuel/ui/icon_refuel_interact.paa new file mode 100644 index 0000000000..2cc1a9320d Binary files /dev/null and b/addons/refuel/ui/icon_refuel_interact.paa differ diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index e1dc9e8d51..8667d9815e 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -7,39 +7,39 @@ if (!hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(checkAmmo), localize LSTRING(checkAmmo), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !([ACE_player] call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; + if !(ACE_player call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; // Statement [ACE_player] call FUNC(checkAmmo); true }, {false}, -[19, [false, true, false]], false] call cba_fnc_addKeybind; +[19, [false, true, false]], false] call CBA_fnc_addKeybind; ["setAmmoSync", { //To propagate the setAmmo change, do it on all clients - PARAMS_3(_unit,_weapon,_ammo); + params ["_unit", "_weapon", "_ammo"]; + TRACE_3("setAmmoSync EH",_unit,_weapon,_ammo); + _unit setAmmo [_weapon, _ammo]; }] call EFUNC(common,addEventhandler); // Listen for attempts to link ammo ["linkedAmmo", { - EXPLODE_3_PVT(_this,_receiver,_giver,_magazine); + params ["_receiver", "_giver", "_magazine"]; - private ["_magazineCfg","_magazineType"]; - _magazineType = currentMagazine _receiver; - _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; + private _magazineType = currentMagazine _receiver; + private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; // Return the magazine if it's the wrong type if (_magazineType != (_magazine select 0)) exitWith { ["returnedAmmo", [_giver], [_giver,_receiver,_magazine]] call EFUNC(common,targetEvent); }; - private ["_ammoCount","_ammoMissing","_ammoAdded","_ammoRemaining"]; - _ammoCount = _receiver ammo currentWeapon _receiver; - _ammoMissing = getNumber (_magazineCfg >> "count") - _ammoCount; + private _ammoCount = _receiver ammo currentWeapon _receiver; + private _ammoMissing = getNumber (_magazineCfg >> "count") - _ammoCount; // Return the magazine if the belt is full or empty if ((_ammoCount == 0) || _ammoMissing == 0) exitWith { @@ -47,19 +47,18 @@ if (!hasInterface) exitWith {}; }; // Add the ammo - _ammoAdded = _ammoMissing min (_magazine select 1); - ["setAmmoSync", [_receiver, (currentWeapon _receiver), (_ammoCount + _ammoAdded)]] call EFUNC(common,globalEvent); + private _ammoAdded = _ammoMissing min (_magazine select 1); + ["setAmmoSync", [_receiver, currentWeapon _receiver, _ammoCount + _ammoAdded]] call EFUNC(common,globalEvent); if ((_magazine select 1) - _ammoAdded > 0) then { - ["returnedAmmo", [_giver], [_giver,_receiver,[_magazineType,(_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); + ["returnedAmmo", [_giver], [_giver, _receiver, [_magazineType, (_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); }; - }] call EFUNC(common,addEventhandler); - // Listen for returned magazines ["returnedAmmo", { - EXPLODE_3_PVT(_this,_receiver,_giver,_magazine); + params ["_receiver", "", "_magazine"]; + TRACE_2("returnedAmmo EH",_receiver,_magazine); _receiver addMagazine _magazine; }] call EFUNC(common,addEventhandler); diff --git a/addons/reload/functions/fnc_canLinkBelt.sqf b/addons/reload/functions/fnc_canLinkBelt.sqf index 4461b4f3e3..b36959e4e1 100644 --- a/addons/reload/functions/fnc_canLinkBelt.sqf +++ b/addons/reload/functions/fnc_canLinkBelt.sqf @@ -11,26 +11,24 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_player,_target); +params ["_player", "_target"]; if (vehicle _target != _target) exitWith {false}; -private ["_magazineCfg","_magazineType"]; -_magazineType = currentMagazine _target; -_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; +private _magazineType = currentMagazine _target; +private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; + if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; // Check if the ammo is not empty or full -private "_ammoCount"; -_ammoCount = _target ammo currentWeapon _target; +private _ammoCount = _target ammo currentWeapon _target; // Exit if the belt is full or empty -if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; +if (_ammoCount == 0 || getNumber (_magazineCfg >> "count") - _ammoCount == 0) exitWith {false}; // Check if the player has any of the same magazines // Calculate max ammo -private "_maxAmmo"; -_maxAmmo = 0; +private _maxAmmo = 0; { _maxAmmo = _maxAmmo max (_x select 1); diff --git a/addons/reload/functions/fnc_checkAmmo.sqf b/addons/reload/functions/fnc_checkAmmo.sqf index 2499a9a893..b0581a143a 100644 --- a/addons/reload/functions/fnc_checkAmmo.sqf +++ b/addons/reload/functions/fnc_checkAmmo.sqf @@ -13,10 +13,9 @@ #define COUNT_BARS 12 -EXPLODE_1_PVT(_this,_unit); +params ["_unit"]; -private ["_target"]; -_target = vehicle _unit; +private _target = vehicle _unit; if (count _this > 1) then { _target = _this select 1; diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index ce08fbd062..7fff5564c0 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -12,13 +12,11 @@ #define COUNT_BARS 12 -EXPLODE_1_PVT(_this,_target); +params ["_target"]; -private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture","_ammoBarsStructuredText", "_a", "_loadedName", "_string"]; - -_weapon = currentWeapon _target; -_muzzle = currentMuzzle _target; -_magazine = currentMagazine _target; +private _weapon = currentWeapon _target; +private _muzzle = currentMuzzle _target; +private _magazine = currentMagazine _target; // currentWeapon returns "" for static weapons before they are shot once if (_target isKindOf "StaticWeapon") then { @@ -31,8 +29,8 @@ if (_target isKindOf "StaticWeapon") then { if (_magazine == "") then { // Try to get magazine using magazinesAmmoFull - private ["_magazines"]; - _magazines = magazinesAmmoFull _target; + private _magazines = magazinesAmmoFull _target; + { if (_x select 2) exitWith { _magazine = _x select 0; @@ -43,12 +41,12 @@ if (_target isKindOf "StaticWeapon") then { if (_magazine == "") exitWith {}; if (_weapon == "") exitWith {}; -if (typeName _muzzle != "STRING") then {_muzzle = _weapon}; +if (!( _muzzle isEqualType "")) then {_muzzle = _weapon}; -_showNumber = false; -_ammo = 0; -_maxRounds = 1; -_count = 0; +private _showNumber = false; +private _ammo = 0; +private _maxRounds = 1; +private _count = 0; // not grenade launcher if (_muzzle == _weapon) then { @@ -75,16 +73,16 @@ if (_muzzle == _weapon) then { }; }; -_ammoBarsStructuredText = if (_showNumber) then { +private _ammoBarsStructuredText = if (_showNumber) then { parseText format ["%1x", _count] } else { - _color = [((2 * (1 - _ammo / _maxRounds)) min 1), ((2 * _ammo / _maxRounds) min 1), 0]; + private _color = [((2 * (1 - _ammo / _maxRounds)) min 1), ((2 * _ammo / _maxRounds) min 1), 0]; - _string = ""; + private _string = ""; for "_a" from 1 to _count do { _string = _string + "|"; }; - _text = [_string, _color] call EFUNC(common,stringToColoredText); + private _text = [_string, _color] call EFUNC(common,stringToColoredText); _string = ""; for "_a" from (_count + 1) to (_maxRounds min COUNT_BARS) do { @@ -97,11 +95,11 @@ _ammoBarsStructuredText = if (_showNumber) then { if (_target isKindOf "StaticWeapon") then { //Vehicle mags (usualy) don't have pictures, so just show the text above ammo count - _loadedName = getText (configFile >> "CfgMagazines" >> _magazine >> "displaynameshort"); + private _loadedName = getText (configFile >> "CfgMagazines" >> _magazine >> "displaynameshort"); _loadedName = parseText format ["%1", _loadedName]; - _text = composeText [_loadedName, linebreak, _ammoBarsStructuredText]; + private _text = composeText [_loadedName, linebreak, _ammoBarsStructuredText]; [_text] call EFUNC(common,displayTextStructured); } else { - _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); + private _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); [_ammoBarsStructuredText, _picture] call EFUNC(common,displayTextPicture); }; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 4bed7f700a..ebee6fd350 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -11,26 +11,24 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_player,_target); +params ["_player", "_target"]; if (vehicle _target != _target) exitWith {false}; -private ["_magazineCfg","_magazineType", "_condition", "_onFailure", "_onFinish"]; -_magazineType = currentMagazine _target; -_magazineCfg = configFile >> "CfgMagazines" >> _magazineType; +private _magazineType = currentMagazine _target; +private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; + if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; // Check if the ammo is not empty or full -private "_ammoCount"; -_ammoCount = _target ammo currentWeapon _target; +private _ammoCount = _target ammo currentWeapon _target; // Exit if the belt is full or empty if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; // Check if the player has any of the same same magazines // Calculate max ammo it can link -private "_maxAmmo"; -_maxAmmo = 0; +private _maxAmmo = 0; { _maxAmmo = _maxAmmo max (_x select 1); @@ -38,21 +36,20 @@ _maxAmmo = 0; if (_maxAmmo == 0) exitWith {}; - // Condition to call each frame -_condition = { - EXPLODE_2_PVT((_this select 0),_player,_target); +private _condition = { + (_this select 0) params ["_player", "_target"]; ([_player, _target, []] call EFUNC(common,canInteractWith)) && ((_player distance _target) < 3) && ((speed _target) < 1) }; -_onFinish = { - EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); +private _onFinish = { + (_this select 0) params ["_player", "_target", "_magazine"]; // Raise event on remote unit ["linkedAmmo", [_target], [_target, _player, _magazine]] call EFUNC(common,targetEvent); }; -_onFailure = { +private _onFailure = { EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); [_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/repair/ACE_Repair.hpp b/addons/repair/ACE_Repair.hpp index a8aac18690..d47773cd83 100644 --- a/addons/repair/ACE_Repair.hpp +++ b/addons/repair/ACE_Repair.hpp @@ -4,14 +4,15 @@ class ACE_Repair { displayName = CSTRING(ReplaceWheel); displayNameProgress = CSTRING(ReplacingWheel); - locations[] = {"All"}; + repairLocations[] = {"All"}; requiredEngineer = QGVAR(engineerSetting_Wheel); repairingTime = 10; repairingTimeSelfCoef = 1; items = QGVAR(wheelRepairRequiredItems); condition = QUOTE(call FUNC(canReplaceWheel)); itemConsumed = 0; - + claimObjects[] = {{"ACE_Wheel"}}; + callbackSuccess = QUOTE(call FUNC(doReplaceWheel)); callbackFailure = ""; callbackProgress = ""; @@ -27,15 +28,18 @@ class ACE_Repair { displayNameProgress = CSTRING(RemovingWheel); condition = QUOTE(call FUNC(canRemove)); callbackSuccess = QUOTE(call FUNC(doRemoveWheel)); + claimObjects[] = {}; }; class MiscRepair: ReplaceWheel { displayName = CSTRING(Repairing); // let's make empty string an auto generated string displayNameProgress = CSTRING(RepairingHitPoint); condition = QUOTE(call FUNC(canMiscRepair)); - requiredEngineer = 0; + requiredEngineer = QGVAR(engineerSetting_Repair); repairingTime = 15; callbackSuccess = QUOTE(call FUNC(doRepair)); items[] = {"ToolKit"}; + itemConsumed = QGVAR(consumeItem_ToolKit); + claimObjects[] = {}; }; class RepairTrack: MiscRepair { displayName = CSTRING(Repairing); @@ -43,6 +47,8 @@ class ACE_Repair { condition = QUOTE(call FUNC(canRepairTrack)); callbackSuccess = QUOTE(call FUNC(doRepairTrack)); requiredEngineer = QGVAR(engineerSetting_Wheel); + claimObjects[] = {{"ACE_Track"}}; + itemConsumed = 0; }; class RemoveTrack: MiscRepair { displayName = CSTRING(RemoveTrack); @@ -50,6 +56,7 @@ class ACE_Repair { condition = QUOTE(call FUNC(canRemove)); callbackSuccess = QUOTE(call FUNC(doRemoveTrack)); requiredEngineer = QGVAR(engineerSetting_Wheel); + itemConsumed = 0; }; class ReplaceTrack: RemoveTrack { displayName = CSTRING(ReplaceTrack); @@ -57,6 +64,7 @@ class ACE_Repair { condition = QUOTE(call FUNC(canReplaceTrack)); callbackSuccess = QUOTE(call FUNC(doReplaceTrack)); requiredEngineer = QGVAR(engineerSetting_Wheel); + claimObjects[] = {{"ACE_Track"}}; }; class FullRepair: MiscRepair { displayName = CSTRING(fullRepair); @@ -66,6 +74,7 @@ class ACE_Repair { repairingTime = 30; condition = "damage _target > 0"; callbackSuccess = QUOTE(call FUNC(doFullRepair)); + itemConsumed = QGVAR(consumeItem_ToolKit); }; }; }; diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp index 22e68ce3e9..c3c8daad16 100644 --- a/addons/repair/ACE_Settings.hpp +++ b/addons/repair/ACE_Settings.hpp @@ -41,7 +41,7 @@ class ACE_Settings { displayName = CSTRING(consumeItem_ToolKit_name); description = CSTRING(consumeItem_ToolKit_description); typeName = "SCALAR"; - value = 1; + value = 0; values[] = {ECSTRING(common,No), ECSTRING(common,Yes)}; category = ECSTRING(OptionsMenu,CategoryLogistics); }; diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 85abce4028..1968023881 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -302,8 +302,8 @@ class CfgVehicles { MACRO_REPAIRVEHICLE }; - class thingX; - class ACE_RepairItem_Base: thingX { + class ThingX; + class ACE_RepairItem_Base: ThingX { XEH_ENABLED; icon = "iconObject_circle"; mapSize = 0.7; @@ -355,12 +355,26 @@ class CfgVehicles { transportRepair = 0; }; + class Heli_Transport_02_base_F; + class I_Heli_Transport_02_F: Heli_Transport_02_base_F { + GVAR(hitpointPositions[]) = {{"HitVRotor", {-1,-9.4,1.8}}, {"HitHRotor", {0,1.8,1.3}}}; + }; + + class Helicopter_Base_F; + class Heli_light_03_base_F: Helicopter_Base_F { + GVAR(hitpointPositions[]) = {{"HitVRotor", {-0.5,-5.55,1.2}}, {"HitHRotor", {0,1.8,1.5}}}; + }; + class B_APC_Tracked_01_base_F; class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { GVAR(canRepair) = 1; transportRepair = 0; }; + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + GVAR(hitpointPositions[]) = {{"HitTurret", {0,-2,0}}}; + }; + class Car_F; class Offroad_01_base_F: Car_F { GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} }; @@ -404,4 +418,7 @@ class CfgVehicles { class B_Quadbike_01_F: Quadbike_01_base_F { GVAR(hitpointPositions[]) = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; }; + class Hatchback_01_base_F: Car_F { + GVAR(hitpointPositions[]) = {{"HitBody", {0, 0.7, -0.5}}, {"HitFuel", {0, -1.75, -0.75}}}; + }; }; diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf index f94c230f29..8efa47e7b3 100644 --- a/addons/repair/XEH_preInit.sqf +++ b/addons/repair/XEH_preInit.sqf @@ -17,6 +17,7 @@ PREP(doRepair); PREP(doRepairTrack); PREP(doReplaceTrack); PREP(doReplaceWheel); +PREP(getClaimObjects); PREP(getHitPointString); PREP(getPostRepairDamage); PREP(getWheelHitPointsWithSelections); diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 7ebf978088..1a9055d3e2 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -1,5 +1,5 @@ /* - * Author: commy2 + * Author: commy2, SilentSpike * Checks if the vehicles class already has the actions initialized, otherwise add all available repair options. Calleed from init EH. * * Arguments: @@ -15,10 +15,12 @@ */ #include "script_component.hpp" -params ["_vehicle"]; -TRACE_1("params", _vehicle); +if (!hasInterface) exitWith {}; -private ["_type", "_initializedClasses", "_condition", "_statement", "_action"]; +params ["_vehicle"]; +TRACE_2("params", _vehicle,typeOf _vehicle); + +private["_action", "_childHitPoint", "_condition", "_groupsConfig", "_hitPoint", "_hitPointsAddedAmount", "_hitPointsAddedNames", "_hitPointsAddedStrings", "_icon", "_initializedClasses", "_name", "_position", "_positionsConfig", "_processedHitPoints", "_selection", "_statement", "_target", "_type"]; _type = typeOf _vehicle; @@ -28,143 +30,139 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); if (_type in _initializedClasses) exitWith {}; // get all hitpoints and selections -([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitPoints", "_hitPointsSelections"]; +(getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; // get hitpoints of wheels with their selections -([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitPointSelections"]; +([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; - -private ["_hitPointsAddedNames", "_hitPointsAddedStrings", "_hitPointsAddedAmount"]; _hitPointsAddedNames = []; _hitPointsAddedStrings = []; _hitPointsAddedAmount = []; +_processedHitpoints = []; -// add repair events to this vehicle class { - if (_x in _wheelHitPoints) then { - // add wheel repair action + _selection = _x; + _hitpoint = _hitPoints select _forEachIndex; - private ["_icon", "_selection", "_name", "_text"]; + if (_selection in _wheelHitSelections) then { + // Wheels should always be unique + if (_hitpoint in _processedHitpoints) exitWith {TRACE_3("Duplicate Wheel",_hitpoint,_forEachIndex,_selection);}; - _icon = QUOTE(PATHTOF(ui\tire_ca.paa)); _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; - // textDefault = ""; - _selection = _wheelHitPointSelections select (_wheelHitPoints find _x); - // remove wheel action - _name = format ["Remove_%1", _x]; + _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; + + TRACE_3("Adding Wheel Actions",_hitpoint,_forEachIndex,_selection); + + // An action to remove the wheel is required + _name = format ["Remove_%1_%2", _forEachIndex, _hitpoint]; _text = localize LSTRING(RemoveWheel); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; - - _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); + _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); - // replace wheel action - _name = format ["Replace_%1", _x]; + // An action to replace the wheel is required + _name = format ["Replace_%1_%2", _forEachIndex, _hitpoint]; _text = localize LSTRING(ReplaceWheel); - _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(repair)}; - - _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); + _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 2] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); - } else { - // exit if the hitpoint is in the blacklist, e.g. glasses - if (_x in IGNORED_HITPOINTS) exitWith {}; - - private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"]; - - // Get hitpoint groups if available - _hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); - _inHitpointSubGroup = false; - if (isArray _hitpointGroupConfig) then { - // Set variable if current hitpoint is in a sub-group (to be excluded from adding action) - _currentHitpoint = _x; - { - { - if (_x == _currentHitpoint) exitWith { - _inHitpointSubGroup = true; - }; - } forEach (_x select 1); - } forEach (getArray _hitpointGroupConfig); + //Skip glass hitpoints + if (((toLower _hitPoint) find "glass") != -1) exitWith { + TRACE_3("Skipping Glass",_hitpoint,_forEachIndex,_selection); + }; + // Empty selections don't exist + // Empty hitpoints don't contain enough information + if (_selection isEqualTo "") exitWith { TRACE_3("Selection Empty",_hitpoint,_forEachIndex,_selection); }; + if (_hitpoint isEqualTo "") exitWith { TRACE_3("Hitpoint Empty",_hitpoint,_forEachIndex,_selection); }; + //Depends hitpoints shouldn't be modified directly (will be normalized) + if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "depends")) exitWith { + TRACE_3("Skip Depends",_hitpoint,_forEachIndex,_selection); }; - // Exit if current hitpoint is in sub-group (only main hitpoints get actions) - if (_inHitpointSubGroup) exitWith {}; + // Associated hitpoints can be grouped via config to produce a single repair action + _groupsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); + _childHitPoint = false; + if (isArray _groupsConfig) then { + { + { + if (_hitpoint == _x) exitWith { + _childHitPoint = true; + }; + } forEach (_x select 1); + } forEach (getArray _groupsConfig); + }; + // If the current selection is associated with a child hitpoint, then skip + if (_childHitPoint) exitWith { TRACE_3("childHitpoint",_hitpoint,_forEachIndex,_selection); }; - // exit if the hitpoint is virtual - if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {}; + // Find the action position + _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _selection]; - // add misc repair action - private ["_name", "_icon", "_selection", "_customSelectionsConfig"]; + // Custom position can be defined via config for associated hitpoint + _positionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); + if (isArray _positionsConfig) then { + { + _x params ["_hit", "_pos"]; + if (_hitpoint == _hit) exitWith { + if (_pos isEqualType []) exitWith { + _position = _pos; // Position in model space + }; + if (_pos isEqualType "") exitWith { + _position = compile format ["_target selectionPosition ['%1', 'HitPoints'];", _pos]; + }; + ACE_LOGERROR_3("Invalid custom position %1 of hitpoint %2 in vehicle %3.",_position,_hitpoint,_type); + }; + } forEach (getArray _positionsConfig); + }; - _name = format ["Repair_%1", _x]; + // Prepair the repair action + _name = format ["Repair_%1_%2", _forEachIndex, _selection]; + _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; // Find localized string and track those added for numerization - ([_x, "%1", _x, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"]; + ([_hitpoint, "%1", _hitpoint, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"]; _hitPointsAddedNames = _trackArray select 0; _hitPointsAddedStrings = _trackArray select 1; _hitPointsAddedAmount = _trackArray select 2; - _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; - - _selection = ""; - - // Get custom position if available - _customSelectionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); - if (isArray _customSelectionsConfig) then { - // Loop through custom hitpoint positions array - _currentHitpoint = _x; - { - _x params ["_hitpoint", "_position"]; - // Exit with supplied custom position when same hitpoint name found or print RPT error if it's invalid - if (_hitpoint == _currentHitpoint) exitWith { - if (typeName _position == "ARRAY") exitWith { - _selection = _position; // Position in model space - }; - if (typeName _position == "STRING") exitWith { - _selection = _vehicle selectionPosition _position; // Selection name - }; - ACE_LOGERROR_3("Invalid custom position %1 of hitpoint %2 in vehicle %3.",_position,_hitpoint,_vehicle); - }; - } forEach (getArray _customSelectionsConfig); - }; - - // If position still empty (not a position array or selection name) try extracting from model - if (typeName _selection == "STRING" && {_selection == ""}) then { - _selection = _vehicle selectionPosition (_hitPointsSelections select (_hitPoints find _x)); - }; - - _condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; - _statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; - - if (_x in TRACK_HITPOINTS) then { - if (_x == "HitLTrack") then { - _selection = [-1.75, 0, -1.75]; + if (_hitpoint in TRACK_HITPOINTS) then { + // 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]; } else { - _selection = [1.75, 0, -1.75]; + _position = [1.75, 0, -1.75]; }; - _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "RepairTrack"], _selection, 4] call EFUNC(interact_menu,createAction); + TRACE_4("Adding RepairTrack",_hitpoint,_forEachIndex,_selection,_text); + _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(canRepair)}; + _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RepairTrack"] call DFUNC(repair)}; + _action = [_name, _text, _icon, _statement, _condition, {}, [_hitpoint], _position, 4] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); } else { - _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction); + TRACE_4("Adding MiscRepair",_hitpoint,_forEachIndex,_selection,_text); + _condition = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(canRepair)}; + _statement = {[_this select 1, _this select 0, _this select 2 select 0, "MiscRepair"] call DFUNC(repair)}; + _action = [_name, _text, _icon, _statement, _condition, {}, [_forEachIndex], _position, 5] call EFUNC(interact_menu,createAction); // Put inside main actions if no other position was found above - if (_selection isEqualTo [0, 0, 0]) then { + if (_position isEqualTo [0,0,0]) then { [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); } else { [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); }; }; - }; -} forEach _hitPoints; -_condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; -_statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; -_action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, ["", "fullRepair"], "", 4] call EFUNC(interact_menu,createAction); + _processedHitPoints pushBack _hitPoint; + }; +} forEach _hitSelections; + +_condition = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(canRepair)}; +_statement = {[_this select 1, _this select 0, "", "fullRepair"] call DFUNC(repair)}; +_action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, [], "", 4] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); + // set class as initialized _initializedClasses pushBack _type; diff --git a/addons/repair/functions/fnc_addSpareParts.sqf b/addons/repair/functions/fnc_addSpareParts.sqf index 4d3197c8e8..74ea0d4c10 100644 --- a/addons/repair/functions/fnc_addSpareParts.sqf +++ b/addons/repair/functions/fnc_addSpareParts.sqf @@ -18,7 +18,6 @@ */ #include "script_component.hpp" -private ["_part"]; params ["_vehicle", ["_amount", 1], ["_part", ""], ["_force", false]]; TRACE_2("params",_vehicle,_amount); diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf index 0533f9f4fc..7ebfb5c5a8 100644 --- a/addons/repair/functions/fnc_canMiscRepair.sqf +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -5,38 +5,51 @@ * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair - * 2: Selected hitpoint + * 2: Selected hitpoint INDEX * * Return Value: * Can Misc Repair * * Example: - * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair + * [unit, vehicle, 5] call ace_repair_fnc_canMiscRepair * * Public: No */ + #include "script_component.hpp" -private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"]; -params ["_caller", "_target", "_hitPoint"]; +private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return", "_hitPointClassname", "_subHitIndex"]; +params ["_caller", "_target", "_hitPointIndex"]; -if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; +(getAllHitPointsDamage _target) params ["_allHitPoints", "", "_allHitPointDamages"]; + +if !([_caller, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Get hitpoint groups if available _hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); _hitpointGroup = []; if (isArray _hitpointGroupConfig) then { + _hitPointClassname = _allHitPoints select _hitPointIndex; + // Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group { + _x params ["_masterHitpoint", "_subHitArray"]; // Exit using found hitpoint group if this hitpoint is leader of any - if (_x select 0 == _hitPoint) exitWith { - _hitpointGroup = _x select 1; + if (_masterHitpoint == _hitPointClassname) exitWith { + { + _subHitIndex = _allHitPoints find _x; + if (_subHitIndex == -1) then { + ERROR("Hitpoint Not Found"); + } else { + _hitpointGroup pushBack _subHitIndex; + }; + } forEach _subHitArray; }; } forEach (getArray _hitpointGroupConfig); }; // Add current hitpoint to the group -_hitpointGroup pushBack _hitPoint; +_hitpointGroup pushBack _hitPointIndex; // Get post repair damage _postRepairDamage = [_caller] call FUNC(getPostRepairDamage); @@ -44,7 +57,7 @@ _postRepairDamage = [_caller] call FUNC(getPostRepairDamage); // Return true if damage can be repaired on any hitpoint in the group, else false _return = false; { - if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith { + if ((_allHitPointDamages select _x) > _postRepairDamage) exitWith { _return = true; }; } forEach _hitpointGroup; diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index 8fb2a4938e..f7c3f60a8a 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -5,14 +5,14 @@ * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair - * 2: Selected hitpoint + * 2: Selected hitpoint or hitpointIndex or * 3: Repair Action Classname * * Return Value: * Can Repair * * Example: - * ["something", player] call ace_repair_fnc_canRepair + * [player, car, "HitHull", "MiscRepair"] call ace_repair_fnc_canRepair * * Public: Yes */ @@ -21,22 +21,22 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_caller,_target,_hitPoint,_className); -private ["_config", "_engineerRequired", "_items", "_locations", "_return", "_condition", "_vehicleStateCondition", "_settingName", "_settingItemsArray"]; +private ["_config", "_engineerRequired", "_items", "_return", "_condition", "_vehicleStateCondition", "_settingName", "_settingItemsArray"]; _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); -if !(isClass _config) exitwith {false}; // or go for a default? -if(isEngineOn _target) exitwith {false}; +if !(isClass _config) exitWith {false}; // or go for a default? +if(isEngineOn _target) exitWith {false}; _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { getNumber (_config >> "requiredEngineer"); } else { // Check for required class - if (isText (_config >> "requiredEngineer")) exitwith { + if (isText (_config >> "requiredEngineer")) exitWith { missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; }; 0; }; -if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; +if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; //Items can be an array of required items or a string to a ACE_Setting array _items = if (isArray (_config >> "items")) then { @@ -49,56 +49,64 @@ _items = if (isArray (_config >> "items")) then { }; _settingItemsArray select (missionNamespace getVariable _settingName); }; -if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; +if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; _return = true; if (getText (_config >> "condition") != "") then { _condition = getText (_config >> "condition"); - if (isnil _condition) then { + if (isNil _condition) then { _condition = compile _condition; } else { _condition = missionNamespace getVariable _condition; }; - if (typeName _condition == "BOOL") then { + if (_condition isEqualType false) then { _return = _condition; } else { _return = [_caller, _target, _hitPoint, _className] call _condition; }; }; -if (!_return) exitwith {false}; +if (!_return) exitWith {false}; -_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { - missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] -} else { - getNumber(_config >> "vehicleStateCondition") -}; -// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; +// _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { + // missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] +// } else { + // getNumber(_config >> "vehicleStateCondition") +// }; +// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false}; -_locations = getArray (_config >> "repairLocations"); -if ("All" in _locations) exitwith {true}; - -private ["_repairFacility", "_repairVeh"]; -_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; -_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; - -{ - if (_x == "field") exitwith {_return = true;}; - if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; - if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; - if !(isnil _x) exitwith { - private "_val"; - _val = missionNamespace getVariable _x; - if (typeName _val == "SCALAR") then { - _return = switch (_val) do { - case 0: {true}; //useAnywhere - case 1: {call _repairVeh}; //repairVehicleOnly - case 2: {call _repairFacility}; //repairFacilityOnly - case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility - default {false}; //Disabled +private _repairLocations = getArray (_config >> "repairLocations"); +if (!("All" in _repairLocations)) then { + private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; + private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; + { + if (_x == "field") exitWith {_return = true;}; + if (_x == "RepairFacility" && _repairFacility) exitWith {_return = true;}; + if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;}; + if !(isNil _x) exitWith { + private _val = missionNamespace getVariable _x; + if (_val isEqualType 0) then { + _return = switch (_val) do { + case 0: {true}; //useAnywhere + case 1: {call _repairVeh}; //repairVehicleOnly + case 2: {call _repairFacility}; //repairFacilityOnly + case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility + default {false}; //Disabled + }; }; }; - }; -} forEach _locations; + } forEach _repairLocations; +}; +if (!_return) exitWith {false}; -_return && alive _target; +//Check that there are required objects nearby +private _requiredObjects = getArray (_config >> "claimObjects"); +if (!(_requiredObjects isEqualTo [])) then { + private _objectsAvailable = [_caller, 5, _requiredObjects] call FUNC(getClaimObjects); + if (_objectsAvailable isEqualTo []) then { + TRACE_2("Missing Required Objects",_requiredObjects,_objectsAvailable); + _return = false + }; +}; + +_return && {alive _target}; diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf index 0ba01afb87..e1ff4a5628 100644 --- a/addons/repair/functions/fnc_canRepairTrack.sqf +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -1,6 +1,6 @@ /* * Author: commy2 - * Check if the unit can replace given wheel of the vehicle. + * Check if the unit can replace given track of the vehicle. * * Arguments: * 0: Unit that does the repairing @@ -17,27 +17,11 @@ */ #include "script_component.hpp" -params ["_unit", "_target", "_hitPoint", ["_wheel",false]]; -TRACE_4("params",_unit,_target,_hitPoint,_wheel); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +params ["_unit", "_target", "_hitPoint"]; +TRACE_3("params",_unit,_target,_hitPoint); if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; -if (typeName _wheel == "OBJECT") then { - // not near interpret as objNull - if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then { - _wheel = objNull; - }; -} else { - _wheel = objNull; +//check for a near track is handled by claimObjects[] config - { - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _wheel = _x; - }; - } forEach nearestObjects [_unit, ["ACE_Track"], 5]; -}; - -if (isNull _wheel || damage _wheel >= 1) exitWith {false}; - -alive _target && {_target getHitPointDamage _hitPoint > 0} +(_target getHitPointDamage _hitPoint > 0) diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf index aec3a9f062..a272a0d176 100644 --- a/addons/repair/functions/fnc_canReplaceTrack.sqf +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -1,12 +1,11 @@ /* * Author: commy2 - * Check if the unit can replace given wheel of the vehicle. + * Check if the unit can replace given track of the vehicle. * * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair * 2: Selected hitpoint - * 3: Track / (default: false) * * Return Value: * None @@ -18,27 +17,11 @@ */ #include "script_component.hpp" -params ["_unit", "_target", "_hitPoint", ["_track", false]]; -TRACE_4("params",_unit,_target,_hitPoint,_track); -// TODO [_unit, _track] call EFUNC(common,claim); on start of action +params ["_unit", "_target", "_hitPoint"]; +TRACE_3("params",_unit,_target,_hitPoint); if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; -if (typeName _track == "OBJECT") then { - // not near interpret as objNull - if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then { - _track = objNull; - }; -} else { - _track = objNull; +//check for a near track object is handled by claimObjects[] config - { - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _track = _x; - }; - } forEach nearestObjects [_unit, ["ACE_Track"], 5]; -}; - -if (isNull _track) exitWith {false}; - -alive _target && {_target getHitPointDamage _hitPoint >= 1} +(_target getHitPointDamage _hitPoint >= 1) diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf index cf7a047f19..0b7f7ad4e7 100644 --- a/addons/repair/functions/fnc_canReplaceWheel.sqf +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -6,7 +6,6 @@ * 0: Unit that does the repairing * 1: Vehicle to repair * 2: Selected hitpoint - * 3: Wheel / (default: false) * * Return Value: * None @@ -18,31 +17,12 @@ */ #include "script_component.hpp" -params ["_unit", "_target", "_hitPoint", ["_wheel", false]]; -TRACE_4("params",_unit,_target,_hitPoint,_wheel); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action -//if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false}; +params ["_unit", "_target", "_hitPoint"]; +TRACE_3("params",_unit,_target,_hitPoint); if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; -//if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false}; +//check for GVAR(engineerSetting_Wheel) is handeled by requiredEngineer config +//check for a near wheel object is handled by claimObjects[] config -// check for a near wheel -if (typeName _wheel == "OBJECT") then { - // not near interpret as objNull - if !(_wheel in nearestObjects [_unit, ["ACE_Wheel"], 5]) then { - _wheel = objNull; - }; -} else { - _wheel = objNull; - - { - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _wheel = _x; - }; - } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; -}; - -if (isNull _wheel) exitWith {false}; - -alive _target && {_target getHitPointDamage _hitPoint >= 1} +(_target getHitPointDamage _hitPoint >= 1) diff --git a/addons/repair/functions/fnc_doFullRepair.sqf b/addons/repair/functions/fnc_doFullRepair.sqf index 6beec4c4c7..ed67a69e99 100644 --- a/addons/repair/functions/fnc_doFullRepair.sqf +++ b/addons/repair/functions/fnc_doFullRepair.sqf @@ -1,23 +1,22 @@ /* * Author: Glowbal - * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * Fully repairs vehicle * * Arguments: - * 0: Unit that does the repairing + * 0: Unit that does the repairing (not used) * 1: Vehicle to repair - * 2: Selected hitpoint * * Return Value: * None * * Example: - * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doFullRepair + * [unit, vehicle] call ace_repair_fnc_doFullRepair * * Public: No */ #include "script_component.hpp" -params ["_unit", "_vehicle", "_hitPoint"]; -TRACE_3("params",_unit,_vehicle,_hitPoint); +params ["", "_vehicle"]; +TRACE_1("params",_vehicle); _vehicle setDamage 0; diff --git a/addons/repair/functions/fnc_doRemoveTrack.sqf b/addons/repair/functions/fnc_doRemoveTrack.sqf index 68755658ca..d36407b197 100644 --- a/addons/repair/functions/fnc_doRemoveTrack.sqf +++ b/addons/repair/functions/fnc_doRemoveTrack.sqf @@ -19,10 +19,9 @@ params ["_unit", "_vehicle", "_hitPoint"]; TRACE_3("params",_unit,_vehicle,_hitPoint); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + // get current hitpoint damage -private "_hitPointDamage"; -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; // can't remove destroyed or already removed wheel if (_hitPointDamage >= 1) exitWith {}; @@ -30,10 +29,9 @@ if (_hitPointDamage >= 1) exitWith {}; // don't die by spawning / moving the wheel ["fixCollision", _unit] call EFUNC(common,localEvent); -// spawn wheel -private "_wheel"; -_wheel = ["ACE_Track", getPosASL _unit] call FUNC(spawnObject); -_wheel setdamage _hitPointDamage; +// spawn track +private _newTrack = ["ACE_Track", getPosASL _unit, _hitPointDamage] call FUNC(spawnObject); +TRACE_2("new track created",_newTrack,damage _newTrack); // raise event to set the new hitpoint damage ["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); diff --git a/addons/repair/functions/fnc_doRemoveWheel.sqf b/addons/repair/functions/fnc_doRemoveWheel.sqf index 0ffeb7ad23..21a152c597 100644 --- a/addons/repair/functions/fnc_doRemoveWheel.sqf +++ b/addons/repair/functions/fnc_doRemoveWheel.sqf @@ -19,10 +19,9 @@ params ["_unit", "_vehicle", "_hitPoint"]; TRACE_3("params",_unit,_vehicle,_hitPoint); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + // get current hitpoint damage -private "_hitPointDamage"; -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; // can't remove destroyed or already removed wheel if (_hitPointDamage >= 1) exitWith {}; @@ -31,9 +30,8 @@ if (_hitPointDamage >= 1) exitWith {}; ["fixCollision", _unit] call EFUNC(common,localEvent); // spawn wheel -private "_wheel"; -_wheel = ["ACE_Wheel", getPosASL _unit] call FUNC(spawnObject); -_wheel setdamage _hitPointDamage; +private _newWheel = ["ACE_Wheel", getPosASL _unit, _hitPointDamage] call FUNC(spawnObject); +TRACE_2("new wheel created",_newWheel,damage _newWheel); // raise event to set the new hitpoint damage ["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf index 1cf3f77bca..4c063c6c73 100644 --- a/addons/repair/functions/fnc_doRepair.sqf +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -5,61 +5,70 @@ * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair - * 2: Selected hitpoint + * 2: Selected hitpointIndex * * Return Value: * None * * Example: - * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRepair + * [unit, vehicle, 6, "MiscRepair"] call ace_repair_fnc_doRepair * * Public: No */ #include "script_component.hpp" -private ["_hitPointDamage", "_text", "_hitpointGroup"]; -params ["_unit", "_vehicle", "_hitPoint"]; -TRACE_3("params",_unit,_vehicle,_hitPoint); +params ["_unit", "_vehicle", "_hitPointIndex"]; +TRACE_3("params",_unit,_vehicle,_hitPointIndex); + +private _postRepairDamageMin = [_unit] call FUNC(getPostRepairDamage); + +(getAllHitPointsDamage _vehicle) params ["_allHitPoints"]; +private _hitPointClassname = _allHitPoints select _hitPointIndex; // get current hitpoint damage -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _hitPointCurDamage = _vehicle getHitIndex _hitPointIndex; -_hitPointDamage = _hitPointDamage - 0.5; -// don't use negative values for damage -_hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage)); +// repair a max of 0.5, don't use negative values for damage +private _hitPointNewDamage = (_hitPointCurDamage - 0.5) max _postRepairDamageMin; -// raise event to set the new hitpoint damage -["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); +if (_hitPointNewDamage < _hitPointCurDamage) then { + // raise event to set the new hitpoint damage + TRACE_3("repairing main point", _vehicle, _hitPointIndex, _hitPointNewDamage); + ["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPointIndex, _hitPointNewDamage]] call EFUNC(common,targetEvent); + _hitPointCurDamage = _hitPointNewDamage; +}; // Get hitpoint groups if available -_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups); -_hitpointGroup = []; +private _hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups); if (isArray _hitpointGroupConfig) then { - // Retrieve group if current hitpoint is leader of any + // Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group { - if (_x select 0 == _hitPoint) exitWith { - ([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"]; - // Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error + _x params ["_masterHitpoint", "_subHitArray"]; + // Exit using found hitpoint group if this hitpoint is leader of any + if (_masterHitpoint == _hitPointClassname) exitWith { { - if (_x in _hitpoints) then { - ["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent); + private _subHitIndex = _allHitPoints find _x; //convert hitpoint classname to index + if (_subHitIndex == -1) then { + ACE_LOGERROR_2("Invalid hitpoint %1 in hitpointGroups of %2",_x,_vehicle); } else { - diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle]; + private _subPointCurDamage = _vehicle getHitIndex _hitPointIndex; + private _subPointNewDamage = (_subPointCurDamage - 0.5) max _postRepairDamageMin; + if (_subPointNewDamage < _subPointCurDamage) then { + TRACE_3("repairing sub point", _vehicle, _subHitIndex, _subPointNewDamage); + ["setVehicleHitPointDamage", _vehicle, [_vehicle, _subHitIndex, _subPointNewDamage]] call EFUNC(common,targetEvent); + }; }; - - } forEach (_x select 1); + } forEach _subHitArray; }; } forEach (getArray _hitpointGroupConfig); }; // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { - private ["_textLocalized", "_textDefault"]; - // Find localized string - _textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)); - _textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0)); - ([_hitPoint, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"]; + private _textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointCurDamage > 0)); + private _textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointCurDamage > 0)); + ([_hitPointClassname, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"]; // Display text [_text] call EFUNC(common,displayTextStructured); diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf index de04e71920..46c94c29f9 100644 --- a/addons/repair/functions/fnc_doRepairTrack.sqf +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -6,43 +6,39 @@ * 0: Unit that does the repairing * 1: Vehicle to repair * 2: Selected hitpoint - * 3: Repair Action Classname + * 3: Repair Action Classname (Not used) + * 4: (Not used) + * 5: (Not used) + * 6: Required Repair Objects * * Return Value: * None * * Example: - * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doRepairTrack + * [unit, vehicle, "hitpoint", "RepairTrack", [], [], [aTrack]] call ace_repair_fnc_doRepairTrack * * Public: No */ #include "script_component.hpp" -params ["_unit", "_vehicle", "_hitPoint", "_classname"]; -TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +params ["_unit", "_vehicle", "_hitPoint", "", "", "", "_claimedObjects"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); -private ["_hitPointDamage", "_newDamage", "_wheel"]; +_claimedObjects params [["_track", objNull]]; +if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { + ACE_LOGERROR_1("Bad Track", _claimedObjects); +}; -_wheel = objNull; - -{ - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _wheel = _x; - }; -} forEach nearestObjects [_unit, ["ACE_Track"], 5]; -if (isNull _wheel) exitwith {}; +// can't use a destroyed track +if ((damage _track) >= 1) exitWith {}; // get current hitpoint damage +private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _damageRepaired = (1 - (damage _track)) / 4; // require 4 tracks to fully replace one side -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; -_newDamage = (1 - (damage _wheel)) / 4; // require 4 tracks to fully replace one side - -// can't replace a destroyed wheel -if ((damage _wheel) >= 1) exitWith {}; // don't die by spawning / moving the wheel -_hitPointDamage = (_hitPointDamage - _newDamage) min 0; -deleteVehicle _wheel; +_hitPointDamage = (_hitPointDamage - _damageRepaired) min 0; +deleteVehicle _track; // raise event to set the new hitpoint damage ["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf index a95a669159..9eafe68c9e 100644 --- a/addons/repair/functions/fnc_doReplaceTrack.sqf +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -1,54 +1,50 @@ /* * Author: commy2 - * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * Replaces a track. * * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair * 2: Selected hitpoint - * 3: Repair Action Classname + * 3: Repair Action Classname (Not used) + * 4: (Not used) + * 5: (Not used) + * 6: Required Repair Objects * * Return Value: * None * * Example: - * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceTrack + * [unit, vehicle, "hitpoint", "ReplaceTrack", [], [], [aTrack]] call ace_repair_fnc_doReplaceTrack * * Public: No */ #include "script_component.hpp" -params ["_unit", "_vehicle", "_hitPoint", "_classname"]; -TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +params ["_unit", "_vehicle", "_hitPoint", "", "", "", "_claimedObjects"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); -private["_hitPointDamage", "_wheel"]; - -_wheel = objNull; - -{ - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _wheel = _x; - }; -} forEach nearestObjects [_unit, ["ACE_Track"], 5]; -if (isNull _wheel) exitwith {}; +_claimedObjects params [["_track", objNull]]; +if ((isNull _track) || {!([_unit, _track, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { + ACE_LOGERROR_1("Bad Track", _claimedObjects); +}; // get current hitpoint damage -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; // can't replace not destroyed wheel if (_hitPointDamage < 1) exitWith {}; -// don't die by spawning / moving the wheel -_hitPointDamage = damage _wheel; +// get track's damage +private _newHitPointDamage = damage _track; -// can't replace a destroyed wheel -if (_hitPointDamage >= 1) exitWith {}; +// can't replace with a destroyed wheel +if (_newHitPointDamage >= 1) exitWith {}; -deleteVehicle _wheel; +deleteVehicle _track; // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _newHitPointDamage]] call EFUNC(common,targetEvent); // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf index f10712d65d..ce5e9220dd 100644 --- a/addons/repair/functions/fnc_doReplaceWheel.sqf +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -1,54 +1,50 @@ /* * Author: commy2 - * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * Repairs a vehicle's wheel with a ACE_wheel spare part object. * * Arguments: * 0: Unit that does the repairing * 1: Vehicle to repair * 2: Selected hitpoint - * 3: Repair Action Classname + * 3: Repair Action Classname (Not used) + * 4: (Not used) + * 5: (Not used) + * 6: Required Repair Objects * * Return Value: * None * * Example: - * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceWheel + * [unit, vehicle, "hitpoint", "ReplaceWheel", [], [], [aWheel]] call ace_repair_fnc_doReplaceWheel * * Public: No */ #include "script_component.hpp" -params ["_unit", "_vehicle", "_hitPoint", "_classname"]; -TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); -// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +params ["_unit", "_vehicle", "_hitPoint", "", "", "", "_claimedObjects"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_claimedObjects); -private ["_hitPointDamage", "_wheel"]; - -_wheel = objNull; - -{ - if ([_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith { - _wheel = _x; - }; -} forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; -if (isNull _wheel) exitwith {}; +_claimedObjects params [["_wheel", objNull]]; +if ((isNull _wheel) || {!([_unit, _wheel, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith))}) exitWith { + ACE_LOGWARNING_1("Bad Claimed Wheel", _claimedObjects); +}; // get current hitpoint damage -_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +private _hitPointDamage = _vehicle getHitPointDamage _hitPoint; // can't replace not destroyed wheel if (_hitPointDamage < 1) exitWith {}; -// don't die by spawning / moving the wheel -_hitPointDamage = damage _wheel; +// get replacement wheel's damage +private _newHitPointDamage = damage _wheel; // can't replace a destroyed wheel -if (_hitPointDamage >= 1) exitWith {}; +if (_newHitPointDamage >= 1) exitWith {}; deleteVehicle _wheel; // raise event to set the new hitpoint damage -["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _newHitPointDamage]] call EFUNC(common,targetEvent); // display text message if enabled if (GVAR(DisplayTextOnRepair)) then { diff --git a/addons/repair/functions/fnc_getClaimObjects.sqf b/addons/repair/functions/fnc_getClaimObjects.sqf new file mode 100644 index 0000000000..bc15975d1c --- /dev/null +++ b/addons/repair/functions/fnc_getClaimObjects.sqf @@ -0,0 +1,45 @@ +/* + * Author: PabstMirror + * Returns array of required nearby repair objects (wheels/tracks) + * + * Arguments: + * 0: Unit that does the repairing + * 1: Max range to seach from unit (meters) + * 2: Array of arrays of classnames + * + * Return Value: + * Array of objects, or [] if not all available + * + * Example: + * [player, 5, [["Ace_Track"]]] call ace_repair_fnc_getClaimObjects + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_maxRange", "_objectsToClaim"]; +TRACE_3("params",_unit,_maxRange,_objectsToClaim); + +private _return = []; + +{ + private _requiredList = _x; //eg ["ace_track", "ace_track"] + private _ableToAquire = []; //will be array of ojbects + { + private _nearObjects = nearestObjects [_unit, [_x], _maxRange]; + private _canClaimObject = objNull; + { + if ((!(_x in _ableToAquire)) + && {[_unit, _x, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)} + &&{(damage _x) < 1} + ) exitWith { _canClaimObject = _x; }; + } forEach _nearObjects; + if (isNull _canClaimObject) exitWith {}; + _ableToAquire pushBack _canClaimObject; + } forEach _x; + TRACE_2("Check required equals available",_requiredList,_ableToAquire); + if ((count _ableToAquire) == (count _requiredList)) exitWith {_return = _ableToAquire}; + false +} count _objectsToClaim; + +_return diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf index 1358e99595..fd108e4b1f 100644 --- a/addons/repair/functions/fnc_getHitPointString.sqf +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -13,15 +13,16 @@ * 1: Added Hitpoint (default: []) * * Example: - * [unit, vehicle, "hitpoint"] call ace_repair_fnc_getHitPointString + * ["HitFuel", "Repairing %1 ...", "Repairing HitFuel"] call ace_repair_fnc_getHitPointString * * Public: No */ #include "script_component.hpp" -private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"]; params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]]; +private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"]; + _track = if (count _trackArray > 0) then {true} else {false}; _trackNames = []; _trackStrings = []; @@ -37,7 +38,7 @@ if (_track) then { _text = LSTRING(Hit); // Remove "Hit" from hitpoint name if one exists -_toFind = if (_hitPoint find "Hit" == 0) then { +_toFind = if ((toLower _hitPoint) find "hit" == 0) then { [_hitPoint, 3] call CBA_fnc_substr } else { _hitPoint @@ -83,6 +84,7 @@ for "_i" from 0 to (count _hitPoint) do { // Don't display part name if no string is found in stringtable if (_text == LSTRING(Hit)) then { + if (_hitPoint != "") then { ACE_LOGWARNING_1("Hitpoint [%1] - could not be localized", _hitPoint); }; _text = _textDefault; }; diff --git a/addons/repair/functions/fnc_getPostRepairDamage.sqf b/addons/repair/functions/fnc_getPostRepairDamage.sqf index 797f7a4f22..9388f4474d 100644 --- a/addons/repair/functions/fnc_getPostRepairDamage.sqf +++ b/addons/repair/functions/fnc_getPostRepairDamage.sqf @@ -17,10 +17,15 @@ params ["_unit"]; TRACE_1("params",_unit); -// TODO when near repair station, full repair? -if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitwith {0}; +//If in facility or near vehicle then complete repair of hitpoint: +if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitWith {0}; -if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)}; -if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)}; -0.3; +private _class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")]; +//If specialist or more qualified than min, then use engineer threshold: +if ((_class isEqualTo 2) || {[_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)}) exitWith { + (GVAR(repairDamageThreshold_Engineer) min GVAR(repairDamageThreshold)) +}; + +//Return default threshold: +GVAR(repairDamageThreshold) diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf index 182c6f54f0..2611d10b38 100644 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -10,7 +10,7 @@ * 1: Wheel hitpoint selections in model coordinates * * Example: - * [unit, vehicle, "hitpoint"] call ace_repair_fnc_getWheelHitPointsWithSelections + * [car1] call ace_repair_fnc_getWheelHitPointsWithSelections * * Public: No */ @@ -19,64 +19,80 @@ params ["_vehicle"]; TRACE_1("params",_vehicle); +private["_bestDist", "_bestIndex", "_wheelBone", "_wheelBoneNameResized", "_wheelCenter", "_wheelCenterPos", "_wheelHitPoint", "_wheelHitPointSelection", "_wheelHitPointSelections", "_wheelHitPoints", "_wheelName", "_xDist", "_xPos"]; + // get the vehicles wheel config private "_wheels"; -_wheels = configfile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; +_wheels = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; // exit with nothing if the vehicle has no wheels class -if !(isClass _wheels) exitWith {[[],[]]}; +if !(isClass _wheels) exitWith {TRACE_1("No Wheels",_wheels); [[],[]]}; + +// get all hitpoints and selections +(getAllHitPointsDamage _vehicle) params ["_hitPoints", "_hitPointSelections"]; // get all wheels and read selections from config -private ["_selections", "_bones"]; - _wheels = "true" configClasses _wheels; -_selections = []; -_bones = []; -{ - _selections pushBack getText (_x >> "center"); - - private "_bone"; - _bone = getText (_x >> "boneName"); - - _bone = toArray _bone; - _bone resize count "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. - _bone = toString _bone; - - _bones pushBack _bone; -} forEach _wheels; - -// get hitpoints with their fire geometry selections -private ["_hitPointsWithSelections", "_hitPoints", "_hitPointSelections"]; - -_hitPointsWithSelections = [_vehicle] call EFUNC(common,getHitPointsWithSelections); - -_hitPoints = _hitPointsWithSelections select 0; -_hitPointSelections = _hitPointsWithSelections select 1; - -// assign hitpoints to correct wheel selection by comparing bone name and fire geometry selection -private ["_wheelHitPoints", "_wheelHitPointSelections"]; - _wheelHitPoints = []; _wheelHitPointSelections = []; + { - private "_bone"; - _bone = _x; + _wheelName = configName _x; + _wheelCenter = getText (_x >> "center"); + _wheelBone = getText (_x >> "boneName"); + _wheelBoneNameResized = _wheelBone select [0, 9]; //ount "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. - private "_index"; + TRACE_4("",_wheelName,_wheelCenter,_wheelBone,_wheelBoneNameResized); - _index = -1; + _wheelHitPoint = ""; + _wheelHitPointSelection = ""; + + //Commy's orginal method { - if (_bone != "" && {_x find _bone == 0}) exitWith { // same as above. Requirement for physx. - _index = _forEachIndex; + if ((_wheelBoneNameResized != "") && {_x find _wheelBoneNameResized == 0}) exitWith { // same as above. Requirement for physx. + _wheelHitPoint = _hitPoints select _forEachIndex; + _wheelHitPointSelection = _hitPointSelections select _forEachIndex; + TRACE_2("wheel found [Orginal]", _wheelName, _wheelHitPoint); }; } forEach _hitPointSelections; - if (_index != -1) then { - _wheelHitPoints pushBack (_hitPoints select _index); - _wheelHitPointSelections pushBack (_selections select _forEachIndex); + + if (_vehicle isKindOf "Car") then { + //Backup method, search for the closest hitpoint to the wheel's center selection pos. + //Ref #2742 - RHS's HMMWV + if (_wheelHitPoint == "") then { + _wheelCenterPos = _vehicle selectionPosition _wheelCenter; + if (_wheelCenterPos isEqualTo [0,0,0]) exitWith {TRACE_1("no center?",_wheelCenter);}; + + + _bestDist = 99; + _bestIndex = -1; + { + if (_x != "") then { + _xPos = _vehicle selectionPosition _x; + if (_xPos isEqualTo [0,0,0]) exitWith {}; + _xDist = _wheelCenterPos distance _xPos; + if (_xDist < _bestDist) then { + _bestIndex = _forEachIndex; + _bestDist = _xDist; + }; + }; + } forEach _hitPointSelections; + + TRACE_2("closestPoint",_bestDist,_bestIndex); + if (_bestIndex != -1) then { + _wheelHitPoint = _hitPoints select _bestIndex; + _wheelHitPointSelection = _hitPointSelections select _bestIndex; + TRACE_2("wheel found [Backup]", _wheelName, _wheelHitPoint); + }; + }; }; -} forEach _bones; + if ((_wheelHitPoint != "") && {_wheelHitPointSelection != ""}) then { + _wheelHitPoints pushBack _wheelHitPoint; + _wheelHitPointSelections pushBack _wheelHitPointSelection; + }; +} forEach _wheels; [_wheelHitPoints, _wheelHitPointSelections] diff --git a/addons/repair/functions/fnc_hasItems.sqf b/addons/repair/functions/fnc_hasItems.sqf index 2f070c8bb6..3af9316256 100644 --- a/addons/repair/functions/fnc_hasItems.sqf +++ b/addons/repair/functions/fnc_hasItems.sqf @@ -23,10 +23,10 @@ private ["_return"]; _return = true; { - if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith { + if ((_x isEqualType []) && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitWith { _return = false; }; - if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith { + if ((_x isEqualType "") && {!([_unit, _x] call EFUNC(common,hasItem))}) exitWith { _return = false; }; } forEach _items; diff --git a/addons/repair/functions/fnc_isEngineer.sqf b/addons/repair/functions/fnc_isEngineer.sqf index 9d6af3a1ff..d07c12af64 100644 --- a/addons/repair/functions/fnc_isEngineer.sqf +++ b/addons/repair/functions/fnc_isEngineer.sqf @@ -24,6 +24,6 @@ _class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehic // This if statement is here for copmatability with the common variant of isEngineer, which requires a bool. // We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module. -if (typeName _class == "BOOL") then {_class = 1}; +if (_class isEqualType false) then {_class = [0, 1] select _class}; -_class >= (_engineerN min GVAR(engineerSetting_Repair)); +_class >= _engineerN; diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf index 0c062ff0b3..b72d8a5985 100644 --- a/addons/repair/functions/fnc_isInRepairFacility.sqf +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -26,7 +26,7 @@ _repairFacility = []; _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]); { - if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { + if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitWith { _isInBuilding = true; }; } forEach _objects; @@ -34,7 +34,7 @@ _objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position sel if (!_isInBuilding) then { _objects = position _object nearObjects 7.5; { - if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { + if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitWith { _isInBuilding = true; }; } forEach _objects; diff --git a/addons/repair/functions/fnc_isNearRepairVehicle.sqf b/addons/repair/functions/fnc_isNearRepairVehicle.sqf index 677f489a88..463e281faa 100644 --- a/addons/repair/functions/fnc_isNearRepairVehicle.sqf +++ b/addons/repair/functions/fnc_isNearRepairVehicle.sqf @@ -24,7 +24,7 @@ _nearObjects = nearestObjects [_unit, ["Air","LandVehicle"], 20]; _return = false; { - if ([_x] call FUNC(isRepairVehicle)) exitwith {_return = true;}; + if ([_x] call FUNC(isRepairVehicle)) exitWith {_return = true;}; } forEach _nearObjects; _return; diff --git a/addons/repair/functions/fnc_isRepairVehicle.sqf b/addons/repair/functions/fnc_isRepairVehicle.sqf index 121bda0fe3..2c0b5a1e21 100644 --- a/addons/repair/functions/fnc_isRepairVehicle.sqf +++ b/addons/repair/functions/fnc_isRepairVehicle.sqf @@ -18,6 +18,6 @@ params ["_vehicle"]; TRACE_1("params",_vehicle); -if (_vehicle isKindOf "CAManBase") exitwith {false}; +if (_vehicle isKindOf "CAManBase") exitWith {false}; ((_vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair))]) > 0); diff --git a/addons/repair/functions/fnc_moduleAddSpareParts.sqf b/addons/repair/functions/fnc_moduleAddSpareParts.sqf index cceb62e10c..bc2502c0f4 100644 --- a/addons/repair/functions/fnc_moduleAddSpareParts.sqf +++ b/addons/repair/functions/fnc_moduleAddSpareParts.sqf @@ -11,7 +11,7 @@ * None * * Example: - * function = "ace_repair_fnc_moduleAddSpareParts" + * [logic] call ace_repair_fnc_moduleAddSpareParts * * Public: No */ @@ -41,5 +41,6 @@ if (!isNull _logic) then { // Add spare parts { [_x, _amount, _part, true] call FUNC(addSpareParts); + false } count _list; }; diff --git a/addons/repair/functions/fnc_moduleAssignEngineer.sqf b/addons/repair/functions/fnc_moduleAssignEngineer.sqf index 240a8c3b62..d64573130c 100644 --- a/addons/repair/functions/fnc_moduleAssignEngineer.sqf +++ b/addons/repair/functions/fnc_moduleAssignEngineer.sqf @@ -11,7 +11,7 @@ * None * * Example: - * function = "ace_repair_fnc_moduleAssignEngineer" + * [logic] call ace_repair_fnc_moduleAssignEngineer * * Public: No */ diff --git a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf index 7150d0226b..9f01a06afc 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf @@ -11,7 +11,7 @@ * None * * Example: - * function = "ace_repair_fnc_moduleAssignRepairFacility" + * [logic] call ace_repair_fnc_moduleAssignRepairFacility * * Public: No */ diff --git a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf index 647b5fe52c..f5df8d58e2 100644 --- a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf +++ b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf @@ -11,7 +11,7 @@ * None * * Example: - * function = "ace_repair_fnc_moduleAssignRepairVehicle" + * [logic] call ace_repair_fnc_moduleAssignRepairVehicle * * Public: No */ diff --git a/addons/repair/functions/fnc_moduleRepairSettings.sqf b/addons/repair/functions/fnc_moduleRepairSettings.sqf index 98ff354662..770af07449 100644 --- a/addons/repair/functions/fnc_moduleRepairSettings.sqf +++ b/addons/repair/functions/fnc_moduleRepairSettings.sqf @@ -4,14 +4,12 @@ * * Arguments: * 0: The module logic - * 1: Synchronized units - * 2: Activated * * Return Value: * None * * Example: - * function = "ace_repair_fnc_moduleRepairSettings" + * [logic] call ace_repair_fnc_moduleRepairSettings * * Public: No */ diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf index 88c72f4de8..a73dfcfe0d 100644 --- a/addons/repair/functions/fnc_normalizeHitPoints.sqf +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -16,33 +16,45 @@ #include "script_component.hpp" params ["_vehicle"]; -TRACE_1("params",_vehicle); +TRACE_2("params",_vehicle, typeOf _vehicle); // Can't execute all commands if the vehicle isn't local, exit if that's so -if !(local _vehicle) exitWith {}; +if !(local _vehicle) exitWith {ACE_LOGERROR_1("Vehicle Not Local %1", _vehicle);}; -private ["_hitPoints", "_config", "_dependentHitPoints", "_dependentHitPointScripts", "_damage"]; +(getAllHitPointsDamage _vehicle) params [["_allHitPoints", []]]; -_hitPoints = [_vehicle] call EFUNC(common,getHitPoints); -_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints"; +private _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints"; -// define global variables. Needed to parse the depends config entries. Also find dependent hitpoints. +private _realHitPoints = []; +private _dependentHitPoints = []; +private _dependentHitPointScripts = []; -_dependentHitPoints = []; -_dependentHitPointScripts = []; +// Find dependent hitpoints +{ + if ((_x != "") && {isClass (_config >> _x)} && {!(_x in _realHitPoints)}) then { + _realHitPoints pushBack _x; + if (isText (_config >> _x >> "depends")) then { + _dependentHitPoints pushBack _x; + _dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends"); + }; + }; +} forEach _allHitPoints; +TRACE_2("",_realHitPoints,_dependentHitPoints); + +// Don't bother setting variables if no depends on vehicle: +if (_dependentHitPoints isEqualTo []) exitWith {}; + + +// Define global variables Total = damage _vehicle; - { missionNamespace setVariable [_x, _vehicle getHitPointDamage _x]; - if (isText (_config >> _x >> "depends")) then { - _dependentHitPoints pushBack _x; - _dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends"); - }; -} forEach _hitPoints; +} forEach _realHitPoints; // apply normalized damage to all dependand hitpoints { - _damage = call (_dependentHitPointScripts select _forEachIndex); + private _damage = call (_dependentHitPointScripts select _forEachIndex); + TRACE_2("setting depend hitpoint", _x, _damage); _vehicle setHitPointDamage [_x, _damage]; } forEach _dependentHitPoints; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index fd3b4f032b..25e58151c5 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -4,8 +4,8 @@ * * Arguments: * 0: Unit that does the repairing - * 1: Vehicle to repair + * 1: Vehicle to repair + * 2: Selected hitpoint or hitpointIndex or * 3: Repair Action Classname * * Return Value: @@ -21,22 +21,22 @@ params ["_caller", "_target", "_hitPoint", "_className"]; TRACE_4("params",_calller,_target,_hitPoint,_className); -private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_locations", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray"]; +private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn", "_settingName", "_settingItemsArray", "_hitPointClassname"]; _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); -if !(isClass _config) exitwith {false}; // or go for a default? +if !(isClass _config) exitWith {false}; // or go for a default? _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { getNumber (_config >> "requiredEngineer"); } else { // Check for required class - if (isText (_config >> "requiredEngineer")) exitwith { + if (isText (_config >> "requiredEngineer")) exitWith { missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; }; 0; }; -if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; -if (isEngineOn _target) exitwith {false}; +if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitWith {false}; +if (isEngineOn _target) exitWith {false}; //Items can be an array of required items or a string to a ACE_Setting array _items = if (isArray (_config >> "items")) then { @@ -49,64 +49,78 @@ _items = if (isArray (_config >> "items")) then { }; _settingItemsArray select (missionNamespace getVariable _settingName); }; -if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; +if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitWith {false}; _return = true; if (getText (_config >> "condition") != "") then { _condition = getText (_config >> "condition"); - if (isnil _condition) then { + if (isNil _condition) then { _condition = compile _condition; } else { _condition = missionNamespace getVariable _condition; }; - if (typeName _condition == "BOOL") then { + if (_condition isEqualType false) then { _return = _condition; } else { _return = [_caller, _target, _hitPoint, _className] call _condition; }; }; -if (!_return) exitwith {false}; +if (!_return) exitWith {false}; -_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { - missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] -} else { - getNumber(_config >> "vehicleStateCondition") -}; -// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; +// _vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { + // missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] +// } else { + // getNumber(_config >> "vehicleStateCondition") +// }; +// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false}; -_locations = getArray (_config >> "repairLocations"); -if ("All" in _locations) exitwith {true}; - -private ["_repairFacility", "_repairVeh"]; -_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; -_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; - -{ - if (_x == "field") exitwith {_return = true;}; - if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; - if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; - if !(isnil _x) exitwith { - private "_val"; - _val = missionNamespace getVariable _x; - if (typeName _val == "SCALAR") then { - _return = switch (_val) do { - case 0: {true}; //useAnywhere - case 1: {call _repairVeh}; //repairVehicleOnly - case 2: {call _repairFacility}; //repairFacilityOnly - case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility - default {false}; //Disabled +private _repairLocations = getArray (_config >> "repairLocations"); +if (!("All" in _repairLocations)) then { + private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; + private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; + { + if (_x == "field") exitWith {_return = true;}; + if (_x == "RepairFacility" && _repairFacility) exitWith {_return = true;}; + if (_x == "RepairVehicle" && _repairVeh) exitWith {_return = true;}; + if !(isNil _x) exitWith { + private _val = missionNamespace getVariable _x; + if (_val isEqualType 0) then { + _return = switch (_val) do { + case 0: {true}; //useAnywhere + case 1: {call _repairVeh}; //repairVehicleOnly + case 2: {call _repairFacility}; //repairFacilityOnly + case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility + default {false}; //Disabled + }; }; }; - }; -} forEach _locations; + } forEach _repairLocations; +}; -if !(_return && alive _target) exitwith {false}; +private _requiredObjects = getArray (_config >> "claimObjects"); +private _claimObjectsAvailable = []; +if (!(_requiredObjects isEqualTo [])) then { + _claimObjectsAvailable = [_caller, 5, _requiredObjects] call FUNC(getClaimObjects); + if (_claimObjectsAvailable isEqualTo []) then { + TRACE_2("Missing Required Objects",_requiredObjects,_claimObjectsAvailable); + _return = false + }; +}; + +if !(_return && alive _target) exitWith {false}; +//Last exitWith: repair_success or repair_failure will be run + +//Claim required objects +{ + TRACE_2("Claiming", _x, (typeOf _x)); + [_caller, _x, false] call EFUNC(common,claim); +} forEach _claimObjectsAvailable; _consumeItems = if (isNumber (_config >> "itemConsumed")) then { getNumber (_config >> "itemConsumed"); } else { // Check for required class - if (isText (_config >> "itemConsumed")) exitwith { + if (isText (_config >> "itemConsumed")) exitWith { missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0]; }; 0; @@ -114,7 +128,7 @@ _consumeItems = if (isNumber (_config >> "itemConsumed")) then { _usersOfItems = []; if (_consumeItems > 0) then { - _usersOfItems = ([_caller, _target, _items] call FUNC(useItems)) select 1; + _usersOfItems = ([_caller, _items] call FUNC(useItems)) select 1; }; // Parse the config for the progress callback @@ -131,7 +145,7 @@ if (isNil _callbackProgress) then { // Player Animation _callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); -_caller setvariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; +_caller setVariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; // Cannot use secondairy weapon for animation if (currentWeapon _caller == secondaryWeapon _caller) then { @@ -149,9 +163,9 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { }; if (stance _caller == "STAND") then { - _caller setvariable [QGVAR(repairPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; + _caller setVariable [QGVAR(repairPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; } else { - _caller setvariable [QGVAR(repairPrevAnimCaller), animationState _caller]; + _caller setVariable [QGVAR(repairPrevAnimCaller), animationState _caller]; }; [_caller, _callerAnim] call EFUNC(common,doAnimation); }; @@ -160,14 +174,14 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _repairTime = if (isNumber (_config >> "repairingTime")) then { getNumber (_config >> "repairingTime"); } else { - if (isText (_config >> "repairingTime")) exitwith { + if (isText (_config >> "repairingTime")) exitWith { _repairTimeConfig = getText(_config >> "repairingTime"); - if (isnil _repairTimeConfig) then { + if (isNil _repairTimeConfig) then { _repairTimeConfig = compile _repairTimeConfig; } else { _repairTimeConfig = missionNamespace getVariable _repairTimeConfig; }; - if (typeName _repairTimeConfig == "SCALAR") exitwith { + if (_repairTimeConfig isEqualType 0) exitWith { _repairTimeConfig; }; [_caller, _target, _hitPoint, _className] call _repairTimeConfig; @@ -177,13 +191,21 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then { private ["_processText"]; // Find localized string +_hitPointClassname = if ((typeName _hitPoint) == "STRING") then { + _hitPoint +} else { + ((getAllHitPointsDamage _target) select 0) select _hitPoint +}; _processText = getText (_config >> "displayNameProgress"); -([_hitPoint, _processText, _processText] call FUNC(getHitPointString)) params ["_text"]; +private _backupText = format [localize LSTRING(RepairingHitPoint), _hitPointClassname]; +([_hitPointClassname, _processText, _backupText] call FUNC(getHitPointString)) params ["_text"]; + +TRACE_4("display",_hitPoint,_hitPointClassname,_processText,_text); // Start repair [ _repairTime, - [_caller, _target, _hitPoint, _className, _items, _usersOfItems], + [_caller, _target, _hitPoint, _className, _items, _usersOfItems, _claimObjectsAvailable], DFUNC(repair_success), DFUNC(repair_failure), _text, diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index 6e27ab07a7..3fabb58e80 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -6,23 +6,24 @@ * 0: Arguments * 0: Unit that does the repairing * 1: Vehicle to repair + * 2: Selected hitpoint or hitpointIndex or * 3: Repair Action Classname * 4: None * 5: Items available + * 6: Claimed Repair Objects * * Return Value: * None * * Example: - * [[unit, vehicle, "hitpoint", "classname", nil, [items]]] call ace_repair_fnc_repair_failure + * [[unit, vehicle, "hitpoint", "classname", nil, [items], [aWheel]]] call ace_repair_fnc_repair_failure * * Public: No */ #include "script_component.hpp" params ["_args"]; -_args params ["_caller", "_target","_selectionName","_className","","_usersOfItems"]; +_args params ["_caller", "_target","_selectionName","_className","","_usersOfItems", "_claimedObjects"]; TRACE_5("params",_caller,_target,_selectionName,_className,_usersOfItems); private ["_config","_callback", "_usersOfItems", "_weaponSelect"]; @@ -33,7 +34,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { if (vehicle _caller == _caller) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; -_caller setvariable [QGVAR(repairPrevAnimCaller), nil]; +_caller setVariable [QGVAR(repairPrevAnimCaller), nil]; _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); if (_weaponSelect != "") then { @@ -46,6 +47,13 @@ if (_weaponSelect != "") then { (_x select 0) addItem (_x select 1); } forEach _usersOfItems; +//Unclaim repair objects: +{ + TRACE_2("Releasing", _x, (typeOf _x)); + [objNull, _x, false] call EFUNC(common,claim); +} forEach _claimedObjects; + + // Record specific callback _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); @@ -58,4 +66,4 @@ if (isNil _callback) then { _args call _callback; -// _args call FUNC(createLitter); +//todo: repair litter? diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index ccad93663f..9625dad1df 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -6,21 +6,24 @@ * 0: Arguments * 0: Unit that does the repairing * 1: Vehicle to repair + * 2: Selected hitpoint or hitpointIndex or * 3: Repair Action Classname + * 4: Items + * 5: User of Items + * 6: Claimed Repair Objects * * Return Value: * None * * Example: - * [[unit, vehicle, "hitpoint", "classname"]] call ace_repair_fnc_repair_success + * [[unit, vehicle, "hitpoint", "classname", [], [], [aWheel]]] call ace_repair_fnc_repair_success * * Public: No */ #include "script_component.hpp" params ["_args"]; -_args params ["_caller", "_target","_selectionName","_className"]; +_args params ["_caller", "_target","_selectionName","_className","","","_claimedObjects"]; TRACE_4("params",_caller,_target,_selectionName,_className); private ["_config","_callback", "_weaponSelect"]; @@ -31,7 +34,7 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { if (vehicle _caller == _caller) then { [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); }; -_caller setvariable [QGVAR(repairPrevAnimCaller), nil]; +_caller setVariable [QGVAR(repairPrevAnimCaller), nil]; _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); if (_weaponSelect != "") then { @@ -40,6 +43,12 @@ if (_weaponSelect != "") then { _caller action ["SwitchWeapon", _caller, _caller, 99]; }; +//Unclaim repair objects: +{ + TRACE_2("Releasing", _x, (typeOf _x)); + [objNull, _x, false] call EFUNC(common,claim); +} forEach _claimedObjects; + // Record specific callback _config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); @@ -51,4 +60,4 @@ if (isNil _callback) then { }; _args call _callback; -// _args call FUNC(createLitter); +//todo: repair litter? diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index a8b4cd347b..ba04cdb7eb 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -1,86 +1,83 @@ /* * Author: commy2 * Set the hitpoint damage and change the structural damage acordingly, requires local vehicle. + * Handles the "setVehicleHitPointDamage" event * * Arguments: * 0: Local Vehicle to Damage - * 1: Selected hitpoint + * 1: Selected hitpoint INDEX * 2: Total Damage * * Return Value: * None * * Example: - * [vehicle, "hitpoint", 0.5] call ace_repair_fnc_setHitPointDamage + * [vehicle, 1, 0.5] call ace_repair_fnc_setHitPointDamage * * Public: No */ #include "script_component.hpp" -params ["_vehicle", "_hitPoint", "_hitPointDamage"]; -TRACE_3("params",_vehicle,_hitPoint,_hitPointDamage); +params ["_vehicle", "_hitPointIndex", "_hitPointDamage"]; +TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); + +private["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageSumOld", "_realHitpointCount", "_selectionName"]; // can't execute all commands if the vehicle isn't local. exit here. -if !(local _vehicle) exitWith {}; +if !(local _vehicle) exitWith {ACE_LOGERROR_1("Vehicle Not Local %1", _vehicle);}; -// get all valid hitpoints -private ["_hitPoints", "_hitPointsWithSelections"]; +//Check for bad typeName (changed from orignal v3.3 that took string) +if (_hitPointIndex isEqualType "") then { + ACE_DEPRECATED("repair-setHitPointDamage (hit point name ","3.5.0","hit index "); + _hitPointIndex = _allHitPoints find _hitPointIndex; +}; -_hitPoints = [_vehicle] call EFUNC(common,getHitpoints); -_hitPointsWithSelections = [_vehicle] call EFUNC(common,getHitpointsWithSelections) select 0; +// get all hitpoints and selections and damages +(getAllHitPointsDamage _vehicle) params [["_allHitPoints", []], ["_allHitPointsSelections", []], ["_allHitPointDamages", []]]; // exit if the hitpoint is not valid -if !(_hitPoint in _hitPoints) exitWith {systemChat format["NOT A VALID HITPOINT: %1",_hitpoint]}; - -// save array with damage values of all hitpoints -private "_hitPointDamages"; -_hitPointDamages = []; - -{ - _hitPointDamages set [_forEachIndex, (_vehicle getHitPointDamage _x)]; -} forEach _hitPoints; +if ((_hitPointIndex < 0) || {_hitPointIndex >= (count _allHitPoints)}) exitWith {ACE_LOGERROR_2("NOT A VALID HITPOINT: %1-%2", _hitPointIndex,_vehicle);}; // save structural damage and sum of hitpoint damages -private ["_damageOld", "_hitPointDamageSumOld"]; _damageOld = damage _vehicle; +_realHitpointCount = 0; _hitPointDamageSumOld = 0; +_hitPointDamageRepaired = 0; //positive for repairs : newSum = (oldSum - repaired) { - if (!(_x in IGNORED_HITPOINTS) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { - _hitPointDamageSumOld = _hitPointDamageSumOld + (_hitPointDamages select (_hitPoints find _x)); + _selectionName = _allHitPointsSelections select _forEachIndex; + //Filter out all the bad hitpoints (HitPoint="" or no selection) + if ((!isNil {_vehicle getHit _selectionName}) && {_x != ""}) then { + _realHitpointCount = _realHitpointCount + 1; + + if ((((toLower _x) find "glass") == -1) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { + _hitPointDamageSumOld = _hitPointDamageSumOld + (_allHitPointDamages select _forEachIndex); + if (_forEachIndex == _hitPointIndex) then { + _hitPointDamageRepaired = (_allHitPointDamages select _forEachIndex) - _hitPointDamage; + }; + }; }; -} forEach _hitPointsWithSelections; +} forEach _allHitPoints; -// set new damage in array -_hitPointDamages set [_hitPoints find _hitPoint, _hitPointDamage]; - -// save sum of new hitpoint damages -private "_hitPointDamageSumNew"; - -_hitPointDamageSumNew = 0; -{ - if (!(_x in IGNORED_HITPOINTS) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { - _hitPointDamageSumNew = _hitPointDamageSumNew + (_hitPointDamages select (_hitPoints find _x)); - }; -} forEach _hitPointsWithSelections; - -// calculate new strctural damage -private "_damageNew"; -_damageNew = _hitPointDamageSumNew / count _hitPoints; +// calculate new structural damage +_damageNew = (_hitPointDamageSumOld - _hitPointDamageRepaired) / _realHitpointCount; if (_hitPointDamageSumOld > 0) then { - _damageNew = _damageOld * (_hitPointDamageSumNew / _hitPointDamageSumOld); + _damageNew = _damageOld * ((_hitPointDamageSumOld - _hitPointDamageRepaired) / _hitPointDamageSumOld); }; +TRACE_5("structuralDamage",_damageOld,_damageNew,_hitPointDamageRepaired,_hitPointDamageSumOld,_realHitpointCount); // set new structural damage value _vehicle setDamage _damageNew; -// set the new damage for that hit point +//Repair the hitpoint in the damages array: +_allHitPointDamages set [_hitPointIndex, _hitPointDamage]; +//Set the new damage for all hitpoints { - _vehicle setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; -} forEach _hitPoints; + _vehicle setHitIndex [_forEachIndex, _x]; +} forEach _allHitPointDamages; // normalize hitpoints -// [_vehicle] call FUNC(normalizeHitPoints); +[_vehicle] call FUNC(normalizeHitPoints); diff --git a/addons/repair/functions/fnc_spawnObject.sqf b/addons/repair/functions/fnc_spawnObject.sqf index 1ea4b7363a..86d0b563ac 100644 --- a/addons/repair/functions/fnc_spawnObject.sqf +++ b/addons/repair/functions/fnc_spawnObject.sqf @@ -4,11 +4,11 @@ * * Arguments: * 0: Item classname - * 1: Position + * 1: Position ASL * 2: Damage * * Return Value: - * None + * The new object * * Example: * ["classname", [0, 0, 0], 1] call ace_repair_fnc_spawnObject @@ -23,10 +23,12 @@ TRACE_3("params",_item,_position,_damage); // randomized end position _position = _position vectorAdd [1 - random 2, 1 - random 2, 0]; -_item = createVehicle [_item, _position, [], 0, "NONE"]; -_item setPosASL _position; +private _newObject = createVehicle [_item, _position, [], 0, "NONE"]; +_newObject setPosASL _position; -["fixCollision", _item] call EFUNC(common,localEvent); -["fixPosition", _item] call EFUNC(common,localEvent); +_newObject setDamage _damage; -_item setDamage _damage; +["fixCollision", _newObject] call EFUNC(common,localEvent); +["fixPosition", _newObject] call EFUNC(common,localEvent); + +_newObject diff --git a/addons/repair/functions/fnc_useItem.sqf b/addons/repair/functions/fnc_useItem.sqf index 218a7a1ee4..024ee76c29 100644 --- a/addons/repair/functions/fnc_useItem.sqf +++ b/addons/repair/functions/fnc_useItem.sqf @@ -4,10 +4,10 @@ * * Arguments: * 0: Unit - * 2: Item classname + * 1: Item classname * * ReturnValue: - * None + * [Had Item to Use , Unit ] * * Example: * [unit, "classname"] call ace_repair_fnc_useItem @@ -19,8 +19,9 @@ params ["_unit", "_item"]; TRACE_2("params",_unit,_item); -if ([_unit, _item] call EFUNC(common,hasItem)) exitwith { +if ([_unit, _item] call EFUNC(common,hasItem)) exitWith { [[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [true, _unit]; }; + [false, objNull]; diff --git a/addons/repair/functions/fnc_useItems.sqf b/addons/repair/functions/fnc_useItems.sqf index f8aa176018..14dcb6223c 100644 --- a/addons/repair/functions/fnc_useItems.sqf +++ b/addons/repair/functions/fnc_useItems.sqf @@ -7,7 +7,7 @@ * 1: Item classnames * * ReturnValue: - * None + * [Had Item to Use , Array of units that used the items ] * * Example: * [unit, ["classname1", "classname2"]] call ace_repair_fnc_useItems @@ -24,17 +24,17 @@ private ["_itemUsedInfo", "_itemsUsedBy"]; _itemsUsedBy = []; { // handle a one of type use item - if (typeName _x == "ARRAY") then { + if (_x isEqualType []) then { { _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; } forEach _x; }; // handle required item - if (typeName _x == "STRING") then { + if (_x isEqualType "") then { _itemUsedInfo = [_unit, _x] call FUNC(useItem); - if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + if (_itemUsedInfo select 0) exitWith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; }; } forEach _items; diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index a6aa1db61f..ff5d40a6ae 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -13,6 +13,4 @@ #include "\z\ace\addons\main\script_macros.hpp" - -#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"] #define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"] diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index ddbccb7777..64fecd5de8 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ Chenille de réserve Zapasowa gąsienica Esteira reserva - Náhradní Pásy + Náhradní pásy Cingolo di scorta Pót lánctalp Запасная гусеница @@ -19,7 +19,7 @@ Rueda de repuesto Roue de secours Zapasowe koło - Náhradní Kolo + Náhradní kolo Estepe Ruota di scorta Pótkerék @@ -35,6 +35,7 @@ Sostituisci la ruota Kerék cseréje Поменять колесо + Vyměnit kolo Replacing Wheel ... @@ -42,7 +43,7 @@ Wymienianie koła ... Trocando roda... Замена колеса ... - Měním Kolo ... + Měním kolo ... Cambiando rueda ... @@ -60,7 +61,7 @@ Quitar rueda Démonter Roue Zdejmij koło - Odstranit Kolo + Odstranit kolo Remover roda Rimuovi la ruota Kerék leszerelése @@ -72,7 +73,7 @@ Zdejmowanie koła ... Removendo roda... Снятие колеса ... - Odstraňuji Kolo ... + Odstraňuji kolo ... Quitando rueda ... @@ -86,22 +87,25 @@ Change Track + Kette wechseln Wymień gąsienicę Trocar esteira Заменить гусеницу - Vyměnit Pás + Vyměnit pás Cambiar oruga Replacing Track ... + Tausche Kette aus ... Wymienianie gąsienicy ... Trocando esteira... Замена гусеницы ... - Měním Pás ... + Měním pás ... Cambiando oruga ... Track replaced + Kette ausgetauscht Gąsienica została wymieniona Esteira trocada Гусеница заменена @@ -110,22 +114,25 @@ Remove Track + Entferne Kette Zdejmij gąsienicę Remover esteira Снять гусеницу - Odstranit Pás + Odstranit pás Quitar oruga Removing Track ... + Entferne Kette ... Zdejmowanie gąsienicy ... Removendo esteira... Снятие гусеницы ... - Odstraňuji Pás ... + Odstraňuji pás ... Quitando oruga ... Track removed + Kette enfernt Gąsienica została zdjęta Esteira trocada Гусеница снята @@ -134,63 +141,75 @@ Full Repair + Vollständige Reperatur Pełna naprawa Reparo completo Полный ремонт - Kompletní Oprava + Kompletní oprava Reparación completa Repairing Vehicle ... + Entferne Fahrzeug ... Naprawianie pojazdu ... Reparando veículo... Ремонт транспорта ... - Opravuji Vozidlo ... + Opravuji vozidlo ... Reparando vehículo ... Full Repair Locations + Möglichkeit zur vollständigen Reperatur Lokaliz. pełnej naprawy Localizações de reparo completo Места полного ремонта - Lokace pro Kompletní Opravu + Oblast pro kompletní opravu Lugares de reparación completa At what locations can a vehicle be fully repaired? + Welche Fahrzeugteile können vollständig in Stand gesetzt werden? W jakich miejscach pojazd może zostać w pełni naprawiony? Em quais locais um veículo pode ser reparado por completo? В каких местах транспорт может быть полностью отремеонтирован? ¿En qué lugares puede un vehículo ser reparado totalmente? + V které oblasti může být vozidlo plně opraveno? Allow Full Repair + Erlaube vollständige Reperatur Zezwól na pełną naprawę Permitir reparo completo Полный ремонт выполняют - Povolit Kompletní Opravu + Povolit kompletní opravu Permitir reparación completa Who can perform a full repair on a vehicle? + Wer ist zur vollständigen Reperatur im Stande? Kto może przeprowadzić pełną naprawę pojazdu? Кто может выполнять полный ремонт? Quem pode reparar o veículo por completo? ¿Quién puede realizar una reparación completa de un vehículo? + Kdo může provést úplné opravy na vozidle? Add Spare Parts + Füge Ersatzteile hinzu Dodaj części zam. Adicionar partes sobressalentes Añadir repuestos Добавлять запчасти + Přidat náhradní díly Add spare parts to vehicles (requires Cargo component)? + Füge Ersatzteile der Fahrzeugfracht (wenn vorhanden) zu? Czy dodać do pojazdów części zamienne? Wymaga włączonego cargo. Adicionar partes sobressalentes aos veículos (requer o componente de carga)? ¿Añadir repuestos para vehículos (requiere componente de carga)? Добавлять запасные части в технику (требуется модуль Грузоперевозок)? + Přidat náhradní díly do vozidla (vyžaduje úložný prostor)? Repair >> @@ -206,6 +225,7 @@ Display text on repair + Zeige Text bei Reperatur an Wyświetl tekst przy naprawie Mostrar texto quando reparar Отображать текст при ремонте @@ -214,10 +234,12 @@ Display a notification whenever you repair a vehicle + Zeige eine Nachricht, wann immer du ein Fahrzeug reparierst Pokaż informację, kiedy wykonujesz czynności związane z naprawą pojazdu. Mostra uma notificação quando você repara um veículo Отображать оповещение каждый раз, когда вы ремонтируете транспорт Mostrar una notificación cada vez que se reparare un vehículo + Zobrazit oznámení kdykoliv opravíš vozidlo Repairing ... @@ -233,7 +255,7 @@ Repairing %1 ... - Reparieren %1 ... + Repariere %1 ... Reparando %1 ... Réparation %1 ... Naprawianie %1... @@ -249,7 +271,7 @@ Reparado %1 %1 réparé(e) Naprawiono %1 - Opraveno - %1 + %1 - opraveno Reparado %1 %1 Riparata/o %1 megjavítva @@ -266,11 +288,12 @@ Partially repaired %1 - Bauteil teilweise repariert + Bauteil zum Teil repariert Częściowo naprawiono: %1 %1 parcialmente reparado Частично отремонтировано: %1 Parcialmente reparada %1 + %1 - částečně opraveno Fully repaired %1 @@ -278,7 +301,7 @@ W pełni naprawiono: %1 %1 totalmente reparado Полностью отремонтировано: %1 - Kompletně opraveno %1 + %1 - kompletně opraveno Totalmente reparada %1 @@ -288,10 +311,11 @@ %1 parcialmente reparado Частично отремонтировано: %1 Parcialmente reparada %1 + %1 - částečně opraveno Body - Karosserie + Fahrgestell Carrocería Blindage Karoseria @@ -331,6 +355,7 @@ Левый горизонтальный стабилизатор Estabilizador Horizontal Esquerdo Estabilizador horizontal izquierdo + Levý horizontální stabilizátor Right Horizontal Stabilizer @@ -338,6 +363,7 @@ Правый горизонтальный стабилизатор Estabilizador Horizontal Direito Estabilizador horizontal derecho + Pravý horizontální stabilizátor Vertical Stabilizer @@ -361,6 +387,7 @@ Transmission + Getriebe Převodovka Skrzynia biegów Трансмиссия @@ -369,13 +396,16 @@ Gear + Gang Podwozie Коробка передач Engrenagem Rueda + Podvozek Starter + Anlasser Zapłon Startér Стартер @@ -384,6 +414,7 @@ Tail + Leitwerk Ogon Ocas Хвост @@ -392,6 +423,7 @@ Pitot Tube + Pitotrohr Rurka Pitota Pilotova Trubice Кокпит @@ -400,14 +432,17 @@ Static Port + Statik Port Port statyczny Статический иллюминатор Porta Estática Puerto estático + Statický port Ammo Munice + Munition Amunicja Боеприпасы Munição @@ -439,6 +474,7 @@ Missiles + Rakete Mísseis Ракеты Rakety @@ -608,6 +644,7 @@ Guincho Лебедка Cabrestante + Naviják Glass (right) @@ -645,22 +682,30 @@ Üveg Стекло + + ERA + Repair Settings + Reperatureinstellungen Ustawienia naprawy Preferências de reparo Ремонт Ajustes de reparación + Nastavení oprav Provides a repair system for all types of vehicles. + Stellt ein Reperatursystem für alle Arten von Fahrzeugen zur Verfügung. Dostarcza rozbudowany system naprawy dla wszystkich typów pojazdów. Provém um sistema de reparo para todos os veículos Предоставляет систему ремонта для всех типов транспортных средств. Proporciona un sistema de reparación para todo tipo de vehículos. + Poskytuje rozsáhlý systém oprav pro všechny typy vozidel. Anyone + Jeder Ktokolwiek Qualquer um Кто угодно @@ -669,6 +714,7 @@ Engineer only + Pionier Tylko mechanicy Somente engenheiro Только инженеры @@ -677,6 +723,7 @@ Repair Specialist only + Nur Reparaturspezialist Tylko inżynierowie Somente especialista em reparos Только ремонтные специалисты @@ -685,6 +732,7 @@ Allow Wheel + Erlaube Radwechsel Wymiana kół Permite rodas Разрешить замену колес @@ -693,6 +741,7 @@ Who can remove and replace wheels? + Wer kann Radwechsel durchführern? Kto może zdejmować i zmieniać koła? Quem pode remover e trocar rodas? Кто может снимать и заменять колеса? @@ -701,6 +750,7 @@ Allow Repair + Erlaube Reperatur Możliwość naprawy Permite reparo Разрешить ремонт @@ -709,6 +759,7 @@ Who can perform repair actions? + Wer kann eine Reperatur durchführen? Kto może wykonywać czynności związane z naprawą pojazdów? Quem pode executar ações de reparo? Кто может выполнять ремонт? @@ -717,48 +768,61 @@ Repair Threshold + Repariere Schweller Próg naprawy Limite de reparo Лимит ремкомплекта Umbral de reparación + Práh oprav What is the maximum damage that can be repaired with a toolkit? + Wie hoch ist der Schaden, der von einem Reperatursatz behoben werden kann? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przy pomocy narzędzi? Qual é o dano máximo que pode ser reparado com um kit de ferramentas? Какой максимальный урон можно починить с помощью ремкомплекта? ¿Cuál es el daño máximo que puede ser reparado con una caja de herramientas? + Jaké maximální poškození může být opraveno pomocí opravárenské sady? Repair Threshold (Engineer) + Repariere Schweller (Pionier) Próg naprawy (mechanik) Limite de reparo (Engenheiro) Лимит инженера Umbral de Reparación (Ingeniero) + Práh oprav (Inženýr) What is the maximum damage that can be repaired by an engineer? + Wie hoch ist der Schaden, der von einem Pionier behoben werden kann? Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przez mechanika? Qual é o dano máximo que pode ser reparado com um engenheiro? Какой максимальный урон может починить инженер? ¿Cuál es el daño máximo que puede ser reparado por un ingeniero? + Jaké maximální poškození může být opraveno pomoci inženýra? Remove toolkit on use + Entferne Reperatursatz bei Verwendung Usuń narzędzia po użyciu Remover kit de ferramentas Удалять ремкомплект после использования Eliminar conjunto de herramientas al usarlo + Odstranit sadu nástrojů po použití Should the toolkit be removed on usage? + Soll der Reperatursatz bei Verwendung entfernt werden? Czy zestaw naprawczy powinien zostać usunięty po jego użyciu? O kit de ferramentas deve ser removido após uso? Следует ли удалять ремкомплект после использования? ¿Deben retirarse las herramientas al usarlas? + Má být odstraněna sada nástroju po použití? Anywhere + Irgendwo Wszędzie Qualquer lugar Где угодно @@ -767,27 +831,34 @@ Repair Vehicle only + Nur Reperaturfahrzeug Przy pojazdach naprawczych Somente veículos de reparo Только у ремонтного транспорта Reparar solo en vehículo + Pouze opravárenské vozidlo Repair Facility only + Nur Reperatureinrichtung Przy budynkach naprawczych Somente instalação de reparo Только у ремонтных сооружений Reparar solo en instalación + Pouze opravárenské zařízení Repair Facility or Vehicle + Reperatureinrichtung oder Reperaturfahrzeug Przy budynkach i pojazdach naprawczych Instalação e veículo de reparo Только у ремонтного транспорта или ремонтных сооружений Reparar en instalación o vehículo + Opravárenské zařízení nebo vozidlo Assign Engineer + Weise Pionier zu Przydziel inżyniera Definir engenheiro Назначить инженером @@ -796,6 +867,7 @@ List + Liste Lista Lista Список @@ -804,27 +876,34 @@ List of unit names that will be classified as engineer, separated by commas. + Eine Aufzählung von Einheiten, die als Pionier gelten, und durch Kommata getrennt sind. Lista nazw jednostek, które są sklasyfikowane jako inżynierowie, oddzielone przecinkami. Lista de nomes de unidades que serão classificadas como engenheiros, separadas por vírgulas. Список имен юнитов, которые будут классифицированы как инженеры, разделенный запятыми. Lista de los nombres de las unidades que serán clasificados como ingeniero, separados por comas. + Seznam jmen jednotek, které budou klasifikovány jako inženýr, oddělit čárkami. Is Engineer + Ist Pionier Poziom wyszkolenia É engenheiro Это инженер Es un ingeniero + Inženýr Select the engineering skill level of the unit + Wählt die Eignungsstufe zur Ausübung des Pioniers für diese Einheit Wybierz biegłość w dziedzinie naprawy danej jednostki Selecione o nível de habilidade da unidade em engenhraria Укажите уровень инженерного мастерства для юнита Selecciona el nivel de conocimientos de ingeniería de la unidad + Vyberte úroveň dovednosti inženýra pro jednotku None + Keine Żadny Nenhum Нет @@ -833,6 +912,7 @@ Engineer + Pionier Mechanik Engenheiro Инженер @@ -841,6 +921,7 @@ Specialist + Reparaturspezialist Inżynier Especialista Специалист @@ -849,20 +930,25 @@ Assign one or multiple units as an engineer + Weist einen oder mehrere Einheiten der Pionierklasse zu. Przydziel klasę inżyniera do jednej lub kilku jednostek Defina um ou mais unidades como engenheiro Назначить одного или нескольких юнитов инженерами Asignar una o varias unidades como ingeniero + Přiřaďte jednu nebo více osob jako inženýra Assign Repair Vehicle + Weise Reperaturfahrzeug zu Przydziel pojazd naprawczy Defina veículo de reparo Назначить ремонтный транспорт Asignar vehículo de reparación + Přiřaďte opraváresnké vozidlo List + Liste Lista Lista Список @@ -871,41 +957,52 @@ List of vehicles that will be classified as repair vehicle, separated by commas. + Eine Aufzählung von Fahrzeugen, die als Reperaturfahrzeug gelten, getrennt durch Kommata Lista nazw pojazdów, które są sklasyfikowane jako pojazdy naprawcze, oddzielone przecinkami. Lista de veículos que serão classificadas como veículo de reparo. Separado por vígulas. Список транспортных средств, которые будут классифицированы как ремонтные, разделенный запятыми. Lista de los vehículos que se clasifican como vehículo de reparación, separados por comas. + Seznam vozidel, která budou klasifikována jako opravárenská, oddělit čárkami. Is Repair Vehicle + Ist Reparaturfahrzeug Jest poj. naprawczym É veículo de reparo Это ремонтный транспорт Es un vehículo de reparación + Opravárenské vozidlo Is the vehicle classified as a repair vehicle? + Gilt dieses Fahrzeug als Reperaturfahrzeug? Czy pojazd jest zklasyfikowany jako pojazd naprawczy? O veículo é classificado como reparo? Классифицируется ли этот транспорт как ремонтный? ¿Está el vehículo clasificado como un vehículo de reparación? + Je vozidlo klasifikováno jako opravárenské? Assign one or multiple vehicles as a repair vehicle + Weist ein oder mehr Fahrzeuge als Reperaturfahrzeug zu Przydziel klasę pojazdu naprawczego do jednego lub kilku pojazdów. Definir um ou mais veículos como reparo Назначить одно или несколько транспортных средств ремонтными Asignar uno o varios vehículos como vehículo de reparación + Přiřaďte jedno nebo více vozidel jako opravárenské vozidlo Assign Repair Facility + Weise Reperatureinrichtung zu Przydziel budynek naprawczy Definir instalação de reparo Назначить ремонтное сооружение Asignar instalación de reparación + Přiřaďte opravárenské zařízení List + Liste Lista Lista Список @@ -914,101 +1011,129 @@ List of objects that will be classified as repair Facility, separated by commas. + Eine Aufzählung von Objekten, die als Reperatureinrichtung gelten, und durch Kommata getrennt sind. Lista nazw budynków, które są sklasyfikowane jako budynki naprawcze, oddzielone przecinkami. Lista de objetos que serão classificados como instalações de reparo. separado por vírgulas. Список объектов, которые будут классифицированы как ремонтные, разделенный запятыми. Lista de los objetos que se clasifican como instalaciones para la reparación, separados por comas. + Seznam objektů, které budou klasifikovány jako opravárenské zařízení, oddělit čárkami. Is Repair Facility + Ist Reperatureinrichtung Jest bud. naprawczym É uma instalação de reparo Это ремонтное сооружение Es una instalación de reparación + Opravárenské zařízení Is the object classified as a repair Facility? + Ist das Objekt als Reperatureinrichtung zugewiesen? Czy budynek jest zklasyfikowany jako budynek naprawczy? O objeto é classificado como instalação de reparo? Классифицируется ли этот объект как ремонтное сооружение? ¿Está el objeto clasificado como una instalación de reparación? + Je objekt klasifikován jako opravárenské zařízení? Assign one or multiple objects as a repair Facility + Weist eines oder mehrere Objekte als Reperatureinrichtung zu Przydziel klasę budynku naprawczego do jednego lub kilku budynków. Назначить один или несколько объектов ремонтными сооружениями Definir um ou mais objetos como instalação de reparos Asignar uno o varios objetos como una instalación de reparación + Přiřaďte jeden nebo více objektů jako opravárenské zařízení Add Spare Parts + Füge Ersatzteile hinzu Dodaj części zam. Adicionar partes sobressalentes Añadir repuestos Добавить запчасти + Přidat náhradní díly Add spare parts to one or multiple objects + Füge Ersatzteile zu einem odere mehreren Objekten hinzu Dodaj części zamienne do jednego lub wielu obiektów. Adicionar partes sobressalentes para um ou mais objetos Añadir repuestos a uno o varios objetos Добавить запасные части в одно или несколько транспортных средств + Přidat náhradní díly do jednoho nebo více objektů List + Liste Lista Lista Lista Список + Seznam List of objects that will get spare parts added, separated by commas. + Eine Aufzählung von Objekten, welche Ersatzteile beherbergen, und durch Kommata getrennt sind. Lista obiektów, które otrzymają części zamienne, oddzielone przecinkiem. Lista de objetos que ganharão partes sobressalentes, dividos por vírgulas. Lista de los objetos que tendrán repuestos añadidos, separados por comas. Список транспортных средств, в которые будут добавляться запчасти, разделенный запятыми. + Seznam objektů, které dostanou náhradní díly, oddělit čárkami. Part + Teil Część Parte Pieza Запчасть + Díl Spare part. + Ersatzteile Część zamienna. Parte sobressalente Pieza de recambio. Запасная часть. + Náhradní díl. Amount + Menge Ilość Quantidade Cantidad Количество + Množství Number of selected spare parts. + Anzahl der ausgewählten Ersatzteile Ilość wybranych części zamiennych. Número de partes sobressalentes. Número de piezas de repuesto seleccionados. Число выбранных запасных частей. + Počet vybraných náhradních dílů. Wheel repair requirements + Erfordernisse zur Reifenreperatur Wym. naprawy kół Requisitos de reparación de ruedas Для ремонта колес требуется Requerimentos para reparo de rodas + Vyžaduje opravu kol Items required to remove/replace wheels + Gegenstänge, die zum Entfernen/Austauschen eines Reifens benötigt werden Przedmioty potrzebne do wymiany kół Elementos necesarios para quitar/cambiar ruedas Предметы, которые требуются для снятия/замены колес Itens requeridos para remover/trocar rodas + Položka vyžaduje odstraněná/vyměněná kola - \ No newline at end of file + diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index a0ca2aa35e..af3acb7fb4 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -27,7 +27,7 @@ _activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponM if ( (_activeMuzzle != "") && {_activeMuzzle != _activeWeapon} && - {_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} + {_activeMuzzle in getArray (configFile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} ) then { _unit selectWeapon _activeMuzzle; } else { diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index 1c5a7b7cc2..1079ef6e6d 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -19,7 +19,7 @@ params ["_unit", "_killer"]; if (_unit != _killer && {side group _unit in [side group ACE_player, civilian]} && {side group _killer == side group ACE_player}) then { - systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)]; + systemChat format ["%1 was killed by %2", [_unit, false, true] call EFUNC(common,getName), [_killer, false, true] call EFUNC(common,getName)]; // Raise ACE globalEvent ["killedByFriendly", [_unit, _killer]] call EFUNC(common,globalEvent); diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index e44150ff10..42bd14945f 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -149,7 +149,7 @@ Respawn System System odrodzenia Sistema de reaparición - Respawn-System + Wiedereinstiegs-System Systém znovuzrození Sistema de Renascimento Système de Respawn @@ -171,7 +171,7 @@ Respawn with the gear a soldier had just before his death? Odradzaj z ekwipunkiem jaki żołnierz miał tuż przed swoją śmiercią? Reaparece con el equipo que el soldado tenía justo antes de morir - Mit der Ausrüstung, die ein Soldat vor seinem Tod hatte, respawnen? + Mit der Ausrüstung, die ein Soldat vor seinem Tod hatte, wiedereinsteigen? Znovuubjevit s výbavou kterou měl voják před smrtí? Renascer com o equipamento que um soldado tinha antes de sua morte? Conserve l'équipement au Respawn @@ -182,7 +182,7 @@ Remove bodies? Usuwać ciała? ¿Eliminar cuerpos? - Körper entfernen? + Sollen Leichen automatisch verschwinden? Odstranit těla? Remover corpos? Enlever les coprs? @@ -203,7 +203,7 @@ This module enables you to configure ACE functionality specific to respawns. Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). - Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. + Dieses Modul erlaubt es, die Wiedereinstiegs-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). Este módulo permite que você personalize as configurações do renascimento (Spawn). Этот модуль позволяет настроить систему возрождения. @@ -213,7 +213,7 @@ Friendly Fire Messages Wiadomości Friendly Fire Mensajes de fuego amigo - Freundbeschuss-Nachrichten + Nachricht bei Freundbeschuss Upozornění na přátelskou střelbu Mensagens de fogo amigo Message de tirs fraticides @@ -222,6 +222,7 @@ Using this module in your mission will make it so any friendly fire kills will be displayed in form of a message in chat. + Dieses Modul zeigt jeden Gefallenen durch Freundbeschuss, in Form einer Textnachricht, im Chat an. Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. @@ -232,7 +233,7 @@ Rallypoint System System punktu zbiórki Sistema de punto de reunión - Rallypoint-System + Sammelpunktssystem Systém shromáždění Sistema de ponto de encontro Système de point de ralliement @@ -241,6 +242,7 @@ This module allows you to use rally points in missions, to which you can quickly teleport from base flag. Requires placing special objects on map - base and flag. Both available in category Empty -> ACE Respawn. + Dieses Modul erlaubt die Verwendung eines Sammelpunktes, über welchen man sich schnell von der Basis zur Fahne teleportieren kann. Benötigt das Aufstellen von speziellen Objekten: Basis und Flagge. Beides ist unter "Leer" - > ACE Wiedereinstieg zu finden Moduł ten pozwala zastosować na misji "punkt zbiórki", do którego można szybko przeteleportować się z "bazy". Wymaga postawienia odpowiednich obiektów na mapie - bazy oraz flagi. Obydwa dostępne są w kategorii Puste -> ACE Odrodzenie. Tento modul umožňuje určit místo shromaždiště, kam se mohou jednokty rychle teleportovat ze "základny". Toto vyžaduje vhodné objekty v mapě - základna a vlajka. Oba dva můžete najít v kategorii Prázdné -> ACE Oživení. Este módulo permite que você aplique em uma missão "pontos de encontro", que pode rapidamente se teletransportar para a "base". Ele requer colocar objetos apropriados no mapa - base e bandeiras. Ambos estão disponíveis na categoria em branco -> ACE Revival. @@ -250,7 +252,7 @@ Move Rallypoint Przenieś punkt zbiórki Mover punto de reunión - Bewege Rallypoint + Bewege Sammelpunkt Přesun na shromaždiště Mover para ponto de encontro Bouger le point de ralliement @@ -261,7 +263,7 @@ ACE Respawn ACE Odrodzenie Reaparición ACE - ACE-Respawn + ACE-Wiedereinstieg ACE Znovuzrození ACE Respawn ACE Respawn diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 9fe429a49b..4d4b89759a 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -61,7 +61,7 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then { ] call EFUNC(common,addActionEventHandler)]; }; -if (typeName _muzzle == "STRING") then { +if (_muzzle isEqualType "") then { _unit selectWeapon _muzzle; }; diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index 492d5c6996..c3f46b9f4d 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -25,7 +25,7 @@ _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl if (isNull _control) exitWith {}; if (_show) then { - private "_config"; + private "_config"; _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index ef01766872..b1c2fda540 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -48,7 +48,7 @@ if (inputAction "nextWeapon" > 0) then { _modes pushBack _weapon; }; nil - } count getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); + } count getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); // select last mode _mode = _modes select (count _modes - 1); diff --git a/addons/sandbag/CfgVehicles.hpp b/addons/sandbag/CfgVehicles.hpp index a2b255318e..71276b91d7 100644 --- a/addons/sandbag/CfgVehicles.hpp +++ b/addons/sandbag/CfgVehicles.hpp @@ -42,8 +42,8 @@ class CfgVehicles { }; };*/ - class thingX; - class ACE_SandbagObject: thingX { + class ThingX; + class ACE_SandbagObject: ThingX { author = ECSTRING(common,ACETeam); XEH_ENABLED; scope = 1; diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index d26569f4ab..b9bd025dff 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -24,6 +24,6 @@ if !("ACE_Sandbag_empty" in items _unit) exitWith {false}; private ["_surfaceClass", "_surfaceType"]; _surfaceClass = (surfaceType getPosASL _unit) select [1]; -_surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); +_surfaceType = getText (configFile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); !(_surfaceType in SURFACE_BLACKLIST) diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index bd81a0935b..41e7d53e17 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -25,7 +25,7 @@ if (!hasInterface) exitWith {}; if !(isNil QGVAR(fadePFH)) then { - [GVAR(fadePFH)] call cba_fnc_removePerFrameHandler; + [GVAR(fadePFH)] call CBA_fnc_removePerFrameHandler; GVAR(fadePFH) = nil; }; }; @@ -44,7 +44,7 @@ if (!hasInterface) exitWith {}; [ACE_player, ELEVATION_UP, MINOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[201, [false, false, false]], true] call cba_fnc_addKeybind; +[201, [false, false, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { @@ -57,7 +57,7 @@ if (!hasInterface) exitWith {}; [ACE_player, ELEVATION_DOWN, MINOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[209, [false, false, false]], true] call cba_fnc_addKeybind; +[209, [false, false, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { @@ -70,7 +70,7 @@ if (!hasInterface) exitWith {}; [ACE_player, WINDAGE_LEFT, MINOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[209, [false, true, false]], true] call cba_fnc_addKeybind; +[209, [false, true, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { @@ -83,7 +83,7 @@ if (!hasInterface) exitWith {}; [ACE_player, WINDAGE_RIGHT, MINOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[201, [false, true, false]], true] call cba_fnc_addKeybind; +[201, [false, true, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { @@ -96,7 +96,7 @@ if (!hasInterface) exitWith {}; [ACE_player, ELEVATION_UP, MAJOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[201, [true, false, false]], true] call cba_fnc_addKeybind; +[201, [true, false, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { @@ -109,7 +109,7 @@ if (!hasInterface) exitWith {}; [ACE_player, ELEVATION_DOWN, MAJOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[209, [true, false, false]], true] call cba_fnc_addKeybind; +[209, [true, false, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { @@ -122,7 +122,7 @@ if (!hasInterface) exitWith {}; [ACE_player, WINDAGE_LEFT, MAJOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[209, [true, true, false]], true] call cba_fnc_addKeybind; +[209, [true, true, false]], true] call CBA_fnc_addKeybind; ["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { @@ -135,4 +135,4 @@ if (!hasInterface) exitWith {}; [ACE_player, WINDAGE_RIGHT, MAJOR_INCREMENT] call FUNC(adjustScope); }, {false}, -[201, [true, true, false]], true] call cba_fnc_addKeybind; +[201, [true, true, false]], true] call CBA_fnc_addKeybind; diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf index 562bf731b4..c40ca3f8b4 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -35,7 +35,7 @@ _newOptics = [_player] call FUNC(getOptics); { if (_newOptics select _forEachIndex != _x) then { // The optic for this weapon changed, set adjustment to zero - if (!((_adjustment select _foreachindex) isEqualTo [0, 0, 0])) then { + if (!((_adjustment select _forEachIndex) isEqualTo [0, 0, 0])) then { _adjustment set [_forEachIndex, [0, 0, 0]]; [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); }; diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index dd302ff333..43595bde87 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -58,6 +58,6 @@ GVAR(fadePFH) = [{ _layer cutFadeOut 2; GVAR(fadePFH) = nil; - [_pfhId] call cba_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; }; }, 0.1, []] call CBA_fnc_addPerFrameHandler diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf index 23816bd8d7..a167e0fea5 100644 --- a/addons/sitting/XEH_clientInit.sqf +++ b/addons/sitting/XEH_clientInit.sqf @@ -3,9 +3,16 @@ // Exit on Headless if (!hasInterface) exitWith {}; -// Add interaction menu exception -["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition); +["SettingsInitialized", { + TRACE_1("SettingInit", GVAR(enable)); + + //If not enabled, then do not add CanInteractWith Condition or event handlers: + if (!GVAR(enable)) exitWith {}; -// Handle interruptions -["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); -["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); + // Add interaction menu exception + ["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition); + + // Handle interruptions + ["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); + ["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); +}] call EFUNC(common,addEventHandler); diff --git a/addons/sitting/functions/fnc_addSitActions.sqf b/addons/sitting/functions/fnc_addSitActions.sqf index 18779d9229..98c9aba99f 100644 --- a/addons/sitting/functions/fnc_addSitActions.sqf +++ b/addons/sitting/functions/fnc_addSitActions.sqf @@ -16,19 +16,28 @@ #include "script_component.hpp" params ["_seat"]; -private ["_type", "_sitAction"]; -_type = typeOf _seat; +private _type = typeOf _seat; // Exit if the object is not specified as a seat if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canSit)) != 1) exitWith {}; +// only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addSitActions), _this]; +}; + +//If not enabled, don't add actions: +if (!GVAR(enable)) exitWith {}; + // Exit if class already initialized if (_type in GVAR(initializedClasses)) exitWith {}; GVAR(initializedClasses) pushBack _type; -_sitAction = [ +TRACE_1("Adding Sit Action",_type); + +private _sitAction = [ QGVAR(Sit), localize LSTRING(Sit), QUOTE(PATHTOF(UI\sit_ca.paa)), diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf index ca9a9ccfb1..ed49b11e92 100644 --- a/addons/sitting/functions/fnc_getRandomAnimation.sqf +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -15,10 +15,8 @@ */ #include "script_component.hpp" -private "_animations"; - // Animations Pool -_animations = [ +private _animations = [ QGVAR(HubSittingChairA_idle1), QGVAR(HubSittingChairA_idle2), QGVAR(HubSittingChairA_idle3), diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 24245699bc..7aa1c4c55b 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -16,15 +16,13 @@ */ #include "script_component.hpp" -private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosOrig"]; - params ["_seat", "_player"]; // Overwrite weird position, because Arma decides to set it differently based on current animation/stance... _player switchMove "amovpknlmstpsraswrfldnon"; // Add scroll-wheel action to release object -_actionID = _player addAction [ +private _actionID = _player addAction [ format ["%1", localize LSTRING(Stand)], QUOTE((_this select 0) call FUNC(stand)), nil, @@ -36,9 +34,9 @@ _actionID = _player addAction [ ]; // Read config -_configFile = configFile >> "CfgVehicles" >> typeOf _seat; -_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); -_sitPosition = getArray (_configFile >> QGVAR(sitPosition)); +private _configFile = configFile >> "CfgVehicles" >> typeOf _seat; +private _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); +private _sitPosition = getArray (_configFile >> QGVAR(sitPosition)); // Get random animation and perform it (before moving player to ensure correct placement) [_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations @@ -55,7 +53,7 @@ _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple peop // Add automatical stand PFH in case of interruptions -_seatPosOrig = getPosASL _seat; +private _seatPosOrig = getPosASL _seat; [{ params ["_args", "_pfhId"]; _args params ["_player", "_seat", "_seatPosOrig"]; diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index 4c08461746..a51f4203fc 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -16,7 +16,6 @@ #include "script_component.hpp" params ["_player"]; -private ["_animation"]; (_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"]; @@ -24,7 +23,7 @@ private ["_animation"]; _player removeAction _actionID; // Restore animation -_animation = switch (currentWeapon _player) do { +private _animation = switch (currentWeapon _player) do { case "": {"amovpercmstpsnonwnondnon"}; case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"}; case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"}; diff --git a/addons/sitting/stringtable.xml b/addons/sitting/stringtable.xml index b8716f49e5..3dd6c3ef46 100644 --- a/addons/sitting/stringtable.xml +++ b/addons/sitting/stringtable.xml @@ -3,6 +3,7 @@ Sit Down + Hinsetzen Usiądź Sentar Sednout si @@ -13,6 +14,7 @@ Stand Up + Aufstehen Wstań Levantar Vstát @@ -23,6 +25,7 @@ Enable Sitting + Sitzen ermöglichen Habilitar opção para sentar Aktywuj siadanie Povolit sezení @@ -33,6 +36,7 @@ Sitting + Hinsetzen Sentado Siadanie Sezení @@ -42,7 +46,8 @@ Сидение - This module allows you to disable the ability to sit on chairs and toilets. + This module allows you to disable the ability to sit on chairs. + Dieses Modul eröffnet die Möglichkeit, sich auf Stühlen hinzusetzen. Este módulo permite que você desabilite a capacidade de sentar-se em cadeiras e banheiros. Moduł ten pozwala na włączenie lub wyłączenie możliwości siadania na krzesłach i toaletach. Tento modul dovoluje zakázat možnost sedět na židlých a toaletách. diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index 2cf707f024..599802c3c9 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -3,6 +3,7 @@ Slideshow + Diavorführung Diaporama Pokaz slajdów Vetítés @@ -13,6 +14,7 @@ This module allows you to set up slide-shows on different objects. One module per image list. Only objects with hiddenSelection 0 are supported. + Dieses Modul erlaubt eine Diavorführung auf unterschiedlichen Objekten. Ein Modul, eine Bilderliste. Nur Objekte mit "hiddenSelection 0" werden unterstützt. Ce module permet d'afficher des diaporamas sur différents objets. Un module par liste d'image. Seul les objets avec le paramètre "HiddenSelection 0" sont supportés Ten moduł pozwala skonfigurować pokaz slajdów na różnych obiektach. Jeden moduł na jedną liste slajdów. Tylko obiekty z hiddenSelection 0 są wspierane. Ez a modul lehetővé teszi a különböző objektumokon való vetítést. Egy modul/képlista. Csak "hiddenSelection 0"-t tartalmazó objektumok felelnek meg. @@ -22,6 +24,7 @@ Objects + Objekte Objets Obiekty Objektumok @@ -32,6 +35,7 @@ Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. Reference INFO for object support. + Objektnamen (können auch synchronisierte Objekte sein) auf denen die Diavorführung abgepielt wird. Werden ggf. durch Kommata getrennt. Weiteres in der INFO für unterstützte Objekte. Nom d'objets (peuvent aussi être des objets synchronisés) sur lesquels les diaporamas vont être affichées, séparation par virgule si plusieurs. Nazwy obiektów (mogą to też być zsynchronizowane obiekty) na których pokaz slajdów zostanie pokazany, oddzielony przecinkiem jeżeli jest ich więcej niż 1. Sprawdź opis modułu aby dowiedzieć się jakie obiekty są wspierane przez moduł. Objektum nevek (szinkronizált is lehet) amik a vetítésen megjelennek, több darab esetén vesszővel elválasztva. Objektumtámogatásért az INFO-t tekintsd meg. @@ -41,6 +45,7 @@ Controllers + Steuereinheit Controleurs Kontroler Vezérlők @@ -50,6 +55,7 @@ Controller object names, separated by commas if multiple. + Objekte die als Steuereinheit fungieren. Werden ggf. durch Kommata getrennt. Noms de controleur d'objets, séparation par virgule si plusieurs Nazwa obiektu - kontrolera, oddzielona przecinkami jeżeli jest ich więcej niż 1. Vezérlő objektum nevek, vesszővel elválasztva több darab esetén. @@ -59,6 +65,7 @@ Images + Bilder Images Obrazy Képek @@ -69,6 +76,7 @@ List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). + Eine Liste von Bildern, die bei der Vorführung verwendet werden. (Durch Kommata getrennt, mit vollem Pfad angegeben (z.B Bilder\bild.paa)). Liste d'images qui seront utilisées dans des diaporama, séparation par virgule, avec le chemin d'accès complet et formaté correctement (ie. images\image.paa) Lista obrazów, które zostaną użyte do pokazu slajdów, oddzielone przecinkiem, z poprawnym pełnym formatem ścieżki do obrazka (np. slajdy\obrazek.paa). A képek listája amit a vetítés használni fog, vesszővel elválasztva, megfelelően formázott teljes útvonallal (pl. képek\kép.paa) @@ -103,6 +111,7 @@ Duração do Slide Длительность слайда Duración de diapositiva + Doba trvání snímku Duration of each slide. Default: 0 (Automatic Transitions Disabled) @@ -121,6 +130,7 @@ Slides Слайды Diapositivas + Snímky - + \ No newline at end of file diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index a3ad215ea2..392cd9a43d 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -184,9 +184,9 @@ class GVAR(interface) { colorBorder[] = {0,0,0,0}; colorBackground[] = {COL_BACK}; colorSelect[] = { - "profilenamespace getvariable ['GUI_BCG_RGB_R',0.77]", - "profilenamespace getvariable ['GUI_BCG_RGB_G',0.51]", - "profilenamespace getvariable ['GUI_BCG_RGB_B',0.08]", + "profilenamespace getVariable ['GUI_BCG_RGB_R',0.77]", + "profilenamespace getVariable ['GUI_BCG_RGB_G',0.51]", + "profilenamespace getVariable ['GUI_BCG_RGB_B',0.08]", 1 }; multiselectEnabled = 0; diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf index f07ac6da47..ce384c496c 100644 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -64,8 +64,8 @@ if (GVAR(camMode) == 0) then { _vector = _vector vectorAdd [0,0,_distance*sin(-_tilt)]; // Update the position of the target camera (used for smooth unit tracking) - _target camSetPos ((_unit modelToWorldVisual [0,0,0]) vectorAdd [0,0,1.5]); - _target camCommit 0; + _target camSetPos ((_unit modelToWorldVisual [0,0,0]) vectorAdd [0,0,1.5]); + _target camCommit 0; // Update the relative position of the unit camera _camera camSetRelPos _vector; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index b4e76b5e82..1ff8eaf301 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -180,7 +180,7 @@ switch (toLower _mode) do { }; // Handle held keys (prevent repeat calling) - if (GVAR(heldKeys) param [_dik,false]) exitwith {}; + if (GVAR(heldKeys) param [_dik,false]) exitWith {}; // Exclude movement/adjustment keys so that speed can be adjusted on fly if !(_dik in [16,17,30,31,32,44,74,78]) then { GVAR(heldKeys) set [_dik,true]; diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index 30aa03764f..b1160be2ea 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -27,7 +27,7 @@ params [["_set",true,[true]], ["_force",true,[true]]]; if (!hasInterface) exitWith {}; // Exit if no change -if (_set isEqualTo GVAR(isSet)) exitwith {}; +if (_set isEqualTo GVAR(isSet)) exitWith {}; // Handle common addon audio if (["ace_hearing"] call EFUNC(common,isModLoaded)) then { @@ -144,6 +144,12 @@ if (_set) then { GVAR(unitCamera) = nil; GVAR(targetCamera) = nil; + //Kill these PFEH handlers now because the PFEH can run before the `onunload` event is handled + GVAR(camHandler) = nil; + GVAR(compHandler) = nil; + GVAR(iconHandler) = nil; + GVAR(toolHandler) = nil; + // Cleanup display variables GVAR(ctrlKey) = nil; GVAR(heldKeys) = nil; diff --git a/addons/spectator/functions/fnc_stageSpectator.sqf b/addons/spectator/functions/fnc_stageSpectator.sqf index 61445f3dd9..87b2faffa8 100644 --- a/addons/spectator/functions/fnc_stageSpectator.sqf +++ b/addons/spectator/functions/fnc_stageSpectator.sqf @@ -26,7 +26,7 @@ params [["_unit",player,[objNull]], ["_set",true,[true]]]; // No change, no service (but allow spectators to be reset) if !(_set || (GETVAR(_unit,GVAR(isStaged),false))) exitWith {}; -if !(local _unit) exitwith { +if !(local _unit) exitWith { [[_unit, _set], QFUNC(stageSpectator), _unit] call EFUNC(common,execRemoteFnc); }; diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index d8c7cd1310..bca0e36c59 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -6,7 +6,7 @@ Ustawienia obserwatora Preferências de Espectador Настройки спектатора - Nastavení Pozorovatele + Nastavení pozorovatele Ajustes de espectador @@ -15,6 +15,7 @@ Configura como o sistema de espectador operará por padrão. Определяют, как система спектатора будет функционировать по-умолчанию. Configurar cómo el sistema de espectador funcionará por defecto. + Konfigurovat výchozí nastavení pozorovatele Unit filter @@ -30,6 +31,7 @@ Método para filtrar unidades espectáveis Метод фильтрации наблюдаемых юнитов. Método de filtrado de unidades de espectador + Metoda filtrování pozorovaných jednotek. No units @@ -52,7 +54,7 @@ Grywalne jednostki Unidades jogáveis Играбельные юниты - Hratelné Jednotky + Hratelné jednotky Unidades jugables @@ -77,6 +79,7 @@ Método para filtrar lados espectáveis. Метод фильтрации наблюдаемых сторон. Método de filtrado de bandos de espectador + Metoda filtrování pozorovaných stran. Player side @@ -124,6 +127,7 @@ Modos de camera que podem ser utilizados Режимы камеры, которые могут быть использованы Modos de la cámara que se pueden utilizar. + Módy kamery které mohou být použity. All @@ -202,6 +206,7 @@ Unidades espectadoras Юниты Unidades espectador + Jednotky pozorovatele Spectator Controls @@ -209,6 +214,7 @@ Controle do espectador Управление спектатором Controles de espectador + Ovládací prvky pozorovatele Free @@ -334,7 +340,7 @@ Zablokuj kamerę na celu Travar câmera em alvo Зафиксировать камеру на цели - Zamknout Kameru na Cíl + Zamknout kameru na Cíl Fijar cámara al objetivo @@ -343,6 +349,7 @@ Aumento de velocidade Ускорение камеры Aumento de velocidad + Zrychlení kamery Interface @@ -357,7 +364,7 @@ Przełącz interfejs Alternar interface Переключить интерфейс - Přepnout Rozhraní + Přepnout rozhraní Conmutar @@ -365,7 +372,7 @@ Przełącz ikony jednostek Alternar ícone de unidades Вкл./выкл. иконки юнитов - Přepnout Ikony Jednotek + Přepnout ikony jednotek Conmutar iconos de unidad @@ -373,7 +380,7 @@ Przełącz listę jednostek Alternar lista de unidades Вкл./выкл. список юнитов - Přepnout Seznam Jednotek + Přepnout seznam jednotek Conmutar lista de unidades @@ -382,13 +389,14 @@ Alternar barra de ferramentas Вкл./выкл. тулбар Conmutar barra de herramientas + Přepnout panel nátrojů Toggle Compass Przełącz kompas Alternar bússola Вкл./выкл. компас - Přepnout Kompas + Přepnout kompas Conmutar brújula @@ -396,7 +404,7 @@ Przełącz mapę Alternar mapa Вкл./выкл. карту - Přepnout Mapu + Přepnout mapu Conmutar map @@ -404,7 +412,7 @@ Przełącz pomoc Alternar ajuda Вкл./выкл. помощь - Přepnout Nápovědu + Přepnout nápovědu Conmutar ayuda @@ -419,7 +427,7 @@ Następna kamera Próxima câmera Следующая камера - Následující Kamera + Následující kamera Siguiente cámara @@ -427,7 +435,7 @@ Poprzednia kamera Câmera anterior Предыдущая камера - Předchozí Kamera + Předchozí kamera Anterior cámara @@ -435,7 +443,7 @@ Następna jednostka Próxima unidade Следующий юнит - Následující Jednotka + Následující jednotka Siguiente unidad @@ -443,7 +451,7 @@ Poprzednia jednostka Unidade anterior Предыдущий юнит - Předchozí Jednotka + Předchozí jednotka Anterior unidad @@ -465,7 +473,7 @@ Reguluj zoom Ajustar zoom Настроить зум - Regulovat Přiblížení + Regulovat přiblížení Ajustar aumento @@ -473,7 +481,7 @@ Reguluj prędkość Ajuster velocidade Настроить скорость - Regulovat Rychlost + Regulovat rychlost Ajustar velocidad @@ -495,7 +503,7 @@ Resetuj zoom Redefinir zoom Сбросить зум - Obnovit Přiblížení + Obnovit přiblížení Reiniciar aumento @@ -503,7 +511,7 @@ Resetuj prędkość Redefinir velocidade Сбросить скорость - Obnovit Rychlost + Obnovit rychlost Reiniciar velocidad diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp index 2c8159fbb1..434c1c96ca 100644 --- a/addons/spottingscope/CfgVehicles.hpp +++ b/addons/spottingscope/CfgVehicles.hpp @@ -56,7 +56,7 @@ class CfgVehicles { side = 1; typicalCargo[] = {"Soldier"}; displayName = CSTRING(DisplayName); - model = PATHTOF(data\spottingscope.p3d); + model = PATHTOF(data\ace_spottingscope.p3d); mapSize = 0.5; transportSoldier = 0; getInAction = "GetInLow"; @@ -89,9 +89,9 @@ class CfgVehicles { initAngleY = 0; minAngleY = -100; maxAngleY = 100; - initFov = 0.7; - minFov = 0.7; - maxFov = 0.7; + initFov = 0.75; + minFov = 0.25; + maxFov = 1.25; }; class ViewOptics { initAngleX = 0; @@ -100,9 +100,9 @@ class CfgVehicles { initAngleY = 0; minAngleY = -100; maxAngleY = 100; - initFov = 0.014812; - minFov = 0.014812; - maxFov = 0.014812; + minFov = 0.0025; + maxFov = 0.05; + initFov= 0.05; }; }; }; diff --git a/addons/spottingscope/CfgWeapons.hpp b/addons/spottingscope/CfgWeapons.hpp index 4ba078c057..9b5825572b 100644 --- a/addons/spottingscope/CfgWeapons.hpp +++ b/addons/spottingscope/CfgWeapons.hpp @@ -8,7 +8,7 @@ class CfgWeapons { displayName = CSTRING(DisplayName); descriptionShort = ""; picture = PATHTOF(UI\w_spottingscope_ca.paa); - model = PATHTOF(data\w_spottingscope.p3d); + model = PATHTOF(data\ace_spottingscope.p3d); class ItemInfo: InventoryItem_Base_F { mass = 40; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp index 157e430868..c3541eed39 100644 --- a/addons/spottingscope/config.cpp +++ b/addons/spottingscope/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {"ACE_SpottingScope"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_apl", "ace_interaction"}; - author[] = {"Rocko", "Scubaman3D", "Ruthberg", "commy2"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg", "commy2", "p1nga"}; VERSION_CONFIG; }; }; diff --git a/addons/spottingscope/data/ace_spottingscope.p3d b/addons/spottingscope/data/ace_spottingscope.p3d new file mode 100644 index 0000000000..fc6bc45354 Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope.p3d differ diff --git a/addons/spottingscope/data/ace_spottingscope_as.paa b/addons/spottingscope/data/ace_spottingscope_as.paa new file mode 100644 index 0000000000..a7e517e4ff Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_as.paa differ diff --git a/addons/spottingscope/data/ace_spottingscope_co.paa b/addons/spottingscope/data/ace_spottingscope_co.paa new file mode 100644 index 0000000000..669d94f4ae Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_co.paa differ diff --git a/addons/spottingscope/data/ace_spottingscope_glass.rvmat b/addons/spottingscope/data/ace_spottingscope_glass.rvmat new file mode 100644 index 0000000000..bce3c40b59 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_glass.rvmat @@ -0,0 +1,96 @@ +class StageTI +{ + texture="a3\data_f\Default_ti_ca.paa"; +}; +ambient[]={0.301,0.63999999,0.68000001,1}; +diffuse[]={0.301,0.63999999,0.68000001,1}; +forcedDiffuse[]={0.2,0.34999999,0.2,0}; +emmisive[]={0,0,0,1}; +specular[]={0.67450982,0.64313728,0.50196081,1}; +specularPower=550; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={6,0,0}; + up[]={0,6,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_as.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(4.01,2.86)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage7 +{ + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/spottingscope/data/ace_spottingscope_item.p3d b/addons/spottingscope/data/ace_spottingscope_item.p3d new file mode 100644 index 0000000000..d2de0edf1c Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_item.p3d differ diff --git a/addons/spottingscope/data/ace_spottingscope_metal.rvmat b/addons/spottingscope/data/ace_spottingscope_metal.rvmat new file mode 100644 index 0000000000..54cfcafeb8 --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_metal.rvmat @@ -0,0 +1,92 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.2,0.2,0.2,0}; +specularPower=100; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={6,0,0}; + up[]={0,6,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_as.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(4.01,2.86)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage7 +{ + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/spottingscope/data/ace_spottingscope_nohq.paa b/addons/spottingscope/data/ace_spottingscope_nohq.paa new file mode 100644 index 0000000000..5cc7f00dfd Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_nohq.paa differ diff --git a/addons/spottingscope/data/ace_spottingscope_rubber.rvmat b/addons/spottingscope/data/ace_spottingscope_rubber.rvmat new file mode 100644 index 0000000000..c31f850e7d --- /dev/null +++ b/addons/spottingscope/data/ace_spottingscope_rubber.rvmat @@ -0,0 +1,85 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.25,0.25,0.25,1}; +specularPower=90; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={6,0,0}; + up[]={0,6,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_as.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="z\ace\addons\spottingscope\data\ace_spottingscope_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,64,64,1)fresnel(1.5,1.22)"; + uvSource="none"; +}; +class Stage7 +{ + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/spottingscope/data/ace_spottingscope_smdi.paa b/addons/spottingscope/data/ace_spottingscope_smdi.paa new file mode 100644 index 0000000000..844626c0af Binary files /dev/null and b/addons/spottingscope/data/ace_spottingscope_smdi.paa differ diff --git a/addons/spottingscope/data/m144_ca.paa b/addons/spottingscope/data/m144_ca.paa index 4d7a63ba0a..a2d299d937 100644 Binary files a/addons/spottingscope/data/m144_ca.paa and b/addons/spottingscope/data/m144_ca.paa differ diff --git a/addons/spottingscope/data/model.cfg b/addons/spottingscope/data/model.cfg index e7beb2f2c1..71eb918bf7 100644 --- a/addons/spottingscope/data/model.cfg +++ b/addons/spottingscope/data/model.cfg @@ -9,8 +9,11 @@ class CfgSkeletons isDiscrete = 1; skeletonInherit = "Default"; skeletonBones[] = { - "otocvez","", - "otochlaven","otocvez" + "main_turret","", + "main_gun","main_turret", + "leg_01","", + "leg_02","", + "leg_03","" }; }; }; @@ -20,15 +23,15 @@ class CfgModels { sections[] = {}; skeletonName = ""; }; - class spottingscope: Default { + class ace_spottingscope: Default { skeletonName = "ace_spottingscope_skeleton"; sectionsInherit = "Default"; class animations { class mainTurret { type = "rotationY"; source = "mainTurret"; - selection = "otocvez"; - axis = "osaveze"; + selection = "main_turret"; + axis = "main_turret_axis"; minValue = "rad -360"; maxValue = "rad +360"; angle0 = "rad -360"; @@ -37,13 +40,31 @@ class CfgModels { class mainGun { type = "rotationX"; source = "mainGun"; - selection = "otochlaven"; - axis = "osahlavne"; + selection = "main_gun"; + axis = "main_gun_axis"; minValue = "rad -360"; maxValue = "rad +360"; angle0 = "rad -360"; angle1 = "rad +360"; }; + class leg_01 { + type = "rotation"; + source = "fold_legs"; + selection = "leg_01"; + axis="leg_01_axis"; + minValue = 0; + maxValue = 1; + angle0="rad +00"; + angle1="rad +55"; + }; + class leg_02: leg_01 { + selection = "leg_02"; + axis="leg_02_axis"; + }; + class leg_03: leg_01 { + selection = "leg_03"; + axis="leg_03_axis"; + }; }; }; }; diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index c3cb99588a..5aab2c9aee 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -32,6 +32,6 @@ params ["_originalPlayerUnit"]; _layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; _layer cuttext ["","plain"]; - [_pfhId] call cba_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; }; }, 0.2, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index 793e72bb71..49c3e97e42 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -76,6 +76,6 @@ if (_leave) exitWith { [localize LSTRING(SwitchedUnit)] call EFUNC(common,displayTextStructured); - [_pfhId] call cba_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; }; }, 0.2, [_unit, player]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml index 3d377ed420..602be09855 100644 --- a/addons/tacticalladder/stringtable.xml +++ b/addons/tacticalladder/stringtable.xml @@ -43,6 +43,7 @@ Rozłóż, +Ctrl nachyl Extender, +Ctrl tilt Разложить, +Ctrl наклонить + Prodloužit, +Ctrl naklonit Position ladder diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp index 60486b8afb..de16d6867a 100644 --- a/addons/tripod/CfgVehicles.hpp +++ b/addons/tripod/CfgVehicles.hpp @@ -32,8 +32,8 @@ class CfgVehicles { }; }; - class thingX; - class ACE_TripodObject: thingX { + class ThingX; + class ACE_TripodObject: ThingX { XEH_ENABLED; EGVAR(dragging,canDrag) = 1; EGVAR(dragging,dragPosition[]) = {0,1,0}; diff --git a/addons/tripod/stringtable.xml b/addons/tripod/stringtable.xml index c6366ba8de..16dd89a1f9 100644 --- a/addons/tripod/stringtable.xml +++ b/addons/tripod/stringtable.xml @@ -3,7 +3,7 @@ SSWT Kit - Scharfschützenzweibein + Scharfschützendreibein Снайперский штатив Trójnóg snajperski SSWT Kit @@ -15,7 +15,7 @@ Place SSWT Kit - Scharfschützenzweibein aufstellen + Scharfschützendreibein aufstellen Установить снайперский штатив Postaw trójnóg snajperski Place SSWT Kit @@ -30,7 +30,7 @@ Podnieś trójnóg snajperski Coger equipo SSWT Zvednout SSWT soupravu - SSWT-Werkzeug aufheben + Scharfschützendreibein einpacken Pegar kit SSWT Prendre le kit SSWT SSWT készlet felvétele @@ -41,7 +41,7 @@ Reguluj trójnóg snajperski Ajustar equipo SSWT Regulovat SSWT soupravu - SSWT-Werkzeug anpassen + Scharfschützendreibein anpassen Ajustar kit SSWT Régler le kit SSWT SSWT készlet állítása diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf index 3ce09e3c6c..6141e40fa8 100644 --- a/addons/vector/functions/fnc_convertToTexturesFOS.sqf +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -237,7 +237,7 @@ switch (_coordinate) do { }; // trap errors -if ({typeName _x == "STRING"} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith { +if !([_digit0, _digit1, _digit2, _digit3, _digit4] isEqualTypeAll "") exitWith { [QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return }; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 5c0e04ee0b..3435af24bf 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -35,7 +35,7 @@ if ((locked _veh) == 0) exitWith {false}; if (!("ACE_key_lockpick" in (items _unit))) exitWith {false}; _vehLockpickStrenth = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)]; -if (typeName _vehLockpickStrenth != "SCALAR") exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false}; +if (!(_vehLockpickStrenth isEqualType 0)) exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false}; //-1 indicates unpickable lock if (_vehLockpickStrenth < 0) exitWith {false}; diff --git a/addons/vehiclelock/README.md b/addons/vehiclelock/readme.md similarity index 76% rename from addons/vehiclelock/README.md rename to addons/vehiclelock/readme.md index c31402c6e3..64ae01a99c 100644 --- a/addons/vehiclelock/README.md +++ b/addons/vehiclelock/readme.md @@ -5,10 +5,11 @@ Adds keys as an item, to lock and unlock vehicles. Primary target would be role play or TVT, but has uses in all game types, even co-ops (e.g.: DAC AI will steal unlocked vehicles) Two key modes (can be used together): -- Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) -- Custom keys (one key will only open a specific vehicle and nothing else) +* Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) +* Custom keys (one key will only open a specific vehicle and nothing else) #### Items Added: + `ACE_key_lockpick` `ACE_key_master` `ACE_key_west` @@ -19,21 +20,19 @@ Two key modes (can be used together): #### Magazine added: `ACE_key_customKeyMagazine` (should never be manualy added, needs to be "programed" to work on a vehicle, see `ACE_VehicleLock_fnc_addKeyForVehicle`) - ## For Mission Makers: #### Modules: -- Vehicle Lock Setup - Settings for locking inventory of locked vehicles, default lockpick time, and initial vehicle lock state. -- Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Will NOT work for JIP units. +* Vehicle Lock Setup - Settings for locking inventory of locked vehicles, default lockpick time, and initial vehicle lock state. +* Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Will NOT work for JIP units. #### Vehicle setVariables: -- `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys -- `ACE_vehicleLock_lockpickStrength` - NUMBER: secons, determines how long lockpicking with take, overrides ACE_VehicleLock_DefaultLockpickStrength +* `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys +* `ACE_vehicleLock_lockpickStrength` - NUMBER: secons, determines how long lockpicking with take, overrides ACE_VehicleLock_DefaultLockpickStrength #### Public Functions: `[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` - will add a `ACE_key_customKeyMagazine` to bob and program it to work on car1 - ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 5cb30518d9..6c0953eb76 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -28,15 +28,6 @@ class CfgWeapons { class LMG_Minigun: LMG_RCWS { magazines[] = {"1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"}; - - class manual: MGun { - reloadTime = 0.015; - dispersion = 0.006; - }; - class close: manual {}; - class short: close {}; - class medium: close {}; - class far: close {}; }; class HMG_127: LMG_RCWS { @@ -49,18 +40,10 @@ class CfgWeapons { class manual: manual { reloadTime = 0.23; }; - class close: manual { - reloadTime = 0.23; - }; - class short: close { - reloadTime = 0.23; - }; - class medium: close { - reloadTime = 0.23; - }; - class far: close { - reloadTime = 0.23; - }; + class close: manual {}; + class short: close {}; + class medium: close {}; + class far: close {}; }; class autocannon_Base_F; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index a8ec2fb75f..c55fcf2544 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -2,20 +2,31 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; - +GVAR(isSpeedLimiter) = false; // Add keybinds ["ACE3 Vehicles", QGVAR(speedLimiter), localize LSTRING(SpeedLimiter), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if !(ACE_player == driver vehicle ACE_player && - {vehicle ACE_player isKindOf 'Car' || - {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; + private _connectedUAV = getConnectedUAV ACE_player; + private _uavControll = UAVControl _connectedUAV; + if ((_uavControll select 1) == "DRIVER") then { + if !(_connectedUAV isKindOf "UGV_01_base_F") exitWith {false}; + GVAR(isUAV) = true; + [_uavControll select 0, _connectedUAV] call FUNC(speedLimiter); + true + } else { + // Conditions: canInteract + if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if !(ACE_player == driver vehicle ACE_player && + {vehicle ACE_player isKindOf 'Car' || + {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; + + GVAR(isUAV) = false; + // Statement + [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); + true + }; - // Statement - [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); - true }, {false}, -[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key +[211, [false, false, false]], false] call CBA_fnc_addKeybind; //DELETE Key diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 151c02fd8a..2d445be3c8 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -16,11 +16,9 @@ */ #include "script_component.hpp" -private "_maxSpeed"; - params ["_driver", "_vehicle"]; -if (GETGVAR(isSpeedLimiter,false)) exitWith { +if (GVAR(isSpeedLimiter)) exitWith { [localize LSTRING(Off)] call EFUNC(common,displayTextStructured); playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = false; @@ -30,19 +28,28 @@ if (GETGVAR(isSpeedLimiter,false)) exitWith { playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; -_maxSpeed = speed _vehicle max 10; +private _maxSpeed = speed _vehicle max 10; [{ params ["_args", "_idPFH"]; _args params ["_driver", "_vehicle", "_maxSpeed"]; - if (!GVAR(isSpeedLimiter) || {_driver != driver _vehicle}) exitWith { - GVAR(isSpeedLimiter) = false; + if (GVAR(isUAV)) then { + private _uavControll = UAVControl _vehicle; + if ((_uavControll select 0) != _driver || _uavControll select 1 != "DRIVER") then { + GVAR(isSpeedLimiter) = false; + }; + } else { + if (_driver != driver _vehicle) then { + GVAR(isSpeedLimiter) = false; + }; + }; + + if (!GVAR(isSpeedLimiter)) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; - private "_speed"; - _speed = speed _vehicle; + private _speed = speed _vehicle; if (_speed > _maxSpeed) then { _vehicle setVelocity ((velocity _vehicle) vectorMultiply ((_maxSpeed / _speed) - 0.00001)); // fix 1.42-hotfix PhysX libraries applying force in previous direction when turning diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 28ed7471ca..1499626b7f 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -9,7 +9,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // index, NOT value // Can set it to client's actual viewdistance in the init function once ACE_Settings supports numbers (if ever). - values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + values[] = {CSTRING(videosettings), "500", "1000", "1500", "2000", "2500", "3000", "3500", "4000", "5000", "6000", "7000", "8000", "9000", "10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf displayName = CSTRING(onFoot_DisplayName); description = CSTRING(onFoot_Description); }; @@ -17,7 +17,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // index, NOT value - values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + values[] = {CSTRING(videosettings), "500", "1000", "1500", "2000", "2500", "3000", "3500", "4000", "5000", "6000", "7000", "8000", "9000", "10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf displayName = CSTRING(landVehicle_DisplayName); description = CSTRING(landVehicle_Description); }; @@ -25,7 +25,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // index, NOT value - values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + values[] = {CSTRING(videosettings), "500", "1000", "1500", "2000", "2500", "3000", "3500", "4000", "5000", "6000", "7000", "8000", "9000", "10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf displayName = CSTRING(airVehicle_DisplayName); description = CSTRING(airVehicle_Description); }; @@ -39,7 +39,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // index. Actual coefficient is given by functions/fnc_returnObjectCoeff.sqf - values[] = {CSTRING(object_off),CSTRING(object_verylow),CSTRING(object_low),CSTRING(object_medium),CSTRING(object_high),CSTRING(object_veryhigh)}; + values[] = {CSTRING(object_off), CSTRING(object_verylow), CSTRING(object_low), CSTRING(object_medium),CSTRING(object_high), CSTRING(object_veryhigh), CSTRING(object_fovBased)}; displayName = CSTRING(object_DisplayName); description = CSTRING(object_Description); }; diff --git a/addons/viewdistance/CfgEventHandlers.hpp b/addons/viewdistance/CfgEventHandlers.hpp index 0f1d8878ba..423993f757 100644 --- a/addons/viewdistance/CfgEventHandlers.hpp +++ b/addons/viewdistance/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); @@ -7,6 +6,6 @@ class Extended_PreInit_EventHandlers { class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_postInit)); + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); }; -}; \ No newline at end of file +}; diff --git a/addons/viewdistance/README.md b/addons/viewdistance/README.md index 67860b1ad0..2f0b14dbeb 100644 --- a/addons/viewdistance/README.md +++ b/addons/viewdistance/README.md @@ -1,7 +1,7 @@ ace_viewdistance =========== -Adds various View Distance settings and allows limiting maximum view distance that can be set by players. +Adds various View Distance settings, including Field of View based Object View Distance, and allows limiting maximum view distance that can be set by players. ## Maintainers @@ -9,3 +9,4 @@ Adds various View Distance settings and allows limiting maximum view distance th The people responsible for merging changes to this component or answering potential questions. - [Winter](https://github.com/Winter259) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_clientInit.sqf similarity index 75% rename from addons/viewdistance/XEH_postInit.sqf rename to addons/viewdistance/XEH_clientInit.sqf index a30befaa81..45b86d944d 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_clientInit.sqf @@ -11,10 +11,11 @@ if (!hasInterface) exitWith {}; // Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately ["SettingChanged",{ - if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || - (_this select 0 == QGVAR(viewDistanceLandVehicle)) || - (_this select 0 == QGVAR(viewDistanceAirVehicle)) || - (_this select 0 == QGVAR(objectViewDistanceCoeff))) then { + params ["_name"]; + if ((_name == QGVAR(viewDistanceOnFoot)) || + (_name == QGVAR(viewDistanceLandVehicle)) || + (_name == QGVAR(viewDistanceAirVehicle)) || + (_name == QGVAR(objectViewDistanceCoeff))) then { [true] call FUNC(adaptViewDistance); }; diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index a68416cada..8237a97cb9 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,10 +2,11 @@ ADDON = false; -PREP(initModule); -PREP(returnValue); -PREP(returnObjectCoeff); -PREP(changeViewDistance); PREP(adaptViewDistance); +PREP(changeViewDistance); +PREP(initModule); +PREP(returnObjectCoeff); +PREP(returnValue); +PREP(setFovBasedOvdPFH); -ADDON = true; \ No newline at end of file +ADDON = true; diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp index a1afbcc93f..2de8b2c954 100644 --- a/addons/viewdistance/config.cpp +++ b/addons/viewdistance/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"Winter"}; + author[] = {"Winter", "Jonpas", "Arkhir"}; authorUrl = "https://github.com/Winter259"; VERSION_CONFIG; }; @@ -14,4 +14,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "ACE_Settings.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index ca03758df5..f1ea7121b2 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_viewdistance_fnc_adaptViewDistance; + * [] call ace_viewdistance_fnc_adaptViewDistance * * Public: No */ @@ -36,4 +36,4 @@ if (_land_vehicle) exitWith { if (_air_vehicle) exitWith { [GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance); -}; \ No newline at end of file +}; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 30dc4f8144..1e887e9538 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -2,7 +2,6 @@ * Author: Winter * Sets the player's current view distance according to allowed values. * - * * Arguments: * 0: View Distance setting INDEX * 1: Show Prompt @@ -11,14 +10,13 @@ * None * * Example: - * [] call ace_viewdistance_fnc_changeViewDistance; + * [] call ace_viewdistance_fnc_changeViewDistance * * Public: No */ - #include "script_component.hpp" -private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"]; +private ["_text", "_new_view_distance", "_view_distance_limit", "_object_view_distance_coeff"]; params ["_index_requested", "_show_prompt"]; @@ -29,19 +27,34 @@ _view_distance_limit = GVAR(limitViewDistance); // Grab the limit TRACE_2("Limit",_new_view_distance,_view_distance_limit); setViewDistance (_new_view_distance min _view_distance_limit); -if (_object_view_distance_coeff > 0) then { - setObjectViewDistance (_object_view_distance_coeff * viewDistance); +if (typeName _object_view_distance_coeff == "SCALAR") then { + if (_object_view_distance_coeff > 0) then { + setObjectViewDistance (_object_view_distance_coeff * viewDistance); + } else { + // Restore correct view distance when changing from FoV Based to Off + // Restoring directly inside PFH's self-exit resulted in the need of selecting another option to take effect + setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); + }; +} else { + if (isNil QGVAR(fovBasedPFHminimalViewDistance)) then { + GVAR(fovBasedPFHminimalViewDistance) = getObjectViewDistance select 0; // Minimal view distance holder and PFH isRunning variable + [FUNC(setFovBasedOvdPFH), 0, []] call CBA_fnc_addPerFrameHandler; + }; }; if (_show_prompt) then { - _text = if (_new_view_distance <= _view_distance_limit) then { - format ["%1 %2m", (localize "STR_ACE_ViewDistance_infotext"), str(viewDistance)]; - } else { - format ["%1 %2m", (localize "STR_ACE_ViewDistance_invalid"), str(viewDistance)]; - }; - if (GVAR(objectViewDistanceCoeff) > 0) then { - _text = _text + format ["
%1 %2%3", (localize "STR_ACE_ViewDistance_objectinfotext"), str(_object_view_distance_coeff * 100),"%"]; + // FoV Based or % + if (GVAR(objectViewDistanceCoeff) == 6) then { + _text = format ["%1 %2
Min. %3
Max. %4
", localize LSTRING(objectinfotext), localize LSTRING(object_fovBased), GVAR(fovBasedPFHminimalViewDistance), viewDistance]; + } else { + _text = if (_new_view_distance <= _view_distance_limit) then { + format ["%1 %2m", localize LSTRING(infotext), viewDistance]; + } else { + format ["%1 %2m", localize LSTRING(invalid), viewDistance]; + }; + _text = _text + format ["
%1 %2%3", localize LSTRING(objectinfotext), _object_view_distance_coeff * 100, "%"]; + }; + [parseText _text, 2] call EFUNC(common,displayTextStructured); }; - [parseText _text,2] call EFUNC(common,displayTextStructured); }; diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 47cf27025e..231cd74c7b 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -1,7 +1,6 @@ /* * Author: Winter - * Initialises the view distance limiter module - * + * Initializes the view distance limiter module. * * Arguments: * 0: logic @@ -10,7 +9,6 @@ * * Return Value: * None - * */ #include "script_component.hpp" diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf index 71a23d7b54..e9838a0c8d 100644 --- a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -2,7 +2,6 @@ * Author: Winter * Returns the object view distance coefficient according to the given index * - * * Arguments: * 0: Object View Distance setting Index * @@ -28,6 +27,7 @@ _return = switch (_index) do { case 3: {0.60}; // Medium case 4: {0.80}; // High case 5: {1.00}; // Very High + case 6: {"fov"}; // FoV Based default {0.50}; // something broke if this returns }; diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index 7e0c41f1be..2e4263fa08 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -1,7 +1,6 @@ /* * Author: Winter - * Returns the view distance value according to the given index - * + * Returns the view distance value according to the given index. * * Arguments: * 0: View Distance Index @@ -10,7 +9,7 @@ * View Distance * * Example: - * [2] call ace_viewdistance_fnc_returnViewDistanceValue; + * [2] call ace_viewdistance_fnc_returnViewDistanceValue * * Public: No */ diff --git a/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf b/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf new file mode 100644 index 0000000000..bcde34316a --- /dev/null +++ b/addons/viewdistance/functions/fnc_setFovBasedOvdPFH.sqf @@ -0,0 +1,53 @@ +/* + * Author: Jonpas + * Sets Object View Distance dynamically based on current Field of View, between Object View Distance (minimal value) and View Distance (maximum value) set before this PFH starts. + * + * Arguments: + * 0: PFH Arguments + * 1: PFH Handle + * + * Return Value: + * PFH Handle + * + * Example: + * [] call ace_viewdistance_fnc_setFovBasedOvdPFH + * + * Public: No + */ + +#include "script_component.hpp" + +#define VD_ZOOM_NORMAL 1.00041 +#define VD_ZOOM_DIVISION 35 +#define VD_ZOOM_DIVISION_AIR 10 + +params ["", "_idPFH"]; + +// Remove PFH and set Object View Distance back to what it was before +if (GVAR(objectViewDistanceCoeff) < 6) exitWith { + [_idPFH] call CBA_fnc_removePerFrameHandler; + GVAR(fovBasedPFHminimalViewDistance) = nil; +}; + +private ["_zoom"]; +_zoom = (call CBA_fnc_getFov) select 1; + +// Air +if ((vehicle ACE_player) isKindOf "Air") exitWith { + if (_zoom > VD_ZOOM_NORMAL) then { + // Dynamically set Object View Distance based on player's Zoom Level and View Distance + setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION_AIR * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); + } else { + setObjectViewDistance (GVAR(fovBasedPFHminimalViewDistance) + viewDistance / 10); + }; + TRACE_2("FoV Based",getObjectViewDistance select 0,_zoom); +}; + +// Land +if (_zoom > VD_ZOOM_NORMAL) then { + // Dynamically set Object View Distance based on player's Zoom Level and View Distance + setObjectViewDistance ((_zoom / VD_ZOOM_DIVISION * (viewDistance - GVAR(fovBasedPFHminimalViewDistance))) + GVAR(fovBasedPFHminimalViewDistance)); +} else { + setObjectViewDistance GVAR(fovBasedPFHminimalViewDistance); +}; +TRACE_2("FoV Based",getObjectViewDistance select 0,_zoom); diff --git a/addons/viewdistance/functions/script_component.hpp b/addons/viewdistance/functions/script_component.hpp index 4b7df89f37..f6c83ec54d 100644 --- a/addons/viewdistance/functions/script_component.hpp +++ b/addons/viewdistance/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\addons\viewdistance\script_component.hpp" \ No newline at end of file +#include "\z\ace\addons\viewdistance\script_component.hpp" diff --git a/addons/viewdistance/script_component.hpp b/addons/viewdistance/script_component.hpp index 79e0e488cc..53c4d76390 100644 --- a/addons/viewdistance/script_component.hpp +++ b/addons/viewdistance/script_component.hpp @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_VIEWDISTANCE #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index b3058bc29e..673f09783d 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -1,6 +1,6 @@ - + - + View Distance Limiter Ogranicznik zasięgu widzenia @@ -156,7 +156,7 @@ Динамич. дальность отрисовки объектов - Sets the object view distance as a coefficient of the view distance. + Sets the object view distance as a coefficient of the view distance or based on field of view. FoV Based's lowest and highest value is the value which is set when enabling the option. Zmienia zasięg rysowania obiektów jako mnożnik zasięgu widzenia. Establece la distancia de visión de objetos como un coeficiente de la distancia de visión. Nastaví objekt dohlednosti jako koeficient dohlednosti. @@ -232,6 +232,11 @@ Maximális Очень высокая + + FoV Based + Зависит от зума + Baseado em FoV + View Distance: Zasięg widzenia: @@ -277,4 +282,4 @@ Видео настройки - + \ No newline at end of file diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 491a86f39d..450086aa91 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -105,8 +105,7 @@ if (!hasInterface) exitWith {}; if ((currentWeapon ACE_player) != "") then { [ACE_player] call FUNC(putWeaponAway); } else { - private ["_weapon"]; - _weapon = switch (true) do { + private _weapon = switch (true) do { case ((primaryWeapon ACE_player) != ""): {primaryWeapon ACE_player}; case ((handgunWeapon ACE_player) != ""): {handgunWeapon ACE_player}; case ((secondaryWeapon ACE_player) != ""): {secondaryWeapon ACE_player}; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 1f324f7fb0..26347fc279 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -17,21 +17,19 @@ GVAR(GrenadesAll) = []; GVAR(GrenadesFrag) = []; GVAR(GrenadesNonFrag) = []; -private ["_magazines", "_ammo", "_explosive"]; - { - _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); + private _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); GVAR(GrenadesAll) append _magazines; { - _ammo = getText (configfile >> "CfgMagazines" >> _x >> "ammo"); - _explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive"); + private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); ([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x; false } count _magazines; false -} count getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); +} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); ADDON = true; diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 6ae945e2fd..ef9397ba57 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -16,16 +16,14 @@ */ #include "script_component.hpp" -if !(GVAR(DisplayText)) exitwith {}; +if !(GVAR(DisplayText)) exitWith {}; params ["_magazine", "_numberofGrenades"]; -private ["_color", "_name", "_text", "_picture"]; +private _color = [[1, 0, 0], [1, 1, 1]] select (_numberofGrenades > 0); +private _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); -_color = [[1, 0, 0], [1, 1, 1]] select (_numberofGrenades > 0); -_name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); - -_text = [format ["%1 x%2", _name, _numberofGrenades], _color] call EFUNC(common,stringToColoredText); -_picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); +private _text = [format ["%1 x%2", _name, _numberofGrenades], _color] call EFUNC(common,stringToColoredText); +private _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); ["displayTextPicture", [_text, _picture]] call EFUNC(common,localEvent); diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 71ef89ecf6..bb877ea3cd 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -17,11 +17,8 @@ params ["_vehicle"]; -private ["_turret", "_weapons"]; - -_turret = [_vehicle] call EFUNC(common,getTurretCommander); - -_weapons = _vehicle weaponsTurret _turret; +private _turret = _vehicle call EFUNC(common,getTurretCommander); +private _weapons = _vehicle weaponsTurret _turret; if ( count _weapons > 1 @@ -32,8 +29,8 @@ if ( // avoid infinite loop if !("SmokeLauncher" in _weapons) exitWith {}; - private "_index"; - _index = 0; + private _index = 0; + while { _vehicle currentWeaponTurret _turret != "SmokeLauncher" } do { @@ -44,8 +41,7 @@ if ( } else { // fire away! - private "_logic"; - _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + private _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; _logic action ["useWeapon", _vehicle, commander _vehicle, 0]; diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 28ef5d21e5..a7c3f13936 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -18,14 +18,12 @@ params ["_unit", "_weapon"]; -private ["_sound", "_position"]; - -_sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); +private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (_sound isEqualTo []) exitWith {}; // get position where to play the sound (position of the weapon) -_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); +private _position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index fd1e463a4d..d2747bf23f 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -17,6 +17,6 @@ params ["_unit"]; -[_unit] call EFUNC(common,fixLoweredRifleAnimation); +_unit call EFUNC(common,fixLoweredRifleAnimation); _unit action ["SwitchWeapon", _unit, _unit, 99]; diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf index d4a00b5718..a4e93814a9 100644 --- a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -18,10 +18,8 @@ params ["_unit", ["_type", 0]]; -private ["_currentGrenade", "_magazines", "_grenades", "_nextGrenadeIndex", "_nextGrenade", "_uniformGrenades", "_vestGrenades", "_backpackGrenades"]; - // get currently selected grenade -_currentGrenade = currentThrowable _unit; +private _currentGrenade = currentThrowable _unit; // get correct array format if no grenade is selected if (_currentGrenade isEqualTo []) then { @@ -31,9 +29,9 @@ if (_currentGrenade isEqualTo []) then { _currentGrenade = _currentGrenade select 0; // get available magazines for that unit -_magazines = magazines _unit; +private _magazines = magazines _unit; -_grenades = []; +private _grenades = []; { if (_x in _magazines) then { @@ -46,22 +44,22 @@ _grenades = []; if (_grenades isEqualTo []) exitWith {false}; // get next grenade muzzle -_nextGrenadeIndex = (_grenades find _currentGrenade) + 1; +private _nextGrenadeIndex = (_grenades find _currentGrenade) + 1; // roll over if the last grenade was selected if (_nextGrenadeIndex >= count _grenades) then { _nextGrenadeIndex = 0; }; -_nextGrenade = _grenades select _nextGrenadeIndex; +private _nextGrenade = _grenades select _nextGrenadeIndex; // abort if the same grenade would be selected if (_currentGrenade == _nextGrenade) exitWith {false}; // current best method to select a grenade: remove all grenades except the one you want to select, then add them back -_uniformGrenades = [uniformItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); -_vestGrenades = [vestItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); -_backpackGrenades = [backpackItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); +private _uniformGrenades = [uniformItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); +private _vestGrenades = [vestItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); +private _backpackGrenades = [backpackItems _unit, {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}] call EFUNC(common,filter); // remove all grenades except those we are switching to --> this breaks the selector {_unit removeItemFromUniform _x; false} count _uniformGrenades; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 815b8d28cf..80784778de 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -29,20 +29,18 @@ if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); }; -private ["_muzzles", "_modes"]; +private _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); +private _modes = [_weapon] call EFUNC(common,getWeaponModes); -_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); -_modes = [_weapon] call EFUNC(common,getWeaponModes); +private _index = (_modes find currentWeaponMode _unit) + 1; -private ["_index", "_muzzle", "_mode"]; - -_index = (_modes find currentWeaponMode _unit) + 1; if (_index > count _modes - 1) then {_index = 0}; -_muzzle = _muzzles select 0; -_mode = _modes select _index; +private _muzzle = _muzzles select 0; +private _mode = _modes select _index; _index = 0; + while { _index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} } do { diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 71c9cfc7b4..973d34f7c8 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -20,8 +20,7 @@ params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; -private "_muzzles"; -_muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); +private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); if (currentWeapon _unit != _weapon) exitWith { if (count _muzzles > 1) then { @@ -35,12 +34,11 @@ if (currentWeapon _unit != _weapon) exitWith { }; }; -private ["_index", "_muzzle"]; +private _index = (_muzzles find currentMuzzle _unit) + 1; -_index = (_muzzles find currentMuzzle _unit) + 1; if (_index > count _muzzles - 1) then {_index = 1}; -_muzzle = _muzzles select _index; +private _muzzle = _muzzles select _index; _index = 0; while { diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 9695079da5..7435dd30d8 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -19,39 +19,36 @@ params ["_unit", "_vehicle", "_index"]; -private "_turret"; -_turret = [_unit] call EFUNC(common,getTurretIndex); +private _turret = _unit call EFUNC(common,getTurretIndex); if (_turret isEqualTo [] && {_unit == driver _vehicle}) then { - private ["_weapons", "_weapon"]; + private _weapons = weapons _vehicle; - _weapons = weapons _vehicle; if (_index > count _weapons - 1) exitWith {}; - _weapon = _weapons select _index; + private _weapon = _weapons select _index; _index = 0; + while { _index < 100 && {currentWeapon _vehicle != _weapon} } do { _unit action ["SwitchWeapon", _vehicle, _unit, _index]; _index = _index + 1; }; - } else { - private ["_weapons", "_weapon"]; + private _weapons = _vehicle weaponsTurret _turret; - _weapons = _vehicle weaponsTurret _turret; if (_index > count _weapons - 1) exitWith {}; - _weapon = _weapons select _index; + private _weapon = _weapons select _index; _index = 0; + while { _index < 100 && {_vehicle currentWeaponTurret _turret != _weapon} } do { _unit action ["SwitchWeapon", _vehicle, _unit, _index]; _index = _index + 1; }; - }; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index 2cdc8e63dc..a99b06879b 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -25,8 +25,7 @@ params ["_unit", "_weapon", "", "", "", "_magazine"]; if (_weapon != "Throw") exitWith {}; -private "_count"; -_count = {_x == _magazine} count magazines _unit; +private _count = {_x == _magazine} count magazines _unit; [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml index ea76984097..c9a8e43f60 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -30,7 +30,7 @@ Pistole auswählen Seleccionar pistola Wybierz pistolet - Zvolit příruční zbraň + Zvolit Pistoly Выбрать пистолет Sélectionner Pistolet Pisztoly Kiválasztása @@ -42,7 +42,7 @@ Gewehr auswählen Seleccionar fusil Wybierz karabin - Zvolit hlavní zbraň + Zvolit Pušku Выбрать винтовку Sélectionner Fusil Puska Kiválasztása @@ -188,7 +188,7 @@ Wybierz granat odłamkowy Sélectionner grenade à fragmentation Repeszgránát Kiválasztása - Zvolit Výbušný Granát + Zvolit výbušný granát Selecionar Granada de Fragmentação Seleziona Granata a Frammentazione Выбрать осколочную гранату @@ -200,7 +200,7 @@ Wybierz granat nieodłamkowy Sélectionner grenade non-léthale Nem-robbanó Gránát Kiválasztása - Zvolit Ne-Výbušný Granát + Zvolit ne-výbušný granát Selecionar Granada Seleziona granate non a frammentazione Выбрать гранату @@ -212,7 +212,7 @@ Rzuć wybrany granat Lancer la grenade sélectionnée Kiválasztott Gránát Eldobása - Hodit Zvolený Granát + Hodit zvolený granát Lançar Granada Selecionada Lancia la Granata Selezionata Бросить выбранную гранату @@ -236,7 +236,7 @@ Brak granatów odłamkowych Plus de grenades à fragmentation Nincs több repeszgránát - Už nejsou granáty + Žádné výbušné granáty Não há granadas de fragmentação restantes Nessuna granata a frammentazione rimanente Осколочных гранат нет @@ -278,4 +278,4 @@ Lançador de fumaça - + \ No newline at end of file diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 44a5b0696c..98d9026c1c 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -33,7 +33,7 @@ GVAR(WindInfo) = true; if !(GVAR(WindInfo) && !(underwater ACE_player) && vehicle ACE_player == ACE_player) exitWith { GVAR(WindInfo) = false; 0 cutText ["", "PLAIN"]; - [_this select 1] call cba_fnc_removePerFrameHandler; + [_this select 1] call CBA_fnc_removePerFrameHandler; }; _windIndex = 12; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index 6c668a8033..a3c51054ee 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -32,6 +32,6 @@ if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exit if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; -GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; +GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")]; true; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index baff39516d..393a5cd757 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -34,8 +34,7 @@ _bulletSpeed = vectorMagnitude _bulletVelocity; if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeed < 100}}) then { - GVAR(trackedBullets) deleteAt (_forEachIndex - _deleted); - _deleted = _deleted + 1; + GVAR(trackedBullets) deleteAt (GVAR(trackedBullets) find _x); } else { if (_isWind) then { _trueVelocity = _bulletVelocity vectorDiff ACE_wind; @@ -51,7 +50,7 @@ }; _bullet setVelocity _bulletVelocity; }; - - } forEach GVAR(trackedBullets); + nil + } count +GVAR(trackedBullets); // END_COUNTER(pfeh); }, GVAR(simulationInterval), [ACE_time]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/zeus/functions/fnc_addObjectToCurator.sqf b/addons/zeus/functions/fnc_addObjectToCurator.sqf index be814266ab..897f51532d 100644 --- a/addons/zeus/functions/fnc_addObjectToCurator.sqf +++ b/addons/zeus/functions/fnc_addObjectToCurator.sqf @@ -13,12 +13,12 @@ #include "script_component.hpp" -if (!isServer) exitwith {}; +if (!isServer) exitWith {}; params ["_object"]; -if (!(_object getvariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitwith {}; +if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {}; { _x addCuratorEditableObjects [[_object], true]; -}foreach allCurators; +}forEach allCurators; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index a36d8dd458..fc21fe11e7 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -24,13 +24,13 @@ _activated = _this select 2; if (_activated) then { //--- Terminate when not created on the server - if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { + if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitWith { [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; deletevehicle _logic; }; //--- Get curator owner - _ownerVar = _logic getvariable ["owner",""]; + _ownerVar = _logic getVariable ["owner",""]; _ownerUID = parsenumber _ownerVar; if (cheatsenabled) then { _ownerVarArray = toarray _ownerVar; @@ -47,7 +47,7 @@ if (_activated) then { _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; //--- Wipe out the variable so clients can't access it - _logic setvariable ["owner",nil]; + _logic setVariable ["owner",nil]; //--- Server if (isserver) then { @@ -58,17 +58,17 @@ if (_activated) then { _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; _adminVar = "admin_"; for "_i" from 0 to 9 do {_adminVar = _adminVar + (_letters call bis_fnc_selectrandom);}; - _logic setvariable ["adminVar",_adminVar,true]; + _logic setVariable ["adminVar",_adminVar,true]; }; //--- Get allowed addons - _addonsType = _logic getvariable ["Addons",0]; + _addonsType = _logic getVariable ["Addons",0]; _addons = []; switch _addonsType do { //--- All (including unofficial ones) case 3: { - _cfgPatches = configfile >> "cfgpatches"; + _cfgPatches = configFile >> "Cfgpatches"; for "_i" from 0 to (count _cfgPatches - 1) do { _class = _cfgPatches select _i; if (isclass _class) then {_addons set [count _addons,configname _class];}; @@ -85,8 +85,8 @@ if (_activated) then { case 1: { _addonsList = []; { - _addonsList = _addonsList + (unitaddons typeof _x); - } foreach (entities "all"); + _addonsList = _addonsList + (unitaddons typeOf _x); + } forEach (entities "all"); removeallcuratoraddons _logic; _logic addcuratoraddons _addonsList; }; @@ -108,12 +108,12 @@ if (_activated) then { if (_adminVar != "") then {_ownerVar = _adminVar;}; - _forced = _logic getvariable ["forced",0] > 0; - _name = _logic getvariable ["name",""]; + _forced = _logic getVariable ["forced",0] > 0; + _name = _logic getVariable ["name",""]; if (_name == "") then {_name = localize "STR_A3_curator";}; //--- Wait until mission starts - waituntil {time > 0}; // NOTE: DO NOT CHANGE TO ACE_TIME, IT BREAKS THE MODULE + waitUntil {time > 0}; // NOTE: DO NOT CHANGE TO ACE_TIME, IT BREAKS THE MODULE //--- Refresh addon list, so it's broadcasted to clients _addons = curatoraddons _logic; @@ -124,38 +124,38 @@ if (_activated) then { //--- Wait for player to become Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; {getplayeruid _x == _ownerVar} count playableunits > 0 || isnull _logic }; }; default { - waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull]) || isnull _logic}; + waitUntil {isplayer (missionnamespace getVariable [_ownerVar,objnull]) || isnull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isnull _logic) exitWith {}; //--- Assign _player = objnull; switch true do { case (_ownerUID > 0): { { - if (getplayeruid _x == _ownerVar) exitwith {_player = _x;}; - } foreach playableunits; + if (getplayeruid _x == _ownerVar) exitWith {_player = _x;}; + } forEach playableunits; }; default { - _player = missionnamespace getvariable [_ownerVar,objnull]; + _player = missionnamespace getVariable [_ownerVar,objnull]; }; }; - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; + waitUntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; + if (isnull _logic) exitWith {}; //--- Add radio channels { _x radiochanneladd [_player]; - } foreach (_logic getvariable ["channels",[]]); + } forEach (_logic getVariable ["channels",[]]); // Added by ace_zeus to delay ascension message at mission start [{ @@ -163,12 +163,12 @@ if (_activated) then { _player = _this select 1; //--- Sent notification to all assigned players - if ((_logic getvariable ["showNotification",true]) && GVAR(zeusAscension)) then { + if ((_logic getVariable ["showNotification",true]) && GVAR(zeusAscension)) then { { if (isplayer _x) then { [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; }; - } foreach (curatoreditableobjects _logic); + } forEach (curatoreditableobjects _logic); }; },[_logic,_player]] call EFUNC(common,execNextFrame); @@ -185,41 +185,41 @@ if (_activated) then { //--- Wait for player to stop being Zeus switch true do { case (_ownerUID > 0): { - waituntil { + waitUntil { sleep 0.01; {getplayeruid _x == _ownerVar} count playableunits == 0 || isnull _logic }; }; default { - waituntil {_player != missionnamespace getvariable [_ownerVar,objnull] || isnull _logic}; + waitUntil {_player != missionnamespace getVariable [_ownerVar,objnull] || isnull _logic}; }; }; - if (isnull _logic) exitwith {}; + if (isnull _logic) exitWith {}; //--- Add radio channels { _x radiochannelremove [_player]; - } foreach (_logic getvariable ["channels",[]]); + } forEach (_logic getVariable ["channels",[]]); //--- Unassign - waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; - if (isnull _logic) exitwith {}; + waitUntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; + if (isnull _logic) exitWith {}; }; }; //--- Activated all future addons _addons = []; { - if (typeof _x == "ModuleCuratorAddAddons_F") then { - _paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]"); + if (typeOf _x == "ModuleCuratorAddAddons_F") then { + _paramAddons = call compile ("[" + (_x getVariable ["addons",""]) + "]"); { if !(_x in _addons) then {_addons set [count _addons,_x];}; { if !(_x in _addons) then {_addons set [count _addons,_x];}; - } foreach (unitaddons _x); - } foreach _paramAddons; + } forEach (unitaddons _x); + } forEach _paramAddons; }; - } foreach (synchronizedobjects _logic); + } forEach (synchronizedobjects _logic); _addons call bis_fnc_activateaddons; // Added by ace_zeus to delay bird code @@ -228,10 +228,10 @@ if (_activated) then { if (GVAR(zeusBird)) then { //--- Create bird - _birdType = _logic getvariable ["birdType","eagle_f"]; + _birdType = _logic getVariable ["birdType","eagle_f"]; if (_birdType != "") then { _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; - _logic setvariable ["bird",_bird,true]; + _logic setVariable ["bird",_bird,true]; }; //--- Locality changed @@ -239,7 +239,7 @@ if (_activated) then { "local", { _logic = _this select 0; - _bird = _logic getvariable ["bird",objnull]; + _bird = _logic getVariable ["bird",objnull]; _bird setowner owner _logic; } ]; @@ -249,11 +249,11 @@ if (_activated) then { //--- Player if (hasinterface) then { - waituntil {local player}; + waitUntil {local player}; _serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"}; //--- Black effect until the interface is open - _forced = _logic getvariable ["forced",0] > 0; + _forced = _logic getVariable ["forced",0] > 0; if (_forced) then { _isCurator = switch true do { case (_ownerUID > 0): { @@ -263,7 +263,7 @@ if (_activated) then { isserver || servercommandavailable _serverCommand }; default { - player == missionnamespace getvariable [_ownerVar,objnull] + player == missionnamespace getVariable [_ownerVar,objnull] }; }; if (_isCurator) then { @@ -274,11 +274,11 @@ if (_activated) then { //--- Check if player is server admin if (_isAdmin) then { - _adminVar = _logic getvariable ["adminVar",""]; - _logic setvariable ["adminVar",nil]; + _adminVar = _logic getVariable ["adminVar",""]; + _logic setVariable ["adminVar",nil]; if (isserver) then { //--- Host - missionnamespace setvariable [_adminVar,player]; + missionnamespace setVariable [_adminVar,player]; } else { //--- Client [_logic,_adminVar,_serverCommand] spawn { @@ -288,13 +288,13 @@ if (_activated) then { _adminVar = _this select 1; _serverCommand = _this select 2; while {true} do { - waituntil {sleep 0.1; servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,player]; + waitUntil {sleep 0.1; servercommandavailable _serverCommand}; + missionnamespace setVariable [_adminVar,player]; publicvariable _adminVar; _respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; - waituntil {sleep 0.1; !servercommandavailable _serverCommand}; - missionnamespace setvariable [_adminVar,objnull]; + waitUntil {sleep 0.1; !servercommandavailable _serverCommand}; + missionnamespace setVariable [_adminVar,objnull]; publicvariable _adminVar; player removeeventhandler ["respawn",_respawn]; }; @@ -305,7 +305,7 @@ if (_activated) then { [_logic] spawn { _logic = _this select 0; sleep 1; - waituntil {alive player}; + waitUntil {alive player}; //--- Show warning when Zeus key is not assigned if (count (actionkeys "curatorInterface") == 0) then { @@ -319,7 +319,7 @@ if (_activated) then { //--- Show hint about pinging for players if ( - isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} + isNil {profilenamespace getVariable "bis_fnc_curatorPinged_done"} && {isTutHintsEnabled} && diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 8f60531b34..2f863ac5b9 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -21,7 +21,7 @@ _units = _this select 1; _activated = _this select 2; if (_activated) then { - _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); + _explosive = gettext (configFile >> "CfgVehicles" >> typeOf _logic >> "explosive"); if (_explosive != "") then { _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; _explosive attachto [_logic]; @@ -32,7 +32,7 @@ if (_activated) then { { _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; _side revealmine _explosive; - } foreach (objectcurators _logic); + } forEach (objectcurators _logic); if (GVAR(revealMines) > 1) then { //--- Mark minefields in the map @@ -43,7 +43,7 @@ if (_activated) then { //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; - waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; + waitUntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; deletevehicle _logic; }; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 7150856154..05d2e2d096 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" -_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; +_fnc_scriptNameParentTemp = if !(isNil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; private ['_fnc_scriptNameParent']; _fnc_scriptNameParent = _fnc_scriptNameParentTemp; _fnc_scriptNameParentTemp = nil; @@ -36,20 +36,20 @@ if ({local _x} count (objectcurators _logic) > 0) then { _logic hideobject false; _logic setpos position _logic; }; -if !(isserver) exitwith {}; +if !(isserver) exitWith {}; if (_activated) then { - _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; + _ammo = _logic getVariable ["type",gettext (configFile >> "CfgVehicles" >> typeOf _logic >> "ammo")]; if (_ammo != "") then { - _cfgAmmo = configfile >> "cfgammo" >> _ammo; - //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; - _dirVar = _fnc_scriptname + typeof _logic; - _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction + _CfgAmmo = configFile >> "CfgAmmo" >> _ammo; + //if !(isclass _CfgAmmo) exitWith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; + _dirVar = _fnc_scriptname + typeOf _logic; + _logic setdir (missionnamespace getVariable [_dirVar,direction _logic]); //--- Restore custom direction _pos = getposatl _logic; _posAmmo = +_pos; _posAmmo set [2,0]; _dir = direction _logic; - _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _simulation = tolower gettext (configFile >> "CfgAmmo" >> _ammo >> "simulation"); _altitude = 0; _velocity = []; _attach = false; @@ -65,7 +65,7 @@ if (_activated) then { _altitude = 1000; _velocity = [0,0,-100]; _radio = "SentGenIncoming"; - _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sounds = if (getnumber (_CfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; _sound = _sounds call bis_fnc_selectrandom; _hint = ["Curator","PlaceOrdnance"]; _shakeStrength = 0.01; @@ -104,21 +104,21 @@ if (_activated) then { _side = side group _x; if (_side in [east,west,resistance,civilian]) then { //--- Play radio (only if it wasn't played recently) - if (ACE_time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { + if (ACE_time > _x getVariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { [[_side,_radio,"side"],"bis_fnc_sayMessage",_x] call bis_fnc_mp; - _x setvariable ["BIS_fnc_moduleProjectile_radio",ACE_time + _delay]; + _x setVariable ["BIS_fnc_moduleProjectile_radio",ACE_time + _delay]; }; }; }; - } foreach _entities; + } forEach _entities; }; }; if (count _hint > 0) then { [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; }; if (count _velocity == 3) then { - _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; - _radio = _logic getvariable ["radio",_radio]; + _altitude = (_logic getVariable ["altitude",_altitude]) call bis_fnc_parsenumber; + _radio = _logic getVariable ["radio",_radio]; //--- Create projectile _posAmmo set [2,_altitude]; @@ -128,7 +128,7 @@ if (_activated) then { if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; // Added by ace_zeus for ace_frag compatibility - if (!isnil QEFUNC(frag,addPfhRound)) then { + if (!isNil QEFUNC(frag,addPfhRound)) then { [objNull, _ammo, _projectile, true] call EFUNC(frag,addPfhRound); }; @@ -146,13 +146,13 @@ if (_activated) then { //--- Update if (_attach) then { - waituntil { + waitUntil { _soundSource setposatl getposatl _projectile; sleep 1; isnull _projectile || isnull _logic }; } else { - waituntil { + waitUntil { _soundSource setposatl getposatl _projectile; if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { @@ -164,7 +164,7 @@ if (_activated) then { _projectile setposasl _posNew; _pos = getposatl _logic; _dir = direction _logic; - missionnamespace setvariable [_dirVar,_dir]; + missionnamespace setVariable [_dirVar,_dir]; }; sleep 0.1; isnull _projectile || isnull _logic @@ -183,7 +183,7 @@ if (_activated) then { } else { //--- Repeat to achieve permanent effect - _repeat = _logic getvariable ["repeat",0] > 0; + _repeat = _logic getVariable ["repeat",0] > 0; if (_repeat) then { [_logic,_units,_activated] call bis_fnc_moduleprojectile; } else { @@ -194,6 +194,6 @@ if (_activated) then { deletevehicle _logic; }; } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeOf _logic] call bis_fnc_error; }; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index a9e1f35080..7eec86bb7d 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -23,11 +23,11 @@ _activated = _this select 2; if (_activated && local _logic && !isnull curatorcamera) then { //--- Terminate when remote control is already in progress - if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + if !(isnull (missionnamespace getVariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitWith {}; //--- Get unit under cursor _unit = objnull; - _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + _mouseOver = missionnamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; _unit = effectivecommander _unit; @@ -37,7 +37,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; - if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + if !(isnull (_unit getVariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; if (_error == "") then { _unit spawn { @@ -47,7 +47,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { _vehicleRole = str assignedvehiclerole _unit; bis_fnc_moduleRemoteControl_unit = _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ace_zeus to toggle remote control wind sound if (GVAR(remoteWind)) then { @@ -76,7 +76,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { //--- Wait for interface to close (finddisplay 312) closedisplay 2; - waituntil {isnull curatorcamera}; + waitUntil {isnull curatorcamera}; //--- Switch player remotecontrol _unit; @@ -106,7 +106,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { _vehicle = vehicle _unit; _vehicleRole = str assignedvehiclerole _unit; _rating = rating player; - waituntil { + waitUntil { //--- Refresh when vehicle or vehicle role changes if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { player remotecontrol _unit; @@ -125,12 +125,12 @@ if (_activated && local _logic && !isnull curatorcamera) then { || {isnull getassignedcuratorlogic player} //|| - //{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit + //{_unit getVariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit }; player addrating (-rating player + _rating); objnull remotecontrol _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + _unit setVariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; //--- Death screen if ( @@ -142,7 +142,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { && {!isnull getassignedcuratorlogic player} //&& - //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} + //{(_unit getVariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} ) then { sleep 2; ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; @@ -152,14 +152,14 @@ if (_activated && local _logic && !isnull curatorcamera) then { _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; //[_camPos,_unit] call bis_fnc_setcuratorcamera; - (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + (getassignedcuratorlogic player) setVariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; opencuratorinterface; ppeffectdestroy _color; - waituntil {!isnull curatorcamera}; + waitUntil {!isnull curatorcamera}; player switchcamera cameraview; bis_fnc_moduleRemoteControl_unit = nil; ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index 661e33f907..d4acda3f54 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -41,7 +41,7 @@ if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { } else { _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); if (_medicN < 1) then { - _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + _unit setVariable [QEGVAR(medical,medicClass), 1, true]; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf index 22826108e7..1e710bf41b 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -40,7 +40,7 @@ if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); } else { if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then { - _unit setvariable [QEGVAR(medical,isMedicalFacility), true, true]; + _unit setVariable [QEGVAR(medical,isMedicalFacility), true, true]; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf index 9e5e788461..4ffec3460e 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -41,7 +41,7 @@ if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { } else { _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); if (_medicN < 1) then { - _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + _unit setVariable [QEGVAR(medical,medicClass), 1, true]; }; }; }; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index b885e1cec1..753b04a9af 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -127,7 +127,7 @@ Pokazuj znaczniki min dla sojuszników i twórz markery na mapie w miejscu min. Revelar minas a aliados y establecer marcadores de mapa. Odhalí miny pro spojence a umístnit jejich značku na mapu. - Enthülle Minen gegenüber Verbündeten und platziere Kartenmarkierungen. + Melde Minen gegenüber Verbündeten und platziere entsprechende Kartenmarkierungen. Revelar minas para aliados e colocar marcadores no mapa. Révéler les mines et placer un marqueur sur la carte Feltárja az aknákat a szövetségeseknek, és jelölőket helyez el a térképen. @@ -190,6 +190,7 @@ Assign Medic + Sanitäter zuweisen. Przydziel medyka Definir médico Назначить медиком @@ -198,6 +199,7 @@ Assign Medical Vehicle + Sanitätesfahrzeug zuweisen. Przydziel pojazd medyczny Definir veículo médico Назначить медицинским транспортом @@ -206,6 +208,7 @@ Assign Medical Facility + Medizinische Einrichtung zuweisen. Przydziel budynek medyczny Definir instalação médica Назанчить медицинским сооружением @@ -215,27 +218,35 @@ Add Spare Wheel Adicionar roda sobressalente + Dodaj koło zapasowe Добавить запасное колесо + Přidat rezervní kolo Adds a Spare Wheel to the vehicle Adiciona uma roda sobressalente ao veículo + Dodaje koło zapasowe do pojazdu Добавляет запасное колесо в транспорт + Přidá rezervní kolo do vozidla Add Spare Track Adicionar esteira sobressalente + Dodaj zapasową gąsienicę Дабавить запасную гусеницу + Přidat náhradní pás Adds a Spare Track to the vehicle Adiciona uma esteira sobressalente ao veículo + Dodaje zapasową gąsienicę do pojazdu Добавляет запасную гусеницу в транспорт + Přidá náhradní pás do vozidla Unit must be alive Utiliser uniquement sur une unité vivante - Nur bei lebenden Einheiten verwendbar + Einheit muss lebendig sein. Utilizar solo en unidades vivas Použitelné jen na živé jednotky Używaj tylko na żywych jednostkach @@ -258,27 +269,35 @@ Unit must be a structure + Das Ziel muss ein Bauwerk sein. Jednostka musi być budynkiem Unidade deve ser uma estrutura Юнит должен быть строением La unidad debe ser una estructura + Jednotka musí být budova Unit must be a vehicle + Das Ziel muss ein Fahrzeug sein. Jednostka musi być pojazdem Unidade deve ser um veículo Юнит должен быть транспортом La unidad debe ser un vehículo + Jednotka musí být vozidlo Unit must be a vehicle with cargo space Unidade deve ser um veículo com espaço em carga + Jednostka musi być pojazdem z wolną przestrzenią cargo Юнит должен быть транспортом с грузовым отсеком + Jednotka musí být vozidlo s úložným prostorem Unit must have cargo space left Unidade deve conter espaço sobressalente + Jednostka musi mieć wolną przestrzeń cargo Юнит должен иметь свободное место в грузовом отсеке + Jednotka musí mít místo v úložném prostoru Unit must not be captive @@ -320,6 +339,7 @@ Adicionar objetos para o Curator Добавить объекты куратору Agregar objetos al director + Přidat objekty kurátorovi Adds any spawned object to all curators in the mission @@ -327,6 +347,7 @@ Adicionar qualquer objeto criado para todos os curators na missão Добавляет любой отспавненный объект всем кураторам в миссии Añadir cualquier objeto creado a todos los directores en la misión + Přidá jakékoliv spawnuté objekty všem kurátorům v misi - \ No newline at end of file + diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 43bd59abaf..c152ce1e21 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -20,7 +20,7 @@ option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) if(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "-std=c++11 -march=i686 -m32 -O2 -s -fPIC -fpermissive") + SET(CMAKE_CXX_FLAGS "-std=c++11 -pedantic -pedantic-errors -march=i686 -m32 -O2 -s -fPIC -fpermissive") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -89,8 +89,8 @@ endif() string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") set(ACE_VERSION_MAJOR 3) -set(ACE_VERSION_MINOR 2) -set(ACE_VERSION_REVISION 0) +set(ACE_VERSION_MINOR 4) +set(ACE_VERSION_REVISION 1) EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD OUTPUT_VARIABLE T_ACE_VERSION_BUILD OUTPUT_STRIP_TRAILING_WHITESPACE diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp index c5c0a6c7a3..8286e054d2 100644 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ b/extensions/advanced_ballistics/AdvancedBallistics.cpp @@ -5,7 +5,7 @@ #include #include -#define M_PI 3.14159265358979323846f + #define GRAVITY 9.80665f #define ABSOLUTE_ZERO_IN_CELSIUS -273.15f #define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) @@ -573,8 +573,8 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) positionOffset[1] += cos(bulletDir + M_PI / 2) * horizontalDeflectionPartial; } - double centripetalAccel = 2 * 0.0000729 * (bulletDatabase[index].muzzleVelocity / -32.2) * cos(bulletDatabase[index].latitude) * sin(bulletDir); - velocityOffset[2] -= centripetalAccel * deltaT; + double centripetalAccel = 2 * 0.0000729 * (bulletDatabase[index].muzzleVelocity) * cos(bulletDatabase[index].latitude) * sin(bulletDir); + velocityOffset[2] += centripetalAccel * deltaT; double spinDrift = bulletDatabase[index].twistDirection * 0.0254 * 1.25 * (bulletDatabase[index].stabilityFactor + 1.2) * pow(TOF, 1.83); double spinDriftPartial = spinDrift - bulletDatabase[index].spinDrift; diff --git a/extensions/break_line/ace_break_line.cpp b/extensions/break_line/ace_break_line.cpp index 8bb5af9572..7644748378 100644 --- a/extensions/break_line/ace_break_line.cpp +++ b/extensions/break_line/ace_break_line.cpp @@ -21,7 +21,7 @@ extern "C" { EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; +} std::vector splitString(const std::string & input) { std::istringstream ss(input); diff --git a/extensions/clipboard/ace_clipboard.cpp b/extensions/clipboard/ace_clipboard.cpp index 61960598ec..cdd5f7c423 100644 --- a/extensions/clipboard/ace_clipboard.cpp +++ b/extensions/clipboard/ace_clipboard.cpp @@ -15,7 +15,7 @@ extern "C" { EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; +} std::string gClipboardData; diff --git a/extensions/common/p3d/animation.cpp b/extensions/common/p3d/animation.cpp index f47a40fe5a..07f5922f49 100644 --- a/extensions/common/p3d/animation.cpp +++ b/extensions/common/p3d/animation.cpp @@ -67,5 +67,5 @@ namespace ace { animation::~animation() { } - }; -}; + } +} diff --git a/extensions/common/p3d/animation.hpp b/extensions/common/p3d/animation.hpp index b53bee6a68..430f3aed6d 100644 --- a/extensions/common/p3d/animation.hpp +++ b/extensions/common/p3d/animation.hpp @@ -65,5 +65,5 @@ namespace ace { //ace::vector3 axis_dir; }; typedef std::shared_ptr animation_p; - }; -}; \ No newline at end of file + } +} diff --git a/extensions/common/p3d/model.hpp b/extensions/common/p3d/model.hpp index bd3cafe60c..a26a8cfbb8 100644 --- a/extensions/common/p3d/model.hpp +++ b/extensions/common/p3d/model.hpp @@ -53,5 +53,5 @@ namespace ace { }; typedef std::shared_ptr model_p; - }; -}; \ No newline at end of file + } +} diff --git a/extensions/common/p3d/model_info.hpp b/extensions/common/p3d/model_info.hpp index 195e925a5a..f785574411 100644 --- a/extensions/common/p3d/model_info.hpp +++ b/extensions/common/p3d/model_info.hpp @@ -70,5 +70,5 @@ namespace ace { }; typedef std::shared_ptr model_info_p; - }; -}; \ No newline at end of file + } +} diff --git a/extensions/common/p3d/parser.hpp b/extensions/common/p3d/parser.hpp index b3f584a017..76a2d2f8e1 100644 --- a/extensions/common/p3d/parser.hpp +++ b/extensions/common/p3d/parser.hpp @@ -13,5 +13,5 @@ namespace ace { model_p load(const std::string &); }; - }; -}; \ No newline at end of file + } +} diff --git a/extensions/common/p3d/skeleton.hpp b/extensions/common/p3d/skeleton.hpp index 86fa71c49c..2b66c4fc6c 100644 --- a/extensions/common/p3d/skeleton.hpp +++ b/extensions/common/p3d/skeleton.hpp @@ -32,5 +32,5 @@ namespace ace { std::vector all_bones; }; typedef std::shared_ptr skeleton_p; - }; -}; \ No newline at end of file + } +} diff --git a/extensions/common/shared.hpp b/extensions/common/shared.hpp index 6c49b99fad..ac8cebaf94 100644 --- a/extensions/common/shared.hpp +++ b/extensions/common/shared.hpp @@ -1,5 +1,9 @@ #pragma once +//_USE_MATH_DEFINES + cmath needs to be first or M_PI won't be defined in VS2015 +#define _USE_MATH_DEFINES +#include + #include "targetver.h" #include #include @@ -11,7 +15,6 @@ #include #include #include -#include #include #include #include "ace_version.hpp" diff --git a/extensions/common/transform_matrix.hpp b/extensions/common/transform_matrix.hpp index f9c3056dc9..73dad45019 100644 --- a/extensions/common/transform_matrix.hpp +++ b/extensions/common/transform_matrix.hpp @@ -31,4 +31,4 @@ namespace ace { }; typedef transform_matrix_base transform_matrix; -}; \ No newline at end of file +} diff --git a/extensions/common/vector.hpp b/extensions/common/vector.hpp index 0eb348f312..3f786a964f 100644 --- a/extensions/common/vector.hpp +++ b/extensions/common/vector.hpp @@ -168,4 +168,4 @@ namespace ace { T _x; T _y; }; -}; +} diff --git a/extensions/fcs/ace_fcs.cpp b/extensions/fcs/ace_fcs.cpp index 178711f54c..5bc750235e 100644 --- a/extensions/fcs/ace_fcs.cpp +++ b/extensions/fcs/ace_fcs.cpp @@ -27,7 +27,7 @@ extern "C" { EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; +} std::vector splitString(std::string input) { std::istringstream ss(input); diff --git a/extensions/medical/medical.cpp b/extensions/medical/medical.cpp index 78517b99d4..5f999caaa2 100644 --- a/extensions/medical/medical.cpp +++ b/extensions/medical/medical.cpp @@ -14,7 +14,7 @@ extern "C" { EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; +} std::vector parseExtensionInput(const std::string& input) { diff --git a/extensions/parse_imagepath/ace_parse_imagepath.cpp b/extensions/parse_imagepath/ace_parse_imagepath.cpp index 051535e473..56d503cbaf 100644 --- a/extensions/parse_imagepath/ace_parse_imagepath.cpp +++ b/extensions/parse_imagepath/ace_parse_imagepath.cpp @@ -18,7 +18,7 @@ extern "C" { __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); -}; +} std::string getImagePathFromStructuredText(const std::string & input) { std::string returnValue = ""; diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png new file mode 100644 index 0000000000..975a4126f3 Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Nightvision_ca.png differ diff --git a/extras/assets/icons/Icon_Module_png/Icons_Modules_Rearm.png b/extras/assets/icons/Icon_Module_png/Icons_Modules_Rearm.png new file mode 100644 index 0000000000..b564992d5f Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icons_Modules_Rearm.png differ diff --git a/extras/assets/icons/Icon_Module_png/Icons_Modules_Refuel.png b/extras/assets/icons/Icon_Module_png/Icons_Modules_Refuel.png new file mode 100644 index 0000000000..da50b92caf Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icons_Modules_Refuel.png differ diff --git a/mod.cpp b/mod.cpp index 096e6d563d..b780224df9 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Advanced Combat Environment 3.3.3"; +name = "Advanced Combat Environment 3.4.2"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; -description = "ACE3 - Version 3.3.3"; +description = "ACE3 - Version 3.4.2"; logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3"; diff --git a/optionals/compat_bwa3/CfgVehicles.hpp b/optionals/compat_bwa3/CfgVehicles.hpp new file mode 100644 index 0000000000..bdcebdab9d --- /dev/null +++ b/optionals/compat_bwa3/CfgVehicles.hpp @@ -0,0 +1,11 @@ +class CfgVehicles { + class Tank_F; + class BWA3_Puma_base: Tank_F { + // Assuming 1 L/km + EGVAR(refuel,fuelCapacity) = 700; + }; + + class BWA3_Leopard_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 1160; + }; +}; diff --git a/optionals/compat_cup/$PBOPREFIX$ b/optionals/compat_cup/$PBOPREFIX$ deleted file mode 100644 index 42044805ba..0000000000 --- a/optionals/compat_cup/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\compat_cup \ No newline at end of file diff --git a/optionals/compat_cup/CfgMagazines.hpp b/optionals/compat_cup/CfgMagazines.hpp deleted file mode 100644 index b05b0c3efd..0000000000 --- a/optionals/compat_cup/CfgMagazines.hpp +++ /dev/null @@ -1,48 +0,0 @@ -class CfgMagazines { - class CUP_M136_M; - class CUP_RPG18_M; - class CUP_NLAW_M; - class ACE_PreloadedMissileDummy_CUP: CUP_M136_M { // The dummy magazine - author = "$STR_ACE_Common_ACETeam"; - scope = 1; - scopeArsenal = 1; - displayName = "Preloaded Missle"; - //displayName = "$STR_ACE_Disposable_PreloadedMissileDummy"; - picture = PATHTOEF(common,UI\blank_CO.paa); - weaponPoolAvailable = 0; - mass = 0; - }; - class ACE_FiredMissileDummy_CUP: ACE_PreloadedMissileDummy_CUP { - count = 0; - }; - class ACE_UsedTube_M136_F: CUP_M136_M { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Disposable_UsedTube"; - descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayNameShort = "-"; - count = 0; - weaponPoolAvailable = 0; - modelSpecial = ""; - mass = 0; - }; - class ACE_UsedTube_RPG18_F: CUP_RPG18_M { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Disposable_UsedTube"; - descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayNameShort = "-"; - count = 0; - weaponPoolAvailable = 0; - modelSpecial = ""; - mass = 0; - }; - class ACE_UsedTube_NLAW_F: CUP_NLAW_M { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Disposable_UsedTube"; - descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayNameShort = "-"; - count = 0; - weaponPoolAvailable = 0; - modelSpecial = ""; - mass = 0; - }; -}; \ No newline at end of file diff --git a/optionals/compat_cup/CfgWeapons.hpp b/optionals/compat_cup/CfgWeapons.hpp deleted file mode 100644 index bbd49548da..0000000000 --- a/optionals/compat_cup/CfgWeapons.hpp +++ /dev/null @@ -1,271 +0,0 @@ -class CfgWeapons -{ - class Launcher_Base_F; - class ItemCore; - class InventoryOpticsItem_Base_F; - - class CUP_optic_SB_3_12x50_PMII : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class LRR { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_LeupoldMk4 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class LRR { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_Leupold_VX3 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class StepScope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_AN_PVS_10 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class NVScope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_LeupoldM3LR : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class LRR { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_LeupoldMk4_10x40_LRT_Desert : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class LRR { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_LeupoldMk4_MRT_tan : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -4, 30 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class MRT { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class CUP_optic_SB_11_4x20_PM : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -0.1, 10.1 }; - ACE_ScopeAdjust_Horizontal[] = { -5.1, 5.1 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class ShortDot { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - - /* - // This would require MOA turrets - class CUP_optic_AN_PVS_4 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { -12, 50 }; - ACE_ScopeAdjust_Horizontal[] = { -20, 20 }; - ACE_ScopeAdjust_VerticalIncrement = 0.25; - ACE_ScopeAdjust_HorizontalIncrement = 0.25; - ACE_ScopeAdjust_Unit = "MOA"; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class ANPVS4 { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - */ - - class CUP_optic_PSO_1 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { 0, 0 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.0; - ACE_ScopeAdjust_HorizontalIncrement = 0.5; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class PSO { - discreteDistance[]={100, 200, 300, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; - discreteDistanceInitIndex=3; - }; - }; - }; - }; - class CUP_optic_PSO_3 : ItemCore { - ACE_ScopeAdjust_Vertical[] = { 0, 0 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.0; - ACE_ScopeAdjust_HorizontalIncrement = 0.5; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class PSO { - discreteDistance[]={100, 200, 300, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000}; - discreteDistanceInitIndex=3; - }; - }; - }; - }; - // Non Disposable launchers - class CUP_launch_Igla: Launcher_Base_F { - EGVAR(overpressure,angle) = 30; - EGVAR(overpressure,range) = 2; - EGVAR(overpressure,damage) = 0.5; - }; - class CUP_launch_M47: Launcher_Base_F { - EGVAR(overpressure,angle) = 45; - EGVAR(overpressure,range) = 30; - EGVAR(overpressure,damage) = 0.7; - }; - class CUP_launch_MAAWS: Launcher_Base_F { - EGVAR(overpressure,angle) = 60; - EGVAR(overpressure,range) = 28; - EGVAR(overpressure,damage) = 0.7; - }; - class CUP_launch_MAAWS_Scope: CUP_launch_MAAWS {}; - class CUP_launch_Metis: Launcher_Base_F { - EGVAR(overpressure,angle) = 45; - EGVAR(overpressure,range) = 30; - EGVAR(overpressure,damage) = 0.5; - }; - class CUP_launch_RPG7V: Launcher_Base_F { - EGVAR(overpressure,angle) = 45; - EGVAR(overpressure,range) = 20; - EGVAR(overpressure,damage) = 1; - }; - class CUP_launch_Mk153Mod0: Launcher_Base_F { - EGVAR(overpressure,angle) = 30; - EGVAR(overpressure,range) = 30; - EGVAR(overpressure,damage) = 1; - }; - class CUP_launch_Mk153Mod0_SMAWOptics: CUP_launch_Mk153Mod0 {}; - class CUP_launch_FIM92Stinger: Launcher_Base_F { - EGVAR(overpressure,angle) = 45; - EGVAR(overpressure,range) = 15; - EGVAR(overpressure,damage) = 0.3; // Main damage arises from debris rather than the actual backblast - }; - class CUP_launch_9K32Strela: Launcher_Base_F { - EGVAR(overpressure,angle) = 30; - EGVAR(overpressure,range) = 2; - EGVAR(overpressure,damage) = 0.5; - }; - // Disposable launchers under this line - class CUP_launch_M136: Launcher_Base_F { - EGVAR(overpressure,angle) = 45; - EGVAR(overpressure,range) = 100; - EGVAR(overpressure,damage) = 0.7; - ACE_UsedTube = "ACE_launch_M136_Used_F"; // The class name of the used tube. - magazines[] = {"ACE_PreloadedMissileDummy_CUP"}; // The dummy magazine - }; - class ACE_launch_M136_Used_F: CUP_launch_M136 { - scope = 1; - ACE_isUsedLauncher = 1; - author = "$STR_ACE_Common_ACETeam"; - //displayName = "$STR_ACE_Disposable_UsedTube"; - //descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayName = "M136 (Used)"; - descriptionShort = "Used M136 Tube"; - magazines[] = {"ACE_FiredMissileDummy_CUP"}; - //picture = ""; @todo - //model = ""; @todo - weaponPoolAvailable = 0; - }; - class CUP_launch_NLAW: Launcher_Base_F { - EGVAR(overpressure,angle) = 30; - EGVAR(overpressure,range) = 2; - EGVAR(overpressure,damage) = 0.5; - ACE_UsedTube = "ACE_launch_NLAW_Used_F"; // The class name of the used tube. - magazines[] = {"ACE_PreloadedMissileDummy_CUP"}; // The dummy magazine - }; - class ACE_launch_NLAW_Used_F: CUP_launch_NLAW { - scope = 1; - ACE_isUsedLauncher = 1; - author = "$STR_ACE_Common_ACETeam"; - //displayName = "$STR_ACE_Disposable_UsedTube"; - //descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayName = "NLAW (Used)"; - descriptionShort = "Used NLAW Tube"; - magazines[] = {"ACE_FiredMissileDummy_CUP"}; - //picture = ""; @todo - //model = ""; @todo - weaponPoolAvailable = 0; - }; - class CUP_launch_RPG18: Launcher_Base_F { - EGVAR(overpressure,angle) = 40; - EGVAR(overpressure,range) = 15; - EGVAR(overpressure,damage) = 1; - ACE_UsedTube = "ACE_launch_RPG18_Used_F"; // The class name of the used tube. - magazines[] = {"ACE_PreloadedMissileDummy_CUP"}; // The dummy magazine - }; - class ACE_launch_RPG18_Used_F: CUP_launch_RPG18 { - scope = 1; - ACE_isUsedLauncher = 1; - author = "$STR_ACE_Common_ACETeam"; - //displayName = "$STR_ACE_Disposable_UsedTube"; - //descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; - displayName = "RPG18 (Used)"; - descriptionShort = "Used RPG18 Tube"; - magazines[] = {"ACE_FiredMissileDummy_CUP"}; - //picture = ""; @todo - //model = ""; @todo - weaponPoolAvailable = 0; - }; -}; \ No newline at end of file diff --git a/optionals/compat_cup/config.cpp b/optionals/compat_cup/config.cpp deleted file mode 100644 index 20ae5d6911..0000000000 --- a/optionals/compat_cup/config.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"CUP_Weapons_Ammunition"}; - author[]={"Ruthberg"}; - VERSION_CONFIG; - }; -}; - -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" \ No newline at end of file diff --git a/optionals/compat_cup/script_component.hpp b/optionals/compat_cup/script_component.hpp deleted file mode 100644 index 3d77fcb370..0000000000 --- a/optionals/compat_cup/script_component.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#define COMPONENT CUP_Weapons_Ammunition_comp - -#include "\z\ace\addons\main\script_mod.hpp" - -#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_rhs_afrf3/CfgAmmo.hpp b/optionals/compat_rhs_afrf3/CfgAmmo.hpp index 541437458e..2444da41cf 100644 --- a/optionals/compat_rhs_afrf3/CfgAmmo.hpp +++ b/optionals/compat_rhs_afrf3/CfgAmmo.hpp @@ -1,10 +1,8 @@ -class CfgAmmo -{ +class CfgAmmo { class BulletBase; class B_556x45_Ball; - class rhs_B_545x39_Ball: B_556x45_Ball - { + class rhs_B_545x39_Ball: B_556x45_Ball { ACE_caliber=5.588; ACE_bulletLength=21.59; ACE_bulletMass=3.42792; @@ -16,8 +14,7 @@ class CfgAmmo ACE_muzzleVelocities[]={780, 880, 920}; ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; - class rhs_B_545x39_Ball_Tracer_Green: rhs_B_545x39_Ball - { + class rhs_B_545x39_Ball_Tracer_Green: rhs_B_545x39_Ball { ACE_caliber=5.588; ACE_bulletLength=21.59; ACE_bulletMass=3.22704; @@ -30,8 +27,7 @@ class CfgAmmo ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_762x51_Ball; - class rhs_B_762x54_Ball: B_762x51_Ball - { + class rhs_B_762x54_Ball: B_762x51_Ball { ACE_caliber=7.925; ACE_bulletLength=28.956; ACE_bulletMass=9.8496; @@ -43,8 +39,7 @@ class CfgAmmo ACE_muzzleVelocities[]={700, 800, 820, 833}; ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; - class rhs_B_762x54_Ball_Tracer_Green: B_762x51_Ball - { + class rhs_B_762x54_Ball_Tracer_Green: B_762x51_Ball { ACE_caliber=7.925; ACE_bulletLength=28.956; ACE_bulletMass=9.6552; @@ -56,8 +51,7 @@ class CfgAmmo ACE_muzzleVelocities[]={680, 750, 798, 800}; ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; - class rhs_B_762x54_7N1_Ball: rhs_B_762x54_Ball - { + class rhs_B_762x54_7N1_Ball: rhs_B_762x54_Ball { ACE_caliber=7.925; ACE_bulletLength=28.956; ACE_bulletMass=9.8496; @@ -69,8 +63,7 @@ class CfgAmmo ACE_muzzleVelocities[]={700, 800, 820, 833}; ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; - class rhs_B_762x39_Ball: B_762x51_Ball - { + class rhs_B_762x39_Ball: B_762x51_Ball { ACE_caliber=7.823; ACE_bulletLength=28.956; ACE_bulletMass=7.9704; @@ -82,8 +75,7 @@ class CfgAmmo ACE_muzzleVelocities[]={650, 716, 750}; ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; - class rhs_B_762x39_Tracer: rhs_B_762x39_Ball - { + class rhs_B_762x39_Tracer: rhs_B_762x39_Ball { ACE_caliber=7.823; ACE_bulletLength=28.956; ACE_bulletMass=7.5816; @@ -96,8 +88,7 @@ class CfgAmmo ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_9x21_Ball; - class rhs_B_9x19_7N21: B_9x21_Ball - { + class rhs_B_9x19_7N21: B_9x21_Ball { ACE_caliber=9.017; ACE_bulletLength=15.494; ACE_bulletMass=5.19696; @@ -109,8 +100,7 @@ class CfgAmmo ACE_muzzleVelocities[]={445, 460, 480}; ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; - class rhs_B_9x18_57N181S: B_9x21_Ball - { + class rhs_B_9x18_57N181S: B_9x21_Ball { ACE_caliber=9.271; ACE_bulletLength=15.494; ACE_bulletMass=6.00048; @@ -122,4 +112,70 @@ class CfgAmmo ACE_muzzleVelocities[]={298, 330, 350}; ACE_barrelLengths[]={96.52, 127.0, 228.6}; }; -}; \ No newline at end of file + class SubmunitionBase; + class rhs_ammo_127x108mm_x5: SubmunitionBase { + ACE_rearm_caliber=13; + }; + + class GrenadeHand; + class rhs_ammo_rgd5: GrenadeHand { + ace_frag_enabled = 1; + ace_frag_metal = 200; + ace_frag_charge = 110; + ace_frag_gurney_c = 2440; + ace_frag_gurney_k = "3/5"; + ace_frag_classes[] = {"ACE_frag_small_HD"}; + ace_frag_skip = 0; + ace_frag_force = 1; + }; + class rhs_ammo_rgn_base: rhs_ammo_rgd5 { + ace_frag_enabled = 1; + ace_frag_metal = 193; + ace_frag_charge = 97; + ace_frag_gurney_c = 2800; + ace_frag_gurney_k = "3/5"; + ace_frag_classes[] = {"ACE_frag_tiny_HD"}; + ace_frag_skip = 0; + ace_frag_force = 1; + }; + class rhs_ammo_rgn: rhs_ammo_rgn_base { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_ammo_rgn_sub: rhs_ammo_rgn_base {}; + class rhs_ammo_rgn_exp: rhs_ammo_rgn_base {}; + class rhs_ammo_fakel: GrenadeHand { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_ammo_fakels: rhs_ammo_fakel {}; + class rhs_ammo_zarya2: rhs_ammo_fakels {}; + class rhs_ammo_plamyam: rhs_ammo_fakels {}; + + class RocketBase; + class R_PG32V_F: RocketBase {}; + class rhs_rpg26_rocket: R_PG32V_F {}; + class rhs_rpg7v2_pg7vl: rhs_rpg26_rocket {}; + class rhs_rpg7v2_og7v: rhs_rpg7v2_pg7vl { + ace_frag_enabled = 1; + ace_frag_metal = 400; + ace_frag_charge = 210; + ace_frag_gurney_c = 2800; + ace_frag_gurney_k = "3/5"; + ace_frag_classes[] = {"ACE_frag_medium_HD"}; + ace_frag_skip = 0; + ace_frag_force = 1; + }; + class rhs_rpg7v2_tbg7v: rhs_rpg7v2_pg7vl { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_rshg2_rocket: rhs_rpg7v2_tbg7v { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; +}; diff --git a/optionals/compat_rhs_afrf3/CfgMagazines.hpp b/optionals/compat_rhs_afrf3/CfgMagazines.hpp index 92444a380b..fcf9841019 100644 --- a/optionals/compat_rhs_afrf3/CfgMagazines.hpp +++ b/optionals/compat_rhs_afrf3/CfgMagazines.hpp @@ -14,4 +14,4 @@ class cfgMagazines { class rhs_mag_127x108mm_1470 : rhs_mag_127x108mm_50 { ace_isbelt = 0; }; -}; \ No newline at end of file +}; diff --git a/optionals/compat_rhs_afrf3/CfgVehicles.hpp b/optionals/compat_rhs_afrf3/CfgVehicles.hpp index e9c71f4da7..d0486ecd0e 100644 --- a/optionals/compat_rhs_afrf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_afrf3/CfgVehicles.hpp @@ -28,6 +28,7 @@ class cfgVehicles { class CommanderOptics; }; class rhs_bmd_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 300; class Turrets: Turrets { class CommanderOptics: NewTurret { ace_fcs_Enabled = 0; @@ -41,6 +42,7 @@ class cfgVehicles { }; }; class rhs_bmp1tank_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 460; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -57,13 +59,14 @@ class cfgVehicles { class MainTurret: MainTurret { class Turrets: Turrets { class CommanderOptics : CommanderOptics { - ace_fcs_Enabled = 0; + ace_fcs_Enabled = 0; }; }; }; }; }; class rhs_bmp3tank_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 460; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -79,6 +82,7 @@ class cfgVehicles { }; }; class rhs_btr_base: Wheeled_APC_F { + EGVAR(refuel,fuelCapacity) = 300; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -89,6 +93,7 @@ class cfgVehicles { }; }; class rhs_a3spruttank_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 400; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -99,12 +104,35 @@ class cfgVehicles { }; }; }; + }; + }; + class rhs_bmd4_vdv: rhs_a3spruttank_base { + class Turrets: Turrets { + class MainTurret: MainTurret { + class Turrets: Turrets { + class CommanderOptics: CommanderOptics {}; + }; + }; class GPMGTurret1: NewTurret { ace_fcs_Enabled = 0; }; }; }; + class rhs_bmd4m_vdv: rhs_bmd4_vdv { + class Turrets: Turrets { + class MainTurret: MainTurret { + class Turrets: Turrets { + class CommanderOptics: CommanderOptics {}; + }; + }; + class GPMGTurret1: GPMGTurret1 {}; + class GPMGTurret2: GPMGTurret1 { + ace_fcs_Enabled = 0; + }; + }; + }; class rhs_a3t72tank_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 1200; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -119,7 +147,20 @@ class cfgVehicles { }; }; }; - class rhs_t72bd_tv: rhs_a3t72tank_base {}; + class rhs_t72bb_tv: rhs_a3t72tank_base { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint"}}}; + }; + class rhs_t72bc_tv: rhs_a3t72tank_base { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint"}}}; + }; + class rhs_t72bd_tv: rhs_a3t72tank_base { + class rhs_t72bd_tv: rhs_a3t72tank_base { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint"}}}; + }; + }; class rhs_t90_tv: rhs_t72bd_tv { class Turrets: Turrets { class MainTurret: MainTurret { @@ -133,6 +174,7 @@ class cfgVehicles { }; }; class rhs_tank_base: Tank_F { + EGVAR(refuel,fuelCapacity) = 1200; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -153,4 +195,75 @@ class cfgVehicles { { ace_gforcecoef = 0.55; }; -}; \ No newline at end of file + + class O_Plane_CAS_02_F; + class RHS_su25_base : O_Plane_CAS_02_F { + EGVAR(refuel,fuelCapacity) = 3600; + }; + + class Heli_Light_02_base_F; + class RHS_Mi8_base : Heli_Light_02_base_F { + EGVAR(refuel,fuelCapacity) = 3700; + }; + + class Heli_Attack_02_base_F; + class RHS_Ka52_base : Heli_Attack_02_base_F { + EGVAR(refuel,fuelCapacity) = 1870; + }; + + class RHS_Mi24_base : Heli_Attack_02_base_F { + EGVAR(refuel,fuelCapacity) = 1851; + }; + + class rhs_t80b : rhs_tank_base { + EGVAR(refuel,fuelCapacity) = 1100; + }; + class rhs_t80bv: rhs_t80b { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint"}}}; + }; + + class Truck_F; + class RHS_Ural_BaseTurret : Truck_F { + EGVAR(refuel,fuelCapacity) = 360; + }; + + class rhs_truck : Truck_F { + EGVAR(refuel,fuelCapacity) = 210; + }; + + class MRAP_02_base_F; + class rhs_tigr_base : MRAP_02_base_F { + EGVAR(refuel,fuelCapacity) = 138; + }; + + class Offroad_01_base_f; + class RHS_UAZ_Base : Offroad_01_base_f { + EGVAR(refuel,fuelCapacity) = 78; + }; + + class APC_Tracked_02_base_F; + class rhs_zsutank_base : APC_Tracked_02_base_F { + EGVAR(refuel,fuelCapacity) = 515; + }; + + class rhs_btr60_base : rhs_btr_base { + EGVAR(refuel,fuelCapacity) = 290; + }; + class rhs_btr70_vmf : rhs_btr_base { + EGVAR(refuel,fuelCapacity) = 350; + }; + + class rhs_btr70_msv : rhs_btr70_vmf {}; + class rhs_btr80_msv : rhs_btr70_msv { + EGVAR(refuel,fuelCapacity) = 300; + }; + + class rhs_2s3tank_base : Tank_F { + EGVAR(refuel,fuelCapacity) = 830; + }; + + class OTR21_Base : Truck_F { + EGVAR(refuel,fuelCapacity) = 500; + }; +}; diff --git a/optionals/compat_rhs_afrf3/CfgWeapons.hpp b/optionals/compat_rhs_afrf3/CfgWeapons.hpp index 0c3d3dfac4..32c1f590c5 100644 --- a/optionals/compat_rhs_afrf3/CfgWeapons.hpp +++ b/optionals/compat_rhs_afrf3/CfgWeapons.hpp @@ -1,61 +1,50 @@ -class CfgWeapons -{ +class CfgWeapons { class hgun_Rook40_F; - class rhs_weap_pya: hgun_Rook40_F - { - ACE_barrelTwist=254.0; - ACE_barrelLength=111.76; + class rhs_weap_pya: hgun_Rook40_F { + ACE_barrelTwist = 254.0; + ACE_barrelLength = 111.76; }; class Pistol_Base_F; - class rhs_weap_makarov_pmm: rhs_weap_pya - { - ACE_barrelTwist=240.03; - ACE_barrelLength=93.472; + class rhs_weap_makarov_pmm: rhs_weap_pya { + ACE_barrelTwist = 240.03; + ACE_barrelLength = 93.472; }; class rhs_weap_ak74m_Base_F; - class rhs_weap_ak74m: rhs_weap_ak74m_Base_F - { - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; + class rhs_weap_ak74m: rhs_weap_ak74m_Base_F { + ACE_barrelTwist = 199.898; + ACE_barrelLength = 414.02; }; - class rhs_weap_akm: rhs_weap_ak74m - { - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; + class rhs_weap_akm: rhs_weap_ak74m { + ACE_barrelTwist = 199.898; + ACE_barrelLength = 414.02; }; class rhs_weap_aks74; - class rhs_weap_aks74u: rhs_weap_aks74 - { - ACE_barrelTwist=160.02; - ACE_barrelLength=210.82; + class rhs_weap_aks74u: rhs_weap_aks74 { + ACE_barrelTwist = 160.02; + ACE_barrelLength = 210.82; }; - class rhs_weap_svd: rhs_weap_ak74m - { - ACE_barrelTwist=238.76; - ACE_barrelLength=619.76; + class rhs_weap_svd: rhs_weap_ak74m { + ACE_barrelTwist = 238.76; + ACE_barrelLength = 619.76; }; class rhs_weap_svdp; - class rhs_weap_svds: rhs_weap_svdp - { - ACE_barrelTwist=238.76; - ACE_barrelLength=563.88; + class rhs_weap_svds: rhs_weap_svdp { + ACE_barrelTwist = 238.76; + ACE_barrelLength = 563.88; }; class rhs_pkp_base; - class rhs_weap_pkp: rhs_pkp_base - { - ACE_barrelTwist=240.03; - ACE_barrelLength=657.86; + class rhs_weap_pkp: rhs_pkp_base { + ACE_barrelTwist = 240.03; + ACE_barrelLength = 657.86; }; - class rhs_weap_pkm: rhs_weap_pkp - { - ACE_barrelTwist=240.03; - ACE_barrelLength=645.16; + class rhs_weap_pkm: rhs_weap_pkp { + ACE_barrelTwist = 240.03; + ACE_barrelLength = 645.16; }; - class rhs_weap_rpk74m: rhs_weap_pkp - { - ACE_barrelTwist=195.072; - ACE_barrelLength=589.28; + class rhs_weap_rpk74m: rhs_weap_pkp { + ACE_barrelTwist = 195.072; + ACE_barrelLength = 589.28; }; class rhs_acc_sniper_base; diff --git a/optionals/compat_rhs_afrf3/config.cpp b/optionals/compat_rhs_afrf3/config.cpp index 123f80b566..4840f8da82 100644 --- a/optionals/compat_rhs_afrf3/config.cpp +++ b/optionals/compat_rhs_afrf3/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhs_c_weapons", "rhs_c_troops"}; - author[]={"Ruthberg"}; + requiredAddons[] = {"rhs_c_weapons", "rhs_c_troops", "rhs_c_bmd", "rhs_c_bmp", "rhs_c_bmp3", "rhs_c_a2port_armor", "rhs_c_btr", "rhs_c_sprut", "rhs_c_t72", "rhs_c_tanks", "rhs_c_a2port_air", "rhs_c_a2port_car", "rhs_c_cars", "rhs_c_2s3", "rhs_c_rva"}; + author[]={"Ruthberg", "GitHawk"}; VERSION_CONFIG; }; }; @@ -14,4 +14,4 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" diff --git a/optionals/compat_rhs_usf3/CfgAmmo.hpp b/optionals/compat_rhs_usf3/CfgAmmo.hpp index 0dde3eaf62..b830d5e564 100644 --- a/optionals/compat_rhs_usf3/CfgAmmo.hpp +++ b/optionals/compat_rhs_usf3/CfgAmmo.hpp @@ -122,4 +122,49 @@ class CfgAmmo attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; }; }; + + class GrenadeHand; + class rhs_ammo_mk3a2: GrenadeHand { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_ammo_m84: GrenadeHand { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_ammo_m7a3_cs: GrenadeHand { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class GrenadeHand_stone; + class rhs_ammo_m69: GrenadeHand_stone { + ace_frag_enabled = 0; + ace_frag_skip = 1; + ace_frag_force = 0; + }; + class rhs_ammo_m67: GrenadeHand { + ace_frag_enabled = 1; + ace_frag_metal = 213; + ace_frag_charge = 185; + ace_frag_gurney_c = 2700; + ace_frag_gurney_k = "3/5"; + ace_frag_classes[] = {"ACE_frag_medium_HD"}; + ace_frag_skip = 0; + ace_frag_force = 1; + }; + class RocketBase; + class rhs_ammo_M136_rocket: RocketBase {}; + class rhs_ammo_M136_hedp_rocket: rhs_ammo_M136_rocket { + ace_frag_enabled = 1; + ace_frag_metal = 330; + ace_frag_charge = 280; + ace_frag_gurney_c = 2800; + ace_frag_gurney_k = "3/5"; + ace_frag_classes[] = {"ACE_frag_medium_HD"}; + ace_frag_skip = 0; + ace_frag_force = 1; + }; }; diff --git a/optionals/compat_rhs_usf3/CfgMagazines.hpp b/optionals/compat_rhs_usf3/CfgMagazines.hpp index e067d1f293..2818478d83 100644 --- a/optionals/compat_rhs_usf3/CfgMagazines.hpp +++ b/optionals/compat_rhs_usf3/CfgMagazines.hpp @@ -19,4 +19,12 @@ class cfgMagazines { class RHS_48Rnd_40mm_MK19: VehicleMagazine { ace_isbelt = 1; }; -}; \ No newline at end of file + + class CA_LauncherMagazine; + class rhs_mag_smaw_SR: CA_LauncherMagazine { + EGVAR(overpressure,priority) = 99; + EGVAR(overpressure,angle) = 0; + EGVAR(overpressure,range) = 0; + EGVAR(overpressure,damage) = 0; + }; +}; diff --git a/optionals/compat_rhs_usf3/CfgVehicles.hpp b/optionals/compat_rhs_usf3/CfgVehicles.hpp index 2be7a8076e..87c66f7212 100644 --- a/optionals/compat_rhs_usf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_usf3/CfgVehicles.hpp @@ -15,6 +15,7 @@ class cfgVehicles { class MBT_01_base_F: Tank_F {}; class rhsusf_m1a1tank_base: MBT_01_base_F { + EGVAR(refuel,fuelCapacity) = 1909; class Turrets: Turrets { class MainTurret: MainTurret { ace_fcs_Enabled = 0; @@ -29,4 +30,95 @@ class cfgVehicles { }; }; }; -}; \ No newline at end of file + class rhsusf_m1a1aim_tuski_wd: rhsusf_m1a1tank_base { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint"}}}; + }; + class rhsusf_m1a2tank_base; + class rhsusf_m1a2sep1tuskid_usarmy: rhsusf_m1a2tank_base { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint"}}}; + }; + class rhsusf_m1a2sep1tuskiiwd_usarmy: rhsusf_m1a2sep1tuskid_usarmy { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint", "era_20_hitpoint", "era_21_hitpoint", "era_22_hitpoint", "era_23_hitpoint", "era_24_hitpoint", "era_25_hitpoint", "era_26_hitpoint", "era_27_hitpoint", "era_28_hitpoint", "era_29_hitpoint", "era_30_hitpoint", "era_31_hitpoint", "era_32_hitpoint", "era_33_hitpoint", "era_34_hitpoint", "era_35_hitpoint", "era_36_hitpoint", "era_37_hitpoint", "era_38_hitpoint", "era_39_hitpoint", "era_40_hitpoint", "era_41_hitpoint", "era_42_hitpoint", "era_43_hitpoint", "era_44_hitpoint", "era_45_hitpoint", "era_46_hitpoint"}}}; + }; + + class Heli_light_03_base_F; + class RHS_UH1_Base: Heli_light_03_base_F { + EGVAR(refuel,fuelCapacity) = 1447; + }; + + class Heli_Transport_01_base_F; + class RHS_UH60_Base: Heli_Transport_01_base_F { + EGVAR(refuel,fuelCapacity) = 1360; + }; + + class Heli_Transport_02_base_F; + class RHS_CH_47F_base: Heli_Transport_02_base_F { + EGVAR(refuel,fuelCapacity) = 3914; + }; + + class Heli_Attack_01_base_F; + class RHS_AH1Z_base: Heli_Attack_01_base_F { + EGVAR(refuel,fuelCapacity) = 1600; + }; + + class RHS_AH64_base: Heli_Attack_01_base_F { + EGVAR(refuel,fuelCapacity) = 1420; + }; + + class MBT_01_arty_base_F; + class rhsusf_m109tank_base: MBT_01_arty_base_F { + EGVAR(refuel,fuelCapacity) = 511; + }; + + class MRAP_01_base_F; + class rhsusf_hmmwe_base: MRAP_01_base_F { + EGVAR(refuel,fuelCapacity) = 95; + }; + + class rhsusf_rg33_base: MRAP_01_base_F { + EGVAR(refuel,fuelCapacity) = 302; + }; + + class Truck_01_base_F; + class rhsusf_fmtv_base: Truck_01_base_F { + EGVAR(refuel,fuelCapacity) = 219; + }; + + class APC_Tracked_02_base_F: Tank_F {}; + class rhsusf_m113_tank_base: APC_Tracked_02_base_F { + EGVAR(refuel,fuelCapacity) = 360; + class Turrets: Turrets { + class MainTurret: MainTurret { + ace_fcs_Enabled = 0; + }; + }; + }; + + class APC_Tracked_03_base_F; + class RHS_M2A2_Base: APC_Tracked_03_base_F { + EGVAR(refuel,fuelCapacity) = 746; + }; + class RHS_M2A2: RHS_M2A2_Base {}; + class RHS_M2A2_BUSKI: RHS_M2A2 { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint"}}}; + }; + class RHS_M2A3: RHS_M2A2 {}; + class RHS_M2A3_BUSKI: RHS_M2A3 { + ace_repair_hitpointPositions[] = {{"era_1_hitpoint", {0,0,0}}}; + ace_repair_hitpointGroups[] = {{"era_1_hitpoint", {"era_2_hitpoint", "era_3_hitpoint", "era_4_hitpoint", "era_5_hitpoint", "era_6_hitpoint", "era_7_hitpoint", "era_8_hitpoint", "era_9_hitpoint", "era_10_hitpoint", "era_11_hitpoint", "era_12_hitpoint", "era_13_hitpoint", "era_14_hitpoint", "era_15_hitpoint", "era_16_hitpoint", "era_17_hitpoint", "era_18_hitpoint", "era_19_hitpoint"}}}; + }; + + class Plane_CAS_01_base_F; + class RHS_A10: Plane_CAS_01_base_F { + EGVAR(refuel,fuelCapacity) = 6223; + }; + + class Plane_Base_F; + class RHS_C130J_Base: Plane_Base_F { + EGVAR(refuel,fuelCapacity) = 25704; + }; +}; diff --git a/optionals/compat_rhs_usf3/CfgWeapons.hpp b/optionals/compat_rhs_usf3/CfgWeapons.hpp index e059a4f71c..becb91ada1 100644 --- a/optionals/compat_rhs_usf3/CfgWeapons.hpp +++ b/optionals/compat_rhs_usf3/CfgWeapons.hpp @@ -8,13 +8,16 @@ class CfgWeapons class UGL_F; class rhs_weap_XM2010_Base_F: Rifle_Base_F { - ACE_barrelTwist=254.0; - ACE_barrelLength=609.6; + ACE_barrelTwist = 254.0; + ACE_barrelLength = 609.6; }; class arifle_MX_Base_F; class rhs_weap_m4_Base: arifle_MX_Base_F { - ACE_barrelTwist=177.8; - ACE_barrelLength=368.3; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 368.3; + ACE_Overheating_Dispersion[] = {0, 0.001, 0.002, 0.004}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; class M203_GL : UGL_F { magazines[] = { "rhs_mag_M441_HE", @@ -110,45 +113,61 @@ class CfgWeapons }; class rhs_weap_m4a1; class rhs_weap_mk18: rhs_weap_m4a1 { - ACE_barrelTwist=177.8; - ACE_barrelLength=261.62; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 261.62; + ACE_Overheating_Dispersion[] = {0, 0.001, 0.002, 0.004}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; }; class rhs_weap_m16a4: rhs_weap_m4_Base { - ACE_barrelTwist=177.8; - ACE_barrelLength=508.0; + ACE_barrelTwist = 177.8; + ACE_barrelLength = 508.0; }; + class rhs_weap_lmg_minimipara; + class rhs_weap_lmg_minimi_railed : rhs_weap_lmg_minimipara { + ACE_barrelLength = 465.0; + ACE_barrelTwist = 177.8; + ACE_Overheating_allowSwapBarrel = 1; + ACE_Overheating_Dispersion[] = {0, -0.001, 0.001, 0.003}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; + }; class rhs_weap_m240_base; class rhs_weap_m240B: rhs_weap_m240_base { - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 629.92; + ACE_Overheating_allowSwapBarrel = 1; + ACE_Overheating_Dispersion[] = {0, -0.001, 0.001, 0.004}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; }; class rhs_weap_m14ebrri: srifle_EBR_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; + ACE_barrelTwist = 304.8; + ACE_barrelLength = 558.8; }; class rhs_weap_sr25: rhs_weap_m14ebrri { - ACE_barrelTwist=285.75; - ACE_barrelLength=609.6; + ACE_barrelTwist = 285.75; + ACE_barrelLength = 609.6; }; class rhs_weap_sr25_ec: rhs_weap_sr25 { - ACE_barrelTwist=285.75; - ACE_barrelLength=508.0; + ACE_barrelTwist = 285.75; + ACE_barrelLength = 508.0; }; class rhs_weap_M590_5RD: Rifle_Base_F { - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=469.9; + ACE_barrelTwist = 0.0; + ACE_twistDirection = 0; + ACE_barrelLength = 469.9; }; class rhs_weap_M590_8RD: rhs_weap_M590_5RD { - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=508.0; + ACE_barrelTwist = 0.0; + ACE_twistDirection = 0; + ACE_barrelLength = 508.0; }; class hgun_ACPC2_F; class rhsusf_weap_m1911a1: hgun_ACPC2_F { - ACE_barrelTwist=406.4; - ACE_barrelLength=127.0; + ACE_barrelTwist = 406.4; + ACE_barrelLength = 127.0; }; class rhsusf_acc_sniper_base; diff --git a/optionals/compat_rhs_usf3/config.cpp b/optionals/compat_rhs_usf3/config.cpp index 3e9aee6ec7..ce847e969e 100644 --- a/optionals/compat_rhs_usf3/config.cpp +++ b/optionals/compat_rhs_usf3/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsusf_c_weapons", "rhsusf_c_troops"}; - author[]={"Ruthberg"}; + requiredAddons[] = {"rhsusf_c_weapons", "rhsusf_c_troops", "rhsusf_c_m1a1", "rhsusf_c_m1a2", "RHS_US_A2_AirImport", "rhsusf_c_m109", "rhsusf_c_hmmwv", "rhsusf_c_rg33", "rhsusf_c_fmtv", "rhsusf_c_m113", "RHS_US_A2Port_Armor"}; + author[]={"Ruthberg", "GitHawk"}; VERSION_CONFIG; }; }; @@ -14,4 +14,4 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" diff --git a/tools/make.py b/tools/make.py index e4b99116a6..496a6bdf67 100644 --- a/tools/make.py +++ b/tools/make.py @@ -975,6 +975,18 @@ See the make.cfg file for additional build options. print ("No cache found.") cache = {} + # Check the ace build version (from main) with cached version - Forces a full rebuild when version changes + aceVersion = get_project_version() + cacheVersion = "None"; + if 'cacheVersion' in cache: + cacheVersion = cache['cacheVersion'] + + if (aceVersion != cacheVersion): + cache = {} + print("Reseting Cache {0} to New Version {1}".format(cacheVersion, aceVersion)) + cache['cacheVersion'] = aceVersion + + if not os.path.isdir(os.path.join(release_dir, project, "addons")): try: os.makedirs(os.path.join(release_dir, project, "addons")) @@ -1083,6 +1095,9 @@ See the make.cfg file for additional build options. print_error("\nFailed to delete {}".format(os.path.join(obsolete_check_path,file))) pass + amountOfBuildsFailed = 0 + namesOfBuildsFailed = [] + # For each module, prep files and then build. print_blue("\nBuilding...") for module in modules: @@ -1222,6 +1237,8 @@ See the make.cfg file for additional build options. print_error("pboProject return code == {}".format(str(ret))) print_error("Module not successfully built/signed. Check your {}temp\{}_packing.log for more info.".format(work_drive,module)) print ("Resuming build...") + amountOfBuildsFailed += 1 + namesOfBuildsFailed.append("{}".format(module)) continue # Back to the root @@ -1388,8 +1405,14 @@ See the make.cfg file for additional build options. except: print_error("Could not copy files. Is Arma 3 running?") - print_green("\nDone.") + if amountOfBuildsFailed > 0: + print_error("Build failed. {} pbos failed.".format(amountOfBuildsFailed)) + for failedModuleName in namesOfBuildsFailed: + print("- {} failed.".format(failedModuleName)) + + else: + print_green("\Completed with 0 errors.") if __name__ == "__main__": start_time = timeit.default_timer() diff --git a/tools/sqf_validator.py b/tools/sqf_validator.py index 7e7c0183d6..7414d7d715 100644 --- a/tools/sqf_validator.py +++ b/tools/sqf_validator.py @@ -109,7 +109,10 @@ def check_sqf_syntax(filepath): print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber)) bad_count_file += 1 brackets_list.append('}') - + elif (c== '\t'): + print("ERROR: Tab detected at {0} Line number: {1}".format(filepath,lineNumber)) + bad_count_file += 1 + if (checkForSemiColumn): if (c not in [' ', '\t', '\n', '/']): # keep reading until no white space or comments checkForSemiColumn = False