diff --git a/README.md b/README.md index 146784e36b..5a01e5d5de 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@

- ACE3 Version + ACE3 Version - + ACE3 Download diff --git a/ace_medical.dll b/ace_medical.dll index 790154d4c4..c54febf34f 100644 Binary files a/ace_medical.dll and b/ace_medical.dll differ diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf index 639bf74919..375fcd5f89 100644 --- a/addons/backpacks/XEH_postInit.sqf +++ b/addons/backpacks/XEH_postInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler); +["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 9488bf6bd9..4e61e8fbcc 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -1,18 +1,19 @@ /* * Author: commy2 + * Someone opened your backpack. Play sound and camshake. Execute locally. * - * Someone opened your backpack. Execute locally. - * - * Argument: + * Arguments: * 0: Who accessed your inventory? (Object) * 1: Unit that wields the backpack (Object) * 2: The backpack object (Object) * - * Return value: - * None. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_sounds", "_position"]; + params ["_target", "_backpack"]; // do cam shake if the target is the player @@ -20,7 +21,8 @@ if ([_target] call EFUNC(common,isPlayer)) then { addCamShake [4, 0.5, 5]; }; -// play a rustling sound +// play a zipper sound effect +private ["_sounds", "_position"]; _sounds = [ /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss", @@ -32,8 +34,7 @@ _sounds = [ QUOTE(PATHTO_R(sounds\zip_out.wav)) ]; -_position = _target modelToWorldVisual (_target selectionPosition "Spine3"); -_position = _position call EFUNC(common,positionToASL); +_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3")); playSound3D [ _sounds select floor random count _sounds, diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index 3419d2ed38..fab82c505f 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -1,23 +1,24 @@ /* * Author: commy2 + * Check if the given backpack is an actual backpack that can store items. Parachute, static weapon packs, etc. will return false. * - * Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example. + * Arguments: + * 0: Backpack * - * Argument: - * 0: A backpack (Object or String) + * Return Value: + * Boolean * - * Return value: - * Boolean (Bool) + * Public: Yes */ #include "script_component.hpp" -private ["_config"]; params ["_backpack"]; if (typeName _backpack == "OBJECT") then { _backpack = typeOf _backpack; }; +private "_config"; _config = configFile >> "CfgVehicles" >> _backpack; -getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} +getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index afeeb21313..154000202d 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -1,17 +1,19 @@ /* * Author: commy2 + * Handle the open inventory event. Camshake and sound on target client. * - * Handle the open inventory event. Display message on target client. + * Arguments: + * 0: Unit + * 1: Backpack * - * Argument: - * Input from "InventoryOpened" eventhandler - * - * Return value: + * Return Value: * false. Always open the inventory dialog. (Bool) + * + * Public: No */ #include "script_component.hpp" -params ["_unit","_backpack"]; +params ["_unit", "_backpack"]; // exit if the target is not a real backpack, i.e. parachute, static weapon bag etc. if !([_backpack] call FUNC(isBackpack)) exitWith {false}; diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 1372b4e10a..fec6e84fbe 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -18,7 +18,6 @@ if (isServer) then { }]; }; -["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler); ["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler); ["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); ["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler); diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index 5e7eb34a76..368ce3cb7a 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -23,4 +23,9 @@ params ["_unit", "_target"]; ("ACE_CableTie" in (items _unit)) && {alive _target} && {!(_target getVariable [QGVAR(isHandcuffed), false])} && -(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2))) +{ + (_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious + {GVAR(requireSurrender) == 0} || //or don't require surrendering + {_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering + {(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon +} diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index 5476073b38..d89049a031 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -26,7 +26,7 @@ if (local _unit) then { }; if (_unit getVariable [QGVAR(isSurrendering), false]) then { - [_unit, false] call FUNC(setSurrender); + [_unit, false] call FUNC(setSurrendered); }; if (_unit getVariable [QGVAR(isHandcuffed), false]) then { diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 15aaaadad6..689ba5f19e 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -16,85 +16,73 @@ class Extended_Killed_EventHandlers { }; }; -class Extended_Init_EventHandlers { +//Need initPost or we have problems with setVariable with 'ACE_Cargo' +class Extended_InitPost_EventHandlers { class StaticWeapon { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ReammoBox_F { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class Cargo_base_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class CargoNet_01_box_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Land_CargoBox_V1_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Land_PaperBox_closed_F { class ADDON { init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); }; }; - class Car { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Tank { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Plane { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class Ship_F { class ADDON { init = QUOTE(_this call DFUNC(initVehicle)); }; }; - class ACE_RepairItem_Base { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ACE_bodyBagObject { class ADDON { init = QUOTE(_this call DFUNC(initObject)); }; }; - class ACE_ConcertinaWireCoil { class ADDON { init = QUOTE(_this call DFUNC(initObject)); diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 1233d0228d..9f349153c0 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -6,6 +6,7 @@ * 0: Item Classname * 1: Vehicle * 2: Amount (default: 1) + * 3: Show Hint (default: false) * * Return Value: * None @@ -18,7 +19,7 @@ #include "script_component.hpp" private ["_position", "_item", "_i"]; -params ["_itemClass", "_vehicle", ["_amount", 1]]; +params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; TRACE_3("params",_itemClass,_vehicle,_amount); _position = getPos _vehicle; @@ -29,9 +30,11 @@ for "_i" from 1 to _amount do { _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; // Load item or delete it if no space left - if !([_item, _vehicle] call FUNC(loadItem)) exitWith { + if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith { + TRACE_1("no room to load item - deleting",_item); deleteVehicle _item; }; + TRACE_1("Item Loaded",_item); // Invoke listenable event ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index efb3b9a5cf..8857030cb7 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -25,7 +25,11 @@ _initializedClasses = GETMVAR(GVAR(initializedClasses),[]); if (isServer) then { { if (isClass _x) then { - ["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent); + private ["_cargoClassname", "_cargoCount"]; + _cargoClassname = getText (_x >> "type"); + _cargoCount = getNumber (_x >> "amount"); + TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount); + ["AddCargoByClass", [_cargoClassname, _vehicle, _cargoCount]] call EFUNC(common,localEvent); }; } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); }; @@ -41,7 +45,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex private ["_text", "_condition", "_statement", "_icon", "_action"]; _condition = { params ["_target", "_player"]; - GVAR(enable) && {locked _target < 2} && {[_player, _target, []] call EFUNC(common,canInteractWith)} + GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, []] call EFUNC(common,canInteractWith)} }; _text = localize LSTRING(openMenu); _statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 3c79604a04..11e7638f1b 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Object * 1: Vehicle + * 2: Show Hint (default: true) * * Return value: * Object loaded @@ -18,14 +19,20 @@ private ["_loaded", "_space", "_itemSize"]; -params ["_item", "_vehicle"]; +params ["_item", "_vehicle", ["_showHint", true, [true]] ]; +TRACE_2("params",_item,_vehicle); -if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; +if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith { + TRACE_2("canLoadItemIn failed",_item,_vehicle); + false +}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded pushback _item; _vehicle setVariable [QGVAR(loaded), _loaded, true]; +TRACE_1("added to loaded array",_loaded); + _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; @@ -40,7 +47,9 @@ private ["_itemName", "_vehicleName"]; _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); -["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); +if (_showHint) then { + ["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); +}; // Invoke listenable event ["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index 9716d7a536..3f4d6c5d51 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT cargo #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_CARGO #define DEBUG_MODE_FULL #endif diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index e8e71291d0..79b8c8aeea 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -17,8 +17,6 @@ params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]]; -//["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); - private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"]; // get old direction vector diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 4c923899a1..9cb5ed4d61 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -92,5 +92,5 @@ if (!isServer) then { }; if (_checkAll) then { - 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); // @todo + 0 spawn COMPILE_FILE(scripts\checkVersionNumber); // @todo }; diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf index 0bfb1d465f..80f6291d0f 100644 --- a/addons/common/functions/fnc_codeToLetter.sqf +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_codeToLetter","3.5.0","-"); + ["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index f09215e200..6430a7bb11 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -38,8 +38,7 @@ if (_level <= _defaultLoglevel) then { }; diag_log _message; - // pass it onwards to the log function: - // [0, [], compile format["%1",_msg], true] call FUNC(log); + }; true diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index ffa6d8e28f..8b00cedeac 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -44,11 +44,7 @@ if (_state) then { private ["_dlg", "_ctrl"]; - _dlg = finddisplay 49; - _dlg displayAddEventHandler ["KeyDown", { - params ["", "_key"]; - !(_key == 1) - }]; + _dlg = findDisplay 49; for "_index" from 100 to 2000 do { (_dlg displayCtrl _index) ctrlEnable false; @@ -97,16 +93,17 @@ if (_state) then { _dlg displayAddEventHandler ["KeyUp", {true}]; - ["ACE_DisableUserInput", "onEachFrame", { + GVAR(disableInputPFH) = [{ if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + [GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(disableInputPFH) = nil; [true] call FUNC(disableUserInput); }; - }] call BIS_fnc_addStackedEventHandler; - + }, 0, []] call CBA_fnc_addPerFrameHandler; } else { - if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { - ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + if (!isNil QGVAR(disableInputPFH)) then { + [GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler; + GVAR(disableInputPFH) = nil; }; (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf index 5fe94dcef7..24084d2c11 100644 --- a/addons/common/functions/fnc_fixFloating.sqf +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -19,14 +19,17 @@ _object = _this; if (!local _object) exitWith {}; // save and restore hitpoints, see below why -private ["_hitPoints", "_hitPointDamages"]; +private "_hitPointDamages"; +_hitPointDamages = getAllHitPointsDamage _object; -_hitPoints = [_object] call FUNC(getHitpoints); -_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map); +// get correct format for objects without hitpoints +if (_hitPointDamages isEqualTo []) then { + _hitPointDamages = [[],[],[]]; +}; // this prevents physx objects from floating when near other physx objects with allowDamage false _object setDamage damage _object; { - _object setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; -} forEach _hitPoints; + _object setHitIndex [_forEachIndex, _x]; +} forEach (_hitPointDamages select 2); diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 8b2f10728c..6c0645007e 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage"); + params ["_vehicle"]; (getAllHitPointsDamage _vehicle select 0) - [""] diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 7b027d9efa..36475672b9 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage"); + params ["_vehicle"]; private "_hitPointsWithSelections"; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 586a37847c..7f881ff746 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY"); + params ["_configEntry", "_configMatch"]; if (configName _configEntry == _configMatch) exitWith {true}; diff --git a/addons/common/functions/fnc_isAlive.sqf b/addons/common/functions/fnc_isAlive.sqf index 343466c00d..b9d94eed5d 100644 --- a/addons/common/functions/fnc_isAlive.sqf +++ b/addons/common/functions/fnc_isAlive.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_isAlive","3.5.0","alive"); + params ["_unit"]; !isNull _unit && {alive _unit} // return diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 15861938b8..39eb460cc4 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut"); + params ["_unit"]; isTurnedOut _unit // return diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf index 12e6cf72ce..7bbbcf4f3d 100644 --- a/addons/common/functions/fnc_letterToCode.sqf +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_letterToCode","3.5.0","-"); + [-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_loadPersonLocal.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf index 2d8295e4af..5b52b38b05 100644 --- a/addons/common/functions/fnc_loadPersonLocal.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -17,7 +17,7 @@ params ["_unit", "_vehicle", "_caller"]; if (!alive _unit) then { - _unit = [_unit, _caller] call FUNC(makeCopyOfBody); + // _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist }; private "_slotsOpen"; @@ -41,8 +41,7 @@ if (_slotsOpen) then { _vehicle setVariable [QGVAR(loaded_persons), _loaded, true]; - // @todo never used. Remove? - /*if !([_unit] call FUNC(isAwake)) then { + if !([_unit] call FUNC(isAwake)) then { [{ (_this select 0) params ["_unit", "_vehicle"]; @@ -60,5 +59,5 @@ if (_slotsOpen) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler; - };*/ + }; }; diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 83e62fcf8b..c2ba1bee18 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -19,10 +19,10 @@ _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume); - [false] call FUNC(disableKeyInput); - - if (["ace_medical"] call FUNC(isModLoader)) then { - [false] call EFUNC(medical,effectBlackOut); + // [false] call FUNC(disableKeyInput); //func does not exist + + if (["ace_medical"] call FUNC(isModLoaded)) then { + // [false] call EFUNC(medical,effectBlackOut); //func does not exist }; if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 76082013ef..287c4566d5 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort"); + params ["_array", "_elementN"]; private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"]; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index e8d469867e..9bdb6ff647 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -14,4 +14,6 @@ */ #include "script_component.hpp" +ACE_DEPRECATED("ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements"); + _this call FUNC(uniqueElements) diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 8dd2737b83..67d104a9e4 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -73,9 +73,7 @@ _unit action ["Eject", vehicle _unit]; _unit setPosASL AGLToASL _emptyPos; - // @todo never used. Remove? - /*if !([_unit] call FUNC(isAwake)) then { - + if !([_unit] call FUNC(isAwake)) then { TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); if (driver _unit == _unit) then { @@ -92,7 +90,7 @@ _unit action ["Eject", vehicle _unit]; }; }, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute); }; - };*/ + }; }, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute); [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); diff --git a/addons/common/scripts/Version/script_component.hpp b/addons/common/scripts/Version/script_component.hpp deleted file mode 100644 index 23da62b05c..0000000000 --- a/addons/common/scripts/Version/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf similarity index 100% rename from addons/common/scripts/Version/checkVersionNumber.sqf rename to addons/common/scripts/checkVersionNumber.sqf diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml index 9d95873e64..1abd146800 100644 --- a/addons/dagr/stringtable.xml +++ b/addons/dagr/stringtable.xml @@ -5,21 +5,25 @@ DAGR DAGR DAGR + DAGR Configure DAGR Konfiguruj DAGR Configurar DAGR + Настроить DAGR Toggle DAGR Przełącz DAGR Mostrar DAGR + Вкл./выкл. DAGR Defense Advanced GPS Receiver Defense Advanced GPS Receiver Defense Advanced GPS Receiver + Военный многофункциональный GPS-приёмник diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index d0eb7fda17..b50383707a 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject_carry); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index dea8897b27..f6ff252886 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index ae5ad17978..eafc9b8e01 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index f527cda7d8..1edbd92a99 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) -if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { +if (!alive _target || {_unit distance _target > 10}) then { [_unit, _target] call FUNC(dropObject); [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 764c0cd7b8..fa00fdd207 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -45,7 +45,7 @@ _children = []; format ["Explosive_%1", _forEachIndex], format [_name + " (%1)", _itemCount select _forEachIndex], getText(_x >> "picture"), - {_this call FUNC(setupExplosive);}, + {[{_this call FUNC(setupExplosive)}, _this] call EFUNC(common,execNextFrame)}, {true}, {}, (configName _x) diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 55a41043b9..b7173f5742 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -87,8 +87,6 @@ if (_suitCoef == 0) then {_suitCoef = 0.001}; _gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG; _gRedOut = MINVIRTUALG / _classCoef; -["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log); - // @todo: Sort the interaction with medical if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { [ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious); diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf index 863046da7f..85692a0f57 100644 --- a/addons/goggles/functions/fnc_onEachFrame.sqf +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -17,7 +17,7 @@ if (isNull(ace_player)) exitWith {}; GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; if (GVAR(FrameEvent) select 0) exitWith { - if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; + if (vehicle ace_player != ace_player && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; }; private ["_rotorWash","_safe"]; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf index b5badef6f2..6f351f4002 100644 --- a/addons/goggles/functions/fnc_rainEffect.sqf +++ b/addons/goggles/functions/fnc_rainEffect.sqf @@ -19,7 +19,7 @@ if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; _fnc_underCover = { private ["_pos", "_unit"]; _unit = (_this select 0); - if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; + if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true}; _pos = eyePos _unit; ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} }; diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 6cb16b0328..5aa33284c8 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -1,3 +1,4 @@ + class CfgAmmo { class FlareCore; class FlareBase: FlareCore { diff --git a/addons/grenades/CfgEventHandlers.hpp b/addons/grenades/CfgEventHandlers.hpp index 2587bdf86f..d93f8469bc 100644 --- a/addons/grenades/CfgEventHandlers.hpp +++ b/addons/grenades/CfgEventHandlers.hpp @@ -1,19 +1,20 @@ + class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) ); + firedBIS = QUOTE(_this call FUNC(throwGrenade)); }; }; }; diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp index 7cf2085193..94c60e10d7 100644 --- a/addons/grenades/CfgVehicles.hpp +++ b/addons/grenades/CfgVehicles.hpp @@ -1,9 +1,6 @@ + class CfgVehicles { class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class Box_NATO_Support_F; - class Box_NATO_Grenades_F: NATO_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_White,12); @@ -12,6 +9,7 @@ class CfgVehicles { }; }; + class EAST_Box_Base; class Box_East_Grenades_F: EAST_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_Yellow,12); @@ -20,6 +18,7 @@ class CfgVehicles { }; }; + class IND_Box_Base; class Box_IND_Grenades_F: IND_Box_Base { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_Yellow,12); @@ -28,6 +27,7 @@ class CfgVehicles { }; }; + class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_HandFlare_White,12); diff --git a/addons/grenades/CfgWeapons.hpp b/addons/grenades/CfgWeapons.hpp index 4edc6e6d12..f84c00713a 100644 --- a/addons/grenades/CfgWeapons.hpp +++ b/addons/grenades/CfgWeapons.hpp @@ -1,21 +1,26 @@ + class CfgWeapons { class GrenadeLauncher; - class Throw: GrenadeLauncher { - muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"}; + muzzles[] += {"ACE_HandFlare_WhiteMuzzle","ACE_HandFlare_RedMuzzle","ACE_HandFlare_GreenMuzzle","ACE_HandFlare_YellowMuzzle","ACE_M84Muzzle"}; + class ThrowMuzzle; class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_White"}; }; + class ACE_HandFlare_RedMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Red"}; }; + class ACE_HandFlare_GreenMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Green"}; }; + class ACE_HandFlare_YellowMuzzle: ThrowMuzzle { magazines[] = {"ACE_HandFlare_Yellow"}; }; + class ACE_M84Muzzle: ThrowMuzzle { magazines[] = {"ACE_M84"}; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 260bf63f6e..54c2b06e8b 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" -["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler); +["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler); if (!hasInterface) exitWith {}; @@ -21,4 +21,4 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; [] call FUNC(nextMode); }, {false}, -[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key +[9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 1f7e97c47a..b45dc099fc 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,13 +15,14 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; params ["_grenade"]; +private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"]; + _affected = _grenade nearEntities ["CAManBase", 20]; { - if ((local _x) && {alive _x}) then { + if (local _x && {alive _x}) then { _strength = 1 - ((_x distance _grenade) min 15) / 15; @@ -30,16 +31,19 @@ _affected = _grenade nearEntities ["CAManBase", 20]; if (_x != ACE_player) then { //must be AI [_x, true] call EFUNC(common,disableAI); - _x setSkill ((skill _x) / 50); + + _x setSkill (skill _x / 50); [{ params ["_unit"]; + //Make sure we don't enable AI for unconscious units - if (!(_unit getVariable ["ace_isunconscious", false])) then { + if !(_unit getVariable ["ace_isUnconscious", false]) then { [_unit, false] call EFUNC(common,disableAI); }; + _unit setSkill (skill _unit * 50); - }, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute); + }, [_x], 7 * _strength] call EFUNC(common,waitAndExecute); } else { //Do effects for player // is there line of sight to the grenade? @@ -49,7 +53,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) _losCount = { - (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) + !lineIntersects [_posGrenade vectorAdd _x, _eyePos, _grenade, ACE_player] } count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; TRACE_1("Line of sight count (out of 4)",_losCount); @@ -57,9 +61,9 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _strength = _strength / 10; }; - //Add ace_hearing ear ringing sound effect - if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then { - [_x, (20 * _strength)] call EFUNC(hearing,earRinging); + // add ace_hearing ear ringing sound effect + if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then { + [_x, 20 * _strength] call EFUNC(hearing,earRinging); }; // account for people looking away by slightly @@ -68,16 +72,16 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _dirToUnitVector = _eyePos vectorFromTo _posGrenade; _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); - //From 0-45deg, full effect + // from 0-45deg, full effect if (_angleDiff > 45) then { _strength = _strength - _strength * ((_angleDiff - 45) / 120); }; TRACE_1("Final strength for player",_strength); - //Add ace_medical pain effect: - if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then { - [ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel); + // add ace_medical pain effect: + if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {_strength > 0.1}) then { + [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); }; // create flash to illuminate environment @@ -87,14 +91,14 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _light setLightColor [1,1,1]; _light setLightDayLight true; - //Delete the light after 0.1 seconds + // delete the light after 0.1 seconds [{ params ["_light"]; deleteVehicle _light; }, [_light], 0.1] call EFUNC(common,waitAndExecute); // blind player - if (_strength > 0.1 && hasInterface) then { + if (hasInterface && {_strength > 0.1}) then { GVAR(flashbangPPEffectCC) ppEffectEnable true; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; @@ -102,14 +106,15 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //PARTIALRECOVERY - start decreasing effect over ACE_time [{ params ["_strength"]; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); - }, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute); + }, [_strength], 7 * _strength] call EFUNC(common,waitAndExecute); //FULLRECOVERY - end effect [{ GVAR(flashbangPPEffectCC) ppEffectEnable false; - }, [], (17 * _strength)] call EFUNC(common,waitAndExecute); + }, [], 17 * _strength] call EFUNC(common,waitAndExecute); }; }; }; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index f0e2406b53..21d132464a 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -14,6 +14,7 @@ * Public: No */ #include "script_component.hpp" + params ["_projectile"]; if (alive _projectile) then { @@ -21,5 +22,6 @@ if (alive _projectile) then { private "_affected"; _affected = _projectile nearEntities ["CAManBase", 50]; + ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 1464639123..05dde3a1bf 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -138,6 +138,7 @@ Aktiviere Taubheit im Gefecht? Povolit ztrátu sluchu? 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 @@ -165,4 +166,4 @@ Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos. - + \ No newline at end of file diff --git a/addons/hitreactions/ACE_Settings.hpp b/addons/hitreactions/ACE_Settings.hpp index adbbdacaf2..4fa45e8ebc 100644 --- a/addons/hitreactions/ACE_Settings.hpp +++ b/addons/hitreactions/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(minDamageToTrigger) { //Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely. diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index 7fa6453fe2..d93b99bd6b 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -1,39 +1,52 @@ -// by commy2 +/* + * Author: commy2 + * Adds reactions to a unit that was hit. EH only runs where to unit is local. Adds screams, falling down, falling from ladders, ejecting from static weapons and camshake for players + * + * Arguments: + * 0: unit + * 1: firer + * 2: damage taken + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" params ["_unit", "_firer", "_damage"]; +// exit if system is disabled +if (GVAR(minDamageToTrigger) == -1) exitWith {}; + +// don't fall after minor damage +if (_damage < GVAR(minDamageToTrigger)) exitWith {}; + // don't fall on collision damage if (_unit == _firer) exitWith {}; -//Exit if system disabled: -if (GVAR(minDamageToTrigger) == -1) exitWith {}; - -// cam shake for player +// camshake for player if (_unit == ACE_player) then { addCamShake [3, 5, _damage + random 10]; }; +// play scream sound +if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { + [_unit] call EFUNC(medical,playInjuredSound); +}; + private "_vehicle"; _vehicle = vehicle _unit; // handle static weapons -if (_vehicle isKindOf "StaticWeapon") exitwith { +if (_vehicle isKindOf "StaticWeapon") exitWith { if (!alive _unit) then { _unit action ["Eject", _vehicle]; unassignVehicle _unit; }; }; -// don't fall after minor damage -if (_damage < GVAR(minDamageToTrigger)) exitWith {}; - -// play sound -if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { - [_unit] call EFUNC(medical,playInjuredSound); -}; - -//Don't do animations if in a vehicle (looks weird and animations never reset): +// don't do animations if in a vehicle (looks weird and animations never reset): if (_vehicle != _unit) exitWith {}; // this checks most things, so it doesn't mess with being inside vehicles or while dragging etc. @@ -54,40 +67,52 @@ _velocity = vectorMagnitude velocity _unit; if (_velocity < 2) exitWith {}; // get correct animation by weapon -private ["_isPlayer", "_isRunning", "_anim"]; +private "_anim"; -_isPlayer = [_unit] call EFUNC(common,isPlayer); -_isRunning = _velocity > 4; +call { + private "_weapon"; + _weapon = currentWeapon _unit; -_anim = switch (currentWeapon _unit) do { - case (""): {"AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"}; - case (primaryWeapon _unit): { - if !(_isPlayer) exitWith {"AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"}; - - [ - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", - "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" - ] select floor random 4; + if (_weapon == "") exitWith { + _anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon" }; - case (handgunWeapon _unit): { - if !(_isPlayer) exitWith {"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"}; - [ - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", - "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" - ] select floor random 4; + if (_weapon == primaryWeapon _unit) exitWith { + if ([_unit] call EFUNC(common,isPlayer)) then { + private "_isRunning"; + _isRunning = _velocity > 4; + + _anim = [ + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + ["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning, + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft", + "AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright" + ] select floor random 4; + } else { + _anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"; + }; }; - default {""}; + + if (_weapon == handgunWeapon _unit) exitWith { + if ([_unit] call EFUNC(common,isPlayer)) then { + _anim = [ + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft", + "AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright" + ] select floor random 4; + } else { + _anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"; + }; + }; + + _anim = ""; }; -// exit if no animation for this weapon exists, i.E. binocular or rocket launcher +// exit if no animation for this weapon exists, i.e. binocular or rocket launcher if (_anim == "") exitWith {}; // don't mess with transitions. don't fall then. -if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {}; - -[_unit, _anim, 2] call EFUNC(common,doAnimation); +if !([_unit] call EFUNC(common,inTransitionAnim)) then { + [_unit, _anim, 2] call EFUNC(common,doAnimation); +}; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index 119afe4294..44dfddcadd 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -111,7 +111,8 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; private ["_badClassnames"]; _badClassnames = []; { - if ((isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}) then { + //Only check Land objects (WeaponHolderSimulated show up in `vehicles` for some reason) + if ((_x isKindOf "Land") && {(isNil (format [QGVAR(Act_%1), typeOf _x])) || {isNil (format [QGVAR(SelfAct_%1), typeOf _x])}}) then { if (!((typeOf _x) in _badClassnames)) then { _badClassnames pushBack (typeOf _x); ACE_LOGERROR_3("Compile checks bad for (classname: %1)(addon: %2) %3", (typeOf _x), (unitAddons (typeOf _x)), _x); diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 130c7427d8..c2ecab058b 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -99,6 +99,11 @@ #define ACE_isHC (!hasInterface && !isDedicated) +//By default CBA's TRACE/LOG/WARNING spawn a buffer, which can cause messages to be logged out of order: +#ifdef CBA_DEBUG_SYNCHRONOUS + #define CBA_fnc_log { params ["_file","_lineNum","_message"]; diag_log [diag_frameNo, diag_tickTime, time, _file + ":"+str(_lineNum + 1), _message]; } +#endif + #define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message) #define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message) @@ -182,4 +187,6 @@ #define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) #define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) +#define ACE_DEPRECATED(arg1,arg2,arg3) ACE_LOGWARNING_3("%1 is deprecated. Support will be dropped in version %2. Replaced by: %3",arg1,arg2,arg3) + #include "script_debug.hpp" diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index e7b0479d24..c87a23aba2 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,8 +5,8 @@ #define MAJOR 3 #define MINOR 3 -#define PATCHLVL 1 -#define BUILD 2 +#define PATCHLVL 2 +#define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 3b203c1f62..560453b416 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -67,7 +67,7 @@ class CfgVehicles { displayName = CSTRING(BFT_Module_DisplayName); function = QFUNC(blueForceTrackingModule); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { class Enabled { diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index 5de07bb457..77275ffd4c 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -1,6 +1,5 @@ /* * Author: KoffeinFlummi -* * Initializes the blue force tracking module. * * Arguments: @@ -12,15 +11,12 @@ #include "script_component.hpp" -if (!hasInterface) exitWith {}; +if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); - -if !(_activated) exitWith {}; +params ["_logic"]; [_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); -ACE_LOGINFO("Blue Force Tracking Module Initialized."); -TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); +ACE_LOGINFO_3("Blue Force Tracking Module Initialized:", GVAR(BFT_Enabled), GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 442ec4d50e..19869ee3ce 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -91,6 +91,4 @@ if (_dir != 1) then { _handled }; -diag_log text format ["HJa %1", _handled]; - _handled diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index ecb9afdfe4..2912c87011 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -122,6 +122,17 @@ class ACE_Torso { enableInside = 1; icon = PATHTOF(UI\icons\triageCard.paa); }; + class Diagnose { + displayName = CSTRING(Actions_Diagnose); + distance = 5.0; + condition = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(canTreatCached)); + statement = QUOTE([ARR_4(_player, _target, 'body', 'Diagnose')] call DFUNC(treatment)); + EXCEPTIONS + showDisabled = 0; + priority = 2; + hotkey = ""; + icon = ""; + }; // Advanced medical class FieldDressing { diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 3b071948f3..0e341792c9 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -23,7 +23,7 @@ if (!local _unit) exitwith { [_this, QFUNC(addToLog), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; -date params ["", "", "", "_minute", "_hour"]; +date params ["", "", "", "_hour", "_minute"]; _moment = format [ (["%1:%2", "%1:0%2"] select (_minute < 10)), _hour, _minute]; diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 56b2042bc9..76d74f85a7 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -18,7 +18,7 @@ private ["_log", "_inList", "_amount"]; params ["_unit", "_newItem"]; if (!local _unit) exitwith { - [_this, QUOTE(DFUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [_this, QUOTE(DFUNC(addToTriageCard)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; _log = _unit getvariable [QGVAR(triageCard), []]; diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1a58e2ed01..afcf6e12e5 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -109,7 +109,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW if (_delayedUnconsicous) then { [{ [_this select 0, true] call FUNC(setUnconscious); - }, [_unit], 0.7, 0] call EFUNC(common,waitAndExec); + }, [_unit], 0.7, 0] call EFUNC(common,waitAndExecute); } else { [{ [_this select 0, true] call FUNC(setUnconscious); diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 3de62db974..cb9fff0693 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -21,6 +21,11 @@ #define DEFAULT_DELAY (round(random(10)+5)) +// only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setUnconscious), _this]; +}; + private ["_animState", "_originalPos", "_startingTime", "_isDead"]; params ["_unit", ["_set", true], ["_minWaitingTime", DEFAULT_DELAY], ["_force", false]]; diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index 2a169a50d0..5d3ba6e1d4 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -28,7 +28,7 @@ if (count _items == 0) exitwith {false}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part == 0 || _part == 1) exitwith { - // [_caller,"You cannot apply a CAT on this body part!"] call EFUNC(common,sendHintTo); + // ["displayTextStructured", [_caller], ["You cannot apply a CAT on this body part!"]] call EFUNC(common,targetEvent); false; }; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 07bf4c8b49..de25b550b4 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -2106,6 +2106,9 @@ %1 провел сердечно-легочную реанимацию %1 realicó RCP + + %1 used Personal Aid Kit + Heavily wounded Schwer verwundet: @@ -2218,6 +2221,7 @@ Heal fully bandaged hitpoints Lecz w pełni zabandażowane hitpointy Curar miembros totalmente vendados + Исцелять полностью перебинтованные части тела Pain is only temporarily suppressed @@ -3435,11 +3439,13 @@ Heal hitpoints Lecz hitpointy Curar puntos de vida + Исцелять части тела Heal fully bandaged hitpoints Po bandażowaniu ulecz hitpointy, usuwając z nich ślady krwi i przywracając im pełną sprawność. Curar miembros totalmente vendados + Исцелять полностью перебинтованные части тела Pain suppression @@ -3836,11 +3842,13 @@ This person (%1) is awake and cannot be loaded Ta osoba (%1) jest przytomna i nie może zostać załadowana Esta persona (%1) está despierto y no puede ser cargado + Боец (%1) в сознании и не может быть погружен There is no tourniquet on this body part! Na tej części ciała nie ma stazy! No hay torniquete en esta parte del cuerpo! + Нет жгута на этой части тела! diff --git a/addons/medical_menu/ACE_Settings.hpp b/addons/medical_menu/ACE_Settings.hpp index 1f2b9cc3ea..42bd80044f 100644 --- a/addons/medical_menu/ACE_Settings.hpp +++ b/addons/medical_menu/ACE_Settings.hpp @@ -1,4 +1,3 @@ - class ACE_Settings { class GVAR(allow) { displayName = CSTRING(allow); @@ -6,6 +5,7 @@ class ACE_Settings { value = 1; typeName = "SCALAR"; values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + category = ECSTRING(medical,Category_Medical); }; class GVAR(useMenu) { displayName = CSTRING(useMenu); @@ -14,6 +14,7 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; isClientSettable = 1; + category = ECSTRING(medical,Category_Medical); }; class GVAR(openAfterTreatment) { displayName = CSTRING(openAfterTreatment); @@ -21,5 +22,6 @@ class ACE_Settings { typeName = "BOOL"; value = 1; isClientSettable = 1; + category = ECSTRING(medical,Category_Medical); }; }; diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf index 9f0acfbeb6..fb64865b89 100644 --- a/addons/medical_menu/functions/fnc_onMenuOpen.sqf +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -74,7 +74,7 @@ GVAR(MenuPFHID) = [{ [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); - _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); + _status = [GVAR(INTERACTION_TARGET)] call EFUNC(medical,getTriageStatus); (_display displayCtrl 2000) ctrlSetText (_status select 0); (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf index cfba7c0e05..32a5a314a7 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -13,7 +13,7 @@ * ARRAY - [NUMBER - Elevation In Degrees, NUMBER - Shot Durration] * * Example: - * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call FUNC(simulateFindSolution); + * [_rangeToHit, _heightToHit, _muzzleVelocity, _airFriction, TIME_STEP] call ace_mk6mortar_fnc_dev_simulateFindSolution; * * Public: No */ diff --git a/addons/noradio/CfgEventhandlers.hpp b/addons/noradio/CfgEventhandlers.hpp index d960e896df..386d98d241 100644 --- a/addons/noradio/CfgEventhandlers.hpp +++ b/addons/noradio/CfgEventhandlers.hpp @@ -1,6 +1,6 @@ + class Extended_PostInit_EventHandlers { - class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_post_initClient)); - serverInit = QUOTE(call COMPILE_FILE(XEH_post_initServer)); - }; -}; \ No newline at end of file + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/noradio/XEH_postInit.sqf b/addons/noradio/XEH_postInit.sqf new file mode 100644 index 0000000000..4aeccffd62 --- /dev/null +++ b/addons/noradio/XEH_postInit.sqf @@ -0,0 +1,24 @@ +// by commy2 +#include "script_component.hpp" + +// unmute unit if that player disconnects +if (isServer) then { + addMissionEventHandler ["HandleDisconnect", { + [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); + }]; +}; + +if (!hasInterface) exitWith {}; + +// mutes/unmutes units when the player changes +["playerChanged", { + params ["_newPlayer", "_oldPlayer"]; + + // mute the new player + [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); + + // unmute the old player + if (alive _oldPlayer) then { + [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); + }; +}] call EFUNC(common,addEventhandler); diff --git a/addons/noradio/XEH_post_initClient.sqf b/addons/noradio/XEH_post_initClient.sqf deleted file mode 100644 index ecd80a6436..0000000000 --- a/addons/noradio/XEH_post_initClient.sqf +++ /dev/null @@ -1,27 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -/* -[{ - if (!isNull ACE_player) then { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - - [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); - }; -}, 0, []] call CBA_fnc_addPerFrameHandler; -*/ - -if (!hasInterface) exitWith {}; - -// Mutes/unmutes units when the player changes -["playerChanged", { - EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); - - // On player change mute the new player - [_newPlayer, "isPlayer"] call EFUNC(common,muteUnit); - - // Unmute the old player - if (alive _oldPlayer) then { - [_oldPlayer, "isPlayer"] call EFUNC(common,unmuteUnit); - }; -}] call EFUNC(common,addEventhandler); diff --git a/addons/noradio/XEH_post_initServer.sqf b/addons/noradio/XEH_post_initServer.sqf deleted file mode 100644 index ae2dc16ec1..0000000000 --- a/addons/noradio/XEH_post_initServer.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -addMissionEventHandler ["HandleDisconnect", { - [_this select 0, "isPlayer"] call EFUNC(common,unmuteUnit); -}]; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 51f23bf0b6..1b64d7f0b0 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -7,7 +7,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Weapons", QGVAR(unjamWeapon), localize LSTRING(UnjamWeapon), { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 521b998fa7..73c790119d 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -28,8 +28,6 @@ _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "Weapo // Calculate cooling _temperature = [_temperature, _barrelMass, ACE_time - _time] call FUNC(cooldown); -//["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log); - // Store new temperature _time = ACE_time; _player setVariable [_string, [_temperature, _time], false]; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index ee1c8f9ff5..d7f40c4d91 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -165,8 +165,6 @@ if ("Jam" in (missionNamespace getvariable ["ACE_Debug", []])) then { _jamChance = 0.5; }; -["Overheating", [_temperature, _jamChance], {format ["Temperature: %1 - JamChance: %2", _this select 0, _this select 1]}] call EFUNC(common,log); - if (random 1 < _jamChance) then { [_unit, _weapon] call FUNC(jamWeapon); }; diff --git a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf index 14ffdd2db7..1653fce9e1 100644 --- a/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf +++ b/addons/overpressure/functions/fnc_fireLauncherBackblast.sqf @@ -62,7 +62,7 @@ if (_distance < _backblastRange) then { [_damage * 100] call BIS_fnc_bloodEffect; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_firer] call EFUNC(medical,hasMedicalEnabled))}) then { - [_firer, "HitBody", [_firer, "body", ((_firer getHitPointDamage "HitBody") + _damage), _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); + [_firer, "body", ((_firer getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); } else { _firer setDamage (damage _firer + _damage); }; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index a24367937b..a39aec3c14 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -62,7 +62,7 @@ if (!surfaceIsWater _pos) then { if (_x == ACE_player) then {[_damage * 100] call BIS_fnc_bloodEffect}; if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {([_x] call EFUNC(medical,hasMedicalEnabled))}) then { - [_x, "HitBody", [_x, "body", (_x getHitPointDamage "HitBody") + _damage, _firer, "backblast"] call EFUNC(medical,handleDamage)] call EFUNC(medical,setHitPointDamage); + [_x, "body", ((_x getvariable [QEGVAR(medical,bodyPartStatus), [0,0,0,0,0,0]]) select 1) + _damage, _firer, "backblast", 0] call EFUNC(medical,handleDamage); } else { _x setDamage (damage _x + _damage); }; diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 03b3b5b494..798a10316a 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -10,35 +10,32 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_Init_EventHandlers { +//Need initPost or we have problems with setVariable with addSpareParts +class Extended_InitPost_EventHandlers { class Car { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Tank { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Plane { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); serverInit = QUOTE(_this call DFUNC(addSpareParts)); }; }; - class Ship_F { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index 83d44592ce..ee31e2c873 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -127,7 +127,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = CSTRING(AssignEngineerRole_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignEngineerRole_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -171,7 +171,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = CSTRING(AssignRepairVehicle_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignRepairVehicle_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -203,7 +203,7 @@ class CfgVehicles { function = QFUNC(moduleAssignRepairFacility); class Arguments { class EnableList { - displayName = CSTRING(AssignRepairFacility_EnableList_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AssignRepairFacility_EnableList_Description); defaultValue = ""; typeName = "STRING"; @@ -243,7 +243,7 @@ class CfgVehicles { author = ECSTRING(common,ACETeam); class Arguments { class List { - displayName = CSTRING(AddSpareParts_List_DisplayName); + displayName = CSTRING(EnableList_DisplayName); description = CSTRING(AddSpareParts_List_Description); defaultValue = ""; typeName = "STRING"; diff --git a/addons/repair/README.md b/addons/repair/README.md index 180ae38128..5cf5e8f89a 100644 --- a/addons/repair/README.md +++ b/addons/repair/README.md @@ -10,3 +10,4 @@ The people responsible for merging changes to this component or answering potent - [commy2](https://github.com/commy2) - [Glowbal](https://github.com/Glowbal) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp index c7015f4650..2e991b54a6 100644 --- a/addons/repair/config.cpp +++ b/addons/repair/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; - author[] = {"commy2", "Glowbal"}; + author[] = {"commy2", "Glowbal", "Jonpas"}; authorUrl = "https://ace3mod.com"; VERSION_CONFIG; }; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 11f4942d74..7ebf978088 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -18,7 +18,7 @@ params ["_vehicle"]; TRACE_1("params", _vehicle); -private ["_type", "_initializedClasses"]; +private ["_type", "_initializedClasses", "_condition", "_statement", "_action"]; _type = typeOf _vehicle; @@ -44,28 +44,25 @@ _hitPointsAddedAmount = []; if (_x in _wheelHitPoints) then { // add wheel repair action - private ["_icon", "_selection"]; + private ["_icon", "_selection", "_name", "_text"]; _icon = QUOTE(PATHTOF(ui\tire_ca.paa)); _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; // textDefault = ""; _selection = _wheelHitPointSelections select (_wheelHitPoints find _x); - private ["_name", "_text", "_condition", "_statement"]; - // remove wheel action - _name = format ["Remove_%1", _x]; + _name = format ["Remove_%1", _x]; _text = localize LSTRING(RemoveWheel); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); // replace wheel action - _name = format ["Replace_%1", _x]; + _name = format ["Replace_%1", _x]; _text = localize LSTRING(ReplaceWheel); _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; @@ -102,7 +99,7 @@ _hitPointsAddedAmount = []; if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {}; // add misc repair action - private ["_name", "_icon", "_selection", "_condition", "_statement"]; + private ["_name", "_icon", "_selection", "_customSelectionsConfig"]; _name = format ["Repair_%1", _x]; @@ -150,11 +147,9 @@ _hitPointsAddedAmount = []; } else { _selection = [1.75, 0, -1.75]; }; - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "RepairTrack"], _selection, 4] call EFUNC(interact_menu,createAction); [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); } else { - private "_action"; _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction); // Put inside main actions if no other position was found above if (_selection isEqualTo [0, 0, 0]) then { @@ -166,8 +161,6 @@ _hitPointsAddedAmount = []; }; } forEach _hitPoints; -private ["_action", "_condition", "_statement"]; - _condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; _statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; _action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, ["", "fullRepair"], "", 4] call EFUNC(interact_menu,createAction); diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf index c60e59c840..0533f9f4fc 100644 --- a/addons/repair/functions/fnc_canMiscRepair.sqf +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -20,6 +20,8 @@ private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"]; params ["_caller", "_target", "_hitPoint"]; +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Get hitpoint groups if available _hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); _hitpointGroup = []; @@ -47,8 +49,4 @@ _return = false; }; } forEach _hitpointGroup; -if (typeOf _target == "B_MRAP_01_F") then { - diag_log format ["%1 - %2", _hitPoint, _hitpointGroup]; -}; - _return diff --git a/addons/repair/functions/fnc_canRemove.sqf b/addons/repair/functions/fnc_canRemove.sqf index 9fa657a2bb..9f06e8d148 100644 --- a/addons/repair/functions/fnc_canRemove.sqf +++ b/addons/repair/functions/fnc_canRemove.sqf @@ -20,4 +20,6 @@ params ["_unit", "_target", "_hitPoint"]; TRACE_3("params",_unit,_target,_hitPoint); +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + alive _target && {_target getHitPointDamage _hitPoint < 1} diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf index 806fa14b2e..0ba01afb87 100644 --- a/addons/repair/functions/fnc_canRepairTrack.sqf +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -21,6 +21,8 @@ params ["_unit", "_target", "_hitPoint", ["_wheel",false]]; TRACE_4("params",_unit,_target,_hitPoint,_wheel); // TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (typeName _wheel == "OBJECT") then { // not near interpret as objNull if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then { diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf index 3f4ae77581..aec3a9f062 100644 --- a/addons/repair/functions/fnc_canReplaceTrack.sqf +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -22,6 +22,8 @@ params ["_unit", "_target", "_hitPoint", ["_track", false]]; TRACE_4("params",_unit,_target,_hitPoint,_track); // TODO [_unit, _track] call EFUNC(common,claim); on start of action +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (typeName _track == "OBJECT") then { // not near interpret as objNull if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then { diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf index e0a2fbbed2..cf7a047f19 100644 --- a/addons/repair/functions/fnc_canReplaceWheel.sqf +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -23,7 +23,7 @@ TRACE_4("params",_unit,_target,_hitPoint,_wheel); // TODO [_unit, _wheel] call EFUNC(common,claim); on start of action //if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false}; -//if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; +if !([_unit, _target, ["isNotDragging", "isNotCarrying", "isNotOnLadder"]] call EFUNC(common,canInteractWith)) exitWith {false}; //if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false}; diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp index 89983dd0e8..a6aa1db61f 100644 --- a/addons/repair/script_component.hpp +++ b/addons/repair/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT repair #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_REPAIR #define DEBUG_MODE_FULL #endif diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 4e872cc151..d4b9527f09 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -183,12 +183,14 @@ Dodaj części zam. Adicionar partes sobressalentes Añadir repuestos + Добавлять запчасти Add spare parts to vehicles (requires Cargo component)? Czy dodać do pojazdów części zamienne? Wymaga włączonego cargo. Adicionar partes sobressalentes aos veículos (requer o componente de carga)? ¿Añadir repuestos para vehículos (requiere componente de carga)? + Добавлять запасные части в технику (требуется модуль Грузоперевозок)? Repair >> @@ -791,7 +793,7 @@ Přiřadit Inženýra Asignar ingeniero - + List Lista Lista @@ -942,58 +944,68 @@ Dodaj części zam. Adicionar partes sobressalentes Añadir repuestos + Добавить запчасти Add spare parts to one or multiple objects Dodaj części zamienne do jednego lub wielu obiektów. Adicionar partes sobressalentes para um ou mais objetos Añadir repuestos a uno o varios objetos + Добавить запасные части в одно или несколько транспортных средств List Lista Lista Lista + Список List of objects that will get spare parts added, separated by commas. Lista obiektów, które otrzymają części zamienne, oddzielone przecinkiem. Lista de objetos que ganharão partes sobressalentes, dividos por vírgulas. Lista de los objetos que tendrán repuestos añadidos, separados por comas. + Список транспортных средств, в которые будут добавляться запчасти, разделенный запятыми. Part Część Parte Pieza + Запчасть Spare part. Część zamienna. Parte sobressalente Pieza de recambio. + Запасная часть. Amount Ilość Quantidade Cantidad + Количество Number of selected spare parts. Ilość wybranych części zamiennych. Número de partes sobressalentes. Número de piezas de repuesto seleccionados. + Число выбранных запасных частей. Wheel repair requirements Wym. naprawy kół Requisitos de reparación de ruedas + Для ремонта колес требуется Items required to remove/replace wheels Przedmioty potrzebne do wymiany kół Elementos necesarios para quitar/cambiar ruedas + Предметы, которые требуются для снятия/замены колес diff --git a/addons/respawn/ACE_Settings.hpp b/addons/respawn/ACE_Settings.hpp index 5c947b8670..f704d25412 100644 --- a/addons/respawn/ACE_Settings.hpp +++ b/addons/respawn/ACE_Settings.hpp @@ -1,3 +1,4 @@ + class ACE_Settings { class GVAR(SavePreDeathGear) { value = 0; diff --git a/addons/respawn/CfgAddons.hpp b/addons/respawn/CfgAddons.hpp index 111613615e..50ea187915 100644 --- a/addons/respawn/CfgAddons.hpp +++ b/addons/respawn/CfgAddons.hpp @@ -1,3 +1,4 @@ + class CfgAddons { class GVAR(Rallypoints) { list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"}; diff --git a/addons/respawn/CfgVehicleClasses.hpp b/addons/respawn/CfgVehicleClasses.hpp index ab9c9b6c7e..817ee8150f 100644 --- a/addons/respawn/CfgVehicleClasses.hpp +++ b/addons/respawn/CfgVehicleClasses.hpp @@ -1,3 +1,4 @@ + class CfgVehicleClasses { class GVAR(Rallypoints) { displayName = CSTRING(EditorCategory); diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index aa99b4e942..8fdfb5f0fc 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,3 +1,4 @@ + class CfgVehicles { class ACE_Module; class ACE_ModuleRespawn: ACE_Module { @@ -6,7 +7,7 @@ class CfgVehicles { displayName = CSTRING(Module_DisplayName); function = QFUNC(module); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_Respawn_ca.paa)); class Arguments { @@ -24,6 +25,7 @@ class CfgVehicles { defaultValue = 1; }; }; + class ModuleDescription { description = CSTRING(Module_Description); }; diff --git a/addons/respawn/XEH_postInit.sqf b/addons/respawn/XEH_postInit.sqf index ada5765e86..22be7b86ac 100644 --- a/addons/respawn/XEH_postInit.sqf +++ b/addons/respawn/XEH_postInit.sqf @@ -2,4 +2,4 @@ #include "script_component.hpp" ["rallypointMoved", {_this call FUNC(updateRallypoint)}] call EFUNC(common,addEventhandler); -["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers +["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); // hide enemy rallypoint markers diff --git a/addons/respawn/XEH_preInit.sqf b/addons/respawn/XEH_preInit.sqf index dd116f108c..eda5293876 100644 --- a/addons/respawn/XEH_preInit.sqf +++ b/addons/respawn/XEH_preInit.sqf @@ -13,7 +13,6 @@ PREP(moduleFriendlyFire); PREP(moduleRallypoint); PREP(moveRallypoint); PREP(removeBody); -PREP(removeDisconnectedPlayer); PREP(restoreGear); PREP(showFriendlyFireMessage); PREP(teleportToRallypoint); diff --git a/addons/respawn/functions/fnc_canMoveRallypoint.sqf b/addons/respawn/functions/fnc_canMoveRallypoint.sqf index d5f325c067..174d76c69d 100644 --- a/addons/respawn/functions/fnc_canMoveRallypoint.sqf +++ b/addons/respawn/functions/fnc_canMoveRallypoint.sqf @@ -1,33 +1,30 @@ /* - Name: ACE_Respawn_fnc_canMoveRallypoint - - Author(s): - commy2 - - Description: - checks if a unit can move a rally point - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - - Returns: - BOOLEAN -*/ - + * Author: commy2 + * Checks if a unit can move a rally point. + * + * Arguments: + * 0: Unit + * 1: Side + * + * Return Value: + * Can move + * + * Example: + * [ACE_Player, side ACE_Player] call ace_respawn_fnc_canMoveRallypoint + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_side"]; +params ["_unit", "_side"]; -_unit = _this select 0; -_side = _this select 1; +// player has to be a rallypoint mover. group leader by default +if !(_unit getVariable ["ACE_canMoveRallypoint", false]) exitWith {false}; -// rallypoint names are defined in CfgVehicles.hpp - -_unit getVariable ["ACE_canMoveRallypoint", false] -&& {!isNull ([ +// rallypoint of that side has to exist +!isNull ([ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] -] select ([west, east, independent] find _side) + 1)} +] select ([west, east, independent] find _side) + 1) // return diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index 914334cc25..a1e46c1caf 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -1,26 +1,39 @@ -// by commy2 -// execute on server only! +/* + * Author: commy2 + * Handle XEH Init Post on Server. + * Execution on server only. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [ACE_Player] call ace_respawn_fnc_handleInitPostServer + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; -private ["_group0", "_rallypoint"]; +private ["_groupUnit", "_rallypoint", "_leaderVarName"]; -_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used +_groupUnit = group _unit; // _group is a reserved veriable and shouldn't be used _rallypoint = [ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], missionNamespace getVariable ["ACE_Rallypoint_East", objNull], missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] -] select ([west, east, independent] find side _group0) + 1; +] select ([west, east, independent] find side _groupUnit) + 1; // exit if no moveable rallypoint is placed for that side if (isNull _rallypoint) exitWith {}; // find leader -private "_leaderVarName"; -_leaderVarName = _group0 getVariable [QGVAR(leaderVarName), ""]; +_leaderVarName = _groupUnit getVariable [QGVAR(leaderVarName), ""]; // exit if group already has a playable slot assigned as rallypoint leader if (_leaderVarName != "") exitWith { @@ -31,7 +44,7 @@ if (_leaderVarName != "") exitWith { }; // treat group leader -_unit = leader _group0; +_unit = leader _groupUnit; _leaderVarName = vehicleVarName _unit; @@ -47,6 +60,6 @@ if (_leaderVarName == "") then { }; // prevent group from getting multiple leaders; use this to assign rallypoint moving ability on JIP -_group0 setVariable [QGVAR(leaderVarName), _leaderVarName]; +_groupUnit setVariable [QGVAR(leaderVarName), _leaderVarName]; _unit setVariable ["ACE_canMoveRallypoint", true, true]; diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 99ec308c1c..200e3c98c8 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -1,31 +1,30 @@ /* - Name: ACE_Respawn_fnc_handleKilled - - Author(s): - bux578 - - Description: - Handles the XEH Killed event - - Parameters: - 0: OBJECT - Killed unit - 1: OBJECT - Attacker - - Returns: - VOID -*/ - + * Author: bux578 + * Handles the XEH killed event. + * + * Arguments: + * 0: Unit + * 1: Killer + * + * Return Value: + * None + * + * Example: + * [ACE_player, bad_dude] call ace_respawn_fnc_handleKilled + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_killedUnit); +params ["_unit"]; // Saves the gear when the player! (and only him) is killed -if (ACE_player == _killedUnit) then { +if (ACE_player == _unit) then { GVAR(unitGear) = []; if (GVAR(SavePreDeathGear)) then { - GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); - GVAR(unitGear) pushBack [currentWeapon _killedUnit, currentMuzzle _killedUnit, currentWeaponMode _killedUnit]; + GVAR(unitGear) = [_unit] call EFUNC(common,getAllGear); + GVAR(unitGear) pushBack [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]; }; }; diff --git a/addons/respawn/functions/fnc_handlePlayerChanged.sqf b/addons/respawn/functions/fnc_handlePlayerChanged.sqf index db699066bc..7d595e6a44 100644 --- a/addons/respawn/functions/fnc_handlePlayerChanged.sqf +++ b/addons/respawn/functions/fnc_handlePlayerChanged.sqf @@ -1,44 +1,28 @@ -// by commy2 +/* + * Author: commy2 + * Handle player changed event. Updates visibility of Rallypoint markers. + * + * Arguments: + * 0: New Unit + * + * Return Value: + * None + * + * Example: + * [ACE_player] call ace_respawn_fnc_handlePlayerChanged + * + * Public: No + */ #include "script_component.hpp" -private "_newUnit"; +params ["_newUnit"]; -_newUnit = _this select 0; +private "_side"; +_side = side group _newUnit; -switch (side group _newUnit) do { - case (west): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; - - case (east): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; - - case (independent): { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 1; - }; - - default { - ((missionNamespace getVariable ["ACE_Rallypoint_West", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_West_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_East_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - ((missionNamespace getVariable ["ACE_Rallypoint_Independent_Base", objNull]) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal 0; - }; -}; +((GETMVAR(ACE_Rallypoint_West, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETMVAR(ACE_Rallypoint_West_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == west)); +((GETMVAR(ACE_Rallypoint_East, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETMVAR(ACE_Rallypoint_East_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == east)); +((GETMVAR(ACE_Rallypoint_Independent, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); +((GETMVAR(ACE_Rallypoint_Independent_Base, objNull)) getVariable [QGVAR(marker), ""]) setMarkerAlphaLocal ([0, 1] select (_side == independent)); diff --git a/addons/respawn/functions/fnc_handleRespawn.sqf b/addons/respawn/functions/fnc_handleRespawn.sqf index 33a0ec09e5..ab5ecedbda 100644 --- a/addons/respawn/functions/fnc_handleRespawn.sqf +++ b/addons/respawn/functions/fnc_handleRespawn.sqf @@ -1,32 +1,29 @@ /* - Name: ACE_Respawn_fnc_handleRespawn - - Author(s): - bux578 - - Description: - Handles the XEH Respawn event - - Parameters: - 0: OBJECT - Respawned Unit - 1: ? - - Returns: - VOID -*/ - + * Author: bux578 + * Handles the XEH Respawn event. + * + * Arguments: + * 0: Unit + * 1: Corpse + * + * Return Value: + * None + * + * Example: + * [ACE_Player, old_body_lying_on_floor] call ace_respawn_fnc_handleRespawn + * + * Public: No + */ #include "script_component.hpp" -private ["_respawnedUnit"]; - -_respawnedUnit = _this select 0; +params ["_unit"]; // Restores the gear when the player respawns if (GVAR(SavePreDeathGear)) then { - [_respawnedUnit, GVAR(unitGear)] call FUNC(restoreGear); + [_unit, GVAR(unitGear)] call FUNC(restoreGear); }; // fix for setVariable public being lost on respawn for machines that JIP after the command was broadcasted -if (_respawnedUnit getVariable ["ACE_canMoveRallypoint", false]) then { - _respawnedUnit setVariable ["ACE_canMoveRallypoint", true, true]; +if (_unit getVariable ["ACE_canMoveRallypoint", false]) then { + _unit setVariable ["ACE_canMoveRallypoint", true, true]; }; diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index bb295a1809..dba1ae5d0a 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -1,52 +1,51 @@ /* - Name: ACE_Respawn_fnc_initRallypoint - - Author(s): - commy2 - - Description: - init code for rally points - - Parameters: - 0: OBJECT - rally - - Returns: - VOID -*/ - + * Author: commy2 + * Init code for rallypoints. + * + * Arguments: + * 0: Rallypoint Object + * 1: Respawn Marker + * 2: Side + * + * Return Value: + * None + * + * Example: + * [respawn_object, "", west] call ace_respawn_fnc_initRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_rallypoint,_respawnMarker,_side); +params ["_rallypoint", "_respawnMarker", "_side"]; private "_name"; _name = typeOf _rallypoint; // init visible marker if (hasInterface) then { - // fix init having wrong position, vars etc. - [_rallypoint, _respawnMarker, _side, _name] spawn { - PARAMS_4(_rallypoint,_respawnMarker,_side,_name); + [{ + params ["_rallypoint", "_respawnMarker", "_side", "_name"]; - private ["_marker", "_type"]; + private ["_marker", "_type", "_date"]; _marker = format ["ACE_Marker_%1", _name]; - // exit if it already exist + // exit if marker already exist if (_marker in allMapMarkers) exitWith {}; _marker = createMarkerLocal [_marker, getPosASL _rallypoint]; _type = ["selector_selectedFriendly", "selector_selectedEnemy"] select (_respawnMarker == ""); _marker setMarkerTypeLocal _type; - _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init + _marker setMarkerAlphaLocal ([0,1] select (_side == playerSide)); // playerSide to guarantee init - private "_markerDate"; - _markerDate = _rallypoint getVariable [QGVAR(markerDate), ""]; + _date = _rallypoint getVariable [QGVAR(markerDate), ""]; - _marker setMarkerTextLocal _markerDate; + _marker setMarkerTextLocal _date; _rallypoint setVariable [QGVAR(marker), _marker]; - }; + }, [_rallypoint, _respawnMarker, _side, _name], 0.1] call EFUNC(common,waitAndExecute); }; if (!isServer) exitWith {}; @@ -62,7 +61,6 @@ if (isNil _name) then { }; ["rallypointMoved", [_rallypoint, _side]] call EFUNC(common,globalEvent); - } else { deleteVehicle _rallypoint; ACE_LOGERROR("Multiple Rallypoints of same type."); diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index 8921c75f54..ea6ba555d5 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -1,26 +1,23 @@ - /* - Name: ACE_Respawn_fnc_module - - Author(s): - KoffeinFlummi, bux578, esteldunedain, commy2 - - Description: - initializes the respawn module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - +/* + * Author: KoffeinFlummi, bux578, esteldunedain, commy2 + * Initializes the respawn module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_module + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); - -if !(isServer) exitWith {}; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; @@ -29,20 +26,18 @@ GVAR(Module) = true; [_logic, QGVAR(SavePreDeathGear), "SavePreDeathGear"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(RemoveDeadBodiesDisconnected), "RemoveDeadBodiesDisconnected"] call EFUNC(common,readSettingFromModule); -if (isServer) then { - if (GVAR(RemoveDeadBodiesDisconnected)) then { - addMissionEventHandler ["HandleDisconnect", { - [{ - PARAMS_1(_unit); +if (isServer && {GVAR(RemoveDeadBodiesDisconnected)}) then { + addMissionEventHandler ["HandleDisconnect", { + [{ + params ["_unit"]; - if (!alive _unit) then { - deleteVehicle _unit; - }; - }, - _this, 4, 1] call EFUNC(common,waitAndExecute); - false - }]; - }; + if (!alive _unit) then { + deleteVehicle _unit; + }; + }, + _this, 4] call EFUNC(common,waitAndExecute); + false + }]; }; ACE_LOGINFO("Respawn Module Initialized."); diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 2d81372e85..f5b982f0ea 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -1,32 +1,33 @@ /* - Name: ACE_Respawn_fnc_moduleFriendlyFire - - Author(s): - commy2 - - Description: - initializes the Friendly Fire Messages module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - + * Author: commy2 + * Initializes the friendly fire module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_moduleFriendlyFire + * + * Public: No + */ #include "script_component.hpp" -_this spawn { - PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; - if !(_activated) exitWith {}; +if !(_activated) exitWith {}; - if (isServer) then { +// this is done for JIP compatibility +if (isServer) then { + [{ missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true]; publicVariable QGVAR(showFriendlyFireMessage); - }; - - ACE_LOGINFO("Friendly Fire Messages Module Initialized."); + }, + [], 0.1] call EFUNC(common,waitAndExecute); }; + +ACE_LOGINFO("Friendly Fire Messages Module Initialized."); diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 86a83bf061..89baed660f 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -1,29 +1,29 @@ /* - Name: ACE_Respawn_fnc_moduleRallypoint - - Author(s): - commy2 - - Description: - initializes the Rallypoint module - - Parameters: - 0: OBJECT - logic - 1: ARRAY - synced units - 2: BOOLEAN - activated - - Returns: - VOID -*/ - + * Author: commy2 + * Initializes the Rallypoint module. + * + * Arguments: + * 0: Logic + * 1: Synced units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * [logic, [ACE_Player], true] call ace_respawn_fnc_moduleRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; { _x setVariable ["ACE_canMoveRallypoint", true]; -} forEach _units; + false +} count _units; ACE_LOGINFO("Rallypoint Module Initialized."); diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index d512c23886..bf96905343 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -1,52 +1,47 @@ /* - Name: ACE_Respawn_fnc_moveRallypoint - - Author(s): - commy2 - - Description: - Moves a rallypoint to the player's location - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - - Returns: - VOID -*/ - + * Author: commy2 + * Moves a rallypoint to the players location. + * + * Arguments: + * 0: Unit + * 1: Side + * + * Return Value: + * None + * + * Example: + * [ACE_Player, side ACE_Player] call ace_respawn_fnc_moveRallypoint + * + * Public: No + */ #include "script_component.hpp" -PARAMS_2(_unit,_side); +params ["_unit", "_side"]; private ["_rallypoint", "_position"]; -// rallypoint names are defined in CfgVehicles.hpp - _rallypoint = [ - objNull, - missionNamespace getVariable ["ACE_Rallypoint_West", objNull], - missionNamespace getVariable ["ACE_Rallypoint_East", objNull], - missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] + objNull, + missionNamespace getVariable ["ACE_Rallypoint_West", objNull], + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] ] select ([west, east, independent] find _side) + 1; -TRACE_3("moving rally",_unit, _rallypoint, (typeOf _rallypoint)); +TRACE_3("moving rally",_unit,_rallypoint,typeOf _rallypoint); if (isNull _rallypoint) exitWith {}; _position = getPosATL _unit; _position = _position findEmptyPosition [0, 2, typeOf _rallypoint]; -if (count _position == 0) then {_position = getPosATL _unit}; + +if (_position isEqualTo []) then {_position = getPosATL _unit}; _position set [2, 0]; [localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ - _rallypoint = _this select 0; - _unit = _this select 1; - _position = _this select 2; - _rallypoint = _this select 3; + params ["_rallypoint", "_unit", "_position"]; _rallypoint setPosATL _position; _unit reveal _rallypoint; @@ -56,5 +51,4 @@ _position set [2, 0]; ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); [localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured); -}, -[_rallypoint, _unit, _position, _rallypoint], 5, 1] call EFUNC(common,waitAndExecute); +}, [_rallypoint, _unit, _position], 5] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeBody.sqf b/addons/respawn/functions/fnc_removeBody.sqf index e00f633e6c..e9676696a1 100644 --- a/addons/respawn/functions/fnc_removeBody.sqf +++ b/addons/respawn/functions/fnc_removeBody.sqf @@ -1,36 +1,27 @@ /* - Name: ACE_Respawn_fnc_removeBody - - Author(s): - bux578 - - Description: - removes a given body - - Parameters: - 0: OBJECT - body - 1: BOOLEAN - forceRemove // not used atm - - Returns: - VOID -*/ - + * Author: bux578, commy2 + * Removes a given body. + * + * Arguments: + * 0: Body + * + * Return Value: + * None + * + * Example: + * [corpse] call ace_respawn_fnc_removeBody + * + * Public: No + */ #include "script_component.hpp" -private ["_body", "_forceRemove", "_bodyRemoveTimer"]; +params ["_body", "_forceRemove"]; -_body = _this select 0; -_forceRemove = _this select 1; - -_bodyRemoveTimer = GVAR(BodyRemoveTimer) max 0; - -// could be used for SpecOps missions. -if (_forceRemove) then { - _bodyRemoveTimer = 2; -}; +private "_bodyRemoveTimer"; +_bodyRemoveTimer = [GVAR(BodyRemoveTimer) max 0, 2] select _forceRemove; // could be used for SpecOps missions. [{ // hideBody takes ~20s till body is fully underground // a better hideBody would make this more aesthetic deleteVehicle _this; -}, _body, _bodyRemoveTimer, 1] call EFUNC(common,waitAndExecute); +}, _body, _bodyRemoveTimer] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf deleted file mode 100644 index 7bd0a6707f..0000000000 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* - Name: ACE_Respawn_fnc_removeDisconnectedPlayer - - Author(s): - commy2 - - Description: - handles the disconnected event - - Parameters: - 0: BOOLEAN - forceRemove // not used atm - - Returns: - VOID -*/ - -#include "script_component.hpp" - -private ["_forceRemove", "_body", "_uid"]; - -_forceRemove = _this select 0; - -{ - if (getPlayerUID _x == _uid) exitWith { - _body = _x; - }; -} forEach playableUnits; - -if (!isNil "_body" && {!alive _body}) then { - [_body, _forceRemove] call FUNC(removeBody); -}; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index fd3f03d7aa..e8a512e127 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -1,34 +1,22 @@ /* - Name: ACE_Respawn_fnc_restoreGear - - Author(s): - bux578 - - Description: - Restores previously saved gear - - Parameters: - 0: OBJECT - unit - 1: ARRAY - Array containing all gear (result of ACE_common_fnc_getAllGear) - - Returns: - VOID -*/ - + * Author: bux578 + * Restores previously saved gear. + * + * Arguments: + * 0: Unit + * 1: All Gear based on return value of ACE_common_fnc_getAllGear + * + * Return Value: + * None + * + * Example: + * [ACE_Player, stored_allGear] call ace_respawn_fnc_restoreGear + * + * Public: No + */ #include "script_component.hpp" -PARAMS_2(_unit,_allGear); - -private ["_unit", "_allGear", "_headgear", "_goggles", -"_uniform", "_uniformitems", -"_vest", "_vestitems", -"_backpack", "_backpackitems", "_backpa", -"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", -"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", -"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", -"_assigneditems", "_binocular", -"_activeWeaponAndMuzzle", "_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; - +params ["_unit", "_allGear"]; // remove all starting gear of a player removeAllWeapons _unit; @@ -40,77 +28,66 @@ removeAllAssignedItems _unit; clearAllItemsFromBackpack _unit; removeBackpack _unit; -_headgear = _allGear select 0; -_goggles = _allGear select 1; -_uniform = _allGear select 2; -_uniformitems = _allGear select 3; -_vest = _allGear select 4; -_vestitems = _allGear select 5; -_backpack = _allGear select 6; -_backpackitems = _allGear select 7; -_primaryweapon = _allGear select 8; -_primaryweaponitems = _allGear select 9; -_primaryweaponmagazine = _allGear select 10; -_secondaryweapon = _allGear select 11; -_secondaryweaponitems = _allGear select 12; -_secondaryweaponmagazine = _allGear select 13; -_handgunweapon = _allGear select 14; -_handgunweaponitems = _allGear select 15; -_handgunweaponmagazine = _allGear select 16; -_assigneditems = _allGear select 17; -_binocular = _allGear select 18; -_activeWeaponAndMuzzle = _allGear select 19; - +_allGear params [ + "_headgear", "_goggles", + "_uniform", "_uniformitems", + "_vest", "_vestitems", + "_backpack", "_backpackitems", + "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", + "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", + "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", + "_assigneditems", "_binocular", + "_activeWeaponAndMuzzle" +]; // start restoring the items -if (_headgear != "") then { - _unit addHeadgear _headgear; -}; -if (_uniform != "") then { - _unit forceAddUniform _uniform; -}; -if (_vest != "") then { - _unit addVest _vest; -}; -if (_goggles != "") then { - _unit addGoggles _goggles; -}; +if (_headgear != "") then {_unit addHeadgear _headgear}; +if (_goggles != "") then {_unit addGoggles _goggles}; +if (_uniform != "") then {_unit forceAddUniform _uniform}; +if (_vest != "") then {_unit addVest _vest}; { _unit addItemToUniform _x; -} forEach _uniformitems; + false +} count _uniformitems; { _unit addItemToVest _x; -} forEach _vestitems; + false +} count _vestitems; private "_flagRemoveDummyBag"; -_flagRemoveDummyBag = false; -if (format["%1", _backpack] != "") then { +if (format ["%1", _backpack] != "") then { _unit addBackpack _backpack; - _backpa = unitBackpack _unit; - clearMagazineCargoGlobal _backpa; - clearWeaponCargoGlobal _backpa; - clearItemCargoGlobal _backpa; + // make sure the backpack is empty. Some bags are prefilled by config + private "_backpackObject"; + _backpackObject = unitBackpack _unit; + + clearMagazineCargoGlobal _backpackObject; + clearWeaponCargoGlobal _backpackObject; + clearItemCargoGlobal _backpackObject; + { _unit addItemToBackpack _x; - } forEach _backpackitems; + false + } count _backpackitems; + _flagRemoveDummyBag = false; } else { // dummy backpack to ensure mags being loaded - _unit addBackpack "B_Kitbag_Base"; + _unit addBackpack "Bag_Base"; _flagRemoveDummyBag = true; }; - // primaryWeapon if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then { { _unit addMagazine _x; - } forEach _primaryweaponmagazine; + false + } count _primaryweaponmagazine; _unit addWeapon _primaryweapon; @@ -118,15 +95,16 @@ if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then if (_x != "") then { _unit addPrimaryWeaponItem _x; }; - } forEach _primaryweaponitems; + false + } count _primaryweaponitems; }; - // secondaryWeapon if (_secondaryweapon != "") then { { _unit addMagazine _x; - } forEach _secondaryweaponmagazine; + false + } count _secondaryweaponmagazine; _unit addWeapon _secondaryweapon; @@ -134,15 +112,16 @@ if (_secondaryweapon != "") then { if (_x != "") then { _unit addSecondaryWeaponItem _x; }; - } forEach _secondaryweaponitems; + false + } count _secondaryweaponitems; }; - // handgun if (_handgunweapon != "") then { { _unit addMagazine _x; - } forEach _handgunweaponmagazine; + false + } count _handgunweaponmagazine; _unit addWeapon _handgunweapon; @@ -150,20 +129,19 @@ if (_handgunweapon != "") then { if (_x != "") then { _unit addHandgunItem _x; }; - } forEach _handgunweaponitems; + false + } count _handgunweaponitems; }; - // remove dummy bagpack if (_flagRemoveDummyBag) then { removeBackpack _unit; }; - -_assignedItems = _assignedItems - [_binocular]; +_assignedItems deleteAt (_assignedItems find _binocular); // items -{_unit linkItem _x} forEach _assignedItems; +{_unit linkItem _x; false} count _assignedItems; _unit addWeapon _binocular; @@ -178,24 +156,24 @@ if ("Laserdesignator" in assignedItems _unit) then { }; // restore the last active weapon, muzzle and weaponMode -_activeWeapon = _activeWeaponAndMuzzle select 0; -_activeMuzzle = _activeWeaponAndMuzzle select 1; -_activeWeaponMode = _activeWeaponAndMuzzle select 2; - -if (!(_activeMuzzle isEqualTo "") and - !(_activeMuzzle isEqualTo _activeWeapon) and - (_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles"))) then { +_activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; +if ( + (_activeMuzzle != "") && + {_activeMuzzle != _activeWeapon} && + {_activeMuzzle in getArray (configfile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} +) then { _unit selectWeapon _activeMuzzle; } else { - if (!(_activeWeapon isEqualTo "")) then { + if (_activeWeapon != "") then { _unit selectWeapon _activeWeapon; }; }; -if (!(currentWeapon _unit isEqualTo "")) then { - private ["_index"]; +if (currentWeapon _unit != "") then { + private "_index"; _index = 0; + while { _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} } do { diff --git a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf index 1fdd10da4e..1c5a7b7cc2 100644 --- a/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf +++ b/addons/respawn/functions/fnc_showFriendlyFireMessage.sqf @@ -1,28 +1,24 @@ /* - Name: ACE_Respawn_fnc_showFriendlyFireMessages - - Author(s): - commy2 - - Description: - shows a message in system chat of who killed who - - Parameters: - 0: OBJECT - unit - 1: OBJECT - killer - - Returns: - VOID -*/ - + * Author: commy2 + * Shows a message in system chat of who killed whom. + * + * Arguments: + * 0: Unitn + * 1: Killer + * + * Return Value: + * None + * + * Example: + * [ACE_Player, killer] call ace_module_fnc_functionName + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_killer"]; +params ["_unit", "_killer"]; -_unit = _this select 0; -_killer = _this select 1; - -if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then { +if (_unit != _killer && {side group _unit in [side group ACE_player, civilian]} && {side group _killer == side group ACE_player}) then { systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)]; // Raise ACE globalEvent diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 59a9766114..88bd0d6d52 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -1,29 +1,25 @@ /* * Author: commy2 - * teleports a unit to a rallypoint + * Teleports a unit to a rallypoint * * Arguments: - * 0: unit - * 1: side? - * 2: teleport to base + * 0: Unit + * 1: Side + * 2: Rallypoint name * * Return Value: - * Nothing + * None * * Example: - * [,,] call ACE_Respawn_fnc_teleportToRallypoint; + * [ACE_player, side ACE_Player, rallypoint_name] call ace_respawn_fnc_teleportToRallypoint; * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_side,_rallypoint); +params ["_unit", "_side", "_rallypoint"]; -private ["_toBase"]; - -// rallypoint names are defined in CfgVehicles.hpp - -//IGNORE_PRIVATE_WARNING("_Base") +private "_toBase"; _toBase = _rallypoint find "_Base" != -1; _rallypoint = missionNamespace getVariable [_rallypoint, objNull], @@ -31,4 +27,5 @@ _rallypoint = missionNamespace getVariable [_rallypoint, objNull], if (isNull _rallypoint) exitWith {}; _unit setPosASL getPosASL _rallypoint; + [[localize LSTRING(TeleportedToRallypoint), localize LSTRING(TeleportedToBase)] select _toBase] call EFUNC(common,displayTextStructured); diff --git a/addons/respawn/functions/fnc_updateRallypoint.sqf b/addons/respawn/functions/fnc_updateRallypoint.sqf index 248955155a..8b34f87019 100644 --- a/addons/respawn/functions/fnc_updateRallypoint.sqf +++ b/addons/respawn/functions/fnc_updateRallypoint.sqf @@ -1,11 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Updates marker position and texts. + * + * Arguments: + * 0: Marker + * 1: Side + * 2: Position + * + * Return Value: + * None + * + * Example: + * [marker_name, side ACE_Player, getPos ACE_Player] call ace_respawn_fnc_updateRallypoint + * + * Public: No + */ #include "script_component.hpp" -private ["_rallypoint", "_side", "_position"]; - -_rallypoint = _this select 0; -_side = _this select 1; -_position = _this select 2; +params ["_rallypoint", "_side", "_position"]; if (!hasInterface) exitWith {}; diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 0b4a06ff7f..e44150ff10 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -201,6 +201,7 @@ Удалять трупы игроков после дисконнекта? + This module enables you to configure ACE functionality specific to respawns. Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. Tento modul umožňuje nastavení znovuzrození (spawn). @@ -220,6 +221,7 @@ Сообщения об огне по своим + Using this module in your mission will make it so any friendly fire kills will be displayed in form of a message in chat. Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp index eefe61652b..0cd959a047 100644 --- a/addons/safemode/CfgEventHandlers.hpp +++ b/addons/safemode/CfgEventHandlers.hpp @@ -1,12 +1,12 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInit) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index c7132dd76c..f3ab06d20e 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -7,8 +7,7 @@ if (!hasInterface) exitWith {}; //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" - -// Add keybinds +// add keybinds ["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { // Conditions: canInteract @@ -21,4 +20,4 @@ if (!hasInterface) exitWith {}; true }, {false}, -[41, [false, true, false]], false] call cba_fnc_addKeybind; +[41, [false, true, false]], false] call CBA_fnc_addKeybind; diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 54fa254716..9fe429a49b 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -20,10 +20,10 @@ // don't immediately switch back if (inputAction "nextWeapon" > 0) exitWith {}; -private ["_safedWeapons", "_condition", "_statement", "_id", "_picture"]; - params ["_unit", "_weapon", "_muzzle"]; +private ["_safedWeapons", "_picture"]; + _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) exitWith { @@ -35,47 +35,39 @@ _safedWeapons pushBack _weapon; _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (_unit getVariable [QGVAR(actionID), -1] == -1) then { - _condition = { - params ["", "_caller"]; - if ( - [_caller] call EFUNC(common,canUseWeapon) - && { - if (currentMuzzle _caller in (_caller getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); - false - }; - true - } else {false} - } - ) then { - // player hud - [false] call FUNC(setSafeModeVisual); - true - } else { - // player hud - [true] call FUNC(setSafeModeVisual); - false - } - }; - - _statement = { - params ["", "_caller"]; - [_caller, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); - }; - - //_id = [_unit, format ["%1", localize LSTRING(TakeOffSafety)], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); - _id = [_unit, "DefaultAction", _condition, {}] call EFUNC(common,addActionEventHandler); - - _unit setVariable [QGVAR(actionID), _id]; + _unit setVariable [QGVAR(actionID), [ + _unit, "DefaultAction", { + if ( + [_this select 1] call EFUNC(common,canUseWeapon) + && { + if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { + if (inputAction "nextWeapon" > 0) exitWith { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + false + }; + true + } else {false} + } + ) then { + // player hud + [false] call FUNC(setSafeModeVisual); + true + } else { + // player hud + [true] call FUNC(setSafeModeVisual); + false + }; + }, {} + ] call EFUNC(common,addActionEventHandler)]; }; -if ((typeName _muzzle) == (typeName "")) then { - _unit selectWeapon _muzzle; //_weapon +if (typeName _muzzle == "STRING") then { + _unit selectWeapon _muzzle; }; // play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); +// show info box _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 3fa29f3d88..5da4aeb672 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -16,23 +16,28 @@ */ #include "script_component.hpp" -private ["_sound", "_position"]; - params ["_unit", "_weapon"]; +private ["_sound", "_position"]; + _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); -if (count _sound == 0) exitWith { +if (_sound isEqualTo []) exitWith { playSound "ACE_Sound_Click"; }; -// add file extension -if ({(toLower (_sound select 0) find _x == (count toArray (_sound select 0) - count toArray _x) - 1)} count [".wav", ".ogg", ".wss"] == 0) then { - _sound set [0, (_sound select 0) + ".wss"]; -}; - -_position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); -_position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; +// get position where to play the sound (position of the weapon) +_position = AGLToASL (_unit modelToWorldVisual (_unit selectionPosition "RightHand")); _sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; + +if (_filename == "") exitWith { + playSound "ACE_Sound_Click"; +}; + +// add file extension .wss as default +if !(toLower (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { + _filename = format ["%1.wss", _filename]; +}; + playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index 43f4bc79b6..492d5c6996 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -15,17 +15,17 @@ */ #include "script_component.hpp" -private ["_control", "_config"]; - params ["_show"]; disableSerialization; +private "_control"; _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; if (isNull _control) exitWith {}; if (_show) then { + private "_config"; _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 35fdb0dee5..ef01766872 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -17,24 +17,19 @@ */ #include "script_component.hpp" -private ["_safedWeapons", "_id", "_picture"]; - params ["_unit", "_weapon", "_muzzle"]; +private ["_safedWeapons", "_picture"]; + _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +_safedWeapons deleteAt (_safedWeapons find _weapon); -if (_weapon in _safedWeapons) then { - _safedWeapons = _safedWeapons - [_weapon]; +_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; - _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; - - if (count _safedWeapons == 0) then { - _id = _unit getVariable [QGVAR(actionID), -1]; - - //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); - [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; - }; +// remove action if all weapons have put their safety on +if (_safedWeapons isEqualTo []) then { + [_unit, "DefaultAction", _unit getVariable [QGVAR(actionID), -1]] call EFUNC(common,removeActionEventHandler); + _unit setVariable [QGVAR(actionID), -1]; }; _unit selectWeapon _muzzle; @@ -74,5 +69,6 @@ if (inputAction "nextWeapon" > 0) then { // player hud [true] call FUNC(setSafeModeVisual); +// show info box _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index 1f56aecefb..bd81a0935b 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -136,30 +136,3 @@ if (!hasInterface) exitWith {}; }, {false}, [201, [true, true, false]], true] call cba_fnc_addKeybind; - -// init shortdot -GVAR(showShortdot) = false; - -["playerInventoryChanged", { - if (_this select 1 isEqualTo []) exitWith {}; //@todo fix eh - - private "_showShortdot"; - _showShortdot = _this select 1 select 9 select 2 == "ACE_optic_DMS"; - - if (GVAR(showShortdot)) then { - if (!_showShortdot) then { - // hide control and turn onDraw handler off - (uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]) ctrlShow false; - GVAR(showShortdot) = false; - }; - } else { - if (_showShortdot) then { - // create control and turn onDraw handler on - ([QGVAR(reticle)] call BIS_fnc_rscLayer) cutRsc ["ACE_Shortdot_Reticle", "PLAIN", 0, false]; - (uiNamespace getVariable "ACE_ctrlShortdotReticle") ctrlSetText QUOTE(PATHTOF(data\reticles\ace_shortdot_reticle_1.paa)); - GVAR(showShortdot) = true; - }; - }; -}] call EFUNC(common,addEventHandler); - -addMissionEventHandler ["Draw3D", {if (GVAR(showShortdot)) then {call FUNC(onDrawShortdot)};}]; diff --git a/addons/spectator/functions/fnc_setSpectator.sqf b/addons/spectator/functions/fnc_setSpectator.sqf index f94d9d9f68..efa7000b8f 100644 --- a/addons/spectator/functions/fnc_setSpectator.sqf +++ b/addons/spectator/functions/fnc_setSpectator.sqf @@ -72,8 +72,10 @@ if (_set) then { closeDialog 0; }; - // Create the display - (findDisplay 46) createDisplay QGVAR(interface); + [{ + // Create the display + (findDisplay 46) createDisplay QGVAR(interface); + }, []] call EFUNC(common,execNextFrame); // Cache and disable nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/ui/$PBOPREFIX$ b/addons/ui/$PBOPREFIX$ index 601bbd5f60..9b6ac48f4f 100644 --- a/addons/ui/$PBOPREFIX$ +++ b/addons/ui/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\ui \ No newline at end of file +z\ace\addons\ui \ No newline at end of file diff --git a/addons/ui/README.md b/addons/ui/README.md index c16d2c04e5..340e3ad0f6 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,7 +1,7 @@ ace_ui ======= -Changes the chat contrast on the map to allow easier reading. +Removes vignette and changes the chat contrast on the map to allow easier reading. ## Maintainers diff --git a/addons/ui/RscChat.hpp b/addons/ui/RscChat.hpp new file mode 100644 index 0000000000..46d8ff0acb --- /dev/null +++ b/addons/ui/RscChat.hpp @@ -0,0 +1,15 @@ +class RscText; +class RscDisplayChat { + class controls { + delete Line; + delete Background; + class CA_Background: RscText { + colorBackground[] = {0.5, 0.5, 0.5, 0.33}; // Make the chat entry field slightly darker + }; + }; +}; + +class RscChatListDefault { + colorBackground[] = {0, 0, 0, 0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85, 0.85, 0.85, 1}; // And the chat text brighter +}; diff --git a/addons/ui/RscVignette.hpp b/addons/ui/RscVignette.hpp new file mode 100644 index 0000000000..1da39c2118 --- /dev/null +++ b/addons/ui/RscVignette.hpp @@ -0,0 +1,4 @@ +class RscPicture; +class RscVignette: RscPicture { + text = ""; // Remove Vignette Texture +}; diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index d2f4d114e4..f545600758 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -6,25 +6,11 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"VKing"}; + author[] = {"VKing", "Jonpas"}; authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; }; }; -class RscText; - -class RscDisplayChat { - class controls { - delete Line; - delete Background; - class CA_Background: RscText { - colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker - }; - }; -}; - -class RscChatListDefault { - colorBackground[] = {0,0,0,0.5}; // Make the chat background darker - colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter -}; +#include "RscChat.hpp" +#include "RscVignette.hpp" diff --git a/addons/ui/functions/script_component.hpp b/addons/ui/functions/script_component.hpp deleted file mode 100644 index 656228f742..0000000000 --- a/addons/ui/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\ui\script_component.hpp" diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp index a1a210701c..a0fa713f9f 100644 --- a/addons/ui/script_component.hpp +++ b/addons/ui/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT ui -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_UI #define DEBUG_MODE_FULL @@ -9,5 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_UI #endif -#include "\z\ace\Addons\main\script_macros.hpp" - +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 71601745f9..46aadce4a2 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -21,7 +21,7 @@ Proporciona controle sobre diversos aspectos do Zeus. Fourni le contrôle des différents aspects de Zeus Különböző beállítási lehetőségeket biztosít a Zeus részeihez. - Обеспечивает контроль над различными аспектами работы Зевса. + Позволяет контролировать различные аспекты Зевса. Ascension Messages @@ -299,4 +299,4 @@ Añadir cualquier objeto creado a todos los directores en la misión - + \ No newline at end of file diff --git a/extensions/medical/medical.cpp b/extensions/medical/medical.cpp index 3dcf3196ab..78517b99d4 100644 --- a/extensions/medical/medical.cpp +++ b/extensions/medical/medical.cpp @@ -39,26 +39,47 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { std::vector arguments = parseExtensionInput(function); if (arguments.size() > 0) { - std::string command = arguments.at(0); - arguments.erase(arguments.begin()); - - if (command == "addInjuryType") { - returnValue = ace::medical::handleDamage::GetInstance().AddInjuryType(arguments); - } - else if (command == "addDamageType") { - returnValue = ace::medical::handleDamage::GetInstance().AddDamageType(arguments); - } - else if (command == "HandleDamageWounds") { - if (arguments.size() >= 4) { - std::string selectionName = arguments.at(0); - double amountOfDamage = std::stod(arguments.at(1)); - std::string typeOfDamage = arguments.at(2); - int woundID = std::stoi(arguments.at(3)); - returnValue = ace::medical::handleDamage::GetInstance().HandleDamageWounds(selectionName, amountOfDamage, typeOfDamage, woundID); + try { + std::string command = arguments.at(0); + arguments.erase(arguments.begin()); + + if (command == "addInjuryType") { + returnValue = ace::medical::handleDamage::GetInstance().AddInjuryType(arguments); + } + else if (command == "addDamageType") { + returnValue = ace::medical::handleDamage::GetInstance().AddDamageType(arguments); + } + else if (command == "HandleDamageWounds") { + if (arguments.size() >= 4) { + std::string selectionName = arguments.at(0); + double amountOfDamage = std::stod(arguments.at(1)); + std::string typeOfDamage = arguments.at(2); + int woundID = std::stoi(arguments.at(3)); + returnValue = ace::medical::handleDamage::GetInstance().HandleDamageWounds(selectionName, amountOfDamage, typeOfDamage, woundID); + } + } + else if (command == "ConfigComplete") { + ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); } } - else if (command == "ConfigComplete") { - ace::medical::handleDamage::GetInstance().FinalizeDefinitions(); + catch (std::exception e) { + std::stringstream debugreturn; + debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; + int i = 0; + for (auto arg : arguments) { + debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; + } + debugreturn << "diag_log format['Exception: " << e.what() << "'];"; + returnValue = debugreturn.str(); + } + catch (...) { + std::stringstream debugreturn; + debugreturn << "diag_log format['ACE3 ERROR - Medical Extension: Something went wrong. Input: '];"; + int i = 0; + for (auto arg : arguments) { + debugreturn << "diag_log format[' arg " << i++ << ":" << arg << "'];"; + } + returnValue = debugreturn.str(); } } strncpy(output, returnValue.c_str(), outputSize); diff --git a/mod.cpp b/mod.cpp index d7b52260b0..2e8513a952 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Advanced Combat Environment 3.3.1"; +name = "Advanced Combat Environment 3.3.2"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; -description = "ACE3 - Version 3.3.1"; +description = "ACE3 - Version 3.3.2"; logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3";