diff --git a/AUTHORS.txt b/AUTHORS.txt index 70bd7af086..62329d7c1d 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -107,3 +107,4 @@ VyMajoris(W-Cephei) Winter zGuba Drill +MikeMatrix diff --git a/README.md b/README.md index a813088e96..4e11a00be7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ACE version - + ACE download diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6738b3e8c8..bd363b1307 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -17,10 +17,10 @@ */ #include "script_component.hpp" -private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; - -PARAMS_3(_attachToVehicle,_unit,_args); -_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; +private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; +params ["_attachToVehicle","_unit","_args"]; +_args params [["_itemClassname","", [""]]]; +TRACE_3("params",_attachToVehicle,_unit,_itemClassname); //Sanity Check (_unit has item in inventory, not over attach limit) if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; @@ -69,9 +69,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment [{ private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; - - PARAMS_2(_args,_pfID); - EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID); + params ["_args","_idPFH"]; + _args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"]; _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); if (cameraView == "EXTERNAL") then { @@ -88,7 +87,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { - [_pfID] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 18071092d5..20a49c09be 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -17,14 +17,14 @@ */ #include "script_component.hpp" -PARAMS_3(_attachToVehicle,_player,_args); +private ["_attachLimit", "_attachedObjects","_playerPos"]; +params ["_attachToVehicle","_player","_args"]; +_args params [["_itemClassname","", [""]]]; +TRACE_3("params",_attachToVehicle,_unit,_itemClassname); -private ["_itemName", "_attachLimit", "_attachedObjects","_playerPos"]; - -_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); -(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; +(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index dc335e6bb6..ba3182ddea 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -16,9 +16,9 @@ */ #include "script_component.hpp" -PARAMS_2(_attachToVehicle,_unit); - private ["_attachedObjects", "_inRange"]; +params ["_attachToVehicle", "_unit"]; +TRACE_2("params",_attachToVehicle,_unit); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 92df83b5c1..98f482f17b 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -16,15 +16,16 @@ */ #include "script_component.hpp" -PARAMS_2(_attachToVehicle,_unit); - -private ["_attachedObjects", "_attachedItems", "_itemDisplayName"]; +private ["_attachedObjects", "_attachedItems", "_itemDisplayName", + "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", + "_unitPos", "_objectPos" +]; +params ["_attachToVehicle","_unit"], +TRACE_2("params",_attachToVehicle,_unit); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []]; -private ["_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_unitPos", "_objectPos"]; - _attachedObject = objNull; _attachedIndex = -1; _itemName = ""; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index fb432146be..aeb75c00d4 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -18,7 +18,8 @@ #include "script_component.hpp" private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"]; -PARAMS_2(_target,_player); +params ["_target","_player"]; +TRACE_2("params",_target,_player); _listed = []; _actions = []; @@ -30,7 +31,7 @@ _actions = []; if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; @@ -43,7 +44,7 @@ _actions = []; if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index efd85769d0..0656e7880f 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -27,7 +27,8 @@ private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; -PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); +params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"]; +TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); _startingOffset = _attachToVehicle worldToModel _startingPosition; diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index 391faaa82e..d9b16eec10 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_wall", "_paper"]; +private "_paper"; -_wall = _this select 0; +params ["_wall"]; if (local _wall) then { _paper = "UserTexture_1x2_F" createVehicle position _wall; diff --git a/addons/captives/ACE_Settings.hpp b/addons/captives/ACE_Settings.hpp index 73bafbab41..1d0ebbf491 100644 --- a/addons/captives/ACE_Settings.hpp +++ b/addons/captives/ACE_Settings.hpp @@ -5,6 +5,13 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(requireSurrender) { + displayName = CSTRING(ModuleSettings_requireSurrender_name); + description = CSTRING(ModuleSettings_requireSurrender_description); + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), CSTRING(SurrenderOnly), CSTRING(SurrenderOrNoWeapon)}; + value = 1; + }; class GVAR(allowSurrender) { displayName = CSTRING(ModuleSettings_allowSurrender_name); description = CSTRING(ModuleSettings_allowSurrender_description); diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 746a1c4b63..187fe1a746 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -189,6 +189,26 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class requireSurrender { + displayName = CSTRING(ModuleSettings_allowSurrender_name); + description = CSTRING(ModuleSettings_allowSurrender_description); + typeName = "NUMBER"; + class values { + class disable { + name = ECSTRING(common,No); + value = 0; + }; + class Surrender { + name = CSTRING(SurrenderOnly); + value = 1; + default = 1; + }; + class SurrenderOrNoWeapon { + name = CSTRING(SurrenderOrNoWeapon); + value = 2; + }; + }; + }; }; class ModuleDescription: ModuleDescription { description = CSTRING(ModuleSettings_Description); diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index e42b5455ff..5e7eb34a76 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -16,11 +16,11 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Check sides, Player has cableTie, target is alive and not already handcuffed (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && ("ACE_CableTie" in (items _unit)) && {alive _target} && -{!(_target getVariable [QGVAR(isHandcuffed), false])} +{!(_target getVariable [QGVAR(isHandcuffed), false])} && +(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2))) diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 1d9480fd0b..a7c799905e 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Alive, handcuffed, not being escored, and not unconscious (_target getVariable [QGVAR(isHandcuffed), false]) && diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf index 5eecc453d4..d164f13ac3 100644 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ b/addons/captives/functions/fnc_canFriskPerson.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; _target getVariable [QGVAR(isHandcuffed), false] || {_target getVariable [QGVAR(isSurrendering), false]} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 04b33ad42d..3f2677da76 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -18,8 +18,7 @@ #include "script_component.hpp" private ["_objects"]; - -PARAMS_3(_unit,_target,_vehicle); +params ["_unit", "_target","_vehicle"]; if (isNull _target) then { _objects = attachedObjects _unit; diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index 4642cd90fd..e8bbe3b50e 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index 56065a43fc..cfafb5a0e8 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); -DEFAULT_PARAM(1,_target,objNull); +params ["_unit", ["_target", objNull]]; if (isNull _target) then { _target = _unit getVariable [QGVAR(escortedUnit), objNull]; diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 059fb98d03..de0a88d871 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -16,12 +16,12 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_newSurrenderState); - private "_returnValue"; +params ["_unit", "_newSurrenderState"]; + _returnValue = if (_newSurrenderState) then { - //no weapon equiped AND not currently surrendering and + //no weapon equiped AND not currently surrendering and GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { //is Surrendering diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 59e798a24c..6bd98cf4eb 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -18,6 +18,6 @@ private ["_cargo"]; -PARAMS_2(_player,_unit); +params ["_player", "_unit"]; ((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doApplyHandcuffs.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf index 0d15f503e8..21bfe58747 100644 --- a/addons/captives/functions/fnc_doApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -16,10 +16,11 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); -_unit removeItem "ACE_CableTie"; +params ["_unit", "_target"]; playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10]; ["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); + +_unit removeItem "ACE_CableTie"; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index bc2cd97ffd..bb070b057a 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_state); +params ["_unit", "_target","_state"]; if (_state) then { if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index d79c88a5fb..e14025b88f 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -19,6 +19,7 @@ private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; PARAMS_2(_player,_unit); +params ["_player", "_unit"]; _weapon = currentWeapon _player; if (_weapon == primaryWeapon _player && {_weapon != ""}) then { diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 97ecd98a0a..69b7276142 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_vehicle); private "_objects"; +params ["_unit", "_target","_vehicle"]; + if (isNull _target) then { _objects = attachedObjects _unit; _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); diff --git a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf index a69decf620..681b698de3 100644 --- a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -15,6 +15,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index 5d95189742..46ba618010 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index cf7d2c7271..487e7d4179 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if (local _unit) then { if (_unit getVariable [QGVAR(isEscorting), false]) then { diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index 4bf9a1fa19..daf88b7e34 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { private ["_cargoIndex"]; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 3eed932d5a..f7b15ec117 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_oldUnit); +params ["_oldUnit"]; if (!local _oldUnit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 9aa4856204..ca6362d3da 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_isUnconc); +params ["_unit","_isUnconc"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index 21fd1e1ec3..aea91b5e11 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_newUnit,_oldUnit); +params ["_newUnit","_oldUnit"]; //set showHUD based on new unit status: if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 02888c27a0..6f68aea2fe 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_dead); +params ["_unit","_dead"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index a8b601300a..66cbcff794 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; // prevent players from throwing grenades (added to all units) [_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 84b90e78c2..7b30199caf 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_zeusIsOpen); +params ["_unit","_zeusIsOpen"]; //set showHUD based on unit status: if (!_zeusIsOpen) then { diff --git a/addons/captives/functions/fnc_moduleSettings.sqf b/addons/captives/functions/fnc_moduleSettings.sqf index c12ac80b99..fc8c76721f 100644 --- a/addons/captives/functions/fnc_moduleSettings.sqf +++ b/addons/captives/functions/fnc_moduleSettings.sqf @@ -13,7 +13,8 @@ #include "script_component.hpp" -PARAMS_1(_logic); +params ["_logic"]; [_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(requireSurrender), "requireSurrender"] call EFUNC(common,readSettingFromModule); diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 5b40b7663e..64c80af35c 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); private ["_bisMouseOver", "_mouseOverObject"]; +params ["_logic", "_units", "_activated"]; + if (!_activated) exitWith {}; if (local _logic) then { diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index bd141988bb..9bde3b399d 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running setHandcuffed on remote unit"); @@ -43,7 +42,7 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ - PARAMS_1(_unit); + params ["_unit"]; if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index c1a34b636c..4fad2d3853 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running surrender on remote unit"); diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 626a0b34e4..7e30fe4af4 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -16,10 +16,10 @@ */ #include "script_component.hpp" -PARAMS_2(_target,_vehicle); - private ["_cargoIndex"]; +params ["_target","_vehicle"]; + _target moveInCargo _vehicle; _target assignAsCargo _vehicle; _cargoIndex = _vehicle getCargoIndex _target; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index 5ef6f01406..000d5ef568 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; _unit setVariable [QGVAR(CargoIndex), -1, true]; moveOut _unit; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 39cf65cac7..8ce7ab90c1 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -221,5 +221,17 @@ Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben Jogadores podem se render depois de guardar sua arma + + Require surrendering + + + Require Players to surrender before they can be arrested + + + Surrendering only + + + Surrendering or No weapon + diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 40d8d7334b..ee34f1308d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -118,8 +118,9 @@ if(!isServer) then { }; ["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); ["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); -[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; - +if (isServer) then { + [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; +}; call FUNC(checkFiles); @@ -340,6 +341,14 @@ if(isMultiplayer && { ACE_time > 0 || isNull player } ) then { GVAR(deviceKeyHandlingArray) = []; GVAR(deviceKeyCurrentIndex) = -1; +// Register localizations for the Keybinding categories +["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call cba_fnc_registerKeybindModPrettyName; + ["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), { [] call FUNC(deviceKeyFindValidIndex); diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 9a95819996..f45f6736bf 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -65,7 +65,8 @@ if (isNil _name) then { localizedDescription, possibleValues, isForced, - defaultValue + defaultValue, + category ];*/ _settingData = [ _name, @@ -75,7 +76,8 @@ if (isNil _name) then { getText (_optionEntry >> "description"), getArray (_optionEntry >> "values"), getNumber (_optionEntry >> "force") > 0, - _value + _value, + getText (_optionEntry >> "category") ]; //Strings in the values array won't be localized from the config, so just do that now: diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 524bf6621d..da2d9ea77e 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -30,14 +30,14 @@ if (_vehicle isKindOf "Ship" ) then { _emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition); _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; } else { - if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); -if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid vehicle state. Either moving or Not close enough on the ground. %1", getPos _vehicle]; false }; +if (!_validVehiclestate) exitwith { diag_log format["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 }; diag_log str _emptyPos; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 6ed5e10d5a..d0034d2c04 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -598,5 +598,86 @@ Następne urządzenie podręczne Procházet ruční zařízení + + Disabled + Zakázáno + Non + Deaktiviert + Disattivato + Wyłączone + Desativado + Откл. + Desactivado + + + Enabled + Zapnuto + Oui + Aktiviert + Attivato + Włączone + Ativado + Вкл. + Activado + + + Yes + Ja + Si + Tak + Ano + Oui + Да + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + Нет + Nem + Não + No + + + Vehicles only + + + Do Not Force + Nie wymuszaj + No forzar + Nicht erzwingen + Nevynucovat + Não forçar + + + ACE3 Equipment + ACE3 Wyposażenie + + + ACE3 Common + ACE3 Ogólne + + + ACE3 Weapons + ACE3 Broń + + + ACE3 Movement + ACE3 Ruch + + + ACE3 Scope Adjustment + ACE3 Regulacja optyki + + + ACE3 Vehicles + ACE3 Pojazdy + diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp index 2592bf5b77..cf1be40487 100644 --- a/addons/concertina_wire/CfgVehicles.hpp +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -123,7 +123,8 @@ class CfgVehicles { displayName = "$STR_ACE_ROLLWIRE"; distance = 4; condition = "true"; - statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index c30e767266..5548cad649 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -37,7 +37,7 @@ deleteVehicle _wirecoil; _unit setVariable [QGVAR(wireDeployed), false]; GVAR(deployPFH) = [{ - EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action); + EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); @@ -73,7 +73,7 @@ GVAR(deployPFH) = [{ { _wireNoGeo animate [_x, _anim]; } foreach WIRE_FAST; -}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler; +}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf index bc51974bc6..2f3b936692 100644 --- a/addons/disposable/XEH_postInit.sqf +++ b/addons/disposable/XEH_postInit.sqf @@ -5,6 +5,7 @@ if (!hasInterface) exitWith {}; ["inventoryDisplayLoaded", {[ACE_player, _this select 0] call FUNC(updateInventoryDisplay)}] call EFUNC(common,addEventHandler); ["playerInventoryChanged", { - [_this select 0, _this select 1 select 11] call FUNC(takeLoadedATWeapon); - [_this select 0] call FUNC(updateInventoryDisplay); + params ["_unit", "_items"]; + [_unit, _items select 11] call FUNC(takeLoadedATWeapon); + [_unit] call FUNC(updateInventoryDisplay); }] call EFUNC(common,addEventHandler); diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf index 8c55209123..3b3d91b6ff 100644 --- a/addons/disposable/functions/fnc_replaceATWeapon.sqf +++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf @@ -21,11 +21,8 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_projectile", "_replacementTube", "_items"]; - -_unit = _this select 0; -_weapon = _this select 1; -_projectile = _this select 6; +private ["_replacementTube", "_items"]; +params ["_unit", "_weapon", "", "", "", "", "_projectile"]; if (!local _unit) exitWith {}; @@ -43,19 +40,19 @@ _unit selectWeapon _replacementTube; //Re-add all attachments to the used tube { if (_x != "") then {_unit addSecondaryWeaponItem _x}; -} forEach _items; +} count _items; // AI - Remove the ai's missle launcher tube after the missle has exploded if !([_unit] call EFUNC(common,isPlayer)) then { [{ - EXPLODE_2_PVT(_this,_params,_pfhId); - EXPLODE_3_PVT(_params,_unit,_tube,_projectile); + params ["args","_idPFH"]; + _args params ["_unit", "_tube", "_projectile"]; //don't do anything until projectile is null (exploded/max range) if (isNull _projectile) then { //Remove PFEH: - [_pfhId] 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 {}; @@ -66,13 +63,13 @@ if !([_unit] call EFUNC(common,isPlayer)) then { _container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"]; _container setPosAsl (getPosAsl _unit); _container addWeaponCargoGlobal [_tube, 1]; - + //This will duplicate attachements, because we will be adding a weapon that may already have attachments on it //We either need a way to add a clean weapon, or a way to add a fully configured weapon to a container: // { // if (_x != "") then {_container addItemCargoGlobal [_x, 1];}; // } forEach _items; - + _unit removeWeaponGlobal _tube; }; }, 1, [_unit, _replacementTube, _projectile]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf index de3875dfa0..d747b77cb1 100644 --- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf +++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf @@ -17,7 +17,8 @@ private ["_unit", "_launcher", "_config"]; -PARAMS_1(_unit); +params ["_unit"]; + if (!local _unit) exitWith {}; _launcher = secondaryWeapon _unit; diff --git a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf index 3f9d6f9802..30ef79ec01 100644 --- a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf +++ b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf @@ -16,9 +16,7 @@ #include "script_component.hpp" disableSerialization; - -PARAMS_1(_player); -DEFAULT_PARAM(1,_display,(findDisplay 602)); +params ["_player", ["_display",(findDisplay 602),[(findDisplay 602)]]] _player removeMagazines "ACE_PreloadedMissileDummy"; _player removeMagazines "ACE_FiredMissileDummy"; diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp index c0f69dda65..867914b857 100644 --- a/addons/hearing/ACE_Settings.hpp +++ b/addons/hearing/ACE_Settings.hpp @@ -2,6 +2,8 @@ class ACE_Settings { class GVAR(EnableCombatDeafness) { value = 1; typeName = "BOOL"; + displayName = CSTRING(CombatDeafness_DisplayName); + description = CSTRING(CombatDeafness_Description); }; class GVAR(EarplugsVolume) { value = 0.5; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 1cf06910b0..44ea8f734f 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -109,6 +109,27 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class DisableEarRinging { + displayName = CSTRING(DisableEarRinging); + typeName = "NUMBER"; + class values { + class DoNotForce { + default = 1; + name = ECSTRING(common,DoNotForce); + value = -1; + }; + /* Probably don't want to allow forcing ear ringing for people who have serious problems with the effect + class NotDisabled { + name = ECSTRING(common,No); + value = 0; + }; + */ + class IsDisabled { + name = ECSTRING(common,Yes); + value = 1; + }; + }; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 7b78ac581b..6ec0af0231 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -16,4 +16,9 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); +// Do Not Force - read module setting only non-default is set due to using SCALAR +if ((_logic getVariable "DisableEarRinging") != -1) then { + [_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule); +}; + diag_log text "[ACE]: Hearing Module Initialized."; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index dbd063b752..a3af102580 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -126,7 +126,7 @@ Ativar surdez em combate? - Enable combat deafness? + Reduces the hearing ability as the player takes hearing damage Możliwość chwilowej utraty słuchu przy głośnych wystrzałach i jednoczesnym braku włożonych stoperów Habilita la sordera de combate Aktiviere Taubheit im Gefecht? @@ -134,7 +134,7 @@ Ativar surdez em combate? - + Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection Głuchota bojowa pojawia się w momentach, kiedy stoimy w pobliżu broni wielkokalibrowej bez ochrony słuchu, lub np. podczas ostrzału artyleryjskiego. Moduł ten pozwala na włączenie lub wyłączenie tego efektu. Dieses Modul aktiviert/deaktiviert die Taubheit im Gefecht. Wenn aktiviert, können Spieler ohne Gehörschutz taub werden, wenn eine Waffe in ihrer Nähe abgefeuert wird oder eine Explosion stattfindet. Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat. diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp index ea4d4699ed..48f32ed13b 100644 --- a/addons/interact_menu/ACE_Settings.hpp +++ b/addons/interact_menu/ACE_Settings.hpp @@ -3,12 +3,14 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorSelfInteraction); }; class GVAR(cursorKeepCentered) { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(cursorKeepCentered); description = CSTRING(cursorKeepCenteredDescription); }; @@ -16,42 +18,49 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorInteraction); }; class GVAR(UseListMenu) { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(UseListMenu); }; class GVAR(colorTextMax) { value[] = {1, 1, 1, 1}; typeName = "COLOR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMax); }; class GVAR(colorTextMin) { value[] = {1, 1, 1, 0.25}; typeName = "COLOR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMin); }; class GVAR(colorShadowMax) { value[] = {0, 0, 0, 1}; typeName = "COLOR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMax); }; class GVAR(colorShadowMin) { value[] = {0, 0, 0, 0.25}; typeName = "COLOR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMin); }; class GVAR(textSize) { value = 2; typeName = "SCALAR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(textSize); values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; }; @@ -59,6 +68,7 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(shadowSetting); description = CSTRING(shadowSettingDescription); values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", CSTRING(shadowOutline)}; @@ -67,12 +77,14 @@ class ACE_Settings { value = 1; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(ActionOnKeyRelease); }; class GVAR(menuBackground) { value = 0; typeName = "SCALAR"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(background); values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(backgroundBlur), CSTRING(backgroundBlack)}; }; @@ -80,6 +92,7 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = LSTRING(Category_InteractionMenu); displayName = CSTRING(addBuildingActions); description = CSTRING(addBuildingActionsDescription); }; diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index 7a8278c72d..ef4dc94d9e 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_objectType,_typeNum,_parentPath,_action); +params ["_objectType", "_typeNum", "_parentPath", "_action"]; // Ensure the config menu was compiled first if (_typeNum == 0) then { diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf index 5c736a2da6..fd64c61dad 100644 --- a/addons/interact_menu/functions/fnc_addActionToObject.sqf +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_object,_typeNum,_parentPath,_action); +params ["_object", "_typeNum", "_parentPath", "_action"]; private ["_varName","_actionList"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 62d9ca1094..4da303f618 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -14,8 +14,8 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); -EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); +params ["_object", "_origAction", "_parentPath"]; +_origAction params ["_origActionData", "_origActionChildren"]; private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"]; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index cf4db7aab1..6dd4c5ee74 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp"; -EXPLODE_1_PVT(_this,_target); +params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; @@ -29,7 +29,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_position", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index a34c45f504..910b8893c6 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp"; -EXPLODE_1_PVT(_this,_target); +params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; @@ -30,7 +30,7 @@ private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index 9dc212ac40..ef7c36abc9 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -19,7 +19,7 @@ private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 6845683044..256984c104 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -26,56 +26,31 @@ */ #include "script_component.hpp" -EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); +params [ + "_actionName", + "_displayName", + "_icon", + "_statement", + "_condition", + ["_insertChildren", {}], + ["_customParams", []], + ["_position", {[0, 0, 0]}], + ["_distance", 2], + ["_params", [false, false, false, false, false]], + ["_modifierFunction", {}] +]; -// IGNORE_PRIVATE_WARNING(_target); -private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"]; - -_insertChildren = if (count _this > 5) then { - _this select 5 -} else { - {} -}; - -_customParams = if (count _this > 6) then { - _this select 6 -} else { - [] -}; - -_position = if (count _this > 7) then { - if (typeName (_this select 7) == "STRING") then { +_position = if (typeName (_position) == "STRING") then { // If the action is set to a selection, create the suitable code - compile format ["_target selectionPosition '%1'", _this select 7]; + compile format ["_target selectionPosition '%1'", _position]; } else { - if (typeName (_this select 7) == "ARRAY") then { + if (typeName (_position) == "ARRAY") then { // If the action is set to a array position, create the suitable code - compile format ["%1", _this select 7]; + compile format ["%1", _position]; } else { - _this select 7 + _position; }; - } -} else { - {[0,0,0]} -}; - -_distance = if (count _this > 8) then { - _this select 8 -} else { - 2 -}; - -_params = if (count _this > 9) then { - _this select 9 -} else { - [false,false,false,false,false] -}; - -_modifierFunction = if (count _this > 10) then { - _this select 10 -} else { - {} -}; + }; [ _actionName, diff --git a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf index b5d6a4e967..13b241e1d1 100644 --- a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf +++ b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf @@ -1,11 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_ctrl", "_index", "_text"]; - -_ctrl = _this select 0; -_index = _this select 1; -_text = _this select 2; +params ["_ctrl", "_index", "_text"]; //systemChat str (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")); diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf index b8639754d2..66738f6cf9 100644 --- a/addons/interact_menu/functions/fnc_findActionNode.sqf +++ b/addons/interact_menu/functions/fnc_findActionNode.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_actionTreeList,_parentPath); +params ["_actionTreeList", "_parentPath"]; private ["_parentNode", "_foundParentNode", "_fnc_findFolder", "_actionTree"]; @@ -31,10 +31,10 @@ _parentNode = [[],_actionTreeList]; _foundParentNode = false; _fnc_findFolder = { - EXPLODE_3_PVT(_this,_parentPath,_level,_actionNode); + params ["_parentPath", "_level", "_actionNode"]; { - EXPLODE_2_PVT(_x,_actionData,_actionChildren); + _x params ["_actionData", "_actionChildren"]; if ((_actionData select 0) isEqualTo (_parentPath select _level)) exitWith { if (count _parentPath == _level + 1) exitWith { diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf index cb21d218db..a0962d7883 100644 --- a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_newUnit,_oldUnit); +params ["_newUnit", "_oldUnit"]; // add to new unit private "_ehid"; diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf index ec22b0aa9e..0a02fe2ea7 100644 --- a/addons/interact_menu/functions/fnc_isSubPath.sqf +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_longPath,_shortPath); +params ["_longPath", "_shortPath"]; private ["_isSubPath","_i"]; _isSubPath = true; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 5bf156b69e..ca06e25eb6 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_menuType); +params ["_menuType"]; if (GVAR(openedMenuType) == _menuType) exitWith {true}; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 02e2d4db01..86580afa67 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -private "_calledByClicking"; -_calledByClicking = _this select 1; +params ["_menuType", "_calledByClicking"]; // Exit if there's no menu opened if (GVAR(openedMenuType) < 0) exitWith {true}; diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 3959d7d0b1..c95f53f152 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); +params ["_objectType", "_typeNum", "_fullPath"]; private ["_res","_varName","_actionTrees", "_parentNode", "_found"]; _res = _fullPath call FUNC(splitPath); -EXPLODE_2_PVT(_res,_parentPath,_actionName); +_res params ["_parentPath", "_actionName"]; _varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; _actionTrees = missionNamespace getVariable [_varName, []]; diff --git a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf index bab740c578..e630bf4ad1 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_object,_typeNum,_fullPath); +params ["_object", "_typeNum", "_fullPath"]; private ["_res","_varName","_actionList"]; _res = _fullPath call FUNC(splitPath); -EXPLODE_2_PVT(_res,_parentPath,_actionName); +_res params ["_parentPath", "_actionName"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _actionList = _object getVariable [_varName, []]; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 80bff14793..81a6887f97 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -78,7 +78,7 @@ _fnc_renderNearbyActions = { _fnc_renderLastFrameActions = { { - EXPLODE_3_PVT(_x,_target,_action,_objectActionList); + _x params ["_target", "_action", "_objectActionList"]; GVAR(objectActionList) = _objectActionList; [_target, _action] call FUNC(renderBaseMenu); @@ -176,6 +176,6 @@ if (count GVAR(collectedActionPoints) > 1) then { // Render the non-ocluded points { - EXPLODE_3_PVT(_x,_z,_sPos,_activeActionTree); + _x params ["_z", "_sPos", "_activeActionTree"]; [[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu); } forEach GVAR(collectedActionPoints); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 5330bbebd2..a5ccabf3bf 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -18,8 +18,8 @@ BEGIN_COUNTER(fnc_renderBaseMenu) private ["_distance","_pos","_weaponDir","_ref","_sPos","_activeActionTree", "_line"]; -EXPLODE_2_PVT(_this,_object,_baseActionNode); -EXPLODE_1_PVT(_baseActionNode,_actionData); +params ["_object", "_baseActionNode"]; +_baseActionNode params ["_actionData"]; _distance = _actionData select 8; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 44a280a52e..ab909964de 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -16,7 +16,8 @@ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) private ["_ctrl", "_pos", "_displayNum"]; -PARAMS_4(_text,_icon,_sPos,_textSettings); + +params ["_text", "_icon", "_sPos", "_textSettings"]; //systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1]; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index a82b82dcb7..21c434fe03 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -17,9 +17,9 @@ private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_target", "_textSettings"]; -EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles); -EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); -EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); +params ["_parentPath", "_action", "_sPos", "_angles"]; +_action params ["_actionData", "_activeChildren", "_actionObject"]; +_angles params ["_centerAngle", "_maxAngleSpan"]; _menuDepth = (count GVAR(menuDepthPath)); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 96a495c715..17ded20903 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_sPos,_icon); +params ["_sPos", "_icon"]; private ["_displayNum", "_ctrl", "_pos"]; diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index e54d529668..c23d68cfd3 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -16,7 +16,7 @@ private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_text //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { - PARAMS_3(_color1,_color2,_ratio); + params ["_color1", "_color2", "_ratio"]; private ["_return", "_mix", "_index"]; _return = ""; for "_index" from 0 to 3 do { diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf index 9143db0d4d..fdd7d14573 100644 --- a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; //Ignore if not enabled: if (!GVAR(addBuildingActions)) exitWith {}; @@ -27,8 +27,8 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; [{ private ["_nearBuidlings", "_typeOfHouse", "_houseBeingScaned", "_actionSet", "_memPoints", "_memPointsActions", "_helperPos", "_helperObject"]; - PARAMS_2(_args,_pfID); - EXPLODE_4_PVT(_args,_setPosition,_addedHelpers,_housesScaned,_housesToScanForActions); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedHelpers", "_housesScaned", "_housesToScanForActions"]; if (!EGVAR(interact_menu,keyDown)) then { {deleteVehicle _x;} forEach _addedHelpers; @@ -75,7 +75,7 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; _housesScaned pushBack _houseBeingScaned; _actionSet = [_typeOfHouse] call FUNC(userActions_getHouseActions); - EXPLODE_2_PVT(_actionSet,_memPoints,_memPointsActions); + _actionSet params ["_memPoints", "_memPointsActions"]; // systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime]; { diff --git a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf index 0b3d4347c7..dee82fd939 100644 --- a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_typeOfBuilding); +params ["_typeOfBuilding"]; private["_action", "_actionDisplayName", "_actionDisplayNameDefault", "_actionMaxDistance", "_actionOffset", "_actionPath", "_actionPosition", "_building", "_configPath", "_endIndex", "_iconImage", "_index", "_ladders", "_memPointIndex", "_memPoints", "_memPointsActions", "_startIndex"]; @@ -24,7 +24,7 @@ _memPointsActions = []; //Get the offset for a memory point: _fnc_getMemPointOffset = { - PARAMS_1(_memoryPoint); + params ["_memoryPoint"]; _memPointIndex = _memPoints find _memoryPoint; _actionOffset = [0,0,0]; if (_memPointIndex == -1) then { @@ -38,14 +38,14 @@ _fnc_getMemPointOffset = { // Add UserActions for the building: _fnc_userAction_Statement = { - PARAMS_3(_target,_player,_variable); - EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + params ["_target", "_player", "_variable"]; + _variable params ["_actionStatement", "_actionCondition"]; this = _target getVariable [QGVAR(building), objNull]; call _actionStatement; }; _fnc_userAction_Condition = { - PARAMS_3(_target,_player,_variable); - EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + params ["_target", "_player", "_variable"]; + _variable params ["_actionStatement", "_actionCondition"]; this = _target getVariable [QGVAR(building), objNull]; if (isNull this) exitWith {false}; call _actionCondition; @@ -84,29 +84,29 @@ for "_index" from 0 to ((count _configPath) - 1) do { // Add Ladder Actions for the building: _fnc_ladder_ladderUp = { - PARAMS_3(_target,_player,_variable); - EXPLODE_1_PVT(_variable,_ladderIndex); + params ["_target", "_player", "_variable"]; + _variable params ["_ladderIndex"]; _building = _target getVariable [QGVAR(building), objNull]; TRACE_3("Ladder Action - UP",_player,_building,_ladderIndex); _player action ["LadderUp", _building, _ladderIndex, 0]; }; _fnc_ladder_ladderDown = { - PARAMS_3(_target,_player,_variable); - EXPLODE_1_PVT(_variable,_ladderIndex); + params ["_target", "_player", "_variable"]; + _variable params ["_ladderIndex"]; _building = _target getVariable [QGVAR(building), objNull]; TRACE_3("Ladder Action - Down",_player,_building,_ladderIndex); _player action ["LadderDown", _building, _ladderIndex, 1]; }; _fnc_ladder_conditional = { - PARAMS_2(_target,_player); + params ["_target", "_player"]; //(Check distance < 2) and (Don't show actions if on a ladder) ((_target distance _player) < 2) && {((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _player) >> "onLadder")) == 0)} }; _ladders = getArray (configFile >> "CfgVehicles" >> _typeOfBuilding >> "ladders"); { - EXPLODE_2_PVT(_x,_ladderBottomMemPoint,_ladderTopMemPoint); + _x params ["_ladderBottomMemPoint", "_ladderTopMemPoint"]; _actionMaxDistance = 3; //interact_menu will check head -> target's offset; leave this high and do a precice distance check in condition diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index b55e8483a1..5bd8aefe21 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -267,5 +267,9 @@ Přidá možnost interakce pro otevření dvěří a umistňovat žebříky na budovy. (Poznámka: Použití této možnosti snižuje výkon při otevírání pomocí interakčního menu, zejména ve velkých městech.) Añade las acciones de interacción para la apertura de puertas y montaje de escaleras en los edificios. (Nota: Hay un coste de rendimiento al abrir el menú de interacción, especialmente en las ciudades) + + Interaction Menu + Menu interakcji + - + \ No newline at end of file diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 17c271f372..6a492b14ad 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -91,7 +91,7 @@ class CfgVehicles { class ACE_JoinGroup { displayName = CSTRING(JoinGroup); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + condition = QUOTE(GVAR(EnableTeamManagement) && {[ARR_2(_player,_target)] call DFUNC(canJoinGroup)}); statement = QUOTE([_player] joinSilent group _target); showDisabled = 0; priority = 2.6; @@ -351,7 +351,7 @@ class CfgVehicles { hotkey = "7"; }; class ACE_Gesture_Yes { - displayName = CSTRING(Gestures_Yes); + displayName = ECSTRING(common,Yes); condition = QUOTE(canStand _target); statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); showDisabled = 1; @@ -359,7 +359,7 @@ class CfgVehicles { hotkey = "8"; }; class ACE_Gesture_No { - displayName = CSTRING(Gestures_No); + displayName = ECSTRING(common,No); condition = QUOTE(canStand _target); statement = QUOTE(_target playActionNow 'gestureNo';); showDisabled = 1; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 5bd3282872..4f1df733b7 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -385,30 +385,6 @@ Olá Ciao - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - Put weapon on back Waffe wegstecken diff --git a/addons/maptools/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf index 30d86160ab..7658c2c1d2 100644 --- a/addons/maptools/functions/fnc_canUseMapTools.sqf +++ b/addons/maptools/functions/fnc_canUseMapTools.sqf @@ -14,7 +14,13 @@ visibleMap && {alive ACE_player} && -{"ItemMap" in (assignedItems ACE_player)} && +{ + scopeName "hasMap"; + { + if (_x isKindOf ["ItemMap", configFile >> "CfgWeapons"]) exitWith {true breakOut "hasMap"}; + } forEach (assignedItems ACE_player); + false +} && {"ACE_MapTools" in (items ACE_player)} && {!GVAR(mapTool_isDragging)} && {!GVAR(mapTool_isRotating)} diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 079ae40506..d94ba333d2 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -4,8 +4,9 @@ class ACE_Medical_Actions { class Bandage { displayName = CSTRING(Bandage); displayNameProgress = CSTRING(Bandaging); - + category = "bandage"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"All"}; requiredMedic = 0; treatmentTime = 5; treatmentTimeSelfCoef = 1; @@ -25,11 +26,13 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; }; class Morphine: Bandage { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; treatmentTime = 2; items[] = {"ACE_morphine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); @@ -39,6 +42,8 @@ class ACE_Medical_Actions { class Epinephrine: Bandage { displayName = CSTRING(Inject_Epinephrine); displayNameProgress = CSTRING(Injecting_Epinephrine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; requiredMedic = 1; treatmentTime = 3; items[] = {"ACE_epinephrine"}; @@ -49,6 +54,8 @@ class ACE_Medical_Actions { class BloodIV: Bandage { displayName = CSTRING(Transfuse_Blood); displayNameProgress = CSTRING(Transfusing_Blood); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "advanced"; requiredMedic = 1; treatmentTime = 20; items[] = {"ACE_bloodIV"}; @@ -57,14 +64,17 @@ class ACE_Medical_Actions { litter[] = {}; }; class BloodIV_500: BloodIV { + category = "advanced"; items[] = {"ACE_bloodIV_500"}; }; class BloodIV_250: BloodIV { + category = "advanced"; items[] = {"ACE_bloodIV_250"}; }; class BodyBag: Bandage { displayName = CSTRING(PlaceInBodyBag); displayNameProgress = CSTRING(PlacingInBodyBag); + category = "advanced"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 4; @@ -81,7 +91,9 @@ class ACE_Medical_Actions { class Diagnose: Bandage { displayName = CSTRING(Actions_Diagnose); displayNameProgress = CSTRING(Actions_Diagnosing); + category = "examine"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"head"}; requiredMedic = 0; treatmentTime = 1; items[] = {}; @@ -97,10 +109,12 @@ class ACE_Medical_Actions { class Advanced { class FieldDressing { - displayName = CSTRING(Bandage); + displayName = CSTRING(Actions_FieldDressing); displayNameProgress = CSTRING(Bandaging); + category = "bandage"; // Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All. treatmentLocations[] = {"All"}; + allowedSelections[] = {"All"}; // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor requiredMedic = 0; // The time it takes for a treatment action to complete. Time is in seconds. @@ -121,20 +135,26 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; }; class PackingBandage: fieldDressing { + displayName = CSTRING(Actions_PackingBandage); items[] = {"ACE_packingBandage"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_packingBandage"}}}; }; class ElasticBandage: fieldDressing { + displayName = CSTRING(Actions_ElasticBandage); items[] = {"ACE_elasticBandage"}; }; class QuikClot: fieldDressing { + displayName = CSTRING(Actions_QuikClot); items[] = {"ACE_quikclot"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_QuickClot"}}}; }; class Tourniquet: fieldDressing { displayName = CSTRING(Apply_Tourniquet); displayNameProgress = CSTRING(Applying_Tourniquet); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r", "body"}; items[] = {"ACE_tourniquet"}; treatmentTime = 6; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); @@ -144,6 +164,8 @@ class ACE_Medical_Actions { class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; items[] = {"ACE_morphine"}; treatmentTime = 3; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication)); @@ -163,8 +185,10 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: fieldDressing { - displayName = CSTRING(Transfuse_Blood); + displayName = CSTRING(Actions_Blood4_1000); displayNameProgress = CSTRING(Transfusing_Blood); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "advanced"; items[] = {"ACE_bloodIV"}; requiredMedic = 1; treatmentTime = 7; @@ -173,38 +197,45 @@ class ACE_Medical_Actions { litter[] = {}; }; class BloodIV_500: BloodIV { + displayName = CSTRING(Actions_Blood4_500); items[] = {"ACE_bloodIV_500"}; }; class BloodIV_250: BloodIV { + displayName = CSTRING(Actions_Blood4_250); items[] = {"ACE_bloodIV_250"}; }; class PlasmaIV: BloodIV { - displayName = CSTRING(Transfuse_Plasma); + displayName = CSTRING(Actions_Plasma4_1000); displayNameProgress = CSTRING(Transfusing_Plasma); items[] = {"ACE_plasmaIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class PlasmaIV_500: PlasmaIV { + displayName = CSTRING(Actions_Plasma4_500); items[] = {"ACE_plasmaIV_500"}; }; class PlasmaIV_250: PlasmaIV { + displayName = CSTRING(Actions_Plasma4_250); items[] = {"ACE_plasmaIV_250"}; }; class SalineIV: BloodIV { - displayName = CSTRING(Transfuse_Saline); + displayName = CSTRING(Actions_Saline4_1000); displayNameProgress = CSTRING(Transfusing_Saline); items[] = {"ACE_salineIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class SalineIV_500: SalineIV { + displayName = CSTRING(Actions_Saline4_500); items[] = {"ACE_salineIV_500"}; }; class SalineIV_250: SalineIV { + displayName = CSTRING(Actions_Saline4_250); items[] = {"ACE_salineIV_250"}; }; class SurgicalKit: fieldDressing { - displayName = ""; + displayName = CSTRING(Use_SurgicalKit); displayNameProgress = CSTRING(TreatmentAction); + category = "advanced"; items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; requiredMedic = QGVAR(medicSetting_SurgicalKit); @@ -217,8 +248,9 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }}; }; class PersonalAidKit: fieldDressing { - displayName = ""; + displayName = CSTRING(Use_Aid_Kit); displayNameProgress = CSTRING(TreatmentAction); + category = "advanced"; items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QGVAR(useLocation_PAK)}; requiredMedic = QGVAR(medicSetting_PAK); @@ -232,11 +264,16 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = ""; animationCallerSelfProne = ""; - litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + 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"}} + }; }; class CheckPulse: fieldDressing { - displayName = ""; + displayName = CSTRING(Actions_CheckPulse); displayNameProgress = CSTRING(Check_Pulse_Content); + category = "examine"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -246,27 +283,36 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; animationCaller = ""; // TODO + animationCallerProne = ""; + animationCallerSelfProne = ""; itemConsumed = 0; litter[] = {}; }; class CheckBloodPressure: CheckPulse { + displayName = CSTRING(Actions_CheckBloodPressure); callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); displayNameProgress = CSTRING(Check_Bloodpressure_Content); }; class CheckResponse: CheckPulse { + displayName = CSTRING(Check_Response); callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); displayNameProgress = CSTRING(Check_Response_Content); }; - class RemoveTourniquet: CheckPulse { + class RemoveTourniquet: Tourniquet { + displayName = CSTRING(Actions_RemoveTourniquet); + items[] = {}; treatmentTime = 2.5; callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet)); condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)); displayNameProgress = CSTRING(RemovingTourniquet); + litter[] = {}; }; class CPR: fieldDressing { displayName = CSTRING(Actions_CPR); displayNameProgress = CSTRING(Actions_PerformingCPR); + category = "advanced"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"body"}; requiredMedic = 0; treatmentTime = 15; items[] = {}; @@ -286,6 +332,7 @@ class ACE_Medical_Actions { class BodyBag: fieldDressing { displayName = CSTRING(PlaceInBodyBag); displayNameProgress = CSTRING(PlacingInBodyBag); + category = "advanced"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -817,9 +864,9 @@ class ACE_Medical_Advanced { // specific details for the ACE_Morphine treatment action class Morphine { painReduce = 15; - hrIncreaseLow[] = {-10, -30, 35}; - hrIncreaseNormal[] = {-10, -50, 40}; - hrIncreaseHigh[] = {-10, -40, 50}; + hrIncreaseLow[] = {-10, -20, 35}; + hrIncreaseNormal[] = {-10, -30, 35}; + hrIncreaseHigh[] = {-10, -35, 50}; timeInSystem = 900; maxDose = 4; inCompatableMedication[] = {}; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index fcaba03aa0..23b7cf8a4f 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -1,94 +1,116 @@ class ACE_Settings { class GVAR(level) { + category = LSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Basic", "Advanced"}; }; class GVAR(medicSetting) { + category = LSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Normal", "Advanced"}; }; class GVAR(enableFor) { + category = LSTRING(Category_Medical); value = 0; typeName = "SCALAR"; values[] = {"Players only", "Players and AI"}; }; class GVAR(enableOverdosing) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(bleedingCoefficient) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(painCoefficient) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableAirway) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableFractures) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableAdvancedWounds) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableVehicleCrashes) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(enableScreams) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(playerDamageThreshold) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(AIDamageThreshold) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableUnconsciousnessAI) { + category = LSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "50/50", "Enabled"}; }; class GVAR(remoteControlledAI) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(preventInstaDeath) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(enableRevive) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"Disabled", "Players only", "Players and AI"}; }; class GVAR(maxReviveTime) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 120; }; class GVAR(amountOfReviveLives) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = -1; }; class GVAR(allowDeadBodyMovement) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(allowLitterCreation) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(litterSimulationDetail) { + category = LSTRING(Category_Medical); displayName = CSTRING(litterSimulationDetail); description = CSTRING(litterSimulationDetail_Desc); typeName = "SCALAR"; @@ -100,40 +122,48 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(litterCleanUpDelay) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 0; }; class GVAR(medicSetting_PAK) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(medicSetting_SurgicalKit) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(consumeItem_PAK) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(consumeItem_SurgicalKit) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(useLocation_PAK) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 3; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useLocation_SurgicalKit) { + category = LSTRING(Category_Medical); typeName = "SCALAR"; value = 2; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useCondition_PAK) { + category = LSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description); typeName = "SCALAR"; @@ -141,6 +171,7 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(useCondition_SurgicalKit) { + category = LSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description); typeName = "SCALAR"; @@ -148,20 +179,24 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(keepLocalSettingsSynced) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(healHitPointAfterAdvBandage) { + category = LSTRING(Category_Medical); displayName = CSTRING(healHitPointAfterAdvBandage); typeName = "BOOL"; value = 0; }; class GVAR(painIsOnlySuppressed) { + category = LSTRING(Category_Medical); displayName = CSTRING(painIsOnlySuppressed); typeName = "BOOL"; value = 1; }; class GVAR(painEffectType) { + category = LSTRING(Category_Medical); displayName = CSTRING(painEffectType); typeName = "SCALAR"; value = 0; @@ -169,15 +204,18 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(allowUnconsciousAnimationOnTreatment) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(moveUnitsFromGroupOnUnconscious) { + category = LSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(menuTypeStyle) { + category = LSTRING(Category_Medical); displayName = CSTRING(menuTypeDisplay); description = CSTRING(menuTypeDescription); typeName = "SCALAR"; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index aab193c098..aef45b115d 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -92,7 +92,7 @@ class CfgVehicles { typeName = "NUMBER"; class values { class disable { - name = CSTRING(disabled); + name = ECSTRING(common,Disabled); value = 0; }; class normal { @@ -101,7 +101,7 @@ class CfgVehicles { default = 1; }; class full { - name = CSTRING(enabled); + name = ECSTRING(common,Enabled); value = 2; }; }; @@ -198,8 +198,8 @@ class CfgVehicles { description = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_Description); typeName = "NUMBER"; class values { - class keep { name = CSTRING(No); value = 0; }; - class remove { name = CSTRING(Yes); value = 1; default = 1; }; + class keep { name = ECSTRING(common,No); value = 0; }; + class remove { name = ECSTRING(common,Yes); value = 1; default = 1; }; }; }; class useCondition_PAK { @@ -220,7 +220,7 @@ class CfgVehicles { class vehicle { name = CSTRING(AdvancedMedicalSettings_vehicle); value = 1; }; class facility { name = CSTRING(AdvancedMedicalSettings_facility); value = 2; }; class vehicleAndFacility { name = CSTRING(AdvancedMedicalSettings_vehicleAndFacility); value = 3; default = 1; }; - class disabled { name = CSTRING(AdvancedMedicalSettings_disabled); value = 4;}; + class disabled { name = ECSTRING(common,Disabled); value = 4;}; }; }; class medicSetting_SurgicalKit: medicSetting_PAK { @@ -280,7 +280,7 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 0; class values { - class disable { name = CSTRING(disabled); value = 0; default = 1;}; + class disable { name = ECSTRING(common,Disabled); value = 0; default = 1;}; class playerOnly { name = CSTRING(playeronly); value = 1; }; class playerAndAI { name = CSTRING(playersandai); value = 2; }; }; @@ -373,11 +373,11 @@ class CfgVehicles { typeName = "NUMBER"; class values { class none { - name = CSTRING(No); + name = ECSTRING(common,No); value = 0; }; class medic { - name = CSTRING(Yes); + name = ECSTRING(common,Yes); value = 1; default = 1; }; @@ -717,6 +717,9 @@ class CfgVehicles { destrType = "DestructNo"; model = QUOTE(PATHTOF(data\littergeneric.p3d)); }; + class ACE_MedicalLitter_clean: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_clean.p3d)); + }; class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase { model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d)); }; diff --git a/addons/medical/data/ace_litterclean_co.paa b/addons/medical/data/ace_litterclean_co.paa new file mode 100644 index 0000000000..68fb2a2b22 Binary files /dev/null and b/addons/medical/data/ace_litterclean_co.paa differ diff --git a/addons/medical/data/littergeneric_clean.p3d b/addons/medical/data/littergeneric_clean.p3d new file mode 100644 index 0000000000..7fa6fb3e91 Binary files /dev/null and b/addons/medical/data/littergeneric_clean.p3d differ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 19bd75caad..82edd1749f 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -58,4 +58,5 @@ if ([_caller] call FUNC(isMedic)) then { 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); }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 9af18d0a6d..d759bf1bc8 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -50,4 +50,5 @@ if (_heartRate > 1.0) then { if (_logOutPut != "") then { [_unit,"activity", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); + [_unit,"quick_view", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 2d62df12f6..b5df63047e 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -28,3 +28,4 @@ if ([_target] call EFUNC(common,isAwake)) then { ["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); diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 4795ccc561..e0cab95420 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition", "_allowedSelections"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -44,6 +44,8 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; +_allowedSelections = getArray (_config >> "allowedSelections"); +if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; _return = true; if (getText (_config >> "condition") != "") then { diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 6797785763..a3b71b7f9c 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -16,12 +16,13 @@ #define MIN_ENTRIES_LITTER_CONFIG 3 -private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems"]; +private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems", "_previousDamage"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; _className = _this select 3; _usersOfItems = _this select 5; +_previousDamage = _this select 6; if !(GVAR(allowLitterCreation)) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; @@ -76,7 +77,7 @@ _createdLitter = []; _litterCondition = missionNamespace getvariable _litterCondition; if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; }; - if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {}; + if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {}; if (typeName _litterOptions == "ARRAY") then { // Loop through through the litter options and place the litter diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index cf8acd0969..d7595ec439 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -31,6 +31,7 @@ if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { GVAR(allCreatedLitter) pushBack [ACE_time, [_litterObject]]; if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { + GVAR(litterPFHRunning) = true; [{ { if (ACE_time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 18f3406df2..9c218de540 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition", "_allowedSelections"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -49,6 +49,9 @@ _medicRequired = if (isNumber (_config >> "requiredMedic")) then { if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; +_allowedSelections = getArray (_config >> "allowedSelections"); +if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; + // Check item _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; @@ -156,7 +159,7 @@ if (_caller == _target) then { _callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE"); }; -_caller setvariable [QGVAR(selectedWeaponOnTreatment), currentWeapon _caller]; +_caller setvariable [QGVAR(selectedWeaponOnTreatment), (weaponState _caller)]; // Cannot use secondairy weapon for animation if (currentWeapon _caller == secondaryWeapon _caller) then { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 61723319a5..c3151f2c90 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -31,4 +31,7 @@ if (random(1)>= 0.6) exitwith { _target setvariable [QGVAR(bloodPressure), [50,70]]; }; +[_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 + true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6b6b7adb81..1278994a11 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -38,5 +38,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }foreach _items;*/ [_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 true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index 544ef6ae55..df7594921d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -68,4 +68,7 @@ if (alive _target) exitwith { // 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 }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index e3d07616f3..0b401a73cc 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -29,9 +29,10 @@ _items = _this select 4; { 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); }; }foreach _items; -[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index fc6b91b057..e0c4d20ed6 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -30,3 +30,4 @@ _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 diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index cab44d3295..148ed06252 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -44,6 +44,7 @@ _removeItem = _items select 0; [_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 true; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index dd49729686..8a5d784301 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -44,9 +44,14 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); -if (_weaponSelect != "") then { - _caller selectWeapon _weaponSelect; +_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]; + //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) + if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; + if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; + }; } else { _caller action ["SwitchWeapon", _caller, _caller, 99]; }; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 19c12d9299..f5cb9baf71 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -42,9 +42,14 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); -if (_weaponSelect != "") then { - _caller selectWeapon _weaponSelect; +_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]; + //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) + if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; + if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; + }; } else { _caller action ["SwitchWeapon", _caller, _caller, 99]; }; @@ -62,11 +67,24 @@ if (isNil _callback) then { _callback = missionNamespace getvariable _callback; }; -_args call _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}; +}; +_args call _callback; +_args pushBack _previousDamage; _args call FUNC(createLitter); //If we're not already tracking vitals, start: if (!(_target getvariable [QGVAR(addedToUnitLoop),false])) then { [_target] call FUNC(addToInjuredCollection); }; + +["medical_treatmentSuccess", [_caller, _target, _selectionName, _className]] call EFUNC(common,localEvent); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 9f161d032d..b852c27f96 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -2928,24 +2928,6 @@ Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy? Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče? - - Disabled - Отключено - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - - - Enabled - Включено - Włączone - Activado - Aktiviert - Povoleno - Ativado - Prevent instant death Отключить мгновенную смерть @@ -3237,15 +3219,6 @@ Vozidla a zařízení Veículos e instalações - - Disabled - Отключено - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - Allow Surgical kit (Adv) Разрешить хирургический набор (усл.) @@ -3612,30 +3585,6 @@ [ACE] Zdravotnické zásoby (pokročilé) [ACE] Caixa com suprimentos médicos (Avançados) - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - Anytime Kdykoli @@ -3648,5 +3597,17 @@ Estable Po stabilizacji + + Medical + Zdravotní + Médical + Sanitäter + Medico + Medyczne + Médico + Медик + Médico + Orvosi + diff --git a/addons/medical/ui/body_background.png b/addons/medical/ui/body_background.png deleted file mode 100644 index 65791a01c0..0000000000 Binary files a/addons/medical/ui/body_background.png and /dev/null differ diff --git a/addons/medical_menu/$PBOPREFIX$ b/addons/medical_menu/$PBOPREFIX$ new file mode 100644 index 0000000000..6ca7434932 --- /dev/null +++ b/addons/medical_menu/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\medical_menu \ No newline at end of file diff --git a/addons/medical_menu/ACE_Settings.hpp b/addons/medical_menu/ACE_Settings.hpp new file mode 100644 index 0000000000..1f2b9cc3ea --- /dev/null +++ b/addons/medical_menu/ACE_Settings.hpp @@ -0,0 +1,25 @@ + +class ACE_Settings { + class GVAR(allow) { + displayName = CSTRING(allow); + description = CSTRING(allow_Descr); + value = 1; + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + }; + class GVAR(useMenu) { + displayName = CSTRING(useMenu); + description = CSTRING(useMenu_Descr); + value = 0; + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + isClientSettable = 1; + }; + class GVAR(openAfterTreatment) { + displayName = CSTRING(openAfterTreatment); + description = CSTRING(openAfterTreatment_Descr); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; +}; diff --git a/addons/medical_menu/CfgEventHandlers.hpp b/addons/medical_menu/CfgEventHandlers.hpp new file mode 100644 index 0000000000..7392999c9a --- /dev/null +++ b/addons/medical_menu/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/medical_menu/CfgVehicles.hpp b/addons/medical_menu/CfgVehicles.hpp new file mode 100644 index 0000000000..7bbe7db2ad --- /dev/null +++ b/addons/medical_menu/CfgVehicles.hpp @@ -0,0 +1,70 @@ + +class CfgVehicles { + + class ACE_Module; + class ACE_moduleMedicalMenuSettings: ACE_Module { + scope = 2; + displayName = CSTRING(module_DisplayName); + icon = QUOTE(PATHTOEF(medical,UI\Icon_Module_Medical_ca.paa)); + category = "ACE_medical"; + function = QUOTE(DFUNC(module)); + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class allow { + displayName = CSTRING(allow); + description = CSTRING(allow_Descr); + typeName = "NUMBER"; + class values { + class disable { + name = ECSTRING(common,Disabled); + value = 0; + }; + class enable { + name = ECSTRING(common,Enabled); + value = 1; + default = 1; + }; + class VehiclesOnly { + name = ECSTRING(common,VehiclesOnly); + value = 2; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(module_Desc); + sync[] = {}; + }; + }; + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class Medical_Menu { + displayName = CSTRING(OpenMenu); + runOnHover = 0; + exceptions[] = {"isNotInside"}; + condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); + statement = QUOTE([_target] call DFUNC(openMenu)); + icon = PATHTOEF(medical,UI\icons\medical_cross.paa); + }; + }; + + class ACE_Actions { + // Create a consolidates medical menu for treatment while boarded + class ACE_MainActions { + class Medical_Menu { + displayName = CSTRING(OpenMenu); + runOnHover = 0; + exceptions[] = {"isNotInside"}; + condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); + statement = QUOTE([_target] call DFUNC(openMenu)); + icon = PATHTOEF(medical,UI\icons\medical_cross.paa); + }; + }; + }; + }; +}; diff --git a/addons/medical_menu/README.md b/addons/medical_menu/README.md new file mode 100644 index 0000000000..0755083712 --- /dev/null +++ b/addons/medical_menu/README.md @@ -0,0 +1,10 @@ +ace_medical_menu +=============== + +Provides the CSE medical menu for the advanced medical system. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf new file mode 100644 index 0000000000..a72c1a8887 --- /dev/null +++ b/addons/medical_menu/XEH_postInit.sqf @@ -0,0 +1,34 @@ +#include "script_component.hpp" + +if (!hasInterface) exitwith {}; + +["medical_treatmentSuccess", { + + if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { + GVAR(pendingReopen) = false; + [{ + [GVAR(INTERACTION_TARGET)] call FUNC(openMenu); + }, []] call EFUNC(common,execNextFrame); + }; +}] call EFUNC(common,addEventhandler); + + +["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), +{ + _target = cursorTarget; + if (!(_target isKindOf "CAManBase") || ACE_player distance _target > 10) then {_target = ACE_player}; + // Conditions: canInteract + if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; + + // Statement + [_target] call FUNC(openMenu); + false +}, +{ + if (ACE_time - GVAR(lastOpenedOn) > 0.5) then { + [ObjNull] call FUNC(openMenu); + }; +}, +[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; + diff --git a/addons/medical_menu/XEH_preInit.sqf b/addons/medical_menu/XEH_preInit.sqf new file mode 100644 index 0000000000..c231c7df6e --- /dev/null +++ b/addons/medical_menu/XEH_preInit.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(onMenuOpen); +PREP(openMenu); + +PREP(canOpenMenu); +PREP(updateIcons); +PREP(updateUIInfo); +PREP(handleUI_DisplayOptions); +PREP(handleUI_dropDownTriageCard); +PREP(getTreatmentOptions); +PREP(updateActivityLog); +PREP(updateQuickViewLog); +PREP(updateBodyImage); +PREP(updateInformationLists); +PREP(setTriageStatus); +PREP(collectActions); +PREP(module); + +GVAR(INTERACTION_TARGET) = objNull; +GVAR(actionsOther) = []; +GVAR(actionsSelf) = []; +GVAR(selectedBodyPart) = 0; + +call FUNC(collectActions); + +ADDON = true; diff --git a/addons/medical_menu/config.cpp b/addons/medical_menu/config.cpp new file mode 100644 index 0000000000..27e0db03b9 --- /dev/null +++ b/addons/medical_menu/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_medical"}; + author[] = {$STR_ACE_Common_ACETeam, "Glowbal"}; + authorUrl = "http://ace3mod.com"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ui\menu.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/medical_menu/data/background_img.paa b/addons/medical_menu/data/background_img.paa new file mode 100644 index 0000000000..de59065e3b Binary files /dev/null and b/addons/medical_menu/data/background_img.paa differ diff --git a/addons/medical_menu/data/icons/advanced_treatment_small.paa b/addons/medical_menu/data/icons/advanced_treatment_small.paa new file mode 100644 index 0000000000..8becb9d2df Binary files /dev/null and b/addons/medical_menu/data/icons/advanced_treatment_small.paa differ diff --git a/addons/medical_menu/data/icons/airway_management_small.paa b/addons/medical_menu/data/icons/airway_management_small.paa new file mode 100644 index 0000000000..ab4da47958 Binary files /dev/null and b/addons/medical_menu/data/icons/airway_management_small.paa differ diff --git a/addons/medical_menu/data/icons/bandage_fracture_small.paa b/addons/medical_menu/data/icons/bandage_fracture_small.paa new file mode 100644 index 0000000000..a869f260ec Binary files /dev/null and b/addons/medical_menu/data/icons/bandage_fracture_small.paa differ diff --git a/addons/medical_menu/data/icons/examine_patient_small.paa b/addons/medical_menu/data/icons/examine_patient_small.paa new file mode 100644 index 0000000000..2e9fc9831d Binary files /dev/null and b/addons/medical_menu/data/icons/examine_patient_small.paa differ diff --git a/addons/medical_menu/data/icons/icon_advanced_treatment.paa b/addons/medical_menu/data/icons/icon_advanced_treatment.paa new file mode 100644 index 0000000000..d6bf6effd9 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_advanced_treatment.paa differ diff --git a/addons/medical_menu/data/icons/icon_airway_management.paa b/addons/medical_menu/data/icons/icon_airway_management.paa new file mode 100644 index 0000000000..f444f5f385 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_airway_management.paa differ diff --git a/addons/medical_menu/data/icons/icon_bandage_fracture.paa b/addons/medical_menu/data/icons/icon_bandage_fracture.paa new file mode 100644 index 0000000000..df8d1de571 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_bandage_fracture.paa differ diff --git a/addons/medical_menu/data/icons/icon_bleeding.paa b/addons/medical_menu/data/icons/icon_bleeding.paa new file mode 100644 index 0000000000..d11c2ed496 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_bleeding.paa differ diff --git a/addons/medical_menu/data/icons/icon_carry.paa b/addons/medical_menu/data/icons/icon_carry.paa new file mode 100644 index 0000000000..7ebb830b03 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_carry.paa differ diff --git a/addons/medical_menu/data/icons/icon_examine_patient.paa b/addons/medical_menu/data/icons/icon_examine_patient.paa new file mode 100644 index 0000000000..12eb06c890 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_examine_patient.paa differ diff --git a/addons/medical_menu/data/icons/icon_medication.paa b/addons/medical_menu/data/icons/icon_medication.paa new file mode 100644 index 0000000000..98893ad863 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_medication.paa differ diff --git a/addons/medical_menu/data/icons/icon_toggle_self.paa b/addons/medical_menu/data/icons/icon_toggle_self.paa new file mode 100644 index 0000000000..3078eb5dd5 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_toggle_self.paa differ diff --git a/addons/medical_menu/data/icons/icon_tourniquet.paa b/addons/medical_menu/data/icons/icon_tourniquet.paa new file mode 100644 index 0000000000..8b34a7bfbb Binary files /dev/null and b/addons/medical_menu/data/icons/icon_tourniquet.paa differ diff --git a/addons/medical_menu/data/icons/icon_tourniquet_small.paa b/addons/medical_menu/data/icons/icon_tourniquet_small.paa new file mode 100644 index 0000000000..a457e2c0d5 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_tourniquet_small.paa differ diff --git a/addons/medical_menu/data/icons/icon_triage_card.paa b/addons/medical_menu/data/icons/icon_triage_card.paa new file mode 100644 index 0000000000..850ab0f4ce Binary files /dev/null and b/addons/medical_menu/data/icons/icon_triage_card.paa differ diff --git a/addons/medical_menu/data/icons/medication_small.paa b/addons/medical_menu/data/icons/medication_small.paa new file mode 100644 index 0000000000..b6acd670c8 Binary files /dev/null and b/addons/medical_menu/data/icons/medication_small.paa differ diff --git a/addons/medical_menu/data/icons/toggle_self_small.paa b/addons/medical_menu/data/icons/toggle_self_small.paa new file mode 100644 index 0000000000..73108e5a98 Binary files /dev/null and b/addons/medical_menu/data/icons/toggle_self_small.paa differ diff --git a/addons/medical_menu/data/icons/triage_card_small.paa b/addons/medical_menu/data/icons/triage_card_small.paa new file mode 100644 index 0000000000..92eb0f0d20 Binary files /dev/null and b/addons/medical_menu/data/icons/triage_card_small.paa differ diff --git a/addons/medical_menu/data/ui_background.paa b/addons/medical_menu/data/ui_background.paa new file mode 100644 index 0000000000..f1c42c7d7d Binary files /dev/null and b/addons/medical_menu/data/ui_background.paa differ diff --git a/addons/medical_menu/functions/fnc_canOpenMenu.sqf b/addons/medical_menu/functions/fnc_canOpenMenu.sqf new file mode 100644 index 0000000000..2cfe7072ef --- /dev/null +++ b/addons/medical_menu/functions/fnc_canOpenMenu.sqf @@ -0,0 +1,24 @@ +/* + * Author: Glowbal + * Check if ACE_player can Open the medical menu + * + * Arguments: + * 0: Caller + * 1: Target + * + * Return Value: + * Can open + * + * Example: + * [] call ace_medical_menu_canOpenMenu + * + * Public: No + */ +#include "script_component.hpp" + +params ["_caller", "_target"]; + +if !(GVAR(allow) == 1 || (GVAR(allow) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; +if !(GVAR(useMenu) == 1 || (GVAR(useMenu) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; + +true; diff --git a/addons/medical_menu/functions/fnc_collectActions.sqf b/addons/medical_menu/functions/fnc_collectActions.sqf new file mode 100644 index 0000000000..211de76202 --- /dev/null +++ b/addons/medical_menu/functions/fnc_collectActions.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Collect treatment actions from medical config + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_fnc_collectActions + * + * Public: No + */ +#include "script_component.hpp" + +private ["_configBasic", "_configAdvanced", "_fnc_compileActionsLevel"]; +_configBasic = (configFile >> "ACE_Medical_Actions" >> "Basic"); +_configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced"); + +_fnc_compileActionsLevel = { + private ["_entryCount", "_actions", "_displayName", "_condition", "_category", "_statement"]; + params ["_config"]; + _actions = []; + + { + if (isClass _x) then { + _displayName = getText (_x >> "displayName"); + _category = getText (_x >> "category"); + _condition = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,canTreatCached)), configName _x]; + _statement = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,treatment)), configName _x]; + _actions pushBack [_displayName, _category, compile _condition, compile _statement]; + }; + nil + }count ("true" configClasses _config); + + _actions // return +}; + +GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel; +GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel; diff --git a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf new file mode 100644 index 0000000000..4b03d27970 --- /dev/null +++ b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Grab available treatment options for given category + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: Category name + * + * Return Value: + * Available actions + * + * Exmaple: + * [ACE_player, poor_dude, "some category"] call ace_medical_menu_fnc_getTreatmentOptions + * + * Public: No + */ +#include "script_component.hpp" + +private "_actions"; +params ["_player", "_target", "_name"]; + +if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; + +_actions = if (EGVAR(medical,level) == 2) then { + GVAR(actionsAdvanced); +} else { + GVAR(actionsBasic); +}; + +_collectedActions = []; + +_bodyPart = EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart); +{ + _x params ["", "_currentCategory", "_currentCondition"]; + if (_name == _currentCategory && {call _currentCondition}) then { + _collectedActions pushBack _x; + }; + nil +} count _actions; + +_collectedActions // return diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf new file mode 100644 index 0000000000..d795b0128c --- /dev/null +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -0,0 +1,110 @@ +/* + * Author: Glowbal + * Display the available treatment options in category + * + * Arguments: + * 0: Category name + * + * Return Value: + * None + * + * Example: + * ["some category"] call ace_medical_menu_handleUI_DisplayOptions + * + * Public: No + */ +#include "script_component.hpp" + +#define START_IDC 20 +#define END_IDC 27 +#define AMOUNT_OF_ENTRIES (count _entries) + +if (!hasInterface) exitwith{}; + +private ["_entries", "_display", "_newTarget", "_card", "_ctrl", "_code"]; + +params ["_name"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); +if (isNil "_display") exitwith {}; // no valid dialog present + +if (_name isEqualTo "toggle") exitwith { + if (GVAR(INTERACTION_TARGET) != ACE_player) then { + _newTarget = ACE_player; + } else { + _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); + }; + + GVAR(INTERACTION_TARGET_PREVIOUS) = GVAR(INTERACTION_TARGET); + [_newTarget] spawn { + closeDialog 0; + sleep 0.1; + [_this select 0] call FUNC(openMenu); + }; +}; + +// Clean the dropdown options list from all actions +for [{_x = START_IDC}, {_x <= END_IDC}, {_x = _x + 1}] do { + _ctrl = (_display displayCtrl (_x)); + _ctrl ctrlSetText ""; + _ctrl ctrlShow false; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + _ctrl ctrlSetTooltip ""; + _ctrl ctrlCommit 0; +}; + +GVAR(LatestDisplayOptionMenu) = _name; + +// The triage card has no options available +lbClear 212; +if (_name isEqualTo "triage") exitwith { + + ctrlEnable [212, true]; + private ["_log", "_triageCardTexts", "_message"]; + _log = GVAR(INTERACTION_TARGET) getvariable [QEGVAR(medical,triageCard), []]; + _triageCardTexts = []; + { + _x params ["_item", "_amount", "_time"]; + _message = _item; + if (isClass(configFile >> "CfgWeapons" >> _item)) then { + _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName"); + } else { + if (isLocalized _message) then { + _message = localize _message; + }; + }; + _triageCardTexts pushback format["%1x - %2 (%3m)", _amount, _message, round((ACE_time - _time) / 60)]; + nil; + }count _log; + + if (count _triageCardTexts == 0) exitwith { + lbAdd [212,(localize ELSTRING(medical,TriageCard_NoEntry))]; + }; + { + lbAdd [212,_x]; + nil; + }count _triageCardTexts; +}; + +ctrlEnable [212, false]; + +_entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTreatmentOptions); + +{ + //player sidechat format["TRIGGERED: %1",_x]; + if (_forEachIndex > END_IDC) exitwith {}; + _ctrl = (_display displayCtrl (START_IDC + _forEachIndex)); + if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then { + _ctrl ctrlSetText (_x select 0); + _code = format ["ace_medical_menu_pendingReopen = true; call %1;", (_x select 3)]; + _ctrl ctrlSetEventHandler ["ButtonClick", _code]; + _ctrl ctrlSetTooltip (_x select 0); // TODO implement + _ctrl ctrlShow true; + } else { + _ctrl ctrlSetText ""; + _ctrl ctrlSetEventHandler ["ButtonClick", ""]; + }; + _ctrl ctrlCommit 0; +} forEach _entries; diff --git a/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf new file mode 100644 index 0000000000..fb924fc40b --- /dev/null +++ b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf @@ -0,0 +1,35 @@ +/* + * Author: Glowbal + * Handle the triage card display + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_handleUI_dropDownTriageCard + * + * Public: No + */ +#include "script_component.hpp" + +private ["_display", "_pos", "_ctrl", "_currentPos", "_idc"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); +_pos = [0, 0, 0, 0]; +_currentPos = ctrlPosition (_display displayCtrl 2002); +_currentPos params ["_currentPosX", "_currentPosY"]; +if (_currentPosX == 0 && _currentPosY == 0) then { + _pos = ctrlPosition (_display displayCtrl 2001); +}; + +for "_idc" from 2002 to 2006 step 1 do { + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = _display displayCtrl _idc; + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; +}; diff --git a/addons/medical_menu/functions/fnc_module.sqf b/addons/medical_menu/functions/fnc_module.sqf new file mode 100644 index 0000000000..d95110c200 --- /dev/null +++ b/addons/medical_menu/functions/fnc_module.sqf @@ -0,0 +1,22 @@ +/* + * Author: Glowbal + * Module for adjusting the medical menu 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(allow), "allow"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf new file mode 100644 index 0000000000..52a957ae93 --- /dev/null +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -0,0 +1,77 @@ +/* + * Author: Glowbal + * Handle medical menu opened + * + * Arguments: + * 0: Medical Menu display + * + * Return Value: + * None + * + * Example: + * [medical_menu] call ace_medical_menu_onMenuOpen + * + * Public: No + */ +#include "script_component.hpp" + +private "_target"; + +params ["_display"]; + +if (isNil "_display") exitwith {}; + +if (isNil QGVAR(LatestDisplayOptionMenu)) then { + GVAR(LatestDisplayOptionMenu) = "triage"; +} else { + if (GVAR(LatestDisplayOptionMenu) == "toggle") then { + GVAR(LatestDisplayOptionMenu) = "triage"; + GVAR(INTERACTION_TARGET) = GVAR(INTERACTION_TARGET_PREVIOUS); + }; +}; + +_target = GVAR(INTERACTION_TARGET); +if (isNil QGVAR(INTERACTION_TARGET_PREVIOUS)) then { + GVAR(INTERACTION_TARGET_PREVIOUS) = _target; +}; +[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + +disableSerialization; + +[_target, _display] call FUNC(updateUIInfo); + +(_display displayCtrl 11) ctrlSetTooltip localize LSTRING(VIEW_TRIAGE_CARD); +(_display displayCtrl 12) ctrlSetTooltip localize LSTRING(EXAMINE_PATIENT); +(_display displayCtrl 13) ctrlSetTooltip localize LSTRING(BANDAGE_FRACTURES); +(_display displayCtrl 14) ctrlSetTooltip localize LSTRING(MEDICATION); +(_display displayCtrl 15) ctrlSetTooltip localize LSTRING(AIRWAY_MANAGEMENT); +(_display displayCtrl 16) ctrlSetTooltip localize LSTRING(ADVANCED_TREATMENT); +(_display displayCtrl 17) ctrlSetTooltip localize LSTRING(DRAG_CARRY); +(_display displayCtrl 18) ctrlSetTooltip localize LSTRING(TOGGLE_SELF); + +(_display displayCtrl 301) ctrlSetTooltip localize LSTRING(SELECT_HEAD); +(_display displayCtrl 302) ctrlSetTooltip localize LSTRING(SELECT_TORSO); +(_display displayCtrl 303) ctrlSetTooltip localize LSTRING(SELECT_ARM_R); +(_display displayCtrl 304) ctrlSetTooltip localize LSTRING(SELECT_ARM_L); +(_display displayCtrl 305) ctrlSetTooltip localize LSTRING(SELECT_LEG_R); +(_display displayCtrl 306) ctrlSetTooltip localize LSTRING(SELECT_LEG_L); +(_display displayCtrl 2001) ctrlSetTooltip localize LSTRING(SELECT_TRIAGE_STATUS); + +(_display displayCtrl 1) ctrlSetText format ["%1", [_target] call EFUNC(common,getName)]; +setMousePosition [0.4, 0.4]; + +[QGVAR(onMenuOpen), "onEachFrame", { + params ["_display"]; + if (isNull GVAR(INTERACTION_TARGET)) then { + GVAR(INTERACTION_TARGET) = ACE_player; + }; + [GVAR(INTERACTION_TARGET), _display] call FUNC(updateUIInfo); + [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); + [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + + _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); + (_display displayCtrl 2000) ctrlSetText (_status select 0); + (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); + }, [_display]] call BIS_fnc_addStackedEventHandler; + + ["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call EFUNC(common,localEvent); diff --git a/addons/medical_menu/functions/fnc_openMenu.sqf b/addons/medical_menu/functions/fnc_openMenu.sqf new file mode 100644 index 0000000000..3bc67f0028 --- /dev/null +++ b/addons/medical_menu/functions/fnc_openMenu.sqf @@ -0,0 +1,33 @@ +/* + * Author: Glowbal + * Open the medical menu for target + * + * Arguments: + * 0: Target + * + * Return Value: + * None + * + * Example: + * [some_player] call ace_medical_menu_openMenu + * + * Public: No + */ +#include "script_component.hpp" + +params ["_interactionTarget"]; + +if (dialog || isNull _interactionTarget) exitwith { + disableSerialization; + + private "_display"; + _display = uiNamespace getVariable QGVAR(medicalMenu); + if (!isNil "_display") then { + closeDialog 314412; + }; +}; + +GVAR(INTERACTION_TARGET) = _interactionTarget; + +createDialog QGVAR(medicalMenu); +GVAR(lastOpenedOn) = ACE_time; diff --git a/addons/medical_menu/functions/fnc_setTriageStatus.sqf b/addons/medical_menu/functions/fnc_setTriageStatus.sqf new file mode 100644 index 0000000000..7e7c764aee --- /dev/null +++ b/addons/medical_menu/functions/fnc_setTriageStatus.sqf @@ -0,0 +1,18 @@ +/* + * Author: Glowbal + * Set the triage status of object + * + * Arguments: + * 0: Target + * 1: Status + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_status"]; + +_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 new file mode 100644 index 0000000000..335aea0c58 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateActivityLog.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the activity log + * + * Arguments: + * 0: display + * 1: log collection + * + * Return Value: + * None + * + * Example: + * [some_display, log] call ace_medical_menu_updateActivityLog + * + * Public: No + */ +#include "script_component.hpp" + +private "_logCtrl"; + +params ["_display", "_logs"]; + +_logCtrl = _display displayCtrl 214; +lbClear _logCtrl; + +{ + _x params ["_message", "_moment", "_dummy", "_arguments"]; + + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + } forEach _arguments; + + _message = format ([_message] + _arguments); + _logCtrl lbAdd format ["%1 %2", _moment, _message]; + nil +} count _logs; diff --git a/addons/medical_menu/functions/fnc_updateBodyImage.sqf b/addons/medical_menu/functions/fnc_updateBodyImage.sqf new file mode 100644 index 0000000000..34b2f450c8 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateBodyImage.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the body image on the menu + * + * Arguments: + * 0: selection bloodloss + * 1: display + * + * Return Value: + * None + * + * Example: + * [0.3, some_display] call ace_medical_menu_updateBodyImage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_selectionBloodLoss", "_display"]; + +// Handle the body image coloring +_availableSelections = [50, 51, 52, 53, 54, 55]; +{ + private ["_red", "_green", "_blue"]; + + _red = 1; + _green = 1; + _blue = 1; + + if (_x > 0) then { + if (_damaged select _forEachIndex) then { + _green = (0.9 - _x) max 0; + _blue = _green; + } else { + _green = (0.9 - _x) max 0; + _red = _green; + //_blue = _green; + }; + }; + + (_display displayCtrl (_availableSelections select _forEachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0]; +} forEach _selectionBloodLoss; diff --git a/addons/medical_menu/functions/fnc_updateIcons.sqf b/addons/medical_menu/functions/fnc_updateIcons.sqf new file mode 100644 index 0000000000..f9d3fc5ab4 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateIcons.sqf @@ -0,0 +1,35 @@ +/* + * Author: Glowbal + * Update the category icons + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_updateIcons + * + * Public: No + */ +#include "script_component.hpp" + +#define START_IDC 111 +#define END_IDC 118 + +private ["_display", "_idc", "_options", "_name", "_amount"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); + +_options = ["triage" , "examine", "bandage", "medication", "airway", "advanced", "drag", "toggle"]; +for "_idc" from START_IDC to END_IDC step 1 do { + _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - START_IDC)] call FUNC(getTreatmentOptions); + if ((count _amount) > 0 || _idc == START_IDC || _idc == END_IDC) then { + (_display displayCtrl _idc) ctrlSettextColor [1, 1, 1, 1]; + } else { + (_display displayCtrl _idc) ctrlSettextColor [0.4, 0.4, 0.4, 1]; + }; +}; diff --git a/addons/medical_menu/functions/fnc_updateInformationLists.sqf b/addons/medical_menu/functions/fnc_updateInformationLists.sqf new file mode 100644 index 0000000000..db7220065c --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateInformationLists.sqf @@ -0,0 +1,36 @@ +/* + * Author: Glowbal + * Update the treatment information list + * + * Arguments: + * 0: display + * 1: message collection + * 2: injury collection + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private "_lbCtrl"; + +params ["_display", "_genericMessages", "_allInjuryTexts"]; + +_lbCtrl = _display displayCtrl 213; +lbClear _lbCtrl; +{ + _lbCtrl lbAdd (_x select 0); + _lbCtrl lbSetColor [_forEachIndex, _x select 1]; +} forEach _genericMessages; + +_amountOfGeneric = count _genericMessages; +{ + _lbCtrl lbAdd (_x select 0); + _lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _x select 1]; +} forEach _allInjuryTexts; + +if (count _allInjuryTexts == 0) then { + _lbCtrl lbAdd localize ELSTRING(medical,NoInjuriesBodypart); +}; diff --git a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf new file mode 100644 index 0000000000..8ca81f28ed --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the quick view log + * + * Arguments: + * 0: display + * 1: log collection + * + * Return Value: + * None + * + * Example: + * [some_display, log] call ace_medical_menu_updateQuickViewLog + * + * Public: No + */ +#include "script_component.hpp" + +private "_logCtrl"; + +params ["_display", "_logs"]; + +_logCtrl = _display displayCtrl 215; +lbClear _logCtrl; + +{ + _x params ["_message", "_moment", "_dummy", "_arguments"]; + + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + } forEach _arguments; + + _message = format ([_message] + _arguments); + _logCtrl lbAdd format ["%1 %2", _moment, _message]; + nil +} count _logs; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf new file mode 100644 index 0000000000..7dee2d5123 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -0,0 +1,142 @@ +/* + * Author: Glowbal + * Update all UI information in the medical menu + * + * Arguments: + * 0: target + * 1: display + * + * Return Value: + * None + * + * Example: + * [some_player, some_display] call ace_medical_menu_updateUIInfo + * + * Public: No + */ +#include "script_component.hpp" + +private ["_genericMessages", "_totalIvVolume", "_damaged", "_selectionBloodLoss", "_allInjuryTexts"]; + +params ["_target", "_display"]; + +_selectionN = GVAR(selectedBodyPart); +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; +_genericMessages pushBack [localize _partText, [1, 1, 1, 1]]; + +if (_target getVariable [QEGVAR(medical,isBleeding), false]) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]]; +}; + +if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 1) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]]; +}; + +if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; +}; + +if (_target getVariable [QEGVAR(medical,hasPain), false]) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Pain), [1, 1, 1, 1]]; +}; + +_totalIvVolume = 0; +{ + private "_value"; + _value = _target getVariable _x; + if (!isNil "_value") then { + _totalIvVolume = _totalIvVolume + (_target getVariable [_x, 0]); + }; +} count EGVAR(medical,IVBags); + +if (_totalIvVolume >= 1) then { + _genericMessages pushBack [format [localize ELSTRING(medical,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; +}; + +_damaged = [false, false, false, false, false, false]; +_selectionBloodLoss = [0, 0, 0, 0, 0, 0]; + +_allInjuryTexts = []; +if (EGVAR(medical,level) >= 2) then { + _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; + private "_amountOf"; + { + _amountOf = _x select 3; + // Find how much this bodypart is bleeding + if (_amountOf > 0) then { + _damaged set [_x select 2, true]; + _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + + if (_selectionN == (_x select 2)) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format["%2x %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format["Partial %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6], [1,1,1,1]]; + }; + }; + }; + } forEach _openWounds; + + _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; + { + _amountOf = _x select 3; + // Find how much this bodypart is bleeding + if !(_damaged select (_x select 2)) then { + _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + }; + if (_selectionN == (_x select 2)) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf > 0) then { + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format ["[B] %2x %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [0.88,0.7,0.65,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format ["[B] Partial %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6], [0.88,0.7,0.65,1]]; + }; + }; + }; + } forEach _bandagedwounds; +} 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; + _severity = switch (true) do { + case (_pointDamage > 0.5): {localize ELSTRING(medical,HeavilyWounded)}; + case (_pointDamage > 0.1): {localize ELSTRING(medical,LightlyWounded)}; + default {localize ELSTRING(medical,VeryLightlyWounded)}; + }; + _part = localize ([ + ELSTRING(medical,Head), + ELSTRING(medical,Torso), + ELSTRING(medical,LeftArm), + ELSTRING(medical,RightArm), + ELSTRING(medical,LeftLeg), + ELSTRING(medical,RightLeg) + ] select _forEachIndex); + _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; + }; + } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; +}; + +[_selectionBloodLoss, _display] call FUNC(updateBodyImage); +[_display, _genericMessages, _allInjuryTexts] call FUNC(updateInformationLists); + +_logs = _target getVariable [QEGVAR(medical,logFile_activity_view), []]; +[_display, _logs] call FUNC(updateActivityLog); + +_logs = _target getVariable [QEGVAR(medical,logFile_quick_view), []]; +[_display, _logs] call FUNC(updateQuickViewLog); + +_triageStatus = [_target] call EFUNC(medical,getTriageStatus); +(_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); +(_display displayCtrl 2000) ctrlSetBackgroundColor (_triageStatus select 2); diff --git a/addons/medical_menu/functions/script_component.hpp b/addons/medical_menu/functions/script_component.hpp new file mode 100644 index 0000000000..8c2e419166 --- /dev/null +++ b/addons/medical_menu/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\medical_menu\script_component.hpp" diff --git a/addons/medical_menu/script_component.hpp b/addons/medical_menu/script_component.hpp new file mode 100644 index 0000000000..3119d48e19 --- /dev/null +++ b/addons/medical_menu/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT medical_menu +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MEDICAL_MENU + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MEDICAL_MENU + #define DEBUG_SETTINGS DEBUG_SETTINGS_MEDICAL_MENU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml new file mode 100644 index 0000000000..45da857c69 --- /dev/null +++ b/addons/medical_menu/stringtable.xml @@ -0,0 +1,391 @@ + + + + + + Medical Menu + + + Allow Medical Menu + + + Allow clients to use the medical menu + + + Use Medical menu + + + If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu + + + Re-open Medical menu + + + Re-open the medical menu after succesful treatment + + + Open Medical Menu + + + Medical Menu Settings + + + Configure the usage of the Medical Menu + + + EXAMINE & TREATMENT + ОСМОТР И ЛЕЧЕНИЕ + EXAMINE & TREATMENT + EXAMINAR & TRATAMIENTO + EXAMINER & TRAITEMENTS + BADANIE & LECZENIE + + + STATUS + СОСТОЯНИЕ + STATUS + ESTADO + ÉTATS + STATUS + + + OVERVIEW + ОБЩАЯ ИНФОРМАЦИЯ + OVERVIEW + DESCRIPCIÓN + DESCRIPTION + OPIS + + + ACTIVITY LOG + ПРОВЕДЕННЫЕ МАНИПУЛЯЦИИ + ACTIVITY LOG + REGISTRO DE ACTIVIDAD + REGISTRE DES SOINS + LOGI AKTYWNOŚCI + + + QUICK VIEW + БЫСТРЫЙ ОСМОТР + QUICK VIEW + VISTA RÁPIDA + VUE RAPIDE + SZYBKI PODGLĄD + + + None + Не ранен + Ninguno + Aucun + Brak + + + Minor + Несрочная помощь + Menor + Mineur + Normalny + + + Delayed + Срочная помощь + Diferido + Urgent + Opóźniony + + + Immediate + Неотложная помощь + Inmediato + Immédiat + Natychmiastowy + + + Deceased + Морг + Fallecido + Décédé + Nie żyje + + + View triage Card + Смотреть первичную карточку + Ver Triage + Voir Carte de Triage + Pokaż kartę segregacyjną + + + Examine Patient + Осмотреть пациента + Examinar Paciente + Examiner Patient + Zbadaj pacjenta + + + Bandage / Fractures + Раны / переломы + Vendajes/Fracturas + Bandages / Fractures + Bandaże / Złamania + + + Medication + Медикаменты + Medicación + Médications + Leki + + + Airway Management + Дыхательные пути + Vías Aéreas + Gestion Des Voie REspiratoire + Drogi oddechowe + + + Advanced Treatments + Специальная медпомощь + Tratamientos Avanzados + Traitement Avancé + Zaawansowane zabiegi + + + Drag/Carry + Тащить/нести + Arrastrar/Cargar + Glisser/Porter + Ciągnij/Nieś + + + Toggle (Self) + Лечить себя/другого раненого + Activer (sois) + Przełącz (na siebie) + Alternar + + + Select triage status + Сортировка + Seleccionar estado de Triage + Selectioner l'état de Triage + Wybierz priorytet + + + Select Head + Выбрать голову + Seleccionar Cabeza + Selectioner Tête + Wybierz głowę + + + Select Torso + Выбрать торс + Seleccionar Torso + Selectioner Torse + Wybierz tors + + + Select Left Arm + Выбрать левую руку + Seleccionar Brazo Izquierdo + Selectioner Bras Gauche + Wybierz lewą rękę + + + Select Right Arm + Выбрать правую руку + Seleccionar Brazo Derecho + Selectioner Bras Droit + Wybierz prawą rękę + + + Select Left Leg + Выбрать левую ногу + Seleccionar Pierna Izquierda + Selectioner Jambe Gauche + Wybierz lewą nogę + + + Select Right Leg + Выбрать правую ногу + Seleccionar Pierna Derecha + Selectioner Jambe Droite + Wybierz prawą nogę + + + Head + Голова + Cabeza + Tête + Głowa + + + Torso + Торс + Torse + Tors + + + Left Arm + Левая рука + Brazo Izquierdo + Bras Gauche + Lewa ręka + + + Right Arm + Правая рука + Brazo Derecho + Bras Droit + Prawa ręka + + + Left Leg + Левая нога + Pierna Izquierda + Jambe Gauche + Lewa noga + + + Right Leg + Правая нога + Pierna Derecha + Jambe Droite + Prawa noga + + + Body Part: %1 + Часть тела: %1 + Parte del cuerpo: %1 + Partie du corps: %1 + Część ciała: %1 + + + Small + малого размера + Pequeña + Petite + małym + + + Medium + среднего размера + Mediana + moyenne + średnim + + + Large + большого размера + Grande + Grande + dużym + + + There are %2 %1 Open Wounds + %2 открытые раны %1 + Hay %2 Heridas Abiertas %1 + Il y a %2 %1 Blessure Ouverte + Widzisz otwarte rany w ilości %2 o %1 rozmiarze + + + There is 1 %1 Open Wound + Открытая рана %1 + Hay 1 Herida Abierta %1 + Il y a 1 blessure ouverte %1 + Widzisz 1 otwartą ranę o %1 rozmiarze + + + There is a partial %1 Open wound + Частично открытая рана %1 + Hay una herida parcial abierta %1 + Il y a une Blessure Patiellement Ouverte %1 + Widzisz częściowo otwartą ranę o %1 rozmiarze + + + There are %2 %1 Bandaged Wounds + %2 перевязанные раны %1 + Hay %2 Heridas %1 Vendadas + Il y a %2 %1 Blessure Bandée + Widzisz %2 zabandażowanych ran o %1 rozmiarze + + + There is 1 %1 Bandaged Wound + 1 перевязанная рана %1 + Hay 1 Herida Vendada %1 + Il y a 1 %1 Blessure Bandée + Widzisz 1 zabandażowaną ranę o %1 rozmiarze + + + There is a partial %1 Bandaged wound + Частично перевязанная рана %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 + + + Normal breathing + Дыхание в норме + Respiración normal + Respiration Normale + Normalny oddech + + + No breathing + Дыхания нет + No respira + Apnée + Brak oddechu + + + Difficult breathing + Дыхание затруднено + Dificultad para respirar + Difficultée Respiratoire + Trudności z oddychaniem + + + Almost no breathing + Дыхания почти нет + Casi sin respirar + Respiration Faible + Prawie brak oddechu + + + Bleeding + Кровотечение + Sangrando + Seignement + Krwawienie zewnętrzne + + + in Pain + Испытывает боль + Con Dolor + A De La Douleur + W bólu + + + Lost a lot of Blood + Большая кровопотеря + Mucha Sangre perdida + A Perdu Bcp de Sang + Stracił dużo krwi + + + Tourniquet [CAT] + Жгут + Torniquete [CAT] + Garot [CAT] + Opaska uciskowa [CAT] + + + Nasopharyngeal Tube [NPA] + Назотрахеальная трубка + Torniquete [CAT] + Canule Naseaupharyngée [NPA] + Rurka nosowo-gardłowa [NPA] + + + + diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp new file mode 100644 index 0000000000..c0c32cac8b --- /dev/null +++ b/addons/medical_menu/ui/menu.hpp @@ -0,0 +1,570 @@ +#include "\z\ace\addons\common\define.hpp" + +class GVAR(medicalMenu) { + idd = 314412; + movingEnable = true; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(common,blurScreen); [_this select 0] call FUNC(onMenuOpen);); + onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(common,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;); + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + }; + class CenterBackground: HeaderBackground { + 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])"}; + }; + class BottomBackground: CenterBackground { + y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + 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])"}; + text = ""; + }; + + class IconsBackGroundBar: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = QUOTE(PATHTOF(data\background_img.paa)); + colorText[] = {1, 1, 1, 0.0}; + }; + class CatagoryLeft: HeaderName { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = $STR_ACE_Medical_Menu_EXAMINE_TREATMENT; + }; + class CatagoryCenter: CatagoryLeft { + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_ACE_Medical_Menu_STATUS; + }; + class CatagoryRight: CatagoryCenter{ + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_ACE_Medical_Menu_OVERVIEW; + }; + class Line: ACE_gui_backgroundBase { + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(1,1,1,0.5)"; + }; + + class iconImg1: ACE_gui_backgroundBase { + idc = 111; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + colorBackground[] = {0,0,0,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOF(data\icons\triage_card_small.paa)); + }; + class iconImg2: iconImg1 { + idc = 112; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\examine_patient_small.paa)); + }; + class iconImg3: iconImg1 { + idc = 113; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)); + }; + class iconImg4: iconImg1 { + idc = 114; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\medication_small.paa)); + }; + class iconImg5: iconImg1 { + idc = 115; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\airway_management_small.paa)); + }; + class iconImg6: iconImg1 { + idc = 116; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\advanced_treatment_small.paa)); + }; + class iconImg7: iconImg1 { + idc = 117; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\icon_carry.paa)); + }; + class iconImg8: iconImg1 { + idc = 118; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\toggle_self_small.paa)); + }; + + + class BtnIconLeft1: ACE_gui_buttonBase { + idc = 11; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(['triage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft2: BtnIconLeft1 { + idc = 12; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['examine'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft3: BtnIconLeft1 { + idc = 13; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['bandage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft4: BtnIconLeft1 { + idc = 14; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['medication'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft5: BtnIconLeft1 { + idc = 15; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['airway'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft6: BtnIconLeft1 { + idc = 16; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['advanced'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft7: BtnIconLeft1 { + idc = 17; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['drag'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft8: BtnIconLeft1 { + idc = 18; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['toggle'] call FUNC(handleUI_DisplayOptions);); + }; + + class TriageCardList: ACE_gui_listBoxBase { + idc = 212; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + }; + + // Left side + class BtnMenu1: BtnIconLeft1 { + idc = 20; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = ""; + }; + class BtnMenu2: BtnMenu1 { + idc = 21; + y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu3: BtnMenu1 { + idc = 22; + y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu4: BtnMenu1 { + idc = 23; + y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text =""; + }; + class BtnMenu5: BtnMenu1 { + idc = 24; + y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu6: BtnMenu1 { + idc = 25; + y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu7: BtnMenu1 { + idc = 26; + y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu8: BtnMenu1 { + idc = 27; + y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + // center + + class bodyImgBackground: ACE_gui_backgroundBase { + idc = -1; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOEF(medical,ui\body_background.paa)); + }; + class bodyImgHead: bodyImgBackground { + idc = 50; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,0.75}; + colorText[] = {1,1,1,0.75}; + text = QUOTE(PATHTOEF(medical,ui\body_head.paa)); + }; + + class bodyImgTorso: bodyImgHead { + idc = 51; + text = QUOTE(PATHTOEF(medical,ui\body_torso.paa)); + }; + class bodyImgArms_l: bodyImgHead { + idc = 52; + text = QUOTE(PATHTOEF(medical,ui\body_arm_left.paa)); + }; + class bodyImgArms_r: bodyImgHead { + idc = 53; + text = QUOTE(PATHTOEF(medical,ui\body_arm_right.paa)); + }; + class bodyImgLegs_l: bodyImgHead { + idc = 54; + text = QUOTE(PATHTOEF(medical,ui\body_leg_left.paa)); + }; + class bodyImgLegs_r: bodyImgHead { + idc = 55; + text = QUOTE(PATHTOEF(medical,ui\body_leg_right.paa)); + }; + + + class selectHead: ACE_gui_buttonBase { + idc = 301; + x = "18.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(GVAR(selectedBodyPart) = 0; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectTorso : selectHead { + idc = 302; + x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 1; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftArm: selectHead{ + idc = 303; + x = "17.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 3; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightArm: selectLeftArm{ + idc = 304; + x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 2; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftLeg :selectHead { + idc = 305; + x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 5; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightLeg :selectLeftLeg { + idc = 306; + x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 4; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + + + class TriageTextBottom: HeaderName { + idc = 2000; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 1}; + colorBackground[] = {0,0.0,0.0,0.7}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + + // Right side + class InjuryList: ACE_gui_listBoxBase { + idc = 213; + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + }; + // bottom + + class ActivityLogHeader: CatagoryLeft { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {0.6, 0.7, 1.0, 1}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = $STR_ACE_Medical_Menu_ACTIVITY_LOG; + }; + class QuickViewHeader: ActivityLogHeader { + x = "19.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_ACE_Medical_Menu_QUICK_VIEW; + }; + class LineBottomHeaders: Line { + y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + }; + class ActivityLog: InjuryList { + idc = 214; + //style = 16; + //type = 102; + //rows=1; + colorBackground[] = {0, 0, 0, 0}; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + //colorSelectBackground[] = {0, 0, 0, 0.0}; + //colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + //columns[] = {0.0, 0.08}; + //canDrag=true; + //arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + // arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + //idcLeft = -1; + //idcRight = -1; + }; + + class QuikViewLog: InjuryList { + idc = 215; + //style = 16; + //type = 102; + //rows=1; + colorBackground[] = {0, 0, 0, 0}; + x = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + + //columns[] = {0.0, 0.08}; + //canDrag=true; + //arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + // arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + //idcLeft = -1; + //idcRight = -1; + }; + + class selectTriageStatus: ACE_gui_buttonBase { + idc = 2001; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard);); + }; + class selectTriageStatusNone: selectTriageStatus { + idc = 2002; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_Medical_Menu_TRIAGE_NONE; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + 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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),0)] call FUNC(setTriageStatus);); + }; + + class selectTriageStatusMinor: selectTriageStatus { + idc = 2003; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_Medical_Menu_TRIAGE_MINOR; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + 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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),1)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDelayed: selectTriageStatus { + idc = 2004; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_Medical_Menu_TRIAGE_DELAYED; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + 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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),2)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusImmediate: selectTriageStatus { + idc = 2005; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_Medical_Menu_TRIAGE_IMMEDIATE; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureOver = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + 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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),3)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDeceased: selectTriageStatus { + idc = 2006; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_Medical_Menu_TRIAGE_DECEASED; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + 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([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),4)] call FUNC(setTriageStatus);); + }; + }; +}; \ No newline at end of file diff --git a/addons/nametags/ACE_Settings.hpp b/addons/nametags/ACE_Settings.hpp index e976c4adc8..2270c93f0a 100644 --- a/addons/nametags/ACE_Settings.hpp +++ b/addons/nametags/ACE_Settings.hpp @@ -11,7 +11,7 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(ShowPlayerNames); description = CSTRING(ShowPlayerNames_Desc); - values[] = {CSTRING(Disabled), CSTRING(Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; }; class GVAR(showPlayerRanks) { value = 1; @@ -42,7 +42,7 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(ShowSoundWaves); description = CSTRING(ShowSoundWaves_Desc); - values[] = {CSTRING(Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; + values[] = {ECSTRING(common,Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; }; class GVAR(playerNamesViewDistance) { value = 5; diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index 6c0c148e47..f6e28095b4 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -16,7 +16,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { @@ -54,7 +54,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { @@ -74,7 +74,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index e811b3447c..a0048c4076 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -149,14 +149,6 @@ 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 - - Do Not Force - Nie wymuszaj - No forzar - Nicht erzwingen - Nevynucovat - Não forçar - Force Hide Wymuś ukrycie @@ -213,22 +205,6 @@ Tento modul umožňuje si přizpůsobit nastavení a vzdálenost jmenovky. Este módulo permite que você personalize as configurações e distâncias de etiquetas de nome. - - Disabled - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - - - Enabled - Włączone - Activado - Aktiviert - Povoleno - Ativado - Only on Cursor Tylko pod kursorem diff --git a/addons/optionsmenu/CfgEventHandlers.hpp b/addons/optionsmenu/CfgEventHandlers.hpp index b97829836e..917a0acbd7 100644 --- a/addons/optionsmenu/CfgEventHandlers.hpp +++ b/addons/optionsmenu/CfgEventHandlers.hpp @@ -1,5 +1,10 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); - }; + 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/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf new file mode 100644 index 0000000000..a981c34e0b --- /dev/null +++ b/addons/optionsmenu/XEH_postInit.sqf @@ -0,0 +1,11 @@ + +#include "script_component.hpp" + +["SettingsInitialized", { + GVAR(categories) pushback ""; //Ensure All Catagories is at top + { + if !(_x select 8 in GVAR(categories)) then { + GVAR(categories) pushback (_x select 8); + }; + }foreach EGVAR(common,settings); +}] call EFUNC(common,addEventHandler); diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index e35784560a..21f64c4f46 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -10,16 +10,19 @@ PREP(onSliderPosChanged); PREP(onServerSaveInputField); PREP(onServerSettingsMenuOpen); PREP(onServerListBoxShowSelectionChanged); +PREP(onCategorySelectChanged); PREP(resetSettings); PREP(serverResetSettings); PREP(settingsMenuUpdateKeyView); PREP(settingsMenuUpdateList); PREP(serverSettingsMenuUpdateKeyView); PREP(serverSettingsMenuUpdateList); +PREP(onServerCategorySelectChanged); PREP(updateSetting); PREP(exportSettings); PREP(toggleIncludeClientSettings); PREP(moduleAllowConfigExport); +PREP(stringEscape); GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; @@ -29,5 +32,7 @@ GVAR(ClientSettingsExportIncluded) = false; GVAR(serverSideOptions) = []; GVAR(serverSideColors) = []; GVAR(serverSideValues) = []; +GVAR(categories) = []; +GVAR(currentCategorySelection) = 0; ADDON = true; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index fa76b8752a..9d6437495d 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -40,7 +40,7 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { _value = missionNamespace getvariable [_name, _defaultValue]; - if (_typeName == "STRING") then { // I dont think we have string values, but just in case + if (_typeName == "STRING") then { _value = format['"%1"', _value]; }; if (_typeName == "BOOL") then { diff --git a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf new file mode 100644 index 0000000000..3b97892cdb --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf @@ -0,0 +1,27 @@ +/* + * Author: Glowbal + * Changes which category is selected + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onCategorySelectChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu"]; + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; + +_ctrlComboBox = (_settingsMenu displayCtrl 14); +GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; + +[false] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf new file mode 100644 index 0000000000..f294e27a5e --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf @@ -0,0 +1,26 @@ +/* + * Author: Glowbal + * Changes which category is selected + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onCategorySelectChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlComboBox"]; +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; + +_ctrlComboBox = (_settingsMenu displayCtrl 14); +GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; + +[false] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index b8eb630f85..11aadc76e4 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -29,7 +29,10 @@ switch (GVAR(optionMenu_openTab)) do { _settingName = _setting select 0; _convertedValue = switch (toUpper (_setting select 1)) do { - case "STRING": {format ['"%1"', _inputText]}; + case "STRING": { + ctrlSetText [414, _inputText call FUNC(stringEscape)]; + format ['%1', _inputText call FUNC(stringEscape)]; + }; case "ARRAY": {format [call compile "[%1]", _inputText]}; case "SCALAR": {parseNumber _inputText;}; default {throw "Error"}; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 4f96438042..621493967e 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -65,3 +65,15 @@ if (GVAR(ClientSettingsExportIncluded)) then { } else { (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(inClientSettings)); }; + + +lbClear (_menu displayCtrl 14); +{ + if (_x == "") then { + _x = localize (LSTRING(category_all)); + }; + if (isLocalized _x) then {_x = localize _x}; + (_menu displayCtrl 14) lbAdd _x; +} forEach GVAR(categories); + +(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 050abcf295..af3e2232f3 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -52,3 +52,16 @@ if (GVAR(serverConfigGeneration) == 0) then { (_menu displayCtrl 1102) ctrlEnable false; (_menu displayCtrl 1102) ctrlShow false; }; + +lbClear (_menu displayCtrl 14); +{ + if (_x == "") then { + _x = localize "STR_ACE_OptionsMenu_category_all"; + }; + if (isLocalized _x) then {_x = localize _x}; + (_menu displayCtrl 14) lbAdd _x; +} forEach GVAR(categories); + +(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies + + diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 9daee053bb..ac25d719e1 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; +private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType", "_filteredCollection", "_selectedCategory"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; @@ -29,16 +29,24 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -if (count _collection > 0) then { +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); +_filteredCollection = []; +{ + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _filteredCollection pushBack _x; + }; +} forEach _collection; + +if (count _filteredCollection > 0) then { _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; + if (_settingIndex > (count _filteredCollection)) then { + _settingIndex = count _filteredCollection - 1; }; if (_settingIndex < 0) then { _settingIndex = 0; }; - _setting = _collection select _settingIndex; + _setting = _filteredCollection select _settingIndex; _entryName = _setting select 0; _localizedName = _setting select 3; @@ -52,12 +60,12 @@ if (count _collection > 0) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { _possibleValues = _setting select 5; - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize LSTRING(Disabled))]; - lbAdd [400, (localize LSTRING(Enabled))]; + lbAdd [400, (localize ELSTRING(common,No))]; + lbAdd [400, (localize ELSTRING(common,Yes))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; @@ -66,14 +74,14 @@ if (count _collection > 0) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_SERVER_COLORS): { - _currentColor = _setting select 8; + _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; }; case (MENU_TAB_SERVER_VALUES): { // TODO implement - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools _expectedType = switch (_setting select 1) do { diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index f3e393bbfd..4a6648878a 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; @@ -24,55 +24,65 @@ _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; lbclear _ctrlList; + +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); + + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + + _settingsValue = _x select 9; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _ctrlList lbadd (_settingsText); }; - - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; - } else { - (_x select 5) select _settingsValue; - }; - - _ctrlList lbadd (_settingsText); }foreach GVAR(serverSideOptions); }; case (MENU_TAB_SERVER_COLORS): { { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + _color = +(_x select 9); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; }; - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; }foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + if ((_x select 3) != "") then { + _ctrlList lbadd (_x select 3); + } else { + _ctrlList lbadd (_x select 0); + }; + _settingsValue = _x select 9; + if (typeName _settingsValue != "STRINg") then { + _settingsValue = format["%1", _settingsValue]; + }; + _ctrlList lbadd (_settingsValue); }; - _settingsValue = _x select 8; - if (typeName _settingsValue != "STRINg") then { - _settingsValue = format["%1", _settingsValue]; - }; - _ctrlList lbadd (_settingsValue); }foreach GVAR(serverSideValues); }; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 3777093ccd..442a1ceb50 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -28,16 +28,24 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -if (count _collection > 0) then { +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); +_filteredCollection = []; +{ + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _filteredCollection pushBack _x; + }; +} forEach _collection; + +if (count _filteredCollection > 0) then { _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; + if (_settingIndex > (count _filteredCollection)) then { + _settingIndex = count _filteredCollection - 1; }; if (_settingIndex < 0) then { _settingIndex = 0; }; - _setting = _collection select _settingIndex; + _setting = _filteredCollection select _settingIndex; _entryName = _setting select 0; _localizedName = _setting select 3; @@ -51,13 +59,13 @@ if (count _collection > 0) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { _possibleValues = _setting select 5; - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize LSTRING(Disabled))]; - lbAdd [400, (localize LSTRING(Enabled))]; + lbAdd [400, (localize ELSTRING(common,No))]; + lbAdd [400, (localize ELSTRING(common,Yes))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; @@ -66,7 +74,7 @@ if (count _collection > 0) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_COLORS): { - _currentColor = _setting select 8; + _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index fdd9128ca3..18075a1844 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; @@ -25,33 +25,37 @@ _ctrlList = _settingsMenu displayCtrl 200; lbclear _ctrlList; +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { - _ctrlList lbadd (_x select 3); + if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + _ctrlList lbadd (_x select 3); + _settingsValue = _x select 9; - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; - } else { - (_x select 5) select _settingsValue; + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + _ctrlList lbadd (_settingsText); }; - - _ctrlList lbadd (_settingsText); }foreach GVAR(clientSideOptions); }; case (MENU_TAB_COLORS): { - { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + { + if (_selectedCategory == "" || _selectedCategory == (_X select 8)) then { + _color = +(_x select 9); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _ctrlList lbadd (_x select 3); + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 9)]; + }; }foreach GVAR(clientSideColors); }; }; diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf new file mode 100644 index 0000000000..fe3930f68c --- /dev/null +++ b/addons/optionsmenu/functions/fnc_stringEscape.sqf @@ -0,0 +1,59 @@ +/* + * Author: Glowbal + * Parse the string for quotation marks, so it can be used for config export. + * + * Arguments: + * 0: string + * + * Return Value: + * parsed string + * + * Example: + * [] call ACE_optionsmenu_fnc_stringEscape + * + * Public: No + */ + +private ["_str", "_array", "_maxIndex"]; +_str = _this; + +_isEven = { + params ["_array", "_index"]; + private [ "_count"]; + _count = 0; + { + if (_forEachIndex <= _index && {_x == 39}) then { + _count = _count + 1; + }; + }foreach _array; + + _count %2 == 0; +}; + +// reg: 34 +// single: 39 +_array = toArray _str; +{ + if (_x == 34) then { + _array set [_foreachIndex, 39]; + }; +}foreach _array; + +_maxIndex = count _array; +for "_i" from 0 to _maxIndex /* step +1 */ do { + if (((_i + 1) < _maxIndex - 1) && {_array select _i == 39 && (_array select (_i + 1)) == 39}) then { + if ([_array, _i] call _isEven) then { + _array deleteAt _i; + _i = _i - 1; + _maxIndex = _maxIndex - 1; + }; + }; +}; + +{ + if (_x == 34) then { + _array set [_foreachIndex, 39]; + }; +}foreach _array; + +toString _array; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index 3fe1682614..25fa06c604 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -32,9 +32,9 @@ switch (_type) do { _newValue = [false, true] select _newValue; }; - if !((_x select 8) isEqualTo _newValue) then { + if !((_x select 9) isEqualTo _newValue) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; } ; }; @@ -42,9 +42,9 @@ switch (_type) do { }; case (MENU_TAB_COLORS): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(clientSideColors); }; @@ -56,9 +56,9 @@ switch (_type) do { _newValue = [false, true] select _newValue; }; - if !((_x select 8) isEqualTo _newValue) then { + if !((_x select 9) isEqualTo _newValue) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; } ; }; @@ -66,17 +66,17 @@ switch (_type) do { }; case (MENU_TAB_SERVER_COLORS): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(serverSideValues); }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 665db1f17a..2c79bdab1d 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -1,9 +1,3 @@ -class ACE_settingsMenu { - idd = 145246; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX (((safezoneW / safezoneH) min 1.2)) #define SIZEY (SIZEX / 1.2) #define X_ORIGINAL(num) (num * (SIZEX / 40) + (safezoneX + (safezoneW - SIZEX)/2)) @@ -21,6 +15,12 @@ class ACE_settingsMenu { #define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), W_ORIGINAL(num), W_MAKEITBIGGA(num))]) #define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), H_ORIGINAL(num), H_MAKEITBIGGA(num))]) +class ACE_settingsMenu { + idd = 145246; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); + class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; @@ -77,10 +77,20 @@ class ACE_settingsMenu { idc = 13; x = X_PART(2); y = Y_PART(3.4); - w = W_PART(30); + w = W_PART(15); h = H_PART(1); text = ""; }; + class categorySelection: ACE_gui_comboBoxBase { + idc = 14; + x = X_PART(14); + y = Y_PART(3.4); + w = W_PART(9); + h = H_PART(1); + text = ""; + onLBSelChanged = QUOTE( call FUNC(onCategorySelectChanged)); + SizeEx = H_PART(0.9); + }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; text = CSTRING(TabOptions); @@ -291,6 +301,16 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { h = H_PART(1); text = ""; }; + class categorySelection: ACE_gui_comboBoxBase { + idc = 14; + x = X_PART(14); + y = Y_PART(3.4); + w = W_PART(9); + h = H_PART(1); + text = ""; + onLBSelChanged = QUOTE( call FUNC(onServerCategorySelectChanged)); + SizeEx = H_PART(0.9); + }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; text = CSTRING(TabOptions); diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 376935297e..bde7803e5a 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -73,30 +73,6 @@ Valori Valores - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - Setting: Nastavení: @@ -345,10 +321,10 @@ Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. - + Headbug Fix - + Resets your animation state. @@ -367,5 +343,9 @@ Pokazuj wiadomości ACE w menu głównym Zobrazit novinky v hlavním menu + + All Categories + Wszystkie kategorie + diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 3de7bf66b6..aefadf2e63 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -6,7 +6,6 @@ class CfgVehicles { }; class TransportBackpacks { MACRO_ADDBACKPACK(ACE_NonSteerableParachute,4); - MACRO_ADDBACKPACK(ACE_ReserveParachute,4); }; }; @@ -93,7 +92,7 @@ class CfgVehicles { class ACE_ReserveParachute: ACE_NonSteerableParachute { author = ECSTRING(common,ACETeam); displayName = CSTRING(ReserveParachute); - scope = 2; + scope = 1; mass = 70; ParachuteClass = "NonSteerable_Parachute_F"; ace_reserveParachute = ""; diff --git a/addons/sandbag/CfgVehicles.hpp b/addons/sandbag/CfgVehicles.hpp index 76a986bfbd..5a9b530062 100644 --- a/addons/sandbag/CfgVehicles.hpp +++ b/addons/sandbag/CfgVehicles.hpp @@ -5,7 +5,8 @@ class CfgVehicles { class ACE_Sandbags { displayName = CSTRING(DeploySandbag); condition = QUOTE(call FUNC(canDeploy)); - statement = QUOTE(call FUNC(deploy)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [])] call EFUNC(common,execNextFrame)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 4; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index ac03046803..42e0f17818 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -10,23 +10,26 @@ * Return value: * Did we adjust anything? * + * Example: + * [player, ELEVATION_UP, false] call ace_scopes_fnc_adjustScope + * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_turretAndDirection,_majorStep); +private ["_weaponIndex", "_zeroing", "_optic", "_opticConfig", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_adjustment"]; + +params ["_unit", "_turretAndDirection", "_majorStep"]; if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; -private ["_weaponIndex", "_zeroing", "_optic", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; // [Windage, Elevation, Zero] + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; // [Windage, Elevation, Zero] }; if (isNil QGVAR(Optics)) then { @@ -34,18 +37,17 @@ if (isNil QGVAR(Optics)) then { }; _optic = GVAR(Optics) select _weaponIndex; -_verticalIncrement = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_VerticalIncrement"); -_horizontalIncrement = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_HorizontalIncrement"); -_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Vertical"); -_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Horizontal"); +_opticConfig = configFile >> "CfgWeapons" >> _optic; +_verticalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement"); +_horizontalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); +_maxVertical = getArray (_opticConfig >> "ACE_ScopeAdjust_Vertical"); +_maxHorizontal = getArray (_opticConfig >> "ACE_ScopeAdjust_Horizontal"); if ((count _maxHorizontal < 2) || (count _maxVertical < 2)) exitWith {false}; if ((_verticalIncrement == 0) && (_horizontalIncrement == 0)) exitWith {false}; _zeroing = _adjustment select _weaponIndex; -_elevation = _zeroing select 0; -_windage = _zeroing select 1; -_zero = _zeroing select 2; +_zeroing params ["_elevation", "_windage", "_zero"]; switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 12e911b537..363407e090 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -8,29 +8,30 @@ * Return value: * true * + * Example: + * [player] call ace_scopes_fnc_adjustZero + * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); +private ["_weaponIndex", "_adjustment", "_zeroing"]; + +params ["_unit"]; if (vehicle _unit != _unit) exitWith {false}; -private ["_weaponIndex", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; -_zeroing = _adjustment select _weaponIndex; -_elevation = _zeroing select 0; -_windage = _zeroing select 1; -_zero = _zeroing select 2; +_zeroing = _adjustment select _weaponIndex; +_zeroing params ["_elevation", "_windage", "_zero"]; _zero = round((_zero + _elevation) * 10) / 10; _elevation = 0; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 4950fe9ece..fbd3e1b636 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -11,20 +11,23 @@ * Return value: * True * + * Example: + * [player, 1.3, 0.3, 0.1] call ace_scopes_fnc_applyScopeAdjustment + * * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero); +private ["_adjustmentDifference", "_pitchBankYaw", "_adjustment", "_weaponIndex"]; -private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"]; +params ["_unit", "_elevation", "_windage", "_zero"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; _unit setVariable [QGVAR(Adjustment), _adjustment]; }; @@ -39,10 +42,11 @@ playSound (["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"] se if (cameraView == "GUNNER") then { // Convert adjustmentDifference from mils to degrees _adjustmentDifference = [_adjustmentDifference, {_this * 0.05625}] call EFUNC(common,map); - _pitchbankyaw = [_unit] call EFUNC(common,getPitchBankYaw); - _pitch = (_pitchbankyaw select 0) + (_adjustmentDifference select 0); - _bank = (_pitchbankyaw select 1); - _yaw = (_pitchbankyaw select 2) + (_adjustmentDifference select 1); + _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; + _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; + _pitch = _pitch + _elevationDifference; + _yaw = _yaw + _windageDifference; [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); } else { [] call FUNC(showZeroing); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index 619d82cf6e..36ea4ac793 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -8,17 +8,20 @@ * Return value: * Can we update the zero reference? * + * Example: + * [player] call ace_scopes_fnc_canAdjustZero + * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); - private ["_weaponIndex", "_adjustment", "_elevation"]; +params ["_unit"]; + if (cameraView == "GUNNER") exitWith {false}; -if !(vehicle _unit == _unit) exitWith {false}; -if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; +if (vehicle _unit != _unit) exitWith {false}; +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; @@ -26,7 +29,7 @@ if (_weaponIndex < 0) exitWith {false}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; _elevation = (_adjustment select _weaponIndex) select 0; diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 020431c27b..5ede2d2cf8 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and esteldunedain + * Author: KoffeinFlummi, esteldunedain * Adjusts the flight path of the bullet according to the zeroing * * Argument: @@ -18,11 +18,11 @@ */ #include "script_component.hpp" -private ["_unit", "_adjustment", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; -_unit = _this select 0; -_projectile = _this select 6; +private ["_adjustment", "_weaponIndex", "_zeroing", "_adjustment"]; -if !([_unit] call EFUNC(common,isPlayer)) exitWith {}; +params ["_unit", "", "", "", "", "", "_projectile"]; + +if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; _adjustment = _unit getVariable [QGVAR(Adjustment), []]; if (_adjustment isEqualTo []) exitWith {}; @@ -32,9 +32,10 @@ if (_weaponIndex < 0) exitWith {}; _zeroing = _adjustment select _weaponIndex; -if (_zeroing isEqualTo [0,0,0]) exitWith {}; +if (_zeroing isEqualTo [0, 0, 0]) exitWith {}; // Convert zeroing from mils to degrees _zeroing = _zeroing vectorMultiply 0.05625; +_zeroing params ["_elevation", "_windage", "_zero"]; -[_projectile, (_zeroing select 1), (_zeroing select 0) + (_zeroing select 2), 0] call EFUNC(common,changeProjectileDirection); +[_projectile, _elevation, _elevation + _zero, 0] call EFUNC(common,changeProjectileDirection); diff --git a/addons/scopes/functions/fnc_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf index 289ed5e7bd..a80c5860e8 100644 --- a/addons/scopes/functions/fnc_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -10,21 +10,25 @@ * 1: Optic of secondary * 2: Optic of handgun * + * Example: + * [player] call ace_scopes_fnc_getOptics + * * Public: No */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_unit); +private "_optics"; -private ["_array"]; -_array = ["", "", ""]; +params ["_unit"]; -if !(_unit isKindOf "CAManBase") exitWith {_array}; +_optics = ["", "", ""]; + +if (!(_unit isKindOf "CAManBase")) exitWith {_optics}; { if (count _x >= 2) then { - _array set [_forEachIndex, _x select 2]; + _optics set [_forEachIndex, _x select 2]; }; } forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; -_array +_optics diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf index af4b347124..562bf731b4 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and Commy2 + * Author: KoffeinFlummi, Commy2 * Check if weapon optics changed and reset zeroing if needed * * Arguments: @@ -8,18 +8,21 @@ * Return Value: * None * + * Example: + * [player] call ace_scopes_fnc_inventoryCheck + * * Public: No */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_player); - private ["_newOptics", "_adjustment"]; +params ["_player"]; + _adjustment = ACE_player getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; ACE_player setVariable [QGVAR(Adjustment), _adjustment]; [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); }; @@ -32,8 +35,8 @@ _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 { - _adjustment set [_forEachIndex, [0,0,0]]; + 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 7cefc68563..d3d4a38a9d 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and esteldunedain + * Author: KoffeinFlummi, esteldunedain * Display the adjustment knobs, update their value and fade them out later * * Arguments: @@ -8,13 +8,16 @@ * Return Value: * None * + * Example: + * [] call ace_scopes_fnc_showZeroing + * * Public: No */ #include "script_component.hpp" -disableSerialization; +private ["_weaponIndex", "_adjustment", "_layer", "_display", "_zeroing", "_vertical", "_horizontal"]; -private ["_weaponIndex","_adjustment","_layer","_display","_zeroing","_vertical","_horizontal"]; +disableSerialization; _weaponIndex = [ACE_player, currentWeapon ACE_player] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; @@ -22,7 +25,7 @@ if (_weaponIndex < 0) exitWith {}; _adjustment = ACE_player getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; // Display the adjustment knobs @@ -35,10 +38,11 @@ if (isNull _display) exitWith {}; // Update values _zeroing = _adjustment select _weaponIndex; +_zeroing params ["_elevation", "_windage"]; _vertical = _display displayCtrl 12; _horizontal = _display displayCtrl 13; -_vertical ctrlSetText (str (_zeroing select 0)); -_horizontal ctrlSetText (str (_zeroing select 1)); +_vertical ctrlSetText (str _elevation); +_horizontal ctrlSetText (str _windage); // Set the ACE_time when to hide the knobs GVAR(timeToHide) = ACE_diagTime + 3.0; @@ -47,14 +51,13 @@ if !(isNil QGVAR(fadePFH)) exitWith {}; // Launch a PFH to wait and fade out the knobs GVAR(fadePFH) = [{ - if (ACE_diagTime >= GVAR(timeToHide)) exitWith { private "_layer"; + params ["", "_pfhId"]; _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; _layer cutFadeOut 2; GVAR(fadePFH) = nil; - [_this select 1] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; - }, 0.1, []] call CBA_fnc_addPerFrameHandler diff --git a/addons/sitting/CfgMoves.hpp b/addons/sitting/CfgMoves.hpp new file mode 100644 index 0000000000..fc902032e2 --- /dev/null +++ b/addons/sitting/CfgMoves.hpp @@ -0,0 +1,105 @@ +// Enable visual head movement while free-looking +#define MACRO_ANIMATION \ + head = "headDefault"; + +class CfgMovesBasic; +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class HubSittingChairA_idle1; + class GVAR(HubSittingChairA_idle1): HubSittingChairA_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairA_idle2; + class GVAR(HubSittingChairA_idle2): HubSittingChairA_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairA_idle3; + class GVAR(HubSittingChairA_idle3): HubSittingChairA_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairA_move1; + class GVAR(HubSittingChairA_move1): HubSittingChairA_move1 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle1; + class GVAR(HubSittingChairB_idle1): HubSittingChairB_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle2; + class GVAR(HubSittingChairB_idle2): HubSittingChairB_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle3; + class GVAR(HubSittingChairB_idle3): HubSittingChairB_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairB_move1; + class GVAR(HubSittingChairB_move1): HubSittingChairB_move1 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle1; + class GVAR(HubSittingChairC_idle1): HubSittingChairC_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle2; + class GVAR(HubSittingChairC_idle2): HubSittingChairC_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle3; + class GVAR(HubSittingChairC_idle3): HubSittingChairC_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairC_move1; + class GVAR(HubSittingChairC_move1): HubSittingChairC_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle1; + class GVAR(HubSittingChairUA_idle1): HubSittingChairUA_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle2; + class GVAR(HubSittingChairUA_idle2): HubSittingChairUA_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle3; + class GVAR(HubSittingChairUA_idle3): HubSittingChairUA_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUA_move1; + class GVAR(HubSittingChairUA_move1): HubSittingChairUA_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle1; + class GVAR(HubSittingChairUB_idle1): HubSittingChairUB_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle2; + class GVAR(HubSittingChairUB_idle2): HubSittingChairUB_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle3; + class GVAR(HubSittingChairUB_idle3): HubSittingChairUB_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUB_move1; + class GVAR(HubSittingChairUB_move1): HubSittingChairUB_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle1; + class GVAR(HubSittingChairUC_idle1): HubSittingChairUC_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle2; + class GVAR(HubSittingChairUC_idle2): HubSittingChairUC_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle3; + class GVAR(HubSittingChairUC_idle3): HubSittingChairUC_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUC_move1; + class GVAR(HubSittingChairUC_move1): HubSittingChairUC_move1 { + MACRO_ANIMATION + }; + }; +}; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index ac690e2dcd..a156d5e87e 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -39,7 +39,7 @@ class CfgVehicles { class ACE_MainActions { \ displayName = ECSTRING(interaction,MainAction); \ selection = ""; \ - distance = 1.25; \ + distance = 1.5; \ condition = "true"; \ class GVAR(Sit) { \ displayName = CSTRING(Sit); \ diff --git a/addons/sitting/config.cpp b/addons/sitting/config.cpp index f12fa530fa..96d3edab7b 100644 --- a/addons/sitting/config.cpp +++ b/addons/sitting/config.cpp @@ -12,6 +12,7 @@ class CfgPatches { }; }; -#include "CfgEventHandlers.hpp" #include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMoves.hpp" #include "CfgVehicles.hpp" diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index c34281e496..fef36b4bbd 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -10,17 +10,16 @@ * Can Sit Down * * Example: - * [seat, player] call ace_sitting_fnc_canSit; + * [seat, player] call ace_sitting_fnc_canSit * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_seat,_player); +params ["_seat", "_player"]; // Sitting enabled, is seat object, not occupied and standing up (or not on a big slope) GVAR(enable) && {getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && -{isNil{_seat getVariable QGVAR(seatOccupied)}} && +{isNil {_seat getVariable QGVAR(seatOccupied)}} && {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf index 4549b9891b..c516485a82 100644 --- a/addons/sitting/functions/fnc_canStand.sqf +++ b/addons/sitting/functions/fnc_canStand.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Sitting -(_player getVariable [QGVAR(isSitting),false]) +(_player getVariable [QGVAR(isSitting), false]) diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf index c83d230a90..ca9a9ccfb1 100644 --- a/addons/sitting/functions/fnc_getRandomAnimation.sqf +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -9,40 +9,40 @@ * Random Animation * * Example: - * _animation = call ace_sitting_fnc_getRandomAnimation; + * _animation = call ace_sitting_fnc_getRandomAnimation * * Public: No */ #include "script_component.hpp" -private ["_animations"]; +private "_animations"; // Animations Pool _animations = [ - "HubSittingChairUA_idle1", - "HubSittingChairUA_idle2", - "HubSittingChairUA_idle3", - "HubSittingChairUA_move1", - "HubSittingChairUB_idle1", - "HubSittingChairUB_idle2", - "HubSittingChairUB_idle3", - "HubSittingChairUB_move1", - "HubSittingChairUC_idle1", - "HubSittingChairUC_idle2", - "HubSittingChairUC_idle3", - "HubSittingChairUC_move1", - "HubSittingChairA_idle1", - "HubSittingChairA_idle2", - "HubSittingChairA_idle3", - "HubSittingChairA_move1", - "HubSittingChairB_idle1", - "HubSittingChairB_idle2", - "HubSittingChairB_idle3", - "HubSittingChairB_move1", - "HubSittingChairC_idle1", - "HubSittingChairC_idle2", - "HubSittingChairC_idle3", - "HubSittingChairC_move1" + QGVAR(HubSittingChairA_idle1), + QGVAR(HubSittingChairA_idle2), + QGVAR(HubSittingChairA_idle3), + QGVAR(HubSittingChairA_move1), + QGVAR(HubSittingChairB_idle1), + QGVAR(HubSittingChairB_idle2), + QGVAR(HubSittingChairB_idle3), + QGVAR(HubSittingChairB_move1), + QGVAR(HubSittingChairC_idle1), + QGVAR(HubSittingChairC_idle2), + QGVAR(HubSittingChairC_idle3), + QGVAR(HubSittingChairC_move1), + QGVAR(HubSittingChairUA_idle1), + QGVAR(HubSittingChairUA_idle2), + QGVAR(HubSittingChairUA_idle3), + QGVAR(HubSittingChairUA_move1), + QGVAR(HubSittingChairUB_idle1), + QGVAR(HubSittingChairUB_idle2), + QGVAR(HubSittingChairUB_idle3), + QGVAR(HubSittingChairUB_move1), + QGVAR(HubSittingChairUC_idle1), + QGVAR(HubSittingChairUC_idle2), + QGVAR(HubSittingChairUC_idle3), + QGVAR(HubSittingChairUC_move1) ]; // Select random animation diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf index fb32635195..328675c172 100644 --- a/addons/sitting/functions/fnc_handleInterrupt.sqf +++ b/addons/sitting/functions/fnc_handleInterrupt.sqf @@ -9,13 +9,13 @@ * None * * Example: - * player call ace_sitting_fnc_handleInterrupt; + * player call ace_sitting_fnc_handleInterrupt * * Public: No */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if (_player getVariable [QGVAR(isSitting), false]) then { _player call FUNC(stand); diff --git a/addons/sitting/functions/fnc_hasChairMoved.sqf b/addons/sitting/functions/fnc_hasChairMoved.sqf index fe56438878..de3a38e0ce 100644 --- a/addons/sitting/functions/fnc_hasChairMoved.sqf +++ b/addons/sitting/functions/fnc_hasChairMoved.sqf @@ -10,18 +10,21 @@ * None * * Example: - * [seat, seatPos] call ace_sitting_fnc_hasChairMoved; + * [seat, seatPos] call ace_sitting_fnc_hasChairMoved * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_seat,_seatPosOrig); +params ["_seat", "_seatPosOrig"]; TRACE_2("Chair position",_seatPosOrig,getPosASL _seat); +(getPosASL _seat) params ["_seatX", "_seatY", "_seatZ"]; +_seatPosOrig params ["_seatOrigX", "_seatOrigY", "_seatOrigZ"]; + // Check each coordinate due to possibility of tiny movements in simulation -(getPosASL _seat) select 0 < (_seatPosOrig select 0) - 0.01 || {(getPosASL _seat) select 0 > (_seatPosOrig select 0) + 0.01} || -{(getPosASL _seat) select 1 < (_seatPosOrig select 1) - 0.01 || {(getPosASL _seat) select 1 > (_seatPosOrig select 1) + 0.01}} || -{(getPosASL _seat) select 2 < (_seatPosOrig select 2) - 0.01 || {(getPosASL _seat) select 2 > (_seatPosOrig select 2) + 0.01}} +if (abs (_seatX - _seatOrigX) > 0.01) exitWith {true}; +if (abs (_seatY - _seatOrigY) > 0.01) exitWith {true}; +if (abs (_seatZ - _seatOrigZ) > 0.01) exitWith {true}; +false diff --git a/addons/sitting/functions/fnc_moduleInit.sqf b/addons/sitting/functions/fnc_moduleInit.sqf index 25da5be347..ae476317db 100644 --- a/addons/sitting/functions/fnc_moduleInit.sqf +++ b/addons/sitting/functions/fnc_moduleInit.sqf @@ -3,18 +3,22 @@ * Initializes the Sitting module. * * Arguments: - * Whatever the module provides. + * 0: The module logic + * 1: Units + * 2: Activated * * Return Value: * None + * + * Public: No */ #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +if (!_activated) exitWith {}; [_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index d6b729d544..0c6825ed58 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -14,12 +14,11 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; -PARAMS_2(_seat,_player); +params ["_seat", "_player"]; // Set global variable for standing up GVAR(seat) = _seat; @@ -34,7 +33,8 @@ _sitPosition = getArray (_configFile >> QGVAR(sitPosition)); _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present // Get random animation and perform it (before moving player to ensure correct placement) -[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); +[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations +[_player, "", 1] call EFUNC(common,doAnimation); // Correctly applies animation's config values (such as disallow throwing of grenades, intercept keybinds... etc). // Set direction and position _player setDir _sitDirection; @@ -49,12 +49,13 @@ _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple peop _sitDirectionVisual = getDirVisual _player; // Needed for precision and issues with using above directly _seatPosOrig = getPosASL _seat; [{ - EXPLODE_5_PVT(_this select 0,_player,_sitDirectionVisual,_sitRotation,_seat,_seatPosOrig); - + params ["_args", "_pfhId"]; + _args params ["_player", "_sitDirectionVisual", "_sitRotation", "_seat", "_seatPosOrig"]; + // Remove PFH if not sitting any more if !(_player getVariable [QGVAR(isSitting), false]) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; - TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting),false)]); + [_pfhId] call cba_fnc_removePerFrameHandler; + TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting), false)]); }; // Stand up if chair moves diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index df1ee6f169..978bcaf279 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Restore animation [_player, "", 2] call EFUNC(common,doAnimation); diff --git a/addons/slideshow/CfgVehicles.hpp b/addons/slideshow/CfgVehicles.hpp index 7bb3b81713..7e82d48ffc 100644 --- a/addons/slideshow/CfgVehicles.hpp +++ b/addons/slideshow/CfgVehicles.hpp @@ -6,7 +6,7 @@ class CfgVehicles { displayName = CSTRING(DisplayName); function = QFUNC(moduleInit); scope = 2; - isGlobal = 0; // Server only + isGlobal = 1; isTriggerActivated = 0; isDisposable = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_Slideshow_ca.paa)); diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 80e9b387af..1ebba306b4 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -10,19 +10,19 @@ * 4: Current Slideshow * * Return Value: - * None + * List of actions * * Example: * [[object], ["image"], ["name"], controller, 1] call ace_slideshow_fnc_addSlideActions * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_5(_objects,_images,_names,_controller,_currentSlideshow); +private "_actions"; + +params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; -private ["_actions"]; _actions = []; { _actions pushBack @@ -32,10 +32,10 @@ _actions = []; _names select _forEachIndex, "", { - EXPLODE_2_PVT(_this select 2,_objects,_image); + (_this select 2) params ["_objects", "_image"]; { _x setObjectTextureGlobal [0, _image] - } forEach _objects; + } count _objects; }, {true}, {}, diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index 639a0fb70b..c8b03a707a 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -4,25 +4,23 @@ * * Arguments: * 0: Objects - * 1: Controller Objects - * 2: Image Paths - * 3: Action Names - * 4: Duration (0 disables automatic transitions) + * 1: Image Paths + * 2: State Variable Name + * 3: Duration (0 disables automatic transitions) * * Return Value: - * Parsed List + * None * * Example: - * [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition + * [objects, images, "ace_slideshow_slideshow1", duration] call ace_slideshow_fnc_autoTransition * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_4(_objects,_images,_varString,_duration); +private "_currentSlide"; -private ["_currentSlide"]; +params ["_objects", "_images", "_varString", "_duration"]; // Get current slide number of this slideshow _currentSlide = missionNamespace getVariable [_varString, 0]; @@ -36,10 +34,8 @@ missionNamespace setVariable [_varString, _currentSlide]; // Set slide { _x setObjectTextureGlobal [0, _images select _currentSlide]; -} forEach _objects; +} count _objects; +// Log current slide and execute Next slide TRACE_4("Auto-transition",_images select _currentSlide,_currentSlide,count _images,_duration); - - -// Next slide [FUNC(autoTransition), [_objects, _images, _varString, _duration], _duration] call EFUNC(common,waitAndExecute); diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index debeac3340..c3b45528da 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -17,10 +17,11 @@ * * Public: Yes */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_5(_objects,_controllers,_images,_names,_duration); +private ["_currentSlideshow", "_actionsObject", "_actionsClass", "_mainAction", "_slidesAction", "_varString"]; + +params ["_objects", "_controllers", "_images", "_names", "_duration"]; // Verify data if (count _images != count _names || {count _images == 0} || {count _names == 0}) exitWith { @@ -30,7 +31,8 @@ if (count _images != count _names || {count _images == 0} || {count _names == 0} // Objects synced to the module { _objects pushBack _x; -} forEach (synchronizedObjects _logic); + nil +} count (synchronizedObjects _logic); // If no controllers use objects as controllers if (count _controllers == 0) then { @@ -39,19 +41,26 @@ if (count _controllers == 0) then { TRACE_4("Information",_objects,_controllers,_images,_names); -// Default images on whiteboards (first image) -{ - _x setObjectTextureGlobal [0, _images select 0]; -} forEach _objects; +if (isServer) then { + // Default images on whiteboards (first image) + { + _x setObjectTextureGlobal [0, _images select 0]; + } count _objects; + + // Number of slideshows (multiple modules support) + GVAR(slideshows) = GVAR(slideshows) + 1; +}; -// Number of slideshows (multiple modules support) -GVAR(slideshows) = GVAR(slideshows) + 1; -private ["_currentSlideshow"]; _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets changed during execution of below code +// If interaction menu module is not present, set default duration value +if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { + _duration = 5; + diag_log text format ["[ACE]: Slideshow: Interaction Menu module not present, defaulting duration value to %1", _duration]; +}; + // Add interactions if automatic transitions are disabled, else setup automatic transitions if (_duration == 0) then { - private ["_actionsObject", "_actionsClass", "_mainAction", "_slidesAction"]; { // Add MainAction if one does not already exist _actionsObject = _x getVariable [QEGVAR(interact_menu,actions), []]; @@ -65,10 +74,12 @@ if (_duration == 0) then { // Add Slides sub-action and populate with images _slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects,_images,_names,_x,_currentSlideshow], [0,0,0], 2] call EFUNC(interact_menu,createAction); [_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject); - } forEach _controllers; + nil + } count _controllers; } else { + if !(isServer) exitWith {}; + // Formatted GVAR string (multiple modules support) - private ["_varString"]; _varString = format [QGVAR(slideshow%1), _currentSlideshow]; TRACE_1("Current Slide",_varString); diff --git a/addons/slideshow/functions/fnc_makeList.sqf b/addons/slideshow/functions/fnc_makeList.sqf index 9ce4a723cc..8de87a2d96 100644 --- a/addons/slideshow/functions/fnc_makeList.sqf +++ b/addons/slideshow/functions/fnc_makeList.sqf @@ -18,7 +18,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_list,_removeWhitespace,_checkNil); +params ["_list", "_removeWhitespace", "_checkNil"]; private ["_splittedList", "_listNoWhitespace", "_nilCheckPassedList"]; @@ -30,7 +30,8 @@ _listNoWhitespace = []; if (_removeWhitespace) then { { _listNoWhitespace pushBack ([_x] call EFUNC(common,stringRemoveWhiteSpace)); - } forEach _splittedList; + nil + } count _splittedList; _list = _listNoWhitespace; }; @@ -45,7 +46,7 @@ if (_checkNil) then { _nilCheckPassedList = _nilCheckPassedList + "," + _x; }; }; - } forEach _list; + } count _list; // Add Array characters and parse into array _list = "[" + _nilCheckPassedList + "]"; @@ -54,4 +55,4 @@ if (_checkNil) then { TRACE_4("Lists",_splittedList,_listNoWhitespace,_nilCheckPassedList,_list); -_list +_list // return diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 50de48693e..da1724dfcc 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -12,18 +12,16 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -if !(isServer) exitWith {}; - -PARAMS_3(_logic,_units,_activated); - -if !(_activated) exitWith {}; +// Exit on Headless Client +if (!hasInterface && !isDedicated) exitWith {}; private ["_objects", "_controllers", "_images", "_names", "_duration"]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]], "_units", "_activated"]; + +if !(_activated) exitWith {}; if (isNull _logic) exitWith {}; // Extract variables from logic diff --git a/addons/spottingscope/functions/fnc_pickup.sqf b/addons/spottingscope/functions/fnc_pickup.sqf index 3730068092..81c9bc10a5 100644 --- a/addons/spottingscope/functions/fnc_pickup.sqf +++ b/addons/spottingscope/functions/fnc_pickup.sqf @@ -1,30 +1,30 @@ /* * Author: Rocko, Ruthberg - * * Pick up spotting scope * * Arguments: * 0: spotting scope * 1: unit * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [spotting_scope, player] call ace_spottingscope_fnc_pickup + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_spottingScope,_unit); +params ["_spottingScope", "_unit"]; if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { _unit playMove "AmovPercMstpSrasWrflDnon_diary"; }; [{ - PARAMS_2(_spottingScope,_unit); - + params ["_spottingScope", "_unit"]; + [_unit, "ACE_SpottingScope"] call EFUNC(common,addToInventory); deleteVehicle _spottingScope; - }, [_spottingScope, _unit], 1, 0]call EFUNC(common,waitAndExecute); diff --git a/addons/spottingscope/functions/fnc_place.sqf b/addons/spottingscope/functions/fnc_place.sqf index 4967151748..09f756c109 100644 --- a/addons/spottingscope/functions/fnc_place.sqf +++ b/addons/spottingscope/functions/fnc_place.sqf @@ -1,21 +1,22 @@ /* * Author: Rocko, Ruthberg - * * Place down spotting scope * * Arguments: * 0: unit * 1: scope class * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [player, "ACE_SpottingScope"] call ace_spottingscope_fnc_place + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_scopeClass); +params ["_unit", "_scopeClass"]; _unit removeItem _scopeClass; @@ -24,18 +25,17 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { }; [{ - PARAMS_1(_unit); - + params ["_unit"]; + private ["_direction", "_position", "_spottingScope"]; _direction = getDir _unit; _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; - + _spottingScope = "ACE_SpottingScopeObject" createVehicle [0, 0, 0]; _spottingScope setDir _direction; _spottingScope setPosASL _position; if ((getPosATL _spottingScope select 2) - (getPos _spottingScope select 2) < 1E-5) then { - _spottingScope setVectorUp (surfaceNormal (position _spottingScope)); + _spottingScope setVectorUp (surfaceNormal (position _spottingScope)); }; _unit reveal _spottingScope; - }, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp index bd66176e34..a1eda1a955 100644 --- a/addons/tacticalladder/CfgVehicles.hpp +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -82,7 +82,8 @@ class CfgVehicles { displayName = CSTRING(Position); distance = 4; condition = "true"; - statement = QUOTE([ARR_2(_target,_player)] call FUNC(positionTL)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(positionTL)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 63a97d97e9..456d245832 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy * * Public: No */ @@ -17,16 +17,16 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_1(_ladder); +params ["_ladder"]; detach _ladder; _ladder animate ["rotate", 0]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 93263c6aa0..764e5c73d8 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -6,16 +6,16 @@ * 0: ladder * * Return Value: - * Success? + * Success * * Example: - * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy * * Public: No */ #include "script_component.hpp" -PARAMS_1(_ladder); +params ["_ladder"]; private ["_pos1", "_pos2"]; _pos1 = getPosASL GVAR(ladder); @@ -23,8 +23,8 @@ _pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) ca if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false }; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); detach _ladder; GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 7ad135ca90..14c386dda1 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -3,13 +3,13 @@ * Deploy tactical ladder * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * call ace_tacticalladder_fnc_deployTL; + * [] call ace_tacticalladder_fnc_deployTL * * Public: No */ diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf index d08cb6e208..6b5107b814 100644 --- a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * Handled * * Example: - * 1 call ace_tacticalladder_fnc_handleScrollWheel; + * [1] call ace_tacticalladder_fnc_handleScrollWheel; * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (isNull GVAR(ladder)) exitWith { false }; @@ -37,7 +37,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; GVAR(currentStep) = _currentStep - 1; - }; + }; }; } else { // Tilting @@ -45,4 +45,4 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; }; -true \ No newline at end of file +true diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf index c603f1feca..ad409f8870 100644 --- a/addons/tacticalladder/functions/fnc_pickupTL.sqf +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -7,10 +7,10 @@ * 1: unit * * Return Value: - * Success? + * Success * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL * * Public: No */ @@ -18,7 +18,7 @@ if ((backpack ACE_player) != "") exitWith { false }; -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; deleteVehicle _ladder; _unit addBackpack "ACE_TacticalLadder_Pack"; diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 103792c851..1035101556 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL * * Public: No */ @@ -18,11 +18,11 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; _unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player @@ -30,7 +30,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe _ladder animate ["rotate", 0]; { _ladder animate [_x, 1]; -} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) +} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) GVAR(ladder) = _ladder; GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp index a489e18704..2a689ba349 100644 --- a/addons/tripod/CfgVehicles.hpp +++ b/addons/tripod/CfgVehicles.hpp @@ -17,7 +17,7 @@ class CfgVehicles { class Item_Base_F; class ACE_Item_Tripod: Item_Base_F { - author[] = {"Rocko", "Scubaman3D"}; + author[] = {"Rocko", "Scubaman3D"}; scope = 2; scopeCurator = 2; displayName = CSTRING(DisplayName); @@ -76,7 +76,8 @@ class CfgVehicles { displayName = CSTRING(Adjust); distance = 5; condition = "true"; - statement = QUOTE(_target call FUNC(adjust)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [_target])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index ce50d38cf0..1ba99cedbe 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -1,37 +1,39 @@ /* * Author: Ruthberg - * * Adjust tripod height * * Arguments: * 0: tripod * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [tripod] call ace_tripod_fnc_adjust + * + * Public: No */ #include "script_component.hpp" -PARAMS_1(_tripod); +params ["_tripod"]; GVAR(adjuster) = ACE_player; GVAR(adjusting) = true; GVAR(adjustPFH) = [{ - EXPLODE_1_PVT(_this select 0,_tripod); - + params ["_args", "_pfhId"]; + _args params ["_tripod"]; + if (GVAR(adjuster) != ACE_player || !GVAR(adjusting)) exitWith { call EFUNC(interaction,hideMouseHint); [ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Adjust), -1]] call EFUNC(Common,removeActionEventHandler); - [_this select 1] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; - + { _tripod animate [_x, 1 - GVAR(height)]; - } foreach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; - + } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; + }, 0, [_tripod]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint); diff --git a/addons/tripod/functions/fnc_handleScrollWheel.sqf b/addons/tripod/functions/fnc_handleScrollWheel.sqf index 7399bf0c2c..973a57dd2f 100644 --- a/addons/tripod/functions/fnc_handleScrollWheel.sqf +++ b/addons/tripod/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * handled * * Example: - * 1.2 call ace_tripod_fnc_handleScrollWheel; + * [1.2] call ace_tripod_fnc_handleScrollWheel; * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(adjustPFH) == -1) exitWith { false }; diff --git a/addons/tripod/functions/fnc_pickup.sqf b/addons/tripod/functions/fnc_pickup.sqf index f264eb1e2e..24fc26ea1d 100644 --- a/addons/tripod/functions/fnc_pickup.sqf +++ b/addons/tripod/functions/fnc_pickup.sqf @@ -1,30 +1,30 @@ /* * Author: Rocko, Ruthberg - * * Pick up tripod * * Arguments: * 0: tripod * 1: unit * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [tripod, player] call ace_tripod_fnc_pickup + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_tripod,_unit); +params ["_tripod", "_unit"]; if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { _unit playMove "AmovPercMstpSrasWrflDnon_diary"; }; [{ - PARAMS_2(_tripod,_unit); + params ["_tripod", "_unit"]; [_unit, "ACE_Tripod"] call EFUNC(common,addToInventory); deleteVehicle _tripod; - }, [_tripod, _unit], 1, 0]call EFUNC(common,waitAndExecute); diff --git a/addons/tripod/functions/fnc_place.sqf b/addons/tripod/functions/fnc_place.sqf index 5e9c783589..ce7f445885 100644 --- a/addons/tripod/functions/fnc_place.sqf +++ b/addons/tripod/functions/fnc_place.sqf @@ -1,21 +1,22 @@ /* * Author: Rocko, Ruthberg - * * Place down tripod * * Arguments: * 0: unit * 1: tripod class * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [player, "ACE_Tripod"] call ace_tripod_fnc_place + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_tripodClass); +params ["_unit", "_tripodClass"]; _unit removeItem _tripodClass; @@ -24,27 +25,29 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { }; [{ - PARAMS_1(_unit); - + params ["_unit"]; + private ["_direction", "_position", "_tripod"]; _direction = getDir _unit; _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; - + _tripod = "ACE_TripodObject" createVehicle [0, 0, 0]; { _tripod animate [_x, 1]; - } foreach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; - + } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; + [{ - EXPLODE_3_PVT(_this select 0,_tripod,_direction,_position); + params ["_args", "_pfhId"]; + _args params ["_tripod", "_direction", "_position"]; + if (_tripod animationPhase "slide_down_tripod" == 1) then { _tripod setDir _direction; _tripod setPosASL _position; if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then { - _tripod setVectorUp (surfaceNormal (position _tripod)); + _tripod setVectorUp (surfaceNormal (position _tripod)); }; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; }; }, 0, [_tripod, _direction, _position]] call CBA_fnc_addPerFrameHandler; - + }, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index d683073286..073054648e 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -20,7 +20,10 @@ private ["_previousMags","_newMags","_keyMagazine","_keyName"]; -PARAMS_3(_unit,_veh,_useCustom); +if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_useCustom", false, [false]]]) exitWith { + ERROR("Input wrong type"); +}; +TRACE_3("params",_unit,_veh,_useCustom); if (isNull _unit) exitWith {ERROR("null unit");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf index 999f471ac3..eda75922c4 100644 --- a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf +++ b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf @@ -17,7 +17,8 @@ private ["_vehConfigSide","_vehSide","_returnValue"]; -PARAMS_1(_veh); +params ["_veh"]; +TRACE_1("params",_veh); if (isNull _veh) exitWith {ERROR("null vehicle"); "error"}; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index 5a2bc3f7bd..be23dc8dd9 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -16,26 +16,30 @@ */ #include "script_component.hpp" -PARAMS_1(_vehicle); - if (!isServer) exitWith {}; +params ["_vehicle"]; +TRACE_1("params",_vehicle); + [{ //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) if (GVAR(VehicleStartingLockState) == -1) exitWith {}; + private ["_lock"]; - PARAMS_1(_vehicle); + + params ["_vehicle"]; + if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) _lock = switch (GVAR(VehicleStartingLockState)) do { - case (0): {(locked _vehicle) in [2, 3]}; - case (1):{true}; - case (2):{false}; + case (0): { (locked _vehicle) in [2, 3] }; + case (1): { true }; + case (2): { false }; }; - if (((_lock) && {(locked _vehicle) != 2}) || {(!_lock) && {(locked _vehicle) != 0}}) then { + if ((_lock && {(locked _vehicle) != 2}) || {!_lock && {(locked _vehicle) != 0}}) then { TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle); ["VehicleLock_SetVehicleLock", [_vehicle], [_vehicle, _lock]] call EFUNC(common,targetEvent); }; }; //Delay call until mission start (so everyone has the eventHandler's installed) -}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute); +}, [_vehicle], 0.25] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index 779f4a363e..390104cefc 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -18,7 +18,8 @@ private ["_returnValue","_sideKeyName","_customKeys"]; -PARAMS_2(_unit,_veh); +params ["_unit", "_veh"]; +TRACE_2("params",_unit,_veh); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 613a7b35dc..f4837c742b 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -22,7 +22,8 @@ private ["_vehLockpickStrenth","_condition","_returnValue"]; -PARAMS_3(_unit,_veh,_funcType); +params ["_unit", "_veh", "_funcType"]; +TRACE_3("params",_unit,_veh,_funcType); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; @@ -41,25 +42,20 @@ if (_vehLockpickStrenth < 0) exitWith {false}; //Condition check for progressBar _condition = { - PARAMS_1(_args); - EXPLODE_2_PVT(_args,_unit,_veh); + params ["_args"]; + _args params ["_args", "_unit", "_veh"]; ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; if (!([[_unit, _veh]] call _condition)) exitWith {false}; -_returnValue = false; -switch (true) do { -case (_funcType == "canLockpick"): { - _returnValue = true; - }; -case (_funcType == "startLockpick"): { +_returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; +switch (_funcType) do { + case "startLockpick": { [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); - _returnValue = true; }; -case (_funcType == "finishLockpick"): { + case "finishLockpick": { ["VehicleLock_SetVehicleLock", [_veh], [_veh, false]] call EFUNC(common,targetEvent); - _returnValue = true; }; default { ERROR("bad function type"); diff --git a/addons/vehiclelock/functions/fnc_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index 510b8ec7be..9b2c3cf182 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -17,10 +17,12 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedUnits,_activated); +if (!isServer) exitWith {}; + +params ["_logic", "_syncedUnits", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if (!_activated) exitWith {WARNING("Vehicle Lock Init Module - placed but not active");}; -if (!isServer) exitWith {}; //Set the GVAR for default lockpick strength [_logic, QGVAR(DefaultLockpickStrength), "DefaultLockpickStrength"] call EFUNC(common,readSettingFromModule); diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index ede20e3196..27577e4dbe 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -17,14 +17,18 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedObjects,_activated); +if (!isServer) exitWith {}; + +params ["_logic", "_syncedObjects", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; -if (!isServer) exitWith {}; [{ private ["_listOfVehicles"]; - PARAMS_1(_syncedObjects); + + params ["_syncedObjects"]; + _listOfVehicles = []; { if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then { diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 8199f4b850..5db2cbebe0 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_container); +params ["_unit", "_container"]; +TRACE_2("params",_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; diff --git a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf index 9d8a396e31..e959a705e0 100644 --- a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf +++ b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf @@ -18,7 +18,8 @@ private ["_currentKeys"]; -PARAMS_2(_veh,_key); +params ["_veh", "_key"]; +TRACE_2("params",_veh,_key); if (!isServer) exitWith {ERROR("only run on server");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index cb51cb27a8..d2290ef732 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -18,7 +18,8 @@ private ["_lockNumber"]; -PARAMS_2(_veh,_isLocked); +params ["_veh", "_isLocked"]; +TRACE_2("params",_veh,_isLocked); _lockNumber = if (_isLocked) then {2} else {0}; TRACE_2("Setting Lock State", _veh, _lockNumber); diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 7ddb07433a..151c02fd8a 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -1,10 +1,24 @@ -// by commy2 +/* + * Author: commy2 + * Toggle speed limiter for Driver in Vehicle. + * + * Arguments: + * 0: Driver + * 1: Vehicle + * + * Return Value: + * None + * + * Example: + * [player, car] call ace_vehicles_fnc_speedLimiter + * + * Public: No + */ #include "script_component.hpp" -private ["_driver", "_vehicle"]; +private "_maxSpeed"; -_driver = _this select 0; -_vehicle = _this select 1; +params ["_driver", "_vehicle"]; if (GETGVAR(isSpeedLimiter,false)) exitWith { [localize LSTRING(Off)] call EFUNC(common,displayTextStructured); @@ -16,19 +30,15 @@ if (GETGVAR(isSpeedLimiter,false)) exitWith { playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; -private "_maxSpeed"; _maxSpeed = speed _vehicle max 10; [{ - private ["_driver", "_vehicle", "_maxSpeed"]; - - _driver = _this select 0 select 0; - _vehicle = _this select 0 select 1; - _maxSpeed = _this select 0 select 2; + params ["_args", "_idPFH"]; + _args params ["_driver", "_vehicle", "_maxSpeed"]; if (!GVAR(isSpeedLimiter) || {_driver != driver _vehicle}) exitWith { GVAR(isSpeedLimiter) = false; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; private "_speed"; diff --git a/addons/vehicles/functions/fnc_startEngine.sqf b/addons/vehicles/functions/fnc_startEngine.sqf index 63afd78e2e..e2c171e018 100644 --- a/addons/vehicles/functions/fnc_startEngine.sqf +++ b/addons/vehicles/functions/fnc_startEngine.sqf @@ -1,23 +1,30 @@ -// by commy2 +/* + * Author: commy2 + * Delays engine start of vehicle. + * + * Arguments: + * 0: Vehicle + * 1: Is Engine on + * + * Return Value: + * None + * + * Example: + * [vehicle player, false] call ace_vehicle_fnc_startEngine + * + * Public: No + */ #include "script_component.hpp" -private ["_vehicle", "_isEngineOn"]; - -_vehicle = _this select 0; -_isEngineOn = _this select 1; +params ["_vehicle", "_isEngineOn"]; if (!_isEngineOn || {floor abs speed _vehicle > 0}) exitWith {}; [{ - private ["_vehicle", "_time", "_direction"]; + params ["_args", "_idPFH"]; + _args params ["_vehicle", "_time", "_direction"]; - _vehicle = _this select 0 select 0; - _time = _this select 0 select 1; - _direction = _this select 0 select 2; - - if (ACE_time > _time) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; + if (ACE_time > _time) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; _vehicle setVelocity [0, 0, 0]; _vehicle setVectorDirAndUp _direction; diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 2ef4b84ae6..ca03758df5 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_show_prompt); - private["_land_vehicle","_air_vehicle"]; +params ["_show_prompt"]; + if (!GVAR(enabled) || isNull ACE_player) exitWith {}; _land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 9060254c60..34a3f5ba46 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -20,7 +20,7 @@ private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"]; -PARAMS_2(_index_requested,_show_prompt); +params ["_index_requested", "_show_prompt"]; _new_view_distance = [_index_requested] call FUNC(returnValue); // changes the setting index into an actual view distance value _object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient. diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 7569383d0c..26072e5b5f 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -17,7 +17,7 @@ if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf index 145b8ae9e6..71a23d7b54 100644 --- a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -1,7 +1,7 @@ /* * Author: Winter * Returns the object view distance coefficient according to the given index - * + * * * Arguments: * 0: Object View Distance setting Index @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"]; + _return = switch (_index) do { case 0: {0.00}; // Off case 1: {0.20}; // Very Low @@ -31,4 +31,4 @@ _return = switch (_index) do { default {0.50}; // something broke if this returns }; -_return; \ No newline at end of file +_return; diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index fb449cf702..d374d69d60 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"]; + _return = switch (_index) do { case 0: {-1}; case 1: {500}; @@ -40,4 +40,4 @@ _return = switch (_index) do { default {1000}; }; -_return; \ No newline at end of file +_return; diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f45ed0ea57..572a83edf1 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -1,21 +1,26 @@ /* * Author: esteldunedain - * * Count how many grenade magazines the unit has on the uniform and vest. * - * Argument: - * 0: Muzzle name + * Arguments: + * 0: Unit + * 1: Muzzle Class * - * Return value: - * 0: Number of magazines - * 1: First magazine name + * Return Value: + * 0: Number of magazines + * 1: First magazine name + * + * Example: + * [player, currentMuzzle player] call ace_weaponselect_fnc_countMagazinesForGrenadeMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 81cb57d9f3..37956d2121 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -1,24 +1,28 @@ /* * Author: esteldunedain - * * Display a grenade type and quantity. * - * Argument: - * 0: magazine class - * 1: number of magazines + * Arguments: + * 0: magazine class + * 1: number of magazines * - * Return value: + * Return Value: * None + * + * Example: + * [currentMagazine player, 3] call ace_weaponselect_fnc_displayGrenadeTypeAndNumber + * + * Public: No */ #include "script_component.hpp" if !(GVAR(DisplayText)) exitwith {}; -PARAMS_2(_magazine,_numberofMagazines); - private ["_color", "_name", "_text", "_picture"]; -_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); +params ["_magazine", "_numberofMagazines"]; + +_color = [[1, 0, 0], [1, 1, 1]] select (_numberofMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); _text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf index 65d62826e5..2b2370260a 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * Find the next Grenade Magazine. + * + * Arguments: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return Value: + * Magazine classname + * + * Example: + * ["All"] call ace_weaponselect_fnc_findNextGrenadeMagazine + * + * Public: No + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMagazine"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf index 0491afa413..5aa096f44e 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * Find the next Grenade Muzzle. + * + * Arguments: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return Value: + * Class name of next throw muzzle + * + * Example: + * ["All"] call ace_weaponselect_fnc_findNextGrenadeMuzzle + * + * Public: No + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMuzzle"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 37e2b1c873..20ef674dae 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -1,9 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Fire Vehicle Smoke Launcher. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [vehicle player] call ace_weaponselect_fnc_fireSmokeLauncher + * + * Public: No + */ #include "script_component.hpp" private ["_turret", "_weapons"]; -PARAMS_1(_vehicle); +params ["_vehicle"]; _turret = [_vehicle] call EFUNC(common,getTurretCommander); diff --git a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf index 5e8c3f920f..aa89a13c98 100644 --- a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf +++ b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Returns the selected Grenade Muzzle. + * + * Arguments: + * None + * + * Return Value: + * Class name of selected throw muzzle + * + * Example: + * [] call ace_weaponselect_fnc_getSelectedGrenade + * + * Public: No + */ #include "script_component.hpp" [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag) diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 45e84d631d..c79f03c6f2 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,9 +1,24 @@ -// by commy2 +/* + * Author: commy2 + * Play the change firemode sound for specified weapon at units position. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_playChangeFiremodeSound + * + * Public: No + */ #include "script_component.hpp" private ["_sound"]; -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index a4cd743bfb..faddb4d869 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -1,17 +1,21 @@ /* * Author: commy2 - * * The unit will put its current weapon away. * - * Argument: - * 0: What unit should put the current weapon on back? (Object) + * Arguments: + * 0: Unit * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player] call ace_weaponselect_fnc_putWeaponAway + * + * Public: NO */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 69ea5cdf99..a68670184a 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -1,25 +1,28 @@ /* * Author: esteldunedain, commy2 - * * Cycle through all grenades. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeAll + * + * Public: No */ #include "script_component.hpp" private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); reverse _magazines; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 91d0023e47..c221b6cc30 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -1,19 +1,23 @@ /* * Author: esteldunedain, commy2 - * * Cycle through frags. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeFrag + * + * Public: No */ #include "script_component.hpp" private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index 28cc0e74d8..2f219989eb 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -1,19 +1,23 @@ /* * Author: esteldunedain, commy2 - * * Cycle through non explosive grenades. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeOther + * + * Public: No */ #include "script_component.hpp" private ["_nextMuzzle", "_text"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 012bf94898..815b8d28cf 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -1,17 +1,22 @@ /* * Author: commy2 - * * The player will select the specified weapon or will change to the next firing mode if the weapon was already selected. * - * Argument: - * 0: A weapon (String) + * Arguments: + * 0: Unit + * 1: Weapon * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_selectWeaponMode + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 67e63cd830..71c9cfc7b4 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -1,17 +1,22 @@ /* * Author: commy2 - * * The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle. * - * Argument: - * 0: A weapon (String) + * Arguments: + * 0: Unit + * 1: Weapon * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_selectWeaponMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 9507c23a30..9695079da5 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -1,7 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Select weapon for unit in vehicle. + * + * Arguments: + * 0: Unit + * 1: Vehicle + * 2: Weapon index + * + * Return Value: + * None + * + * Example: + * [player, vehicle player, 1] call ace_weaponselect_fnc_selectWeaponVehicle + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_unit,_vehicle,_index); +params ["_unit", "_vehicle", "_index"]; private "_turret"; _turret = [_unit] call EFUNC(common,getTurretIndex); diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index 4bf970fab1..ce7ec55393 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -1,21 +1,25 @@ /* * Author: esteldunedain - * * Select the next grenade muzzle to throw. * - * Argument: - * muzzle name + * Arguments: + * 0: Unit + * 1: Muzzlename * - * Return value: + * Return Value: * None * + * Example: + * [player, currentMuzzle player] call ace_weaponselect_fnc_setNextGrenadeMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index ab06fd5b5d..2cdc8e63dc 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -1,11 +1,27 @@ -// by commy2 +/* + * Author: commy2 + * Display Grenade information on grenade throw. + * + * Arguments: + * 0: unit - Object the event handler is assigned to + * 1: weapon - Fired weapon + * 2: muzzle - Muzzle that was used + * 3: mode - Current mode of the fired weapon + * 4: ammo - Ammo used + * 5: magazine - magazine name which was used + * 6: projectile - Object of the projectile that was shot + * + * Return Value: + * None + * + * Example: + * [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] call ace_weaponselect_fnc_throwGrenade + * + * Public: No + */ #include "script_component.hpp" -private ["_unit","_weapon","_magazine"]; - -_unit = _this select 0; -_weapon = _this select 1; -_magazine = _this select 5; +params ["_unit", "_weapon", "", "", "", "_magazine"]; if (_weapon != "Throw") exitWith {}; diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index e81463f41a..44a5b0696c 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -47,7 +47,7 @@ GVAR(WindInfo) = true; }; if (_windSpeed > 0.2) then { - _playerDir = getDir ACE_player; + _playerDir = (ACE_player call CBA_fnc_headDir) select 0; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); _windIndex = round(((_playerDir - _windDir + 360) % 360) / 30); _windIndex = _windIndex % 12; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index d3f9da8153..6c668a8033 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -21,9 +21,7 @@ */ #include "script_component.hpp" -private ["_unit", "_bullet"]; -_unit = _this select 0; -_bullet = _this select 6; +params ["_unit", "", "", "", "_ammo", "", "_bullet"]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false}; @@ -34,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" >> (_this select 4) >> "airFriction")]; +GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; true; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 40be14a2b2..037ce15c47 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -15,10 +15,7 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 23d0be6b79..baff39516d 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -18,11 +18,12 @@ [{ // BEGIN_COUNTER(pfeh); - private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_lastTime", "_trueSpeed", "_trueVelocity"]; + private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; - _lastTime = (_this select 0) select 0; + params ["_args"]; + _args params ["_lastTime"]; _deltaT = ACE_time - _lastTime; - (_this select 0) set [0, ACE_time]; + _args set [0, ACE_time]; _deleted = 0; _isWind = (vectorMagnitude ACE_wind > 0); diff --git a/documentation/development/arma-3-issues.md b/documentation/development/arma-3-issues.md index 4a3e9ea0fc..16f9988409 100644 --- a/documentation/development/arma-3-issues.md +++ b/documentation/development/arma-3-issues.md @@ -22,6 +22,7 @@ Keeping track of Arma 3 issues that need to be fixed. If you want to support us * [James2464: 0023725: All Environment Rocks Should Have PhysX LODs](http://feedback.arma3.com/view.php?id=23725) * [Jaynus: 0023679: Display event handler return values for mouse buttons should be respected](http://feedback.arma3.com/view.php?id=23679) * [Heisenberg: 0023741: Switching between optic modes of a sniper scope (AMS, DMS, MOS) will result in a blurred vision](http://feedback.arma3.com/view.php?id=23741) +* [AgentRev: 0022310: setObjectTextureGlobal causing "Cannot load texture" errors when used with valid mission files](http://feedback.arma3.com/view.php?id=22310) **Resolved:** diff --git a/documentation/feature/finger.md b/documentation/feature/finger.md index 9920ee9e66..3943980a97 100644 --- a/documentation/feature/finger.md +++ b/documentation/feature/finger.md @@ -3,6 +3,7 @@ layout: wiki title: Finger description: Finger pointing group: feature +category: realism parent: wiki --- diff --git a/documentation/feature/interaction.md b/documentation/feature/interaction.md index 340fabf3db..3916afede2 100644 --- a/documentation/feature/interaction.md +++ b/documentation/feature/interaction.md @@ -2,8 +2,8 @@ layout: wiki title: Interaction description: -category: Interaction group: feature +category: interaction parent: wiki --- diff --git a/documentation/feature/parachute.md b/documentation/feature/parachute.md index adc87b8aa3..39f353f08b 100644 --- a/documentation/feature/parachute.md +++ b/documentation/feature/parachute.md @@ -3,6 +3,7 @@ layout: wiki title: Parachute description: Add an altimeter and a non-steerable parachute group: feature +category: equipment parent: wiki --- diff --git a/documentation/feature/sitting.md b/documentation/feature/sitting.md index 81367ed71d..aee2ee859d 100644 --- a/documentation/feature/sitting.md +++ b/documentation/feature/sitting.md @@ -3,6 +3,7 @@ layout: wiki title: Sitting description: group: feature +category: interaction parent: wiki --- diff --git a/documentation/feature/slideshow.md b/documentation/feature/slideshow.md index 2dcd0d2f9f..0ff2372064 100644 --- a/documentation/feature/slideshow.md +++ b/documentation/feature/slideshow.md @@ -2,6 +2,7 @@ layout: wiki title: Slideshow group: feature +category: interaction parent: wiki --- @@ -10,7 +11,7 @@ This adds the ability to have images shown on some objects and have other object Please note that only objects with hiddenSelection 0 can be used to render images (whiteboard, TV, PC Screen being the most notable examples). ## 2. Usage -Note that this sections is for users, for mission makers refer to [the entry in mission-tools](./missionmaker/mission-tools.html) +Note that this sections is for users, for mission makers refer to [the entry in mission-tools](../missionmaker/mission-tools.html) Also if no remotes are defined the "screen" object itself becomes the remote. ### 2.1 Switching between images diff --git a/documentation/missionmaker/mission-tools.md b/documentation/missionmaker/mission-tools.md index 9904acbeae..eeb4c2be06 100644 --- a/documentation/missionmaker/mission-tools.md +++ b/documentation/missionmaker/mission-tools.md @@ -15,13 +15,14 @@ parent: wiki They can be found in the editor under: "Empty" >> "ACE Respawn" **Classnames:** -* `ACE_Rallypoint_West`, `ACE_Rallypoint_West_Base` -* `ACE_Rallypoint_East`, `ACE_Rallypoint_East_Base` -* `ACE_Rallypoint_Independent`, `ACE_Rallypoint_Independent_Base` +- `ACE_Rallypoint_West`, `ACE_Rallypoint_West_Base` +- `ACE_Rallypoint_East`, `ACE_Rallypoint_East_Base` +- `ACE_Rallypoint_Independent`, `ACE_Rallypoint_Independent_Base` Using the Interaction Menu on a rallypoint offers the ability to teleport from one flagpole to the other flagpole and vice versa. If you want to change the texture of the flag use this line: + ```c++ this setFlagTexture 'path\to\my\texture\my_awesome_clan_logo.paa'; ``` @@ -32,7 +33,7 @@ All units synced to the ["Rallypoint System" module](./modules.html#1.14-rallypo
Note:
-

It's important to mention that this doesn't work for player who join during a mission (JIP = Join in progress). That's something we can't change because that's the way Bohemia has implemented their module framework.

+

It's important to mention that this doesn't work for player who join during a mission (JIP = Join in progress). That's something we can't change because that's the way Bohemia Interactive has implemented their module framework.

To enable other units to move them add this to the unit's initialization code: @@ -77,6 +78,12 @@ Slide duration | 0 (0 = disabled, number is in seconds) - Only objects with hiddenSelection 0 can be used as "screens". - If you set a duration the remotes will be disabled. (If the remotes are disabled `ace_interaction` is not needed) - You can have multiple sets of images on different screens, see the advanced slideshow below. +- It is advisable images resolution sizes are powers of 2 (eg. 512x512) to avoid graphical glitches in them. + +
+
Note:
+

Mission MUST be in a PBO format (not bare folder) when used on a dedicated server due to an [issue](http://feedback.arma3.com/view.php?id=22310) to prevent errors.

+
### 3.2 Basic slideshow *A set of 4 images that are swapped via a remote* diff --git a/tools/search_privates.py b/tools/search_privates.py index 37320214fc..207c6403e0 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -21,7 +21,7 @@ def get_private_declare(content): priv_split = sorted(set(priv_split)) priv_declared += priv_split; - srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') + srch = re.compile('params \[.*\]|PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared)) diff --git a/tools/search_unused_privates.py b/tools/search_unused_privates.py index b9bdd880ce..72a0dadcea 100644 --- a/tools/search_unused_privates.py +++ b/tools/search_unused_privates.py @@ -21,7 +21,7 @@ def get_private_declare(content): priv_split = sorted(set(priv_split)) priv_declared += priv_split; - srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') + srch = re.compile('params \[.*\]|PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared))