diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..f6f23b8d1b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + diff --git a/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf b/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf deleted file mode 100644 index 4b4d93d453..0000000000 --- a/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf +++ /dev/null @@ -1,98 +0,0 @@ -/** - * fn_moduleAmbianceSoundLoop.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"]; -_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; -_units = [_this,1,[],[[]]] call BIS_fnc_param; -_activated = [_this,2,true,[true]] call BIS_fnc_param; - -if (_activated && isServer) then { - _ambianceSounds = []; - _unparsedSounds = _logic getvariable ["soundFiles", ""]; - _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; - _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; - _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; - _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; - _volume = (_logic getvariable ["soundVolume", 30]) max 1; - _followPlayers = _logic getvariable ["followPlayers", false]; - - _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; - - _nilCheckPassedList = ""; - { - _x = [_x] call cse_fnc_string_removeWhiteSpace; - _splittedList set [_foreachIndex, _x]; - }foreach _splittedList; - - _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; - { - if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); - } else { - if (isclass (configFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); - }; - }; - }foreach _splittedList; - - if (count _ambianceSounds == 0) exitwith { - [format["No Ambiance sounds available"]] call cse_fnc_debug; - }; - { - if !([".", _x, true] call BIS_fnc_inString) then { - [format["Ambiance soundfile does not contain a file extension %1", _x]] call cse_fnc_debug; - _ambianceSounds set [_foreachIndex, _x + ".wss"]; - }; - }foreach _ambianceSounds; - [format["Ambiance sounds %1", _ambianceSounds]] call cse_fnc_debug; - - while {alive _logic} do { - _allUnits = switch (true) do { - case isMultiplayer: {playableUnits}; - case isDedicated: {[_logic]}; - default {[player]}; - }; - - if (count _allUnits > 0) then { - _targetUnit = _allUnits select (round(random((count _allUnits)-1))); - - _newPos = (getPos _targetUnit); - if (!_followPlayers) then { - _newPos = getPos _logic; - }; - - if (random(1) >= 0.5) then { - if (random(1) >= 0.5) then { - _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; - }; - } else { - if (random(1) >= 0.5) then { - _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; - } else { - _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; - }; - }; - - if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { - - _soundToPlay = _ambianceSounds select (round(random((count _ambianceSounds)-1))); - playSound3D [_soundToPlay, _targetUnit, false, _newPos, _volume, 1, 1000]; - - [format["Played a sound %1", _soundToPlay]] call cse_fnc_debug; - - sleep (_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds; - }; - }; - }; -}; - -true; \ No newline at end of file diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index 1cd65127a6..b681c0f7f7 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -1,25 +1,30 @@ #define MACRO_ATTACHTOVEHICLE \ class ACE_Actions { \ - class GVAR(AttachVehicle) { \ - displayName = "$STR_ACE_Attach_AttachDetach"; \ - condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ - exceptions[] = {"ACE_Drag_isNotDragging"}; \ - showDisabled = 0; \ - priority = 0; \ - icon = PATHTOF(UI\attach_ca.paa); \ - distance = 4; \ - }; \ - class GVAR(DetachVehicle) { \ - displayName = "$STR_ACE_Attach_Detach"; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ - statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ - exceptions[] = {"ACE_Drag_isNotDragging"}; \ - showDisabled = 0; \ - priority = 0; \ - icon = PATHTOF(UI\detach_ca.paa); \ - distance = 4; \ + class ACE_MainActions { \ + selection = ""; \ + distance = 5; \ + condition = "true"; \ + class GVAR(AttachVehicle) { \ + displayName = "$STR_ACE_Attach_AttachDetach"; \ + condition = QUOTE(([ARR_3(_player, _target, '')] call FUNC(canAttach))); \ + statement = QUOTE( [ARR_2(_player, _target)] call FUNC(openAttachUI);); \ + exceptions[] = {"ACE_Drag_isNotDragging"}; \ + showDisabled = 0; \ + priority = 0; \ + icon = PATHTOF(UI\attach_ca.paa); \ + distance = 4; \ + }; \ + class GVAR(DetachVehicle) { \ + displayName = "$STR_ACE_Attach_Detach"; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canDetach))); \ + statement = QUOTE( [ARR_2(_player, _target)] call FUNC(detach) ); \ + exceptions[] = {"ACE_Drag_isNotDragging"}; \ + showDisabled = 0; \ + priority = 0; \ + icon = PATHTOF(UI\detach_ca.paa); \ + distance = 4; \ + }; \ }; \ }; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 31b0ac713f..3e4147eee1 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -2,70 +2,78 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_Actions { - class ACE_ApplyHandcuffs { - displayName = "$STR_ACE_Captives_SetCaptive"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); - exceptions[] = {}; - showDisabled = 0; - priority = 2.4; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - hotkey = "C"; + class ACE_RightHandActions { + selection = "righthand"; + displayName = "Right hand"; + distance = 5; + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)) || ([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs))); + class ACE_ApplyHandcuffs { + displayName = "$STR_ACE_Captives_SetCaptive"; + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doApplyHandcuffs)); + exceptions[] = {}; + showDisabled = 0; + priority = 2.4; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); + hotkey = "C"; + }; + class ACE_RemoveHandcuffs { + displayName = "$STR_ACE_Captives_ReleaseCaptive"; + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); + exceptions[] = {}; + showDisabled = 0; + priority = 2.4; + icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); + hotkey = "R"; + }; }; - class ACE_RemoveHandcuffs { - displayName = "$STR_ACE_Captives_ReleaseCaptive"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doRemoveHandcuffs)); - exceptions[] = {}; - showDisabled = 0; - priority = 2.4; - icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); - hotkey = "R"; - }; - class ACE_EscortCaptive { - displayName = "$STR_ACE_Captives_EscortCaptive"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive)); - statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive)); - exceptions[] = {}; - showDisabled = 0; - icon = QUOTE(PATHTOF(UI\captive_ca.paa)); - priority = 2.3; - hotkey = "E"; - }; - class ACE_StopEscorting { - displayName = "$STR_ACE_Captives_StopEscorting"; - distance = 4; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting)); - statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); - exceptions[] = {QGVAR(isNotEscorting)}; - showDisabled = 0; - icon = QUOTE(PATHTOF(UI\captive_ca.paa)); - priority = 2.3; - hotkey = "E"; - }; - class ACE_LoadCaptive { - displayName = "$STR_ACE_Captives_LoadCaptive"; - distance = 4; - condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); - statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); - exceptions[] = {QGVAR(isNotEscorting)}; - showDisabled = 0; - icon = QUOTE(PATHTOF(UI\captive_ca.paa)); - priority = 2.2; - hotkey = "L"; - }; - class ACE_FriskPerson { - displayName = "$STR_ACE_Captives_FriskPerson"; - distance = 2; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson)); - showDisabled = 0; - //icon = ""; //@todo - priority = 3; - hotkey = "F"; + class ACE_MainActions { + class ACE_EscortCaptive { + displayName = "$STR_ACE_Captives_EscortCaptive"; + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive)); + statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive)); + exceptions[] = {}; + showDisabled = 0; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); + priority = 2.3; + hotkey = "E"; + }; + class ACE_StopEscorting { + displayName = "$STR_ACE_Captives_StopEscorting"; + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting)); + statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); + exceptions[] = {QGVAR(isNotEscorting)}; + showDisabled = 0; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); + priority = 2.3; + hotkey = "E"; + }; + class ACE_LoadCaptive { + displayName = "$STR_ACE_Captives_LoadCaptive"; + distance = 4; + condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); + statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); + exceptions[] = {QGVAR(isNotEscorting)}; + showDisabled = 0; + icon = QUOTE(PATHTOF(UI\captive_ca.paa)); + priority = 2.2; + hotkey = "L"; + }; + class ACE_FriskPerson { + displayName = "$STR_ACE_Captives_FriskPerson"; + distance = 2; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson)); + showDisabled = 0; + //icon = ""; //@todo + priority = 3; + hotkey = "F"; + }; }; }; @@ -100,24 +108,27 @@ class CfgVehicles { #define MACRO_LOADUNLOADCAPTIVE \ class ACE_Actions { \ - class ACE_LoadCaptive { \ - displayName = "$STR_ACE_Captives_LoadCaptive"; \ - distance = 4; \ - condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ - statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ - exceptions[] = {QGVAR(isNotEscorting)}; \ - showDisabled = 0; \ - priority = 1.2; \ - hotkey = "L"; \ - }; \ - class ACE_UnloadCaptive { \ - displayName = "$STR_ACE_Captives_UnloadCaptive"; \ - distance = 4; \ - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ - showDisabled = 0; \ - priority = 1.2; \ - hotkey = "C"; \ + class ACE_MainActions { \ + selection = ""; \ + class ACE_LoadCaptive { \ + displayName = "$STR_ACE_Captives_LoadCaptive"; \ + distance = 4; \ + condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ + statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ + exceptions[] = {QGVAR(isNotEscorting)}; \ + showDisabled = 0; \ + priority = 1.2; \ + hotkey = "L"; \ + }; \ + class ACE_UnloadCaptive { \ + displayName = "$STR_ACE_Captives_UnloadCaptive"; \ + distance = 4; \ + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ + showDisabled = 0; \ + priority = 1.2; \ + hotkey = "C"; \ + }; \ }; \ }; diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index e6a5a0e568..56065a43fc 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -19,22 +19,10 @@ PARAMS_1(_unit); DEFAULT_PARAM(1,_target,objNull); -private ["_isAttached"]; - if (isNull _target) then { _target = _unit getVariable [QGVAR(escortedUnit), objNull]; }; -if (isNull _target) exitWith { - ERROR("Null Target (no ACE_escortedUnit)"); - false -}; +if (isNull _target) exitWith {false}; -_isAttached = _target in (attachedObjects _unit); - -if (_isAttached && (!(_target getVariable [QGVAR(isHandcuffed), false]))) exitWith { - ERROR("Attached But Not Captive"); - false -}; - -_isAttached +(_target in (attachedObjects _unit)) && {_target getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index b9c5d7e4ce..522df03d4f 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -38,7 +38,7 @@ class Extended_Respawn_EventHandlers { respawn = QUOTE(_this call FUNC(setName)); }; class GVAR(RESETDefaults) { - respawn = QUOTE(_this call FUNC(resetAllDefaults_F)); + respawn = QUOTE(_this call FUNC(resetAllDefaults)); }; }; }; diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp index 3e3493a8ba..5dc0e6384a 100644 --- a/addons/common/HintConfig.hpp +++ b/addons/common/HintConfig.hpp @@ -17,14 +17,15 @@ class RscTitles { class HintBox: RscStructuredText { idc = 1; text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; + //size = "1 / 40 / (getResolution select 5)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0.5}; x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW; y = safeZoneY + 0.2 * safezoneH; w = 0.2 * safeZoneW; h = 0.1 * SafeZoneH; + font = "PuristaMedium"; }; }; }; @@ -36,13 +37,12 @@ class RscTitles { fadeIn = 0.2; fadeOut = 0.2; name = "ACE_RscErrorHint"; - class controls { class HintBox: RscStructuredText { idc = 1; text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; + //size = "1 / 40 / (getResolution select 5)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0.8, 0, 0, 0.5}; x = 0.3 * safeZoneW + safeZoneX; @@ -52,6 +52,7 @@ class RscTitles { }; }; }; + class ACE_EventHandlerHelper: ACE_Rsc_Display_Base { idd = -1; class controls { diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index 31184f00f4..751d48af9f 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -1,6 +1,3 @@ -class ACE_gui_RscProgress; -class ACE_gui_staticBase; - class GVAR(ProgressBar_Dialog) { idd = -1; @@ -20,7 +17,7 @@ class GVAR(ProgressBar_Dialog) { type = 0; style = 0; size = 1; - colorBackground[] = {0, 0, 0, 0.1}; + colorBackground[] = {0, 0, 0, 0.0}; colorText[] = {0, 0, 0, 0}; x = "safezoneX"; y = "safezoneY"; @@ -34,7 +31,7 @@ class GVAR(ProgressBar_Dialog) { y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorFrame[] = {0,0,0,0.025}; + colorFrame[] = {0,0,0,0.0}; colorBar[] = {0.27,0.5,0.31,0.8}; texture = "#(argb,8,8,3)color(1,1,1,0.7)"; }; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index d0b08c50c2..fe21b05265 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -26,5 +26,5 @@ class RscDisplayInventory { }; class RscDisplayChannel { - onLoad = QUOTE(_this call GVAR(onLoadRscDisplayChannel)); + onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel)); }; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 64a06a0f8c..62fbd7404f 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -15,12 +15,17 @@ PREP(addSetting); PREP(adminKick); PREP(ambientBrightness); PREP(applyForceWalkStatus); +PREP(beingCarried); PREP(binarizeNumber); +PREP(blurScreen); PREP(callCustomEventHandlers); PREP(callCustomEventHandlersGlobal); PREP(canGetInPosition); +PREP(canInteract); PREP(canInteractWith); PREP(canUseWeapon); +PREP(carriedByObj); +PREP(carryObj); PREP(changeProjectileDirection); PREP(checkPBOs); PREP(claim); @@ -30,7 +35,12 @@ PREP(codeToString); PREP(convertKeyCode); PREP(createOrthonormalReference); PREP(currentChannel); +PREP(debug); +PREP(debugModule); +PREP(defineVariable); +PREP(disableAI); PREP(disableUserInput); +PREP(displayIcon); PREP(displayText); PREP(displayTextPicture); PREP(displayTextStructured); @@ -42,12 +52,21 @@ PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); PREP(fixLoweredRifleAnimation); +PREP(getAllDefinedSetVariables); PREP(getAllGear); PREP(getCaptivityStatus); +PREP(getCarriedBy); +PREP(getCarriedObj); PREP(getConfigCommander); PREP(getConfigGunner); +PREP(getDeathAnim); PREP(getDefaultAnim); +PREP(getDefinedVariable); +PREP(getDefinedVariableDefault); +PREP(getDefinedVariableInfo); PREP(getDoorTurrets); +PREP(getFirstObjectIntersection); +PREP(getFirstTerrainIntersection); PREP(getForceWalkStatus); PREP(getGunner); PREP(getHitPoints); @@ -56,6 +75,7 @@ PREP(getInPosition); PREP(getMarkerType); PREP(getName); PREP(getNumberFromMissionSQM); +PREP(getNumberMagazinesIn); PREP(getPitchBankYaw); PREP(getSettingData); PREP(getStringFromMissionSQM); @@ -74,29 +94,43 @@ PREP(getUavControlPosition); PREP(getVehicleCargo); PREP(getVehicleCodriver); PREP(getVehicleCrew); +PREP(getVersion); PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); PREP(getWeaponType); PREP(getWindDirection); PREP(goKneeling); PREP(hadamardProduct); +PREP(hasItem); +PREP(hasMagazine); +PREP(inheritsFrom); +PREP(insertionSort); PREP(interpolateFromArray); PREP(inTransitionAnim); +PREP(inWater); +PREP(isArrested); PREP(isAutoWind); +PREP(isAwake); PREP(isEngineer); PREP(isEOD); PREP(isInBuilding); +PREP(isModLoaded); PREP(isPlayer); PREP(isTurnedOut); PREP(letterToCode); +PREP(limitMovementSpeed); +PREP(loadPerson); +PREP(loadPersonLocal); PREP(loadSettingsFromProfile); PREP(loadSettingsOnServer); PREP(map); PREP(moduleCheckPBOs); PREP(moduleLSDVehicles); +PREP(moveToTempGroup); PREP(muteUnit); PREP(numberToDigits); PREP(numberToDigitsString); +PREP(onAnswerRequest); PREP(onLoadRscDisplayChannel); PREP(owned); PREP(player); @@ -104,33 +138,53 @@ PREP(playerSide); PREP(progressBar); PREP(queueAnimation); PREP(readSettingFromModule); +PREP(receiveRequest); PREP(removeActionEventHandler); PREP(removeActionMenuEventHandler); PREP(removeCameraEventHandler); PREP(removeCustomEventHandler); PREP(removeMapMarkerCreatedEventHandler); PREP(removeScrollWheelEventHandler); +PREP(requestCallback); +PREP(resetAllDefaults); PREP(restoreVariablesJIP); PREP(revertKeyCodeLocalized); PREP(sanitizeString); +PREP(sendRequest); PREP(serverLog); +PREP(setArrestState); +PREP(setCanInteract); PREP(setCaptivityStatus); +PREP(setCarriedBy); +PREP(setDefinedVariable); +PREP(setDisableUserInputStatus); PREP(setForceWalkStatus); +PREP(setHearingCapability); PREP(setName); PREP(setParameter); PREP(setPitchBankYaw); -PREP(setVariableJIP); -PREP(setVariablePublic); +PREP(setProne); PREP(setSetting); PREP(setSettingFromConfig); +PREP(setVariableJIP); +PREP(setVariablePublic); +PREP(setVolume); +PREP(sortAlphabeticallyBy); +PREP(stringCompare); PREP(stringToColoredText); +PREP(stringRemoveWhiteSpace); PREP(subString); +PREP(switchToGroupSide); +PREP(throttledPublicVariable); PREP(toBin); PREP(toBitmask); PREP(toHex); PREP(toNumber); -PREP(throttledPublicVariable); +PREP(uniqueElementsOnly); +PREP(unloadPerson); PREP(unmuteUnit); +PREP(useItem); +PREP(useMagazine); PREP(waitAndExecute); // ACE_Debug @@ -195,74 +249,6 @@ if (hasInterface) then { }, 0, []] call cba_fnc_addPerFrameHandler; }; -PREP(stringCompare); -PREP(string_removeWhiteSpace); -PREP(isHC); -PREP(sendRequest_f); -PREP(requestCallback); -PREP(receiveRequest); -PREP(onAnswerRequest); -PREP(debug); -PREP(debugModule); -PREP(defineVariable); -PREP(setDefinedVariable); -PREP(getDefinedVariable); -PREP(getAllDefinedSetVariables); -PREP(getDefinedVariableInfo); -PREP(getDefinedVariableDefault); -PREP(getDeathAnim); -PREP(insertionSort); -PREP(uniqueElementsOnly); -PREP(sortAlphabeticallyBy); -PREP(hasMagazine); -PREP(useMagazine); -PREP(findMagazine); -PREP(hasItem); -PREP(useItem); -PREP(findItem); -PREP(getNumberMagazinesIn); -PREP(setCanInteract); -PREP(getCanInteract); -PREP(canInteract); -PREP(resetAllDefaults_f); -PREP(broadcastSound3D_f); - -PREP(isAwake); -PREP(setProne); - -PREP(setDisableUserInputStatus); - -PREP(dropWeapon_f); -PREP(inWater_f); -PREP(setVolume_f); -PREP(closeAllDialogs_f); -PREP(disableAI_f); -PREP(switchToGroupSide_f); -PREP(getFirstObjectIntersection); -PREP(getFirstTerrainIntersection); -PREP(setHearingCapability); -PREP(revealObject_f); -PREP(getWeaponItems_f); -PREP(isModLoaded_f); -PREP(inheritsFrom); -PREP(getVersion); -PREP(carryObj); -PREP(carriedByObj); -PREP(getCarriedObj); -PREP(getCarriedBy); -PREP(beingCarried); -PREP(setCarriedBy); - - -PREP(moveToTempGroup); - - -PREP(limitMovementSpeed); -PREP(setArrestState); -PREP(isArrested); -PREP(loadPerson_F); -PREP(loadPersonLocal_F); -PREP(unloadPerson_F); - - ADDON = true; + +isHC = !(hasInterface || isDedicated); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 84052cbdfb..d562d185ec 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -94,8 +94,41 @@ class ACE_Settings { isClientSetable = 1; displayName = "$STR_ACE_Common_EnableNumberHotkeys"; }; + class GVAR(settingFeedbackIcons) { + value = 1; + typeName = "SCALAR"; + force = 0; + isClientSetable = 1; + displayName = "$STR_ACE_Common_SettingFeedbackIconsName"; + description = "$STR_ACE_Common_SettingFeedbackIconsDesc"; + values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"}; + }; + class GVAR(SettingProgressBarLocation) { + value = 0; + typeName = "SCALAR"; + force = 0; + isClientSetable = 1; + displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; + description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; + values[] = {"Top", "Bottom"}; + }; + class GVAR(displayTextColor) { + value[] = {0,0,0,0.1}; + typeName = "COLOR"; + isClientSetable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; + description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; + }; + class GVAR(displayTextFontColor) { + value[] = {1,1,1,1}; + typeName = "COLOR"; + isClientSetable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; + description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; + }; }; +#include "define.hpp" #include #include #include @@ -103,3 +136,23 @@ class ACE_Settings { #include #include +class CfgUIGrids { + class IGUI { + class Presets { + class Arma3 { + class Variables { + grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"}; + }; + }; + }; + + class Variables { + class grid_ACE_displayText { + displayName = "ACE Hint"; + description = "Textual in game feedback to the player."; + preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa"; + saveToProfile[] = {0,1}; + }; + }; + }; +}; diff --git a/addons/gui/UI/define.hpp b/addons/common/define.hpp similarity index 97% rename from addons/gui/UI/define.hpp rename to addons/common/define.hpp index 13ce7d8a3e..f1cc009864 100644 --- a/addons/gui/UI/define.hpp +++ b/addons/common/define.hpp @@ -182,12 +182,12 @@ class ACE_gui_buttonBase { bottom = 0.00; }; textureNoShortcut = ""; - animTextureNormal = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa) ); - animTextureDisabled = QUOTE( PATHTOF(data\buttonDisabled_gradient.paa)); - animTextureOver = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa)); - animTextureFocused = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa)); - animTexturePressed = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa)); - animTextureDefault = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa)); + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; period = 0.5; font = FontCSE; soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; diff --git a/addons/gui/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf similarity index 99% rename from addons/gui/functions/fnc_blurScreen.sqf rename to addons/common/functions/fnc_blurScreen.sqf index 1cde214587..c3d101a37e 100644 --- a/addons/gui/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -39,4 +39,4 @@ if (_show) then { GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; }; }; -}; \ No newline at end of file +}; diff --git a/addons/common/functions/fnc_broadcastSound3D_f.sqf b/addons/common/functions/fnc_broadcastSound3D_f.sqf deleted file mode 100644 index 93f95bb431..0000000000 --- a/addons/common/functions/fnc_broadcastSound3D_f.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/** - * fn_broadcastSound3D_f.sqf - * @Descr: Plays a sound in 3D - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, sound STRING] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -if (isDedicated) exitwith{}; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_sound = [_this, 1, "",[""]] call BIS_fnc_Param; -_unit say3D _sound; \ No newline at end of file diff --git a/addons/common/functions/fnc_closeAllDialogs_f.sqf b/addons/common/functions/fnc_closeAllDialogs_f.sqf deleted file mode 100644 index b5ce1bc280..0000000000 --- a/addons/common/functions/fnc_closeAllDialogs_f.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_closeAllDialogs_f.sqf - * @Descr: Close all dialogs - * @Author: Glowbal - * - * @Arguments: [] - * @Return: void - * @PublicAPI: true - */ -#include "script_component.hpp" - -while {dialog} do { - closeDialog 0; -}; \ No newline at end of file diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf index 115364fb24..a7ca8c1dd5 100644 --- a/addons/common/functions/fnc_currentChannel.sqf +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -14,4 +14,4 @@ #define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"] #define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"] -CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable ["ACE_currentChannel", ""])) max 0 +CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0 diff --git a/addons/common/functions/fnc_disableAI_f.sqf b/addons/common/functions/fnc_disableAI.sqf similarity index 100% rename from addons/common/functions/fnc_disableAI_f.sqf rename to addons/common/functions/fnc_disableAI.sqf diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf new file mode 100644 index 0000000000..1fbc4e89aa --- /dev/null +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -0,0 +1,120 @@ +/* +* Author: Glowbal +* +* Draw progress bar and execute given function if succesful. +* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] +* +* Argument: +* 0: icon ID +* 1: show +* 2: Icon Path +* 3: Icon color +* 4: timeAlive. -1 = forever +* +* Return value: +* Nothing +* +* Example: +* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon; +*/ + + +#include "script_component.hpp" + +// positions for the icon UI +#define RIGHT_SIDE (safezoneW + safezoneX) +#define LEFT_SIDE safezoneX +#define TOP_SIDE safeZoneY +#define BOTTOM_SIDE (safeZoneH + safezoneY) +#define ICON_WIDTH (2 * (((safezoneW / safezoneH) min 1.2) / 40)) +#define X_POS_ICONS (RIGHT_SIDE - (1.5 * ICON_WIDTH)) +#define Y_POS_ICONS (TOP_SIDE + (2.5 * ICON_WIDTH)) +#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH) +#define X_POS_ICONS_SECOND (RIGHT_SIDE - (4.4 * ICON_WIDTH)) +#define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH)) + +// setting values +#define TOP_RIGHT_DOWN 1 +#define TOP_RIGHT_LEFT 2 +#define TOP_LEFT_DOWN 3 +#define TOP_LEFT_RIGHT 4 + +// other constants +#define DEFAULT_TIME 6 + +private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"]; +_iconId = _this select 0; +_show = _this select 1; +_icon = _this select 2; +_color = _this select 3; +_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME}; + +disableSerialization; +_list = missionNamespace getvariable [QGVAR(displayIconList),[]]; + +_refresh = { + private ["_allControls"]; + // Refreshing of all icons.. + _allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []]; + { + ctrlDelete _x; + }foreach _allControls; + + _allControls = []; + + private ["_ctrl", "_setting"]; + _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; + if (_setting > 0) then { + { + // +19000 because we want to make certain we are using free IDCs.. + _ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]); + _position = switch (_setting) do { + case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; + default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; + }; + _ctrl ctrlSetPosition _position; + _ctrl ctrlsetText (_x select 1); + _ctrl ctrlSetTextColor (_x select 2); + _ctrl ctrlCommit 0; + _allControls pushback _ctrl; + }foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]); + }; + missionNamespace setvariable [QGVAR(displayIconListControls), _allControls]; +}; + +if (_show) then { + if ({(_x select 0 == _iconId)} count _list == 0) then { + _list pushback [_iconId, _icon, _color, time]; + } else { + { + if (_x select 0 == _iconId) exitwith { + _list set [_foreachIndex, [_iconId, _icon, _color, time]]; + }; + }foreach _list; + }; + missionNamespace setvariable [QGVAR(displayIconList), _list]; + call _refresh; + + if (_timeAlive >= 0) then { + [{ + [_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon); + }, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute); + }; + +} else { + if ({(_x select 0 == _iconId)} count _list == 1) then { + private "_newList"; + _newList = []; + { + if (_x select 0 != _iconId) then { + _newList pushback _x; + }; + }foreach _list; + + missionNamespace setvariable [QGVAR(displayIconList), _newList]; + call _refresh; + }; +}; diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index c6a68cbab2..7121ef6813 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -18,36 +18,32 @@ #define DEFAULT_DELAY 2 #define DEFAULT_PRIORITY 0 -if (isNil QGVAR(lastHint)) then { - GVAR(lastHint) = [0, 0]; -}; - _this resize 4; -_this spawn { - private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; +private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; +_text = _this select 0; +_sound = _this select 1; +_delay = _this select 2; +_priority = _this select 3; - _text = _this select 0; - _sound = _this select 1; - _delay = _this select 2; - _priority = _this select 3; +if (isNil QGVAR(lastHint)) then { + GVAR(lastHint) = [0, 0]; +}; - _lastHintTime = GVAR(lastHint) select 0; - _lastHintPriority = GVAR(lastHint) select 1; +_lastHintTime = GVAR(lastHint) select 0; +_lastHintPriority = GVAR(lastHint) select 1; - if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; - if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; - if (isNil "_delay") then {_delay = DEFAULT_DELAY}; - if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; +if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; +if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; +if (isNil "_delay") then {_delay = DEFAULT_DELAY}; +if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; - _time = time; - if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { +_time = time; +if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { hintSilent _text; if (_sound) then {playSound "ACE_Sound_Click"}; GVAR(lastHint) set [0, _time]; GVAR(lastHint) set [1, _priority]; - sleep _delay; - if (_time == GVAR(lastHint) select 0) then {hintSilent ""}; - }; + [{if ((_this select 0) == GVAR(lastHint) select 0) then {hintSilent ""};}, [_time], _delay, 0] call FUNC(waitAndExecute); }; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index 8d46d8d38e..8472b3d1b6 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -1,30 +1,30 @@ /* - * Author: commy2 + * Author: commy2, Glowbal * * Display a structured text with image. * * Argument: - * 0: Text (Anything) - * 1: Image (String) + * 0: Text + * 1: Image + * 2: Image color * * Return value: * Nothing */ + #include "script_component.hpp" -private ["_text", "_image"]; - +private ["_text", "_image", "_imageColor"]; _text = _this select 0; _image = _this select 1; +_imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]}; +_imageColor resize 3; if (typeName _text != "TEXT") then { - _text = parseText format ["%1", _text]; + if (typeName _text == "STRING" && {isLocalized _text}) then { + _text = localize _text; + }; + _text = parseText format ["%1", _text]; }; - -_text = composeText [ - parseText format ["", _image], - lineBreak, - _text -]; - -[_text] call FUNC(displayTextStructured); +_text = composeText [parseText format ["", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text]; +[_text, 2] call FUNC(displayTextStructured); diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf index 62db6a829f..054e98de70 100644 --- a/addons/common/functions/fnc_displayTextStructured.sqf +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -1,26 +1,30 @@ /* - * Author: commy2 + * Author: commy2, Glowbal * * Display a structured text. * * Argument: - * 0: Text (Anything) - * 1: Size of the textbox (Number, optional default: 1) + * 0: Text + * 1: Size of the textbox * * Return value: * Nothing */ + #include "script_component.hpp" -private ["_text", "_size", "_isShown", "_ctrlHint"]; +private ["_text", "_size", "_isShown", "_ctrlHint", "_yPos", "_xPos", "_wPos", "_hPos", "_position"]; _text = _this select 0; _size = _this select 1; -if (isNil "_size") then {_size = 1}; +if (isNil "_size") then {_size = 1.5}; if (typeName _text != "TEXT") then { - _text = composeText [lineBreak, parseText format ["%1", _text]]; + if (typeName _text == "STRING" && {isLocalized _text}) then { + _text = localize _text; + }; + _text = composeText [lineBreak, parseText format ["%1", _text]]; }; _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); @@ -30,19 +34,25 @@ _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); disableSerialization; _ctrlHint = uiNamespace getVariable "ACE_ctrlHint"; -_ctrlHint ctrlSetPosition [ - safeZoneW + safeZoneX - 0 * safezoneW, - safeZoneY + 0.2 * safezoneH, - 0.2 * safeZoneW, - _size * 0.1 * SafeZoneH -]; +_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor); +_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); +/* +// This does not function at the moment. Has been disabled until it fixed. +_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; +_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; +_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))]; +_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; +*/ + +_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); +_yPos = safeZoneY + 0.175 * safezoneH; +_wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40)); +_hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)); +_position = [_xPos, _yPos, _wPos, _size * _hPos]; + +_ctrlHint ctrlSetPosition _position; _ctrlHint ctrlCommit 0; _ctrlHint ctrlSetStructuredText _text; -_ctrlHint ctrlSetPosition [ - safeZoneW + safeZoneX - 0.2 * safezoneW, - safeZoneY + 0.2 * safezoneH, - 0.2 * safeZoneW, - _size * 0.1 * SafeZoneH -]; -_ctrlHint ctrlCommit ([0.2, 0] select _isShown); +_ctrlHint ctrlSetPosition _position; +_ctrlHint ctrlCommit ([0.5, 0] select _isShown); diff --git a/addons/common/functions/fnc_dropWeapon_f.sqf b/addons/common/functions/fnc_dropWeapon_f.sqf deleted file mode 100644 index bf1358b5e7..0000000000 --- a/addons/common/functions/fnc_dropWeapon_f.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * fn_dropWeapon_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ -#include "script_component.hpp" -private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; - -_currentWeapon = currentWeapon _unit; -_currentAnimation = animationState _unit; -_WeaponHolder = "GroundWeaponHolder" createVehicle position _unit; - -_unit removeWeapon _currentWeapon; -_weaponHolder addWeaponCargoGlobal [_currentWeapon, 1]; -//_unit action [ "DropWeapon", _WeaponHolder, _currentWeapon ]; -_WeaponHolder setPos (getPos _unit); -//_unit switchMove _currentAnimation; - -_primairyWeapon = primaryWeapon _unit; -_secondairyWeapon = secondaryWeapon _unit; -_handGunWeapon = handgunWeapon _unit; - -switch (_currentWeapon) do { - case _primairyWeapon: { - - }; - case _secondairyWeapon: { - - }; - case _handGunWeapon: { - - }; - default {}; -}; \ No newline at end of file diff --git a/addons/common/functions/fnc_endRadioTransmission.sqf b/addons/common/functions/fnc_endRadioTransmission.sqf index 990d4e03d8..772a34a06b 100644 --- a/addons/common/functions/fnc_endRadioTransmission.sqf +++ b/addons/common/functions/fnc_endRadioTransmission.sqf @@ -14,17 +14,17 @@ // ACRE if (isClass (configFile >> "CfgPatches" >> "acre_main")) then { - [-1] call acre_core_fnc_handleMultiPttKeyPressUp; - [0] call acre_core_fnc_handleMultiPttKeyPressUp; - [1] call acre_core_fnc_handleMultiPttKeyPressUp; - [2] call acre_core_fnc_handleMultiPttKeyPressUp; + [-1] call acre_core_fnc_handleMultiPttKeyPressUp; + [0] call acre_core_fnc_handleMultiPttKeyPressUp; + [1] call acre_core_fnc_handleMultiPttKeyPressUp; + [2] call acre_core_fnc_handleMultiPttKeyPressUp; }; // TFAR if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { - call TFAR_fnc_onSwTangentReleased; - call TFAR_fnc_onAdditionalSwTangentReleased; - call TFAR_fnc_onLRTangentReleased; - call TFAR_fnc_onAdditionalLRTangentReleased; - call TFAR_fnc_onDDTangentReleased; + call TFAR_fnc_onSwTangentReleased; + call TFAR_fnc_onAdditionalSwTangentReleased; + call TFAR_fnc_onLRTangentReleased; + call TFAR_fnc_onAdditionalLRTangentReleased; + call TFAR_fnc_onDDTangentReleased; }; diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index 10c88d6bca..c298785c26 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -1,8 +1,8 @@ // by commy2 /* - usage: + usage: - (configFile >> "CfgAmmo") call FUNC(exportConfig); + (configFile >> "CfgAmmo") call FUNC(exportConfig); */ #include "script_component.hpp" diff --git a/addons/common/functions/fnc_findItem.sqf b/addons/common/functions/fnc_findItem.sqf deleted file mode 100644 index 5c4469ea7f..0000000000 --- a/addons/common/functions/fnc_findItem.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * fn_findItem.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: true - */ -#include "script_component.hpp" -private ["_unit","_magazine","_return"]; -_unit = _this select 0; -_item = _this select 1; - -if (_item in (uniformItems _unit)) exitwith {1}; -if (_item in (vestItems _unit)) exitwith {2}; -if (_item in (backpackItems _unit)) exitwith {3}; -if (_item in (assignedItems _unit)) exitwith {4}; -if (_item in (primaryWeaponItems _unit)) exitwith {5}; -if (_item in (secondaryWeaponItems _unit)) exitwith {6}; -if (_item in (handgunItems _unit)) exitwith {7}; -if (_item in (items _unit)) exitwith {8}; // in case it is in items but cannot be found in any other container (should never reach this) - -// If we cannot find the item, return 0. -0; \ No newline at end of file diff --git a/addons/common/functions/fnc_findMagazine.sqf b/addons/common/functions/fnc_findMagazine.sqf deleted file mode 100644 index 549d016e8d..0000000000 --- a/addons/common/functions/fnc_findMagazine.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/** - * fn_findMagazine.sqf - * @Descr: Find where the current magazines are. Order: uniform, vest, backpack, any. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, magazine STRING (Classname of magazine)] - * @Return: NUMBER 0 = none, 1 = in uniform, 2 = in vest, 3 = in backpack, 4 = found outside container - * @PublicAPI: true - */ -#include "script_component.hpp" -private ["_unit","_magazine"]; -_unit = _this select 0; -_magazine = _this select 1; - -if (_magazine in (getMagazineCargo uniformContainer _unit)) exitwith {1}; -if (_magazine in (getMagazineCargo vestContainer _unit)) exitwith {2}; -if (_magazine in (getMagazineCargo backpackContainer _unit)) exitwith {3}; -if (_magazine in (magazines _unit)) exitwith {4}; // in case it cannot be found in any other container. Most likely loaded in a weapon. - -// If we cannot find the item, return 0. -0; \ No newline at end of file diff --git a/addons/common/functions/fnc_getCanInteract.sqf b/addons/common/functions/fnc_getCanInteract.sqf deleted file mode 100644 index 87f572b93d..0000000000 --- a/addons/common/functions/fnc_getCanInteract.sqf +++ /dev/null @@ -1,12 +0,0 @@ -/** - * fn_getCanInteract.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ -#include "script_component.hpp" - -((_this select 0) getvariable [QGVAR(canInteract),0]) \ No newline at end of file diff --git a/addons/common/functions/fnc_getCustomResults_f.sqf b/addons/common/functions/fnc_getCustomResults_f.sqf deleted file mode 100644 index 4b68f85c9c..0000000000 --- a/addons/common/functions/fnc_getCustomResults_f.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/** - * fn_getCustomResults_f.sqf - * @Descr: Executes custom results eventhandlers, collects their output and returns this. - * @Author: Glowbal - * - * @Arguments: [arguments ANY, handle STRING] - * @Return: ARRAY Collection of all return values of all executed CustomResult handlers - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"]; -_arguments = _this select 0; -_handle = _this select 1; - -_eventHandlerName = ("ace_f_custom_results_eventhandler_" + _handle); -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - - // TODO Get a replacement for this - _cfg = (ConfigFile >> "Advanced_Combat_Environment" >> "CustomResults" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; -}; - -_return = []; -{ - _return pushback (_arguments call (_x select 1)); - false; -}count _eventHandlerCollection; - -_return diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index 0c82066e4b..71191083e0 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -20,9 +20,9 @@ private "_gunner"; _gunner = objNull; { - if (_weapon in (_vehicle weaponsTurret _x)) exitWith { - _gunner = _vehicle turretUnit _x; - }; + if (_weapon in (_vehicle weaponsTurret _x)) exitWith { + _gunner = _vehicle turretUnit _x; + }; } forEach allTurrets _vehicle; _gunner diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index a6d75e41b9..26b0b1b840 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -23,33 +23,33 @@ _hitpoints = []; private "_hitpointClasses"; _hitpointClasses = [_config >> "HitPoints"]; { - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; + private "_class"; + _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; + if (isClass _class) then { + _hitpointClasses pushBack _class; + }; } forEach allTurrets _vehicle; // iterate through all classes with hitpoints and their parents { - private "_class"; - _class = _x; + private "_class"; + _class = _x; - while {isClass _class} do { + while {isClass _class} do { - for "_i" from 0 to (count _class - 1) do { - private "_entry"; - _entry = configName (_class select _i); + for "_i" from 0 to (count _class - 1) do { + private "_entry"; + _entry = configName (_class select _i); - if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then { - _hitpoints pushBack _entry; - }; - }; + if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then { + _hitpoints pushBack _entry; + }; + }; - _class = inheritsFrom _class; - }; + _class = inheritsFrom _class; + }; } forEach _hitpointClasses; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index e9a7a8fac5..f0c9801382 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -24,36 +24,36 @@ _selections = []; private "_hitpointClasses"; _hitpointClasses = [_config >> "HitPoints"]; { - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; + private "_class"; + _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; + if (isClass _class) then { + _hitpointClasses pushBack _class; + }; } forEach allTurrets _vehicle; // iterate through all classes with hitpoints and their parents { - private "_class"; - _class = _x; + private "_class"; + _class = _x; - while {isClass _class} do { + while {isClass _class} do { - for "_i" from 0 to (count _class - 1) do { - private ["_entry", "_selection"]; + for "_i" from 0 to (count _class - 1) do { + private ["_entry", "_selection"]; - _entry = configName (_class select _i); - _selection = getText (_class select _i >> "name"); + _entry = configName (_class select _i); + _selection = getText (_class select _i >> "name"); - if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { - _hitpoints pushBack _entry; - _selections pushBack _selection; - }; - }; + if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { + _hitpoints pushBack _entry; + _selections pushBack _selection; + }; + }; - _class = inheritsFrom _class; - }; + _class = inheritsFrom _class; + }; } forEach _hitpointClasses; diff --git a/addons/common/functions/fnc_getWeaponItems_f.sqf b/addons/common/functions/fnc_getWeaponItems_f.sqf deleted file mode 100644 index d18ce28a72..0000000000 --- a/addons/common/functions/fnc_getWeaponItems_f.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_getWeaponItems_f.sqf - * @Descr: Get the weapon items from the unit. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: - * @PublicAPI: false - */ -#include "script_component.hpp" -private "_unit"; -_unit = _this select 0; - -[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; \ No newline at end of file diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index 6147d06a73..7682b2f6a2 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -9,18 +9,18 @@ _key = _this select 1; ERRORDATA(2); _val = nil; try { - if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; - if(_index != -1) then { - _val = (_hash select 1) select _index; - if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then { - _val = nil; - }; - }; - } else { - ERROR("Input hash is not valid"); - }; + if(VALIDHASH(_hash)) then { + _index = (_hash select 0) find _key; + if(_index != -1) then { + _val = (_hash select 1) select _index; + if(IS_STRING(_val) && {_val == "ACREHASHREMOVEDONOTUSETHISVAL"}) then { + _val = nil; + }; + }; + } else { + ERROR("Input hash is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; _val diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index d69ad2f3e8..8011e987fb 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -9,15 +9,15 @@ _key = _this select 1; ERRORDATA(2); _val = false; try { - if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; - if(_index != -1) then { - _val = true; - }; - } else { - ERROR("Input hash is not valid"); - }; + if(VALIDHASH(_hash)) then { + _index = (_hash select 0) find _key; + if(_index != -1) then { + _val = true; + }; + } else { + ERROR("Input hash is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; _val diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index fef9c79b85..cdad5987cd 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -7,12 +7,12 @@ _hashList = _this select 0; ERRORDATA(1); _hashKeys = []; try { - if(VALIDHASH(_hashList)) then { - _hashKeys = (_hashList select 0); - } else { - ERROR("Input hashlist is not valid"); - }; + if(VALIDHASH(_hashList)) then { + _hashKeys = (_hashList select 0); + } else { + ERROR("Input hashlist is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; [_hashKeys, []]; diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf index e783f7c324..afd092a1b9 100644 --- a/addons/common/functions/fnc_hashListPush.sqf +++ b/addons/common/functions/fnc_hashListPush.sqf @@ -7,11 +7,11 @@ _hashList = _this select 0; _value = _this select 1; ERRORDATA(2); try { - if(VALIDHASH(_hashList)) then { - [_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet); - } else { - ERROR("Input hashlist in push not valid"); - }; + if(VALIDHASH(_hashList)) then { + [_hashList, (count (_hashList select 1)), _value] call FUNC(hashListSet); + } else { + ERROR("Input hashlist in push not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index e1ee0aae0f..0c552d072e 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -8,20 +8,20 @@ _index = _this select 1; ERRORDATA(2); _hash = nil; try { - if(VALIDHASH(_hashList)) then { - _keys = _hashList select 0; - _hashes = _hashList select 1; - if(_index < (count _hashes)) then { - _values = _hashes select _index; + if(VALIDHASH(_hashList)) then { + _keys = _hashList select 0; + _hashes = _hashList select 1; + if(_index < (count _hashes)) then { + _values = _hashes select _index; - _hash = [_keys, _values, 1]; - } else { - ERROR("Index of hashlist is out of range"); - }; - } else { - ERROR("Input hashlist is not valid"); - }; + _hash = [_keys, _values, 1]; + } else { + ERROR("Index of hashlist is out of range"); + }; + } else { + ERROR("Input hashlist is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; _hash; diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index 8b7239dffd..c384bc15c9 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -8,17 +8,17 @@ _index = _this select 1; _value = _this select 2; ERRORDATA(3); try { - if(VALIDHASH(_hashList)) then { - if(VALIDHASH(_value)) then { - _vals = _value select 1; - - (_hashList select 1) set[_index, _vals]; - } else { - ERROR("Set hash in hashlist is not valid"); - }; - } else { - ERROR("Input hashlist is not valid"); - }; + if(VALIDHASH(_hashList)) then { + if(VALIDHASH(_value)) then { + _vals = _value select 1; + + (_hashList select 1) set[_index, _vals]; + } else { + ERROR("Set hash in hashlist is not valid"); + }; + } else { + ERROR("Input hashlist is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 86898fb3df..000dbbefe0 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -8,23 +8,23 @@ _key = _this select 1; ERRORDATA(2); _val = nil; try { - if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; - if(_index != -1) then { - (_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"]; - // is this hash is not part of a hash list? - // if it is we need to leave the keys intact. - if((count _hash) == 2) then { - // if this is a standalone hash then we can clean it up - (_hash select 0) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"]; - _hash set[0, ((_hash select 0) - ["ACREHASHREMOVEDONOTUSETHISVAL"])]; - _hash set[1, ((_hash select 1) - ["ACREHASHREMOVEDONOTUSETHISVAL"])]; - }; - }; - } else { - ERROR("Input hash is not valid"); - }; + if(VALIDHASH(_hash)) then { + _index = (_hash select 0) find _key; + if(_index != -1) then { + (_hash select 1) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"]; + // is this hash is not part of a hash list? + // if it is we need to leave the keys intact. + if((count _hash) == 2) then { + // if this is a standalone hash then we can clean it up + (_hash select 0) set[_index, "ACREHASHREMOVEDONOTUSETHISVAL"]; + _hash set[0, ((_hash select 0) - ["ACREHASHREMOVEDONOTUSETHISVAL"])]; + _hash set[1, ((_hash select 1) - ["ACREHASHREMOVEDONOTUSETHISVAL"])]; + }; + }; + } else { + ERROR("Input hash is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; true diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 23438eaf83..0e374d5f12 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -9,19 +9,19 @@ _key = _this select 1; _val = _this select 2; ERRORDATA(3); try { - if(VALIDHASH(_hash)) then { - _index = (_hash select 0) find _key; - if(_index == -1) then { - _index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL"; - if(_index == -1) then { - _index = (count (_hash select 0)); - }; - (_hash select 0) set[_index, _key]; - }; - (_hash select 1) set[_index, _val]; - } else { - ERROR("Input hash is not valid"); - }; + if(VALIDHASH(_hash)) then { + _index = (_hash select 0) find _key; + if(_index == -1) then { + _index = (_hash select 0) find "ACREHASHREMOVEDONOTUSETHISVAL"; + if(_index == -1) then { + _index = (count (_hash select 0)); + }; + (_hash select 0) set[_index, _key]; + }; + (_hash select 1) set[_index, _val]; + } else { + ERROR("Input hash is not valid"); + }; } catch { - HANDLECATCH; + HANDLECATCH; }; diff --git a/addons/common/functions/fnc_inWater_f.sqf b/addons/common/functions/fnc_inWater.sqf similarity index 100% rename from addons/common/functions/fnc_inWater_f.sqf rename to addons/common/functions/fnc_inWater.sqf diff --git a/addons/common/functions/fnc_isHC.sqf b/addons/common/functions/fnc_isHC.sqf deleted file mode 100644 index 82a9d49ba2..0000000000 --- a/addons/common/functions/fnc_isHC.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_isHC.sqf - * @Descr: Check if current locality is a headless client - * @Author: Glowbal - * - * @Arguments: [] - * @Return: BOOL True if locality is headless client OR is not in multiplayer - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_return"]; - -if (!isMultiplayer) then { - _return = true; -} else { - if (isServer && !isDedicated) then { - _return = true; - } else { - _return = !(hasInterface || isDedicated); - }; -}; -_return \ No newline at end of file diff --git a/addons/common/functions/fnc_isModLoaded_f.sqf b/addons/common/functions/fnc_isModLoaded.sqf similarity index 100% rename from addons/common/functions/fnc_isModLoaded_f.sqf rename to addons/common/functions/fnc_isModLoaded.sqf diff --git a/addons/common/functions/fnc_loadPerson_f.sqf b/addons/common/functions/fnc_loadPerson.sqf similarity index 86% rename from addons/common/functions/fnc_loadPerson_f.sqf rename to addons/common/functions/fnc_loadPerson.sqf index 5944879c62..0d2995db1b 100644 --- a/addons/common/functions/fnc_loadPerson_f.sqf +++ b/addons/common/functions/fnc_loadPerson.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) +#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"]; _caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; @@ -34,9 +34,9 @@ if (_unit distance _loadcar <= 10) then { }; }; if (!isNull _vehicle) then { - [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); + [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); [_caller,objNull] call FUNC(carryObj); [_unit,objNull] call FUNC(carryObj); - [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc); + [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); }; _vehicle \ No newline at end of file diff --git a/addons/common/functions/fnc_loadPersonLocal_f.sqf b/addons/common/functions/fnc_loadPersonLocal.sqf similarity index 83% rename from addons/common/functions/fnc_loadPersonLocal_f.sqf rename to addons/common/functions/fnc_loadPersonLocal.sqf index dbba09111a..6e31050cf9 100644 --- a/addons/common/functions/fnc_loadPersonLocal_f.sqf +++ b/addons/common/functions/fnc_loadPersonLocal.sqf @@ -16,13 +16,13 @@ _vehicle = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; _caller = [_this, 2, ObjNull,[ObjNull]] call BIS_fnc_Param; if (!alive _unit) then { - _unit = [_unit,_caller] call FUNC(makeCopyOfBody_F); + _unit = [_unit,_caller] call FUNC(makeCopyOfBody); }; _unit moveInCargo _vehicle; -_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; +_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; _loaded pushback _unit; -_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; +_vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; if (!([_unit] call FUNC(isAwake))) then { _handle = [_unit,_vehicle] spawn { private ["_unit","_vehicle"]; diff --git a/addons/common/functions/fnc_moveToTempGroup.sqf b/addons/common/functions/fnc_moveToTempGroup.sqf index b146e67ef3..802bc2285d 100644 --- a/addons/common/functions/fnc_moveToTempGroup.sqf +++ b/addons/common/functions/fnc_moveToTempGroup.sqf @@ -18,12 +18,12 @@ if (_moveTo) then { _previousGroup = group _unit; _newGroup = createGroup (side _previousGroup); [_unit] joinSilent _newGroup; - _unit setvariable [QGVAR(previousGroup_F),_previousGroup]; + _unit setvariable [QGVAR(previousGroup),_previousGroup]; } else { - _previousGroup = _unit getvariable QGVAR(previousGroup_F); + _previousGroup = _unit getvariable QGVAR(previousGroup); if (!isnil "_previousGroup") then { _currentGroup = group _unit; - _unit setvariable [QGVAR(previousGroup_F),nil]; + _unit setvariable [QGVAR(previousGroup),nil]; [_unit] joinSilent _previousGroup; if (count units _currentGroup == 0) then { deleteGroup _currentGroup; diff --git a/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf b/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf index 2a2fbfc9a4..ae8113c1b8 100644 --- a/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf +++ b/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf @@ -1,24 +1,29 @@ /* - Name: FUNC(onLoadRscDisplayChannel) - - Author: Pabst Mirror, commy2 - - Description: - When the RscDisplayChannel is loaded, this will constantly uiNamespace variable "ACE_currentChannel" - with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open. - - Parameters: - 0: DISPLAY - RscDisplayChannel - - Returns: - Nothing -*/ + * Author: Pabst Mirror, commy2 + * When the RscDisplayChannel is loaded, this will constantly uiNamespace variable ace_common_currentChannel + * with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open. + * + * Arguments: + * 0: The RscDisplayChannel Display + * + * Return Value: + * Nothing + * + * Example: + * onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel)); + * + * Public: No + */ #include "script_component.hpp" -uiNamespace setVariable ["ACE_ctrlChannel", (_this select 0) displayCtrl 101]; +uiNamespace setVariable [QGVAR(currentChannelControl), ((_this select 0) displayCtrl 101)]; ["ACE_currentChannel", "onEachFrame", { - if (ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull]) != "") then { - uiNamespace setVariable ["ACE_currentChannel", ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull])]; - }; + if (isNull (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull])) then { + ["ACE_currentChannel", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + } else { + private "_localizedChannelText"; + _localizedChannelText = ctrlText (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull]); + uiNamespace setVariable [QGVAR(currentChannel), _localizedChannelText]; + }; }] call BIS_fnc_addStackedEventhandler; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index ab4cb7b69c..0b8fcc7ac4 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -15,6 +15,9 @@ * * Return value: * Nothing +* +* Example: +* [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar */ #include "script_component.hpp" @@ -32,14 +35,24 @@ closeDialog 0; createDialog QGVAR(ProgressBar_Dialog); (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle; +if (GVAR(SettingProgressBarLocation) == 1) then { + private "_ctrlPos"; + _ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; + (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; + (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; + (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; +}; + + _perFrameFunction = { PARAMS_2(_parameters,_pfhID); EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions); private ["_elapsedTime", "_errorCode"]; - + _elapsedTime = time - _startTime; _errorCode = -1; - + if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then { _errorCode = 1; } else { diff --git a/addons/common/functions/fnc_queueAnimation.sqf b/addons/common/functions/fnc_queueAnimation.sqf index a489a46174..73f3dca109 100644 --- a/addons/common/functions/fnc_queueAnimation.sqf +++ b/addons/common/functions/fnc_queueAnimation.sqf @@ -4,7 +4,7 @@ terminate (missionNamespace getVariable [QGVAR(waitForAnimationHandle), scriptNull]); GVAR(waitForAnimationHandle) = _this spawn { - waitUntil {!([_this select 0] call FUNC(inTransitionAnim))}; + waitUntil {!([_this select 0] call FUNC(inTransitionAnim))}; - _this call FUNC(doAnimation); + _this call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_resetAllDefaults_f.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf similarity index 74% rename from addons/common/functions/fnc_resetAllDefaults_f.sqf rename to addons/common/functions/fnc_resetAllDefaults.sqf index c415b5b32c..63e6764d01 100644 --- a/addons/common/functions/fnc_resetAllDefaults_f.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -17,17 +17,17 @@ _unit setvariable ["ACE_isDead",nil,true]; _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { - [true] call FUNC(setVolume_f); - [false] call FUNC(disableKeyInput_f); - if (["ace_medical"] call FUNC(isModLoader_f)) then { + [true] call FUNC(setVolume); + [false] call FUNC(disableKeyInput); + if (["ace_medical"] call FUNC(isModLoader)) then { [false] call EFUNC(medical,effectBlackOut); }; - if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { + if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { // clear all disable user input { [_X, false] call FUNC(setDisableUserInputStatus); - }foreach GVAR(DISABLE_USER_INPUT_COLLECTION_F); + }foreach GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; diff --git a/addons/common/functions/fnc_revealObject_f.sqf b/addons/common/functions/fnc_revealObject_f.sqf deleted file mode 100644 index 9c5a34f59a..0000000000 --- a/addons/common/functions/fnc_revealObject_f.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * fnc_revealObject_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" - -if (hasInterface) then { - player reveal (_this select 0); -}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf similarity index 95% rename from addons/gui/functions/fnc_sendDisplayInformationTo.sqf rename to addons/common/functions/fnc_sendDisplayInformationTo.sqf index ae4012b5fe..f22894e057 100644 --- a/addons/gui/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -42,6 +42,6 @@ if (isPlayer _reciever) then { }foreach _content; - [_title,_content,_type] call EFUNC(gui,displayInformation); + [_title,_content,_type] call EFUNC(common,displayInformation); }; }; \ No newline at end of file diff --git a/addons/gui/functions/fnc_sendDisplayMessageTo.sqf b/addons/common/functions/fnc_sendDisplayMessageTo.sqf similarity index 95% rename from addons/gui/functions/fnc_sendDisplayMessageTo.sqf rename to addons/common/functions/fnc_sendDisplayMessageTo.sqf index c66af97266..3c5b399659 100644 --- a/addons/gui/functions/fnc_sendDisplayMessageTo.sqf +++ b/addons/common/functions/fnc_sendDisplayMessageTo.sqf @@ -41,6 +41,6 @@ if (isPlayer _reciever) then { }foreach _parameters; _content = format _localizationArray; - [_title,_content,_type] call EFUNC(gui,displayMessage); + [_title,_content,_type] call EFUNC(common,displayMessage); }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_sendRequest_f.sqf b/addons/common/functions/fnc_sendRequest.sqf similarity index 100% rename from addons/common/functions/fnc_sendRequest_f.sqf rename to addons/common/functions/fnc_sendRequest.sqf diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index 2451cbe90f..2cf25b827a 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -13,16 +13,16 @@ _id = _this select 0; _disable = _this select 1; -if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) = []; +if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { + GVAR(DISABLE_USER_INPUT_COLLECTION) = []; }; if (_disable) then { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) pushback _id; + GVAR(DISABLE_USER_INPUT_COLLECTION) pushback _id; [true] call FUNC(disableUserInput); } else { - GVAR(DISABLE_USER_INPUT_COLLECTION_F) = GVAR(DISABLE_USER_INPUT_COLLECTION_F) - [_id]; - if (GVAR(DISABLE_USER_INPUT_COLLECTION_F) isEqualTo []) then { + GVAR(DISABLE_USER_INPUT_COLLECTION) = GVAR(DISABLE_USER_INPUT_COLLECTION) - [_id]; + if (GVAR(DISABLE_USER_INPUT_COLLECTION) isEqualTo []) then { [false] call FUNC(disableUserInput); }; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 4151f3e0e4..27c727acab 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -17,7 +17,8 @@ EXPLODE_1_PVT(_this,_optionEntry); _fnc_getValueWithType = { EXPLODE_2_PVT(_this,_optionEntry,_typeName); - _value = getNumber (_optionEntry >> "value"); + _valueConfig = (_optionEntry >> "value"); + _value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0}; TRACE_3("_fnc_getValueWithType:", configName _optionEntry, _typeName, _value); if (_typeName == "BOOL") exitWith { _value > 0 diff --git a/addons/common/functions/fnc_setVolume_f.sqf b/addons/common/functions/fnc_setVolume.sqf similarity index 100% rename from addons/common/functions/fnc_setVolume_f.sqf rename to addons/common/functions/fnc_setVolume.sqf diff --git a/addons/common/functions/fnc_string_removeWhiteSpace.sqf b/addons/common/functions/fnc_stringRemoveWhiteSpace.sqf similarity index 100% rename from addons/common/functions/fnc_string_removeWhiteSpace.sqf rename to addons/common/functions/fnc_stringRemoveWhiteSpace.sqf diff --git a/addons/common/functions/fnc_switchToGroupSide_f.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf similarity index 92% rename from addons/common/functions/fnc_switchToGroupSide_f.sqf rename to addons/common/functions/fnc_switchToGroupSide.sqf index 97b043adbe..528d32853c 100644 --- a/addons/common/functions/fnc_switchToGroupSide_f.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -16,7 +16,7 @@ _switch = [_this, 1, false,[false]] call BIS_fnc_Param; _id = [_this, 2, "", [""]] call BIS_fnc_Param; _side = [_this, 3, side _unit,[west]] call BIS_fnc_Param; -_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo_F),[]]; +_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo),[]]; if (_switch) then { // go forward _previousGroup = group _unit; @@ -30,7 +30,7 @@ if (_switch) then { [_unit] joinSilent _newGroup; _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; - _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; + _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; } else { // go one back { @@ -60,5 +60,5 @@ if (_switch) then { }foreach _previousGroupsList; _previousGroupsList = _previousGroupsList - [objNull]; reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. - _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; + _unit setvariable [QGVAR(previousGroupSwitchTo), _previousGroupsList, true]; }; diff --git a/addons/common/functions/fnc_unloadPerson_f.sqf b/addons/common/functions/fnc_unloadPerson.sqf similarity index 89% rename from addons/common/functions/fnc_unloadPerson_f.sqf rename to addons/common/functions/fnc_unloadPerson.sqf index 1aaaee84a1..33c0e9c0c2 100644 --- a/addons/common/functions/fnc_unloadPerson_f.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) +#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) private ["_caller", "_unit","_vehicle", "_loaded"]; _caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; @@ -27,11 +27,11 @@ if (!alive _unit) then { _unit action ["Eject", vehicle _unit]; }; -[_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); +[_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide); -_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; +_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; _loaded = _loaded - [_unit]; -_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; +_vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; if (!([_unit] call FUNC(isAwake))) then { _handle = [_unit,_vehicle] spawn { diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index f2d944eb7a..d1462c1214 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -315,6 +315,30 @@ Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + + Feedback icons + + + Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed. + + + Progress bar location + + + Set the desired location of the progress bar on your screen. + + + Hint Background color + + + The color of the background from the ACE hints. + + + Hint text font color + + + The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. + \ No newline at end of file diff --git a/addons/explosives/CfgACE_Triggers.hpp b/addons/explosives/CfgACE_Triggers.hpp index 1b686d6092..789786bb4f 100644 --- a/addons/explosives/CfgACE_Triggers.hpp +++ b/addons/explosives/CfgACE_Triggers.hpp @@ -24,6 +24,12 @@ class CfgACE_Triggers { picture = PATHTOF(Data\UI\DeadmanSwitch.paa); requires[] = {"ACE_DeadManSwitch"}; }; + class Cellphone:Command { + displayName = $STR_ACE_Explosives_cellphone_displayName; + picture = PATHTOF(Data\UI\Cellphone_UI.paa); + onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); + requires[] = {"ACE_Cellphone"}; + }; class PressurePlate { displayName = $STR_ACE_Explosives_PressurePlate; picture = PATHTOF(Data\UI\PressurePlate.paa); diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 7cc1c8a8bd..51c85e607f 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -95,4 +95,33 @@ class CfgMagazines { }; }; }; + + class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanBig"; + class ACE_Triggers { + SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + class Command { + FuseTime = 0.5; + }; + class DeadmanSwitch:Command{}; + class Cellphone:Command{}; + }; + }; + class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag{ + ACE_SetupObject = "ACE_Explosives_Place_IEDLandBig"; + }; + class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanSmall"; + class ACE_Triggers { + SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + class Command { + FuseTime = 0.5; + }; + class DeadmanSwitch:Command{}; + class Cellphone:Command{}; + }; + }; + class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { + ACE_SetupObject = "ACE_Explosives_Place_IEDLandSmall"; + }; }; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 73477ddce5..983bc0972a 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -49,6 +49,15 @@ class CfgVehicles { priority = 0.8; hotkey = "F"; }; + class ACE_Cellphone { + displayName = $STR_ACE_Explosives_cellphone_displayName; + condition = "('ACE_Cellphone' in (items ace_player))"; + statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; + exceptions[] = {"ACE_Interaction_isNotSwimming"}; + showDisabled = 0; + icon = PATHTOF(Data\UI\Cellphone_UI.paa); + priority = 0.8; + }; }; }; }; @@ -105,6 +114,27 @@ class CfgVehicles { model = "\A3\Weapons_F\Explosives\mine_SLAM_directional"; }; + // IEDs + class ACE_Explosives_Place_IEDUrbanBig:ACE_Explosives_Place { + displayName = "IED Urban Big"; + model = "\A3\Weapons_F\Explosives\IED_urban_big"; + }; + + class ACE_Explosives_Place_IEDLandBig:ACE_Explosives_Place { + displayName = "IED Land Big"; + model = "\A3\Weapons_F\Explosives\IED_land_big"; + }; + + class ACE_Explosives_Place_IEDUrbanSmall:ACE_Explosives_Place { + displayName = "IED Urban Small"; + model = "\A3\Weapons_F\Explosives\IED_urban_small"; + }; + + class ACE_Explosives_Place_IEDLandSmall:ACE_Explosives_Place { + displayName = "IED Land Small"; + model = "\A3\Weapons_F\Explosives\IED_land_small"; + }; + class NATO_Box_Base; class EAST_Box_Base; class IND_Box_Base; @@ -133,6 +163,7 @@ class CfgVehicles { MACRO_ADDITEM(ACE_M26_Clacker,6) MACRO_ADDITEM(ACE_DefusalKit,12) MACRO_ADDITEM(ACE_Deadmanswitch,2) + MACRO_ADDITEM(ACE_Cellphone,3) }; }; @@ -142,6 +173,7 @@ class CfgVehicles { MACRO_ADDITEM(ACE_M26_Clacker,2) MACRO_ADDITEM(ACE_DefusalKit,2) MACRO_ADDITEM(ACE_Deadmanswitch,1) + MACRO_ADDITEM(ACE_Cellphone,2) }; }; @@ -151,6 +183,7 @@ class CfgVehicles { MACRO_ADDITEM(ACE_M26_Clacker,6) MACRO_ADDITEM(ACE_DefusalKit,12) MACRO_ADDITEM(ACE_Deadmanswitch,6) + MACRO_ADDITEM(ACE_Cellphone,10) }; }; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index e239ed8841..fd142019e8 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -47,6 +47,20 @@ class CfgWeapons { ACE_Range = 100; ACE_Detonator = 1; + class ItemInfo: ACE_ExplosiveItem { + mass = 2; + uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; + }; + }; + class ACE_Cellphone: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_Explosives_cellphone_displayName; + descriptionShort = $STR_ACE_Explosives_cellphone_description; + picture = PATHTOF(Data\UI\Cellphone_UI.paa); + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + ACE_Range = 15000; + ACE_Detonator = 1; + class ItemInfo: ACE_ExplosiveItem { mass = 2; uniformModel = "\A3\weapons_F\ammo\mag_univ.p3d"; diff --git a/addons/explosives/Data/Audio/Cellphone_Ring.wss b/addons/explosives/Data/Audio/Cellphone_Ring.wss new file mode 100644 index 0000000000..bafdf7596a Binary files /dev/null and b/addons/explosives/Data/Audio/Cellphone_Ring.wss differ diff --git a/addons/explosives/Data/Audio/DialTone.wss b/addons/explosives/Data/Audio/DialTone.wss new file mode 100644 index 0000000000..4ac52b1acf Binary files /dev/null and b/addons/explosives/Data/Audio/DialTone.wss differ diff --git a/addons/explosives/Data/UI/Cellphone_Background.paa b/addons/explosives/Data/UI/Cellphone_Background.paa new file mode 100644 index 0000000000..9cafe97af8 Binary files /dev/null and b/addons/explosives/Data/UI/Cellphone_Background.paa differ diff --git a/addons/explosives/Data/UI/Cellphone_UI.paa b/addons/explosives/Data/UI/Cellphone_UI.paa new file mode 100644 index 0000000000..38360ee4da Binary files /dev/null and b/addons/explosives/Data/UI/Cellphone_UI.paa differ diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index c6c76e573c..769b3dc167 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -4,16 +4,49 @@ #define GUI_GRID_H (0.04) #define ST_CENTER 0x02 +#define X_OFFSET 0.25 class RscText; class RscButton; - -#define X_OFFSET 0.25 - class RscXSliderH; class IGUIBack; +class RscPicture; +class RscEdit; -class Rsc_ACE_Timer_Slider:RscXSliderH{ +class Rsc_ACE_CallScreen_Edit:RscEdit { + canModify = 1; + colorBackground[] = {0,0,0,1}; + colorText[] = {0,0,0,1}; + colorDisabled[] = {1,1,1,0.25}; + colorSelection[] = { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", + 1 + }; + text = ""; + style = "0x00 + 0x40 + 0x200"; + shadow = 1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 20) * 1)"; + x = 0.288594 * safezoneW + safezoneX; + w = 0.0825 * safezoneW; + h = 0.044 * safezoneH; +}; +class Rsc_ACE_HiddenButton:RscButton { + colorText[] = {0, 0, 0, 0}; + colorDisabled[] = {0, 0, 0, 0}; + colorBackground[] = {0, 0, 0, 0}; + colorBackgroundDisabled[] = {0, 0, 0, 0}; + colorBackgroundActive[] = {0, 0, 0, 0}; + colorFocused[] = {0, 0, 0, 0}; + colorShadow[] = {0, 0, 0, 0}; + colorBorder[] = {0, 0, 0, 0}; + w = 0.095589; + h = 0.039216; + shadow = 0; +}; + +class Rsc_ACE_Timer_Slider:RscXSliderH { x = 0.4; y = 0.2; w = 0.3; @@ -21,8 +54,7 @@ class Rsc_ACE_Timer_Slider:RscXSliderH{ colorBackground[] = {0,0,0,0.5}; }; -class RscACE_SelectTimeUI -{ +class RscACE_SelectTimeUI { idd = 8854; movingEnable = 0; class controls { @@ -72,3 +104,185 @@ class RscACE_SelectTimeUI }; }; }; + +class Rsc_ACE_NumKeyButton: Rsc_ACE_HiddenButton{}; +class Rsc_ACE_PhoneInterface { + idd = 8855; + movingEnable = 1; + onLoad = QUOTE(GVAR(IED_CurrentSpeedDial) = -1); + class controls { + class RscPicture_1200: RscPicture { + idc = 1200; + text = PATHTOF(Data\UI\Cellphone_Background.paa); + x = 0.231875 * safezoneW + safezoneX; + y = 0.104 * safezoneH + safezoneY; + w = 0.195937 * safezoneW; + h = 0.704 * safezoneH; + }; + class numkey_1: Rsc_ACE_NumKeyButton { + idc = 1600; + x = 0.278281 * safezoneW + safezoneX; + y = 0.533 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "1"; + action = "ctrlSetText [1400,((ctrlText 1400) + '1')];"; + }; + class numkey_2: Rsc_ACE_NumKeyButton { + idc = 1601; + x = 0.314375 * safezoneW + safezoneX; + y = 0.533 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "2"; + action = "ctrlSetText [1400,((ctrlText 1400) + '2')];"; + }; + class numkey_3: Rsc_ACE_NumKeyButton { + idc = 1602; + x = 0.350469 * safezoneW + safezoneX; + y = 0.533 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "3"; + action = "ctrlSetText [1400,((ctrlText 1400) + '3')];"; + }; + class numkey_4: Rsc_ACE_NumKeyButton { + idc = 1603; + x = 0.278281 * safezoneW + safezoneX; + y = 0.577 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "4"; + action = "ctrlSetText [1400,((ctrlText 1400) + '4')];"; + }; + class numkey_5: Rsc_ACE_NumKeyButton { + idc = 1604; + x = 0.314375 * safezoneW + safezoneX; + y = 0.577 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "5"; + action = "ctrlSetText [1400,((ctrlText 1400) + '5')];"; + }; + class numkey_6: Rsc_ACE_NumKeyButton { + idc = 1605; + x = 0.350469 * safezoneW + safezoneX; + y = 0.577 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "6"; + action = "ctrlSetText [1400,((ctrlText 1400) + '6')];"; + }; + class numkey_7: Rsc_ACE_NumKeyButton { + idc = 1606; + x = 0.278281 * safezoneW + safezoneX; + y = 0.621 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "7"; + action = "ctrlSetText [1400,((ctrlText 1400) + '7')];"; + }; + class numkey_8: Rsc_ACE_NumKeyButton { + idc = 1607; + x = 0.314375 * safezoneW + safezoneX; + y = 0.621 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "8"; + action = "ctrlSetText [1400,((ctrlText 1400) + '8')];"; + }; + class numkey_9: Rsc_ACE_NumKeyButton { + idc = 1608; + x = 0.350469 * safezoneW + safezoneX; + y = 0.621 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "9"; + action = "ctrlSetText [1400,((ctrlText 1400) + '9')];"; + }; + class numkey_0: Rsc_ACE_NumKeyButton { + idc = 1609; + x = 0.314375 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "0"; + action = "ctrlSetText [1400,((ctrlText 1400) + '0')];"; + }; + class speedDialAdd: Rsc_ACE_NumKeyButton { + idc = 1610; + x = 0.278281 * safezoneW + safezoneX; + y = 0.676 * safezoneH + safezoneY; + w = 0.0309375 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "$STR_ACE_Explosives_Phone_AddToSpeedDial"; + action = QUOTE([ARR_2(ctrlText 1401,ctrlText 1400)] call FUNC(addToSpeedDial);); + }; + class clear: Rsc_ACE_HiddenButton { + idc = 1610; + x = 0.278281 * safezoneW + safezoneX; + y = 0.445 * safezoneH + safezoneY; + w = 0.020625 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "$STR_ACE_Explosives_Clear"; + action = QUOTE(ctrlSetText [ARR_2(1400,'')];[ctrlText 1401] call FUNC(removeFromSpeedDial);ctrlSetText [ARR_2(1401,'')];); + }; + class dial: Rsc_ACE_HiddenButton { + idc = 1611; + x = 0.309219 * safezoneW + safezoneX; + y = 0.445 * safezoneH + safezoneY; + w = 0.04125 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "$STR_ACE_Explosives_Phone_Dial"; + action = QUOTE([ARR_2(ace_player,ctrlText 1400)] call FUNC(dialPhone);); + }; + class up: Rsc_ACE_HiddenButton { + idc = 1612; + x = 0.360781 * safezoneW + safezoneX; + y = 0.445 * safezoneH + safezoneY; + w = 0.020625 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "$STR_ACE_Explosives_Phone_Up"; + action = QUOTE([true] call FUNC(setSpeedDial)); + }; + class down: Rsc_ACE_HiddenButton { + idc = 1613; + x = 0.345312 * safezoneW + safezoneX; + y = 0.485 * safezoneH + safezoneY; + w = 0.020625 * safezoneW; + h = 0.033 * safezoneH; + tooltip = "$STR_ACE_Explosives_Phone_Down"; + action = QUOTE([false] call FUNC(setSpeedDial)); + }; + class speedDial_Text: RscText { + idc = 1405; + y = 0.302 * safezoneH + safezoneY; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; + x = 0.288594 * safezoneW + safezoneX; + w = 0.0825 * safezoneW; + h = 0.044 * safezoneH; + text = "Name"; + }; + class speedDial_edit: Rsc_ACE_CallScreen_Edit { + idc = 1401; + y = 0.302 * safezoneH + safezoneY; + x = 0.318 * safezoneW + safezoneX; + w = 0.1; + }; + class numberEdit_Text: RscText { + idc = 1406; + y = 0.348 * safezoneH + safezoneY; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 22) * 1)"; + x = 0.288594 * safezoneW + safezoneX; + w = 0.0825 * safezoneW; + h = 0.044 * safezoneH; + text = "#"; + }; + class number_edit: Rsc_ACE_CallScreen_Edit { + canModify = 0; + idc = 1400; + y = 0.348 * safezoneH + safezoneY; + x = 0.3 * safezoneW + safezoneX; + }; + }; +}; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 2ede878a37..e3b40308c3 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -18,6 +18,7 @@ if !(hasInterface) exitWith {}; GVAR(PlacedCount) = 0; GVAR(Setup) = objNull; GVAR(pfeh_running) = false; +GVAR(CurrentSpeedDial) = 0; [{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); player addEventHandler ["Killed", { diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index 801ded6615..3747151d16 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -17,11 +17,15 @@ ADDON = false; +PREP(addCellphoneIED); PREP(addClacker); +PREP(addToSpeedDial); PREP(canDefuse); PREP(canDetonate); PREP(defuseExplosive); PREP(detonateExplosive); +PREP(dialPhone); +PREP(dialingPhone); PREP(handleScrollWheel); @@ -30,6 +34,7 @@ PREP(hasPlacedExplosives); PREP(getDetonators); PREP(getPlacedExplosives); +PREP(getSpeedDialExplosive); PREP(openDetonateUI); PREP(openPlaceUI); @@ -41,10 +46,12 @@ PREP(place_Approve); PREP(place_Cancel); PREP(placeExplosive); +PREP(removeFromSpeedDial); PREP(selectTrigger); PREP(setupExplosive); PREP(setPosition); +PREP(setSpeedDial); PREP(startDefuse); PREP(startTimer); PREP(triggerType); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index e4a079f107..da95d45e7e 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"}; + weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch", "ACE_Cellphone"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common", "ace_interaction"}; author[] = {"Garth 'L-H' de Wet"}; diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf new file mode 100644 index 0000000000..84cb57cf4e --- /dev/null +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -0,0 +1,51 @@ +/* + * Author: Garth 'L-H' de Wet + * Adds an IED to the cellphone list + * + * Arguments: + * 0: Unit + * 1: Explosive + * 2: Magazine classname + * 3: Extra variables + * + * Return Value: + * None + * + * Example: + * Handled by PlaceExplosive. + * + * Public: No + */ +#include "script_component.hpp" +EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra); +// Config is the last item in the list of passed in items. +_config = (_this select 3) select (count (_this select 3) - 1); + +_requiredItems = getArray(_config >> "requires"); +_hasRequired = true; +_detonators = [_unit] call FUNC(getDetonators); +{ + if !(_x in _detonators) exitWith{ + _hasRequired = false; + }; +} count _requiredItems; +private ["_code", "_count", "_codeSet"]; +_codeSet = false; +while {!_codeSet} do { + _code = str(round (random 9999)); + _count = 4 - count (toArray _code); + while {_count > 0} do { + _code = "0" + _code; + _count = _count - 1; + }; + _codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0; +}; +if (isNil QGVAR(CellphoneIEDs)) then { + GVAR(CellphoneIEDs) = []; +}; +_count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; +_count = _count + 1; +publicVariable QGVAR(CellphoneIEDs); +_unit sideChat format ["IED %1 code: %2", _count,_code]; +if !(_hasRequired) exitWith {}; +[format ["IED %1", _count],_code] call FUNC(addToSpeedDial); diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf new file mode 100644 index 0000000000..142996e4c3 --- /dev/null +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -0,0 +1,37 @@ +/* + * Author: Garth 'L-H' de Wet + * Sets the speed dial for the UI. + * + * Arguments: + * 0: Name of speed dial + * 1: Code to add to speed dial + * + * Return Value: + * None + * + * Example: + * ["My Speed Dial","2131"] call ACE_explosives_fnc_addToSpeedDial; + * + * Public: Yes + */ +#include "script_component.hpp" +private ["_speedDial", "_found"]; +_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +_found = false; + +EXPLODE_2_PVT(_this,_name,_code); + +if ((_code) == "") ExitWith { + [_name] call FUNC(removeFromSpeedDial); +}; +{ + if ((_x select 0) == _name) exitWith { + _speedDial set [_foreachindex, _this]; + _found = true; + }; +} foreach _speedDial; +if (!_found) then { + _speedDial pushBack _this; +}; + +ace_player setVariable [QGVAR(SpeedDial), _speedDial]; diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf new file mode 100644 index 0000000000..41b2a4a4f7 --- /dev/null +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -0,0 +1,42 @@ +/* + * Author: Garth 'L-H' de Wet + * Dials the number passed and detonates the explosive. + * + * Arguments: + * 0: Unit to do dialing + * 1: Code to dial + * + * Return Value: + * None + * + * Example: + * [ace_player,"2131"] call ACE_explosives_fnc_dialPhone; + * + * Public: Yes + */ +#include "script_component.hpp" +private ["_arr", "_ran", "_i","_speedDial"]; +EXPLODE_2_PVT(_this,_unit,_code); +if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; +if !(alive _unit) exitWith {}; +_unit setVariable [QGVAR(Dialing), true, true]; + +_ran = (ceil(random 8)) + 1; +_arr = []; +for [{_i=0}, {_i<_ran}, {_i=_i+1}] do { + _arr = _arr + ['.','..','...','']; +}; +if (_unit == ace_player) then { + ctrlSetText [1400,"Calling"]; + [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); +} else { + private ["_explosive"]; + _explosive = [_code] call FUNC(getSpeedDialExplosive); + if ((count _explosive) > 0) then { + [{ + playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; + (_this select 0) setVariable [QGVAR(Dialing), false, true]; + }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); + [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); + }; +}; diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf new file mode 100644 index 0000000000..d3c429c9fc --- /dev/null +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -0,0 +1,44 @@ +/* + * Author: Garth 'L-H' de Wet + * Performs the dial tones and detonation of explosive. + * + * Arguments: + * 0: Unit to do dialing + * 1: Index + * 2: Dialing points + * 3: IED code + * + * Return Value: + * None + * + * Example: + * [FUNC(dialingPhone), 0.25, [_unit,4,_arr,_code]] call CALLSTACK(CBA_fnc_addPerFrameHandler); + * + * Public: No + */ +#include "script_component.hpp" +EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); +if ((_i mod 4) == 0) then { + playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit ModelToWorld [0,0.2,2]), 15,1,2.5]; +}; +ctrlSetText [1400,format["Calling%1",_arr select (_i - 4)]]; + +private "_explosive"; +_explosive = [_code] call FUNC(getSpeedDialExplosive); + +if (_i >= (count _arr + 2)) then { + [_this select 1] call CALLSTACK(cba_fnc_removePerFrameHandler); + if ((count _explosive) > 0) then { + [_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive); + }; + _unit setVariable [QGVAR(Dialing), false, true]; + if (_unit == ace_player) then { + ctrlSetText [1400,"Call Ended!"]; + }; +}; +if (_i == (count _arr)) then { + if ((count _explosive) > 0) then { + playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_explosive select 0),3.16228,1,75]; + }; +}; +(_this select 0) set [1, _i + 1]; diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf new file mode 100644 index 0000000000..d6d5b57b3b --- /dev/null +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -0,0 +1,27 @@ +/* + * Author: Garth 'L-H' de Wet + * Gets the explosive from the speed dial entry. + * + * Arguments: + * 0: Speed dial entry + * + * Return Value: + * Associated explosive (or ObjNull) + * + * Example: + * ["2113"] call ace_explosives_fnc_getSpeedDialExplosive; + * + * Public: Yes + */ +#include "script_component.hpp" +EXPLODE_1_PVT(_this,_code); +private ["_explosive"]; +if (isNil QGVAR(CellphoneIEDs)) exitWith {[]}; +_explosive = []; +{ + if ((_x select 1) == _code) exitWith { + _explosive = _x; + }; + false +} count GVAR(CellphoneIEDs); +_explosive diff --git a/addons/explosives/functions/fnc_openPlaceUI.sqf b/addons/explosives/functions/fnc_openPlaceUI.sqf index 1bb78248d2..5ad79381b1 100644 --- a/addons/explosives/functions/fnc_openPlaceUI.sqf +++ b/addons/explosives/functions/fnc_openPlaceUI.sqf @@ -51,7 +51,7 @@ _actions = [localize "STR_ACE_Explosives_PlaceMenu", localize "STR_ACE_Explosive }, { call EFUNC(interaction,hideMenu); - if !(profileNamespace getVariable [EGVAR(interaction,AutoCloseMenu), false]) then { + if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then { "ACE_Explosives" call EFUNC(interaction,openMenuSelf); }; } diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf index 97528cb8f6..77cfbb92a1 100644 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ b/addons/explosives/functions/fnc_place_Approve.sqf @@ -28,79 +28,78 @@ _player = ACE_player; [_player, "DefaultAction", _player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); [_player, "MenuBack", _player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); call EFUNC(interaction,hideMouseHint); -if ((_setup getVariable [QGVAR(Class), ""]) != "") then { - _dir = (getDir _setup); - if (_dir > 180) then { - _dir = _dir - 180; - } else { - _dir = 180 + _dir; - }; - _setup setVariable [QGVAR(Direction), _dir]; - _player setVariable [QGVAR(PlantingExplosive), true]; - _setup addEventHandler ["EpeContactStart", { - if (!((_this select 0) getVariable [QGVAR(Handled), false])) then { - private ["_player", "_pos", "_attachTo"]; +if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith { + deleteVehicle _setup; +}; +_dir = (getDir _setup); +if (_dir > 180) then { + _dir = _dir - 180; +} else { + _dir = 180 + _dir; +}; +_setup setVariable [QGVAR(Direction), _dir]; +_player setVariable [QGVAR(PlantingExplosive), true]; +_setup addEventHandler ["EpeContactStart", { + if (!((_this select 0) getVariable [QGVAR(Handled), false])) then { + private ["_player", "_pos", "_attachTo"]; + _player = ACE_player; + _player setVariable [QGVAR(PlantingExplosive), false]; + _pos = getPosATL (_this select 0); + (_this select 0) enableSimulationGlobal false; + if (surfaceIsWater _pos) then { + _pos = getPosASL (_this select 0); + (_this select 0) setPosASL _pos; + }else{ + (_this select 0) setPosATL _pos; + }; + (_this select 0) setVariable [QGVAR(Handled), true]; + _attachTo = objNull; + if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then { + _attachTo = (_this select 1); + }; + [(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution + private ["_mag", "_setup", "_dir", "_player"]; + _setup = _this select 0; _player = ACE_player; - _pos = getPosATL (_this select 0); - (_this select 0) enableSimulationGlobal false; - if (surfaceIsWater _pos) then { - _pos = getPosASL (_this select 0); - (_this select 0) setPosASL _pos; - }else{ - (_this select 0) setPosATL _pos; - }; - (_this select 0) setVariable [QGVAR(Handled), true]; - _player setVariable [QGVAR(PlantingExplosive), false]; - _attachTo = objNull; - if (!isNull (_this select 1) && {(_this select 1) isKindOf "AllVehicles"}) then { - _attachTo = (_this select 1); - }; - [(_this select 0),_attachTo, _pos] spawn { // TODO: Change to scheduled delay execution - private ["_mag", "_setup", "_dir", "_player"]; - _setup = _this select 0; - _player = ACE_player; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; + _mag = _setup getVariable [QGVAR(Class), ""]; + _dir = _setup getVariable [QGVAR(Direction), 0]; - sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime"); - _explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive); - deleteVehicle _setup; - if (!isNull(_explosive)) then { - _player RemoveMagazine _mag; - if (!isNull (_this select 1)) then { - _explosive attachTo [(_this select 1)]; - _dir = _dir - (getDir (_this select 1)); - [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); - }; + sleep getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime"); + _explosive = [_player, _this select 2, _dir, _mag, _setup getVariable QGVAR(Trigger), + [_setup getVariable QGVAR(Timer)], isNull (_this select 1)] call FUNC(placeExplosive); + deleteVehicle _setup; + if (!isNull(_explosive)) then { + _player RemoveMagazine _mag; + if (!isNull (_this select 1)) then { + _explosive attachTo [(_this select 1)]; + _dir = _dir - (getDir (_this select 1)); + [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); }; }; }; - }]; - _setup enableSimulationGlobal true; - _player playActionNow "MedicOther"; - [_setup] spawn { // TODO: Change to scheduled delay execution - private ["_setup", "_player"]; - _setup = _this select 0; - _player = ACE_player; - sleep 5; + }; +}]; +_setup enableSimulationGlobal true; +_player playActionNow "MedicOther"; +[_setup] spawn { // TODO: Change to scheduled delay execution + private ["_setup", "_player"]; + _setup = _this select 0; + _player = ACE_player; + sleep 5; + _player setVariable [QGVAR(PlantingExplosive), false]; + if (!isNull _setup) then { + private ["_mag", "_dir", "_delayTime"]; + _mag = _setup getVariable [QGVAR(Class), ""]; + _dir = _setup getVariable [QGVAR(Direction), 0]; + _delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5; + if (_delayTime > 0) then { + sleep _delayTime; + }; if (!isNull _setup) then { - private ["_mag", "_dir", "_delayTime"]; - _mag = _setup getVariable [QGVAR(Class), ""]; - _dir = _setup getVariable [QGVAR(Direction), 0]; - _delayTime = (getNumber(ConfigFile >> "CfgMagazines" >> _mag >> "ACE_DelayTime")) - 5; - if (_delayTime > 0) then { - sleep _delayTime; - }; - if (!isNull _setup) then { - [_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger), - [_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive); - deleteVehicle _setup; - _player RemoveMagazine _mag; - _player setVariable [QGVAR(PlantingExplosive), false]; - }; + [_player, GetPosATL _setup, _dir, _mag, _setup getVariable QGVAR(Trigger), + [_setup getVariable QGVAR(Timer)], true] call FUNC(placeExplosive); + deleteVehicle _setup; + _player RemoveMagazine _mag; }; }; -}else{ - deleteVehicle _setup; }; diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf new file mode 100644 index 0000000000..c0a467e6f1 --- /dev/null +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -0,0 +1,26 @@ +/* + * Author: Garth 'L-H' de Wet + * Removes the specified speed dial from unit's speed dial. + * + * Arguments: + * 0: Speed dial name + * + * Return Value: + * None + * + * Example: + * ["IED 1"] call ACE_explosives_fnc_removeFromSpeedDial; + * + * Public: Yes + */ +#include "script_component.hpp" +private "_speedDial"; +_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +if (count _speedDial == 0) exitWith {}; +{ + if ((_x select 0) == (_this select 0)) exitWith { + _speedDial set [_foreachIndex, "x"]; + _speedDial = _speedDial - ["x"]; + ace_player setVariable [QGVAR(SpeedDial),_speedDial]; + }; +} foreach _speedDial; diff --git a/addons/explosives/functions/fnc_setSpeedDial.sqf b/addons/explosives/functions/fnc_setSpeedDial.sqf new file mode 100644 index 0000000000..adb2e6af03 --- /dev/null +++ b/addons/explosives/functions/fnc_setSpeedDial.sqf @@ -0,0 +1,26 @@ +/* + * Author: Garth 'L-H' de Wet + * Sets the speed dial for the UI. + * + * Arguments: + * 0: Whether to increase or decrease speed dial index + * + * Return Value: + * None + * + * Example: + * [true] call ACE_explosives_fnc_setSpeedDial; // increase + * [false] call ACE_explosives_fnc_setSpeedDial; // decrease + * + * Public: No + */ + #include "script_component.hpp" +private ["_speedDial", "_amount"]; +_speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; +if (count _speedDial == 0) exitWith {}; +_amount = if((_this select 0))then{1}else{-1}; + +GVAR(CurrentSpeedDial) = (GVAR(CurrentSpeedDial) + _amount + count _speedDial) mod (count _speedDial); + +ctrlSetText [1400,(_speedDial select GVAR(CurrentSpeedDial)) select 1]; +ctrlSetText [1401,(_speedDial select GVAR(CurrentSpeedDial)) select 0]; diff --git a/addons/gui/CfgEventHandlers.hpp b/addons/gui/CfgEventHandlers.hpp deleted file mode 100644 index c9142e676b..0000000000 --- a/addons/gui/CfgEventHandlers.hpp +++ /dev/null @@ -1,11 +0,0 @@ -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE( call compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(XEH_preInit.sqf))) ); - }; -}; - -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE( call compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(XEH_postInit.sqf))) ); - }; -}; \ No newline at end of file diff --git a/addons/gui/GUI.hpp b/addons/gui/GUI.hpp deleted file mode 100644 index 71e8dc0090..0000000000 --- a/addons/gui/GUI.hpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "UI\define.hpp" -#include "UI\RscTitles.hpp" diff --git a/addons/gui/README.md b/addons/gui/README.md deleted file mode 100644 index a6fe74f6c2..0000000000 --- a/addons/gui/README.md +++ /dev/null @@ -1,11 +0,0 @@ -ace_gui -======= - -to be scrapped. - - -## Maintainers - -The people responsible for merging changes to this component or answering potential questions. - -- [Glowbal](https://github.com/Glowbal) diff --git a/addons/gui/UI/RscTitles.hpp b/addons/gui/UI/RscTitles.hpp deleted file mode 100644 index 02e68e8d32..0000000000 --- a/addons/gui/UI/RscTitles.hpp +++ /dev/null @@ -1,179 +0,0 @@ - -#define RIGHT_SIDE (safezoneW + safezoneX) -#define LEFT_SIDE safezoneX -#define TOP_SIDE safeZoneY -#define BOTTOM_SIDE (safeZoneH + safezoneY) - -#define ICON_WIDTH (1.75 * (((safezoneW / safezoneH) min 1.2) / 40)) -#define X_POS_ICONS RIGHT_SIDE - (1.1 * ICON_WIDTH) -#define Y_POS_ICONS TOP_SIDE + (2.2 * ICON_WIDTH) -#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH) - -class RscTitles { - class GVAR(iconsDisplay) { - duration = 1e+011; - idd = 1111; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(iconsDisplay)), _this select 0)]); - class controlsBackground { - class icon_1: ACE_gui_backgroundBase { - text = ""; - colorText[] = {0.0,1.0,0.0,0.4}; - idc = 10501; - x = X_POS_ICONS; - y = Y_POS_ICONS + (0 * DIFFERENCE_ICONS); - w = ICON_WIDTH; - h = ICON_WIDTH; - }; - class icon_2: icon_1 { - idc = 10502; - y = Y_POS_ICONS + (1 * DIFFERENCE_ICONS); - }; - class icon_3: icon_1 { - idc = 10503; - y = Y_POS_ICONS + (2 * DIFFERENCE_ICONS); - }; - class icon_4: icon_1 { - idc = 10504; - y = Y_POS_ICONS + (3 * DIFFERENCE_ICONS); - }; - class icon_5: icon_1 { - idc = 10505; - y = Y_POS_ICONS + (4 * DIFFERENCE_ICONS); - }; - class icon_6: icon_1 { - idc = 10506; - y = Y_POS_ICONS + (5 * DIFFERENCE_ICONS); - }; - }; - }; - - class GVAR(RSC_PROGRESSBAR_LOADING) { - idd = -1; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_PROGRESSBAR_LOADING)), _this select 0)]); - fadein = 0; - fadeout = 0; - duration = 10e10; - class Controls { - class background: ACE_gui_backgroundBase { - idc = -1; - colorBackground[] = {0,0,0,1}; - colorText[] = {1, 1, 1, 1}; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - text = "#(argb,8,8,3)color(0,0,0,0.4)"; - }; - - class Progress: ACE_gui_RscProgress { - idc = 6; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorFrame[] = {0,0,0,0}; - colorBar[] = {0.27,0.5,0.31,0.6}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - }; - }; - }; - - - class GVAR(RSC_DISPLAY_MESSAGE) { - duration = 7; - idd = 86411; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_DISPLAY_MESSAGE)), _this select 0)]); - fadein = 0; - class controlsBackground { - class header: ACE_gui_staticBase { - idc = 1; - type = CT_STATIC; - x = "safezoneX + (safezoneW / 10)"; - y = "safezoneY + (30 * (safeZoneH / 40))"; - w = "(safeZoneW / 10)"; - h = "(safeZoneH / 40)"; - style = ST_LEFT; - font = FontCSE; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0.85, 0.85, 0.85, 1.0}; - colorBackground[] = {0, 0, 0, 0.9}; - text = ""; - }; - class text: header { - idc = 2; - y = "safezoneY + (31 * (safeZoneH / 40))"; - w = "(safeZoneW / 10) * 1.3"; - colorText[] = {0.0, 0.0, 0.0, 1.0}; - colorBackground[] = {1, 1, 1, 0.9}; - text = ""; - }; - }; - }; - - class GVAR(RSC_DISPLAY_INFORMATION) { - duration = 15; - idd = 86412; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_DISPLAY_INFORMATION)), _this select 0)]); - fadein = 0; - class controlsBackground { - class header: ACE_gui_staticBase { - idc = 1; - type = CT_STATIC; - x = "safezoneX + (safezoneW / 10)"; - y = "safezoneY + (6 * (safeZoneH / 40))"; - w = "(safeZoneW / 10)"; - h = "(safeZoneH / 40)"; - style = ST_LEFT; - font = FontCSE; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0.85, 0.85, 0.85, 1.0}; - colorBackground[] = {0, 0, 0, 0.9}; - text = ""; - }; - class text: header { - idc = 2; - y = "safezoneY + (7.1 * (safeZoneH / 40))"; - w = "(safeZoneW / 10) * 1.3"; - colorText[] = {0.0, 0.0, 0.0, 1.0}; - colorBackground[] = {1, 1, 1, 0.9}; - text = ""; - }; - class text2: text { - idc = 3; - y = "safezoneY + (8.2 * (safeZoneH / 40))"; - }; - class text3: text { - idc = 4; - y = "safezoneY + (9.3 * (safeZoneH / 40))"; - }; - class text4: text { - idc = 5; - y = "safezoneY + (10.4 * (safeZoneH / 40))"; - }; - class text5: text { - idc = 6; - y = "safezoneY + (11.5 * (safeZoneH / 40))"; - }; - - - class icon: ACE_gui_backgroundBase { - type = CT_STATIC; - idc = 10; - style = ST_PICTURE; - colorBackground[] = {0,0,0,1}; - colorText[] = {1, 1, 1, 1}; - font = FontCSE; - text = ""; - sizeEx = 0.032; - x = "safezoneX + (safezoneW / 10)"; - y = "safezoneY + (4 * (safeZoneH / 40))"; - w = "(safeZoneH / 40)*2"; - h = "(safeZoneH / 40)*2"; - }; - }; - }; - -}; \ No newline at end of file diff --git a/addons/gui/XEH_postInit.sqf b/addons/gui/XEH_postInit.sqf deleted file mode 100644 index 4172145202..0000000000 --- a/addons/gui/XEH_postInit.sqf +++ /dev/null @@ -1,11 +0,0 @@ -/** - * XEH_postInit.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" diff --git a/addons/gui/XEH_preInit.sqf b/addons/gui/XEH_preInit.sqf deleted file mode 100644 index b5cc064d18..0000000000 --- a/addons/gui/XEH_preInit.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * XEH_preInit.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" - -ADDON = false; - -PREP(loadingBar); -PREP(displayInformation); -PREP(displayMessage); -PREP(blurScreen); -PREP(displayIcon); -PREP(sendHintTo); -PREP(sendMessageTo); -PREP(sendDisplayInformationTo); -PREP(sendDisplayMessageTo); - -ADDON = true; diff --git a/addons/gui/config.cpp b/addons/gui/config.cpp deleted file mode 100644 index 2f7666be13..0000000000 --- a/addons/gui/config.cpp +++ /dev/null @@ -1,27 +0,0 @@ - -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_main"}; - version = VERSION; - author[] = {$STR_ACE_Common_ACETeam}; - authorUrl = "http://csemod.com"; // TODO website link? - }; -}; -class CfgAddons { - class PreloadAddons { - class ADDON { - list[] = {QUOTE(ADDON)}; - }; - }; -}; - -#include "CfgEventHandlers.hpp" - -// TODO Port over the UI defines -#include "GUI.hpp" -#include "empty.hpp" diff --git a/addons/gui/data/buttonDisabled.paa b/addons/gui/data/buttonDisabled.paa deleted file mode 100644 index 2c2a10856b..0000000000 Binary files a/addons/gui/data/buttonDisabled.paa and /dev/null differ diff --git a/addons/gui/data/buttonDisabled_gradient.paa b/addons/gui/data/buttonDisabled_gradient.paa deleted file mode 100644 index 43b1b8d100..0000000000 Binary files a/addons/gui/data/buttonDisabled_gradient.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal.paa b/addons/gui/data/buttonNormal.paa deleted file mode 100644 index 84936d8356..0000000000 Binary files a/addons/gui/data/buttonNormal.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal_gradient.paa b/addons/gui/data/buttonNormal_gradient.paa deleted file mode 100644 index 2210f98741..0000000000 Binary files a/addons/gui/data/buttonNormal_gradient.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal_gradient2.paa b/addons/gui/data/buttonNormal_gradient2.paa deleted file mode 100644 index cabe6c7fed..0000000000 Binary files a/addons/gui/data/buttonNormal_gradient2.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal_gradient3.paa b/addons/gui/data/buttonNormal_gradient3.paa deleted file mode 100644 index 7da9fbcf8a..0000000000 Binary files a/addons/gui/data/buttonNormal_gradient3.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal_gradient_top.paa b/addons/gui/data/buttonNormal_gradient_top.paa deleted file mode 100644 index 904e1a62f7..0000000000 Binary files a/addons/gui/data/buttonNormal_gradient_top.paa and /dev/null differ diff --git a/addons/gui/data/buttonNormal_gradient_top_w.paa b/addons/gui/data/buttonNormal_gradient_top_w.paa deleted file mode 100644 index 23dd190afc..0000000000 Binary files a/addons/gui/data/buttonNormal_gradient_top_w.paa and /dev/null differ diff --git a/addons/gui/empty.hpp b/addons/gui/empty.hpp deleted file mode 100644 index 698784e2c6..0000000000 --- a/addons/gui/empty.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "\z\ace\addons\gui\UI\define.hpp" - -class ACE_common_empty_screen { - idd = 679123; - onLoad = "uiNamespace setVariable [""ACE_common_empty_screen"", _this select 0]"; - onUnload = "if (missionNamespace getvariable [""ACE_common_DISABLE_USER_INPUT_SCREEN"", false)]) then { createDialog ""ACE_common_empty_screen""; }"; - class controlsBackground { - class background : ACE_gui_backgroundBase { - idc = 1; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - text = ""; - moving = 0; - }; - }; - - class controls { - }; -}; diff --git a/addons/gui/functions/fnc_displayIcon.sqf b/addons/gui/functions/fnc_displayIcon.sqf deleted file mode 100644 index 98895c6346..0000000000 --- a/addons/gui/functions/fnc_displayIcon.sqf +++ /dev/null @@ -1,79 +0,0 @@ -/** - * fn_gui_displayIcon.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: true - * - * @Example ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1]] call ace_gui_fnc_displayIcon; - */ - -#include "script_component.hpp" - -#define MAX_N_ICONS 6 - -private ["_iconId", "_show", "_icon", "_spot", "_idc", "_display","_next_IDC", "_nextText"]; -_iconId = _this select 0; -_show = _this select 1; -_icon = _this select 2; -_color = _this select 3; - -disableSerialization; -_list = missionNamespace getvariable [QGVAR(displayIconList),[]]; -_display = uiNamespace getvariable QGVAR(iconsDisplay); - -if (isNil "_display") then { - // Display the icons - 11401 cutRsc [QGVAR(iconsDisplay),"PLAIN"]; - _display = uiNamespace getvariable QGVAR(iconsDisplay); -}; - -if (_show) then { - if ({(_x select 0 == _iconId)} count _list == 0) then { - _list pushback [_iconId, _icon, _color]; - } else { - { - if (_x select 0 == _iconId) exitwith { - _list set [_foreachIndex, [_iconId, _icon, _color]]; - }; - }foreach _list; - }; - - missionNamespace setvariable [QGVAR(displayIconList), _list]; - - { - if (_x select 0 == _iconId) exitwith { - _idc = 10501 + _foreachIndex; - _ctrl = _display displayCtrl _idc; - _ctrl ctrlsetText _icon; - _ctrl ctrlSetTextColor _color; - }; - }foreach _list; -} else { - if ({(_x select 0 == _iconId)} count _list == 1) then { - _newList = []; - { - if (_x select 0 != _iconId) then { - _newList pushback _x; - }; - }foreach _list; - - missionNamespace setvariable [QGVAR(displayIconList), _newList]; - - for "_i" from 0 to (MAX_N_ICONS - 1) /* step +1 */ do { - _idc = 10501 + _i; - _ctrl = _display displayCtrl _idc; - _ctrl ctrlsetText ""; - _ctrl ctrlSetTextColor [1,1,1,1]; - }; - - { - _idc = 10501 + _foreachIndex; - _ctrl = _display displayCtrl _idc; - _ctrl ctrlsetText (_x select 1); - _ctrl ctrlSetTextColor (_x select 2); - }foreach _newList; - }; -}; diff --git a/addons/gui/functions/fnc_displayInformation.sqf b/addons/gui/functions/fnc_displayInformation.sqf deleted file mode 100644 index c4eb96984b..0000000000 --- a/addons/gui/functions/fnc_displayInformation.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/** - * fn_gui_displayInformation.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" - -#define DISPLAY_LAYER 32547 - -private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos","_icon","_iconCtrl"]; -_title = [_this, 0, "",[""]] call BIS_fnc_Param; -_content = [_this, 1, [""],[[""]]] call BIS_fnc_Param; -_type = [_this, 2, 0, [0]] call BIS_fnc_Param; -_icon = [_this, 3, "",[""]] call BIS_fnc_Param; - -if (_title != "") then { - DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_INFORMATION),"PLAIN"]; - - disableSerialization; - _display = uiNamespace getvariable QGVAR(RSC_DISPLAY_INFORMATION); - if (!isnil "_display") then { - _headerCtrl = _display displayCtrl 1; - _headerCtrl ctrlSetText _title; - _iconCtrl = _display displayCtrl 10; - _iconCtrl ctrlSetText _icon; - - _idc = 2; - { - _text = _x; - if (_text != "") then { - _contentCtrl = _display displayCtrl _idc; - _contentCtrl ctrlSetText _text; - - _contentAmountOfChars = count (toArray _text); - _pos = ctrlPosition _contentCtrl; - _pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)]; - _contentCtrl ctrlSetPosition _pos; - _contentCtrl ctrlCommit 0; - - - if (_type >0) then { - if (_type == 1) then { - _contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8]; - _contentCtrl ctrlSetTextColor [1,1,1,0.9]; - }; - }; - _idc = _idc + 1; - }; - }foreach _content; - - while {(_idc < 7)} do { - _contentCtrl = _display displayCtrl _idc; - _contentCtrl ctrlSetPosition [0,0,0,0]; - _contentCtrl ctrlCommit 0; - - _idc = _idc + 1; - }; - }; -} else { - - DISPLAY_LAYER cutText ["","PLAIN"]; -}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_displayMessage.sqf b/addons/gui/functions/fnc_displayMessage.sqf deleted file mode 100644 index 3dceab2638..0000000000 --- a/addons/gui/functions/fnc_displayMessage.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/** - * fn_gui_displayMessage.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include "script_component.hpp" - -#define DISPLAY_LAYER 546 - -private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos"]; -_title = [_this, 0, "",[""]] call BIS_fnc_Param; -_content = [_this, 1, "",[""]] call BIS_fnc_Param; -_type = [_this, 2, 0, [0]] call BIS_fnc_Param; - -if (_title != "" && _content != "") then { - DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_MESSAGE),"PLAIN"]; - - disableSerialization; - _display = uiNamespace getvariable QGVAR(RSC_DISPLAY_MESSAGE); - if (!isnil "_display") then { - _headerCtrl = _display displayCtrl 1; - _contentCtrl = _display displayCtrl 2; - - _headerCtrl ctrlSetText _title; - _contentCtrl ctrlSetText _content; - - _contentAmountOfChars = count (toArray _content); - _pos = ctrlPosition _contentCtrl; - _pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)]; - _contentCtrl ctrlSetPosition _pos; - _contentCtrl ctrlCommit 0; - - if (_type >0) then { - if (_type == 1) then { - _contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8]; - _contentCtrl ctrlSetTextColor [1,1,1,0.9]; - }; - }; - }; -}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_loadingbar.sqf b/addons/gui/functions/fnc_loadingbar.sqf deleted file mode 100644 index 4aba751235..0000000000 --- a/addons/gui/functions/fnc_loadingbar.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/** - * fn_gui_loadingbar.sqf - * @Descr: Displays a loading bar and halts script until loading bar has finished - * @Author: Glowbal - * - * @Arguments: [timeToWait NUMBER, condition CODE (Optional), onSuccess CODE (Optional), onFailure CODE (Optional), arguments ARRAY (Optional)] - * @Return: BOOl Returns true if loading bar has fully finished. Otherwise false - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_timeToWait","_cond","_onfailure","_onSuccess","_args"]; -_timeToWait = _this select 0; -_cond = [_this, 1, {true}, [{true}]] call BIS_fnc_Param; -_onSuccess = [_this, 2, {}, [{}]] call BIS_fnc_Param; -_onfailure = [_this, 3, {}, [{}]] call BIS_fnc_Param; -_args = [_this, 4, [], [[]]] call BIS_fnc_Param; - - -if (_timeToWait > 0) exitwith { - GVAR(LOADING_BAR_STATUS) = 0; - disableSerialization; - 1534 cutRsc [QGVAR(RSC_PROGRESSBAR_LOADING),"plain"]; - [{ - private ["_args","_timeToWait","_start","_cond","_onSuccess","_onfailure","_params"]; - _args = _this select 0; - - _start = _args select 0; - _timeToWait = _args select 1; - _cond = _args select 2; - _onSuccess = _args select 3; - _onfailure = _args select 4; - _params = _args select 5; - - if !(_params call _cond) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - 1534 cutText ["","plain"]; - _params call _onfailure; - }; - - if (GVAR(LOADING_BAR_STATUS) >= 1) exitwith { - [(_this select 1)] call cba_fnc_removePerFrameHandler; - 1534 cutText ["","plain"]; - _params call _onSuccess; - }; - private "_dialog"; - disableSerialization; - _dialog = uiNamespace getvariable QGVAR(RSC_PROGRESSBAR_LOADING); - - GVAR(LOADING_BAR_STATUS) = (diag_tickTime - _start) / _timeToWait; - (_dialog displayCtrl 6) progressSetPosition GVAR(LOADING_BAR_STATUS); - - }, 0, [diag_tickTime, _timeToWait, _cond, _onSuccess, _onfailure, _args]] call CBA_fnc_addPerFrameHandler; - true; -}; - -if (_args call _cond) exitwith { - _args call _onSuccess; - true; -}; - -_args call _onfailure; -false; \ No newline at end of file diff --git a/addons/gui/functions/fnc_sendHintTo.sqf b/addons/gui/functions/fnc_sendHintTo.sqf deleted file mode 100644 index 0454cc5691..0000000000 --- a/addons/gui/functions/fnc_sendHintTo.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * fn_sendHintTo.sqf - * @Descr: Sends a hint to player unit across network - * @Author: Glowbal - * - * @Arguments: [reciever OBJECT, message STRING] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_reciever","_message"]; -_reciever = _this select 0; -_message = _this select 1; - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendHintTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { - if (isLocalized _message) then { - _message = localize _message; - }; - hintsilent format ["%1",_message]; - }; -}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_sendMessageTo.sqf b/addons/gui/functions/fnc_sendMessageTo.sqf deleted file mode 100644 index a4e0e4ccd5..0000000000 --- a/addons/gui/functions/fnc_sendMessageTo.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * fn_sendMessageTo.sqf - * @Descr: Sends a chat message to player unit across the network - * @Author: Glowbal - * - * @Arguments: [reciever OBJECT, message STRING] - * @Return: void - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_reciever","_message"]; -_reciever = _this select 0; -_message = _this select 1; - - -if (isPlayer _reciever) then { - if (!local _reciever) then { - [_this, QUOTE(FUNC(sendMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); - } else { - if (isnil QGVAR(LOGIC_OBJECT)) exitwith { - // need to create an object instead - }; - - if (isLocalized _message) then { - _message = localize _message; - }; - GVAR(LOGIC_OBJECT) globalChat format ["%1",_message]; - }; -}; diff --git a/addons/gui/functions/script_component.hpp b/addons/gui/functions/script_component.hpp deleted file mode 100644 index e9276928ad..0000000000 --- a/addons/gui/functions/script_component.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#define COMPONENT GUI -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_GUI - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_GUI - #define DEBUG_SETTINGS DEBUG_SETTINGS_GUI -#endif - -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/gui/script_component.hpp b/addons/gui/script_component.hpp deleted file mode 100644 index e9276928ad..0000000000 --- a/addons/gui/script_component.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#define COMPONENT GUI -#include "\z\ace\addons\main\script_mod.hpp" - -#ifdef DEBUG_ENABLED_GUI - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_GUI - #define DEBUG_SETTINGS DEBUG_SETTINGS_GUI -#endif - -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/gui/stringtable.xml b/addons/gui/stringtable.xml deleted file mode 100644 index 6a7807c925..0000000000 --- a/addons/gui/stringtable.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index ae9c93b32e..1301f022d3 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -13,7 +13,7 @@ class Extended_PostInit_EventHandlers { class Extended_InitPost_EventHandlers { class All { class GVAR(compileMenu) { - init = QUOTE(_this call FUNC(compileMenu)); + init = QUOTE(_this call FUNC(compileMenu);_this call FUNC(compileMenuSelfAction)); }; }; }; \ No newline at end of file diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index a02bf4d558..a2ce5ef8a6 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -15,13 +15,27 @@ _fnc = { ["ACE3", "Interact Key", {_this call FUNC(keyDown)}, -[15, [false, false, false]], +[219, [false, false, false]], false, "keydown"] call cba_fnc_registerKeybind; ["ACE3", "Interact Key", {_this call FUNC(keyUp)}, -[15, [false, false, false]], +[219, [false, false, false]], +false, +"keyUp"] call cba_fnc_registerKeybind; + +["ACE3", +"Self Actions Key", +{_this call FUNC(keyDownSelfAction)}, +[219, [false, true, false]], +false, +"keydown"] call cba_fnc_registerKeybind; + +["ACE3", +"Self Actions Key", +{_this call FUNC(keyUpSelfAction)}, +[219, [false, true, false]], false, "keyUp"] call cba_fnc_registerKeybind; \ No newline at end of file diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 42795d6c75..d3766cf765 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -2,22 +2,25 @@ ADDON = false; -PREP(setToRender); +PREP(addAction); +PREP(compileMenu); +PREP(compileMenuSelfAction); +PREP(keyDown); +PREP(keyDownSelfAction); +PREP(keyUp); +PREP(keyUpSelfAction); +PREP(probe); +PREP(removeAction); PREP(render); PREP(renderIcon); PREP(renderMenu); -PREP(probe); -PREP(rotateVectLineGetMap); PREP(rotateVectLine); -PREP(keyDown); -PREP(keyUp); -PREP(compileMenu); -PREP(addAction); -PREP(removeAction); +PREP(rotateVectLineGetMap); GVAR(toRender) = []; GVAR(keyDown) = false; +GVAR(keyDownSelfAction) = false; GVAR(keyDownTime) = 0; GVAR(lastTime) = diag_tickTime; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index a7b7bae6df..784c6529d6 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {""}; + author[] = {"NouberNou", "CAA-Picard"}; authorUrl = ""; VERSION_CONFIG; }; diff --git a/addons/interact_menu/functions/fnc_addAction.sqf b/addons/interact_menu/functions/fnc_addAction.sqf index 4b9243cfac..3d445a4b13 100644 --- a/addons/interact_menu/functions/fnc_addAction.sqf +++ b/addons/interact_menu/functions/fnc_addAction.sqf @@ -1,31 +1,27 @@ /* - * Author: commy2 - * - * Add an ACE action to an object. Note: This function is NOT global. + * Author: commy2 and NouberNou + * Add an ACE action to an object or inside a parent action. Note: This function is NOT global. * * Argument: - * 0: Object the action should be assigned to (Object) - * 1: Name of the action shown in the menu (String) - * 2: Icon (String) - * 3: Position (Position or Selection Name) - * 4: Statement (Code) - * 5: Condition (Code) - * 6: Distance (Number) + * 0: Object the action should be assigned to or parent action or + * 1: Name of the action shown in the menu + * 2: Icon + * 3: Position (Position or Selection Name) or + * 4: Statement + * 5: Condition + * 6: Distance * * Return value: - * The entry array, which can be used to remove the entry, or add children entries. + * The entry array, which can be used to remove the entry, or add children entries . + * + * Public: No */ #include "script_component.hpp" -private ["_object", "_displayName", "_icon", "_position", "_statement", "_condition", "_distance", "_actions", "_entry"]; -_object = _this select 0; -_displayName = _this select 1; -_icon = _this select 2; -_position = _this select 3; -_statement = _this select 4; -_condition = _this select 5; -_distance = _this select 6; +EXPLODE_7_PVT(_this,_object,_displayName,_icon,_position,_statement,_condition,_distance); + +private ["_actions","_entry"]; _actions = []; if(IS_OBJECT(_object)) then { _actions = _object getVariable [QUOTE(GVAR(actionData)), []]; @@ -50,4 +46,4 @@ _entry = [ ]; GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; -_entry; \ No newline at end of file +_entry; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 1b5e803ad6..0bcecf0732 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -1,23 +1,18 @@ -//fnc_compileMenu.sqf -#include "script_component.hpp"; -// diag_log text format["COMPILE ACTIONS: %1", _this]; - -_object = _this select 0; -_objectType = typeOf _object; - - /* -displayName = "$STR_ACE_Interaction_TeamManagement"; -distance = 4; -condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)}); -statement = ""; -showDisabled = 0; -priority = 3.2; -icon = PATHTOF(UI\team\team_management_ca.paa); -subMenu[] = {"ACE_TeamManagement", 0}; -hotkey = "M"; -enableInside = 1; -*/ + * Author: NouberNou + * Compile the action menu from config for a given object. + * + * Argument: + * 0: Object + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp"; + +EXPLODE_1_PVT(_this,_object); /* [ @@ -33,11 +28,13 @@ enableInside = 1; ] */ +private ["_objectType","_recurseFnc","_actions"]; +_objectType = typeOf _object; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions"; _recurseFnc = { - private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_condition", "_showDisabled", + private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", "_enableInside", "_children", "_entry", "_actionsCfg"]; _actions = []; _actionsCfg = _this select 0; @@ -48,7 +45,10 @@ _recurseFnc = { _distance = getNumber (_entryCfg >> "distance"); _icon = getText (_entryCfg >> "icon"); _statement = compile (getText (_entryCfg >> "statement")); - + _selection = getText (_entryCfg >> "selection"); + if (_selection == "") then { + _selection = [0,0,0]; + }; _condition = getText (_entryCfg >> "condition"); if (_condition == "") then {_condition = "true"}; @@ -59,25 +59,18 @@ _recurseFnc = { _enableInside = getNumber (_entryCfg >> "enableInside"); _condition = compile _condition; - // diag_log text format["_condition: %1", _condition]; - _children = []; - if(isArray (_entryCfg >> "subMenu")) then { - _subMenuDef = getArray (_entryCfg >> "subMenu"); - _childMenuName = _subMenuDef select 0; - _childMenuCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions" >> _childMenuName; - _children = [_childMenuCfg] call _recurseFnc; - }; + _children = [_entryCfg] call _recurseFnc; _entry = [ _displayName, _icon, - [0,0,0], + _selection, _statement, _condition, _distance, _children, GVAR(uidCounter) ]; - GVAR(uidCounter) = GVAR(uidCounter) + 1; + GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; }; }; @@ -86,17 +79,4 @@ _recurseFnc = { _actions = [_actionsCfg] call _recurseFnc; -_actions = [[ - "TEST!", - "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", - "Spine3", - { true }, - { true }, - 5, - _actions, - GVAR(uidCounter) -] -]; -GVAR(uidCounter) = GVAR(uidCounter) + 1; - -_object setVariable [QUOTE(GVAR(actionData)), _actions]; \ No newline at end of file +_object setVariable [QUOTE(GVAR(actionData)), _actions]; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf new file mode 100644 index 0000000000..0135d64eb8 --- /dev/null +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -0,0 +1,92 @@ +/* + * Author: NouberNou and CAA-Picard + * Compile the self action menu from config for a given object. + * + * Argument: + * 0: Object + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp"; + +EXPLODE_1_PVT(_this,_object); + +/* +[ + [ + "Launch", + "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + [0,0,0], + { (_this select 0) setVelocity [0,0,10]; }, + { true }, + 1, + [] + ] +] +*/ + +private ["_objectType","_recurseFnc","_actions"]; +_objectType = typeOf _object; +_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; + + +_recurseFnc = { + private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_condition", "_showDisabled", + "_enableInside", "_children", "_entry", "_actionsCfg"]; + _actions = []; + _actionsCfg = _this select 0; + for "_i" from 0 to (count _actionsCfg)-1 do { + _entryCfg = _actionsCfg select _i; + if(isClass _entryCfg) then { + _displayName = getText (_entryCfg >> "displayName"); + _icon = getText (_entryCfg >> "icon"); + _statement = compile (getText (_entryCfg >> "statement")); + + _condition = getText (_entryCfg >> "condition"); + if (_condition == "") then {_condition = "true"}; + + // Add canInteract (including exceptions) and canInteractWith to condition + _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + + _showDisabled = getNumber (_entryCfg >> "showDisabled"); + _enableInside = getNumber (_entryCfg >> "enableInside"); + + _condition = compile _condition; + _children = [_entryCfg] call _recurseFnc; + _entry = [ + _displayName, + _icon, + [0,0,0], + _statement, + _condition, + 10, //distace + _children, + GVAR(uidCounter) + ]; + GVAR(uidCounter) = GVAR(uidCounter) + 1; + _actions pushBack _entry; + }; + }; + _actions +}; + +_actions = [_actionsCfg] call _recurseFnc; + +// Create a master action to base on self action +_actions = [[ + "Self Actions", + "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa", + "Spine3", + { true }, + { true }, + 10, + _actions, + GVAR(uidCounter) +] +]; +GVAR(uidCounter) = GVAR(uidCounter) + 1; + +_object setVariable [QUOTE(GVAR(selfActionData)), _actions]; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index e18ec69ae8..5d37019858 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -1,8 +1,19 @@ -//fnc_keyDown.sqf +/* + * Author: NouberNou + * Handle interaction key down + * + * Argument: + * None + * + * Return value: + * true + * + * Public: No + */ #include "script_component.hpp" if(!GVAR(keyDown)) then { - GVAR(keyDown) = true; - GVAR(keyDownTime) = diag_tickTime; + GVAR(keyDown) = true; + GVAR(keyDownTime) = diag_tickTime; }; true diff --git a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf new file mode 100644 index 0000000000..be46dd132c --- /dev/null +++ b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf @@ -0,0 +1,22 @@ +/* + * Author: NouberNou + * Handle self action key down + * + * Argument: + * None + * + * Return value: + * true + * + * Public: No + */ +#include "script_component.hpp" + +if(!GVAR(keyDownSelfAction)) then { + GVAR(keyDownSelfAction) = true; + GVAR(keyDown) = false; + GVAR(keyDownTime) = diag_tickTime; + + GVAR(selfMenuOffset) = [sin getDir ACE_player, cos getDir ACE_player, 0] vectorMultiply 2; +}; +true diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 8f91b1322d..6a39f40f95 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -1,12 +1,23 @@ -//fnc_keyUp.sqf +/* + * Author: NouberNou + * Handle interaction key up + * + * Argument: + * None + * + * Return value: + * true + * + * Public: No + */ #include "script_component.hpp" GVAR(keyDown) = false; if(GVAR(actionSelected)) then { - this = GVAR(selectedTarget); + this = GVAR(selectedTarget); _player = ACE_Player; _target = GVAR(selectedTarget); - [GVAR(selectedTarget), player] call GVAR(selectedAction); + [GVAR(selectedTarget), player] call GVAR(selectedAction); }; GVAR(expanded) = false; GVAR(lastPath) = []; diff --git a/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf new file mode 100644 index 0000000000..82130c9993 --- /dev/null +++ b/addons/interact_menu/functions/fnc_keyUpSelfAction.sqf @@ -0,0 +1,26 @@ +/* + * Author: NouberNou + * Handle self action key up + * + * Argument: + * None + * + * Return value: + * true + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(keyDownSelfAction) = false; +if(GVAR(actionSelected)) then { + this = GVAR(selectedTarget); + _player = ACE_Player; + _target = GVAR(selectedTarget); + [GVAR(selectedTarget), player] call GVAR(selectedAction); +}; +GVAR(expanded) = false; +GVAR(lastPath) = []; +GVAR(menuDepthPath) = []; +GVAR(vecLineMap) = []; +true diff --git a/addons/interact_menu/functions/fnc_probe.sqf b/addons/interact_menu/functions/fnc_probe.sqf index 1f178180be..dc1b7e6c87 100644 --- a/addons/interact_menu/functions/fnc_probe.sqf +++ b/addons/interact_menu/functions/fnc_probe.sqf @@ -1,15 +1,27 @@ -//fnc_probe.sqf +/* + * Author: NouberNou + * Scan de vicinity of the player and collect every interaction available around it on + * the GVAR(toRender) array. + * + * Argument: + * None + * + * Return value: + * None + * + * Public: No + */ #include "script_component.hpp" private ["_nearestObjects", "_actionObject", "_x", "_actionData", "_renderData", "_actionItem", "_active", "_renderItem", "_object", "_forEachIndex"]; if(!GVAR(keyDown)) then { - _nearestObjects = nearestObjects [(getPos player), ["All"], 100]; + _nearestObjects = nearestObjects [(getPos ACE_player), ["All"], 100]; GVAR(toRender) = []; { _actionObject = _x; _actionData = _actionObject getVariable [QUOTE(GVAR(actionData)), []]; - + if((count _actionData) > 0) then { _renderData = []; { @@ -18,6 +30,7 @@ if(!GVAR(keyDown)) then { _target = _actionObject; _player = ACE_player; _active = [_target, ACE_player] call (_actionItem select 4); + systemChat format ["%1 %2 is active %3", _actionObject, _actionItem select 0, _active]; // player sideChat format["_active: %1 %2", _actionItem select 0, _active]; if(_active) then { _renderItem = +_actionItem; @@ -35,7 +48,7 @@ if(!GVAR(keyDown)) then { GVAR(filter) = []; { _object = _x select 0; - if(_object distance player > 100) then { + if(_object distance ACE_player > 100) then { GVAR(filter) set[(count GVAR(filter)), _forEachIndex]; }; } forEach GVAR(toRender); diff --git a/addons/interact_menu/functions/fnc_removeAction.sqf b/addons/interact_menu/functions/fnc_removeAction.sqf index 3b32f4d012..3ab4379768 100644 --- a/addons/interact_menu/functions/fnc_removeAction.sqf +++ b/addons/interact_menu/functions/fnc_removeAction.sqf @@ -1,24 +1,21 @@ /* - * Author: commy2 - * - * Add an ACE action to an object. Note: This function is global. + * Author: commy2 and NouberNou + * Remove an action from an object * * Argument: - * 0: Object the action should be assigned to (Object) - * 1: Entry to remove (Array or Number) + * 0: Object the action should be assigned to + * 1: Entry to remove or * * Return value: - * ID of the action (used to remove it later). + * None + * + * Public: No */ - #include "script_component.hpp" -private ["_object", "_entry", "_found", "_actions", "_searchFnc"]; - -_object = _this select 0; -_entry = _this select 1; - +EXPLODE_2_PVT(_this,_object,_entry); +private ["_found", "_actions", "_searchFnc"]; if(!IS_OBJECT(_object)) exitWith {false}; @@ -50,4 +47,4 @@ _searchFnc = { _actions = [_actions, _entry] call _searchFnc; _object setVariable [QUOTE(GVAR(actionData)), _actions]; -_found; \ No newline at end of file +_found; diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 29033e3407..79d300019a 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -1,4 +1,15 @@ -//fnc_render.sqf +/* + * Author: NouberNou and CAA-Picard + * Render all available nearby interactions + * + * Argument: + * None + * + * Return value: + * None + * + * Public: No + */ #include "script_component.hpp" private ["_cursorPos1", "_cursorPos2", "_cursorVec", "_p1", "_p2", "_p", "_v", "_cp", "_forEachIndex", "_renderTargets", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_pos", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i"]; @@ -6,99 +17,108 @@ _foundTarget = false; _cursorPos1 = positionCameraToWorld [0, 0, 0]; _cursorPos2 = positionCameraToWorld [0, 0, 2]; GVAR(currentOptions) = []; -if((count GVAR(toRender)) > 0 && GVAR(keyDown)) then { - if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then { - GVAR(lastPos) = getPosASL player; - _cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY; - _p1 = [0,0,0]; - _p2 = +_cursorVec; - _p = (_cursorVec call CBA_fnc_vect2polar); - _v = [(_p select 0), (_p select 1), (_p select 2)+90] call CBA_fnc_polar2vect; - _cp = [_cursorVec, _v] call BIS_fnc_crossProduct; - - GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap); - }; - { - if(!(_forEachIndex in GVAR(filter))) then { - GVAR(renderDepth) = 0; - _renderTargets = _x; - { - [_renderTargets select 0, _x, 0] call FUNC(renderMenu); - } forEach (_renderTargets select 1); - }; - } forEach GVAR(toRender); - // player sideChat format["c: %1", count GVAR(toRender)]; +if((count GVAR(toRender)) > 0 && (GVAR(keyDown) || GVAR(keyDownSelfAction))) then { + if((count GVAR(vecLineMap)) == 0 || ((count GVAR(menuDepthPath)) > 0 && (getPosASL player) distance GVAR(lastPos) > 0.01)) then { + GVAR(lastPos) = getPosASL player; + _cursorVec = [_cursorPos2, _cursorPos1] call BIS_fnc_vectorFromXtoY; + _p1 = [0,0,0]; + _p2 = +_cursorVec; + _p = (_cursorVec call CBA_fnc_vect2polar); + _v = [(_p select 0), (_p select 1), (_p select 2)+90] call CBA_fnc_polar2vect; + _cp = [_cursorVec, _v] call BIS_fnc_crossProduct; + + GVAR(vecLineMap) = [_cp, _p1, _p2] call FUNC(rotateVectLineGetMap); + }; + if (GVAR(keyDown)) then { + // Render all nearby interaction menus + { + if(!(_forEachIndex in GVAR(filter))) then { + GVAR(renderDepth) = 0; + _renderTargets = _x; + { + [_renderTargets select 0, _x, 0, [180, 360]] call FUNC(renderMenu); + } forEach (_renderTargets select 1); + }; + } forEach GVAR(toRender); + } else { + // Render only the self action menu + _actions = (ACE_player getVariable QGVAR(selfActionData)) select 0; + _pos = (ACE_player modelToWorld (ACE_player selectionPosition "spine3")) vectorAdd GVAR(selfMenuOffset) vectorAdd [0,0,0.25]; + [ACE_player, _actions, 0, [180, 360], _pos] call FUNC(renderMenu); + }; + + // player sideChat format["c: %1", count GVAR(toRender)]; }; -if(GVAR(keyDown)) then { - - _cursorScreenPos = worldToScreen _cursorPos2; - _closestDistance = 1000000; - _closestSelection = -1; - { - _pos = _x select 1; - _sPos = worldToScreen _pos; - if(count _sPos > 0) then { - _disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2); - if(_disSq < 0.0125 && _disSq < _closestDistance) then { - _closestDistance = _disSq; - _closestSelection = _forEachIndex; - }; - }; - } forEach GVAR(currentOptions); - - if(_closestSelection != -1) then { - - _closest = GVAR(currentOptions) select _closestSelection; - - _pos = _closest select 1; - _cTime = diag_tickTime; - _delta = _cTime - GVAR(lastTime); - GVAR(lastTime) = _cTime; - GVAR(rotationAngle) = GVAR(rotationAngle) + (180*_delta); - if(GVAR(rotationAngle) > 360) then { - GVAR(rotationAngle) = GVAR(rotationAngle) - 360; - }; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,.75], _pos, 0.6*SafeZoneW, 0.6*SafeZoneW, GVAR(rotationAngle), "", 0.5, 0.025, "TahomaB"]; - _foundTarget = true; - GVAR(actionSelected) = true; - GVAR(selectedTarget) = (_closest select 0) select 0; - GVAR(selectedAction) = ((_closest select 0) select 1) select 3; - _misMatch = false; - _hoverPath = (_closest select 2); - if((count GVAR(lastPath)) != (count _hoverPath)) then { - _misMatch = true; - } else { - { - if(_x != (_hoverPath select _forEachIndex)) exitWith { - _misMatch = true; - }; - } forEach GVAR(lastPath); - }; - - if(_misMatch) then { - GVAR(lastPath) = _hoverPath; - GVAR(startHoverTime) = diag_tickTime; - GVAR(expanded) = false; - } else { - if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then { - GVAR(expanded) = true; - GVAR(menuDepthPath) = +GVAR(lastPath); - }; - }; - }; - drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa", [1,0,0,1], _cursorPos2, 1, 1, 0, "", 0.5, 0.025, "TahomaB"]; +if(GVAR(keyDown) || GVAR(keyDownSelfAction)) then { + + _cursorScreenPos = worldToScreen _cursorPos2; + _closestDistance = 1000000; + _closestSelection = -1; + { + _pos = _x select 1; + _sPos = worldToScreen _pos; + if(count _sPos > 0) then { + _disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2); + if(_disSq < 0.0125 && _disSq < _closestDistance) then { + _closestDistance = _disSq; + _closestSelection = _forEachIndex; + }; + }; + } forEach GVAR(currentOptions); + + if(_closestSelection != -1) then { + + _closest = GVAR(currentOptions) select _closestSelection; + + _pos = _closest select 1; + _cTime = diag_tickTime; + _delta = _cTime - GVAR(lastTime); + GVAR(lastTime) = _cTime; + GVAR(rotationAngle) = GVAR(rotationAngle) + (180*_delta); + if(GVAR(rotationAngle) > 360) then { + GVAR(rotationAngle) = GVAR(rotationAngle) - 360; + }; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,.75], _pos, 0.6*SafeZoneW, 0.6*SafeZoneW, GVAR(rotationAngle), "", 0.5, 0.025, "TahomaB"]; + _foundTarget = true; + GVAR(actionSelected) = true; + GVAR(selectedTarget) = (_closest select 0) select 0; + GVAR(selectedAction) = ((_closest select 0) select 1) select 3; + _misMatch = false; + _hoverPath = (_closest select 2); + if((count GVAR(lastPath)) != (count _hoverPath)) then { + _misMatch = true; + } else { + { + if(_x != (_hoverPath select _forEachIndex)) exitWith { + _misMatch = true; + }; + } forEach GVAR(lastPath); + }; + + if(_misMatch) then { + GVAR(lastPath) = _hoverPath; + GVAR(startHoverTime) = diag_tickTime; + GVAR(expanded) = false; + } else { + if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then { + GVAR(expanded) = true; + GVAR(menuDepthPath) = +GVAR(lastPath); + }; + }; + }; + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa", [1,0,0,1], _cursorPos2, 1, 1, 0, "", 0.5, 0.025, "TahomaB"]; }; if(!_foundTarget && GVAR(actionSelected)) then { - GVAR(actionSelected) = false; - GVAR(expanded) = false; - GVAR(lastPath) = []; - if(!GVAR(keyDown)) then { - GVAR(vecLineMap) = []; - }; + GVAR(actionSelected) = false; + GVAR(expanded) = false; + GVAR(lastPath) = []; + if(!GVAR(keyDown)) then { + GVAR(vecLineMap) = []; + }; }; for "_i" from GVAR(iconCount) to (count GVAR(iconCtrls))-1 do { - ctrlDelete (GVAR(iconCtrls) select _i); + ctrlDelete (GVAR(iconCtrls) select _i); }; GVAR(iconCtrls) resize GVAR(iconCount); GVAR(iconCount) = 0; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 39b4b120b9..4b04ff6909 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -1,4 +1,21 @@ -//fnc_renderIcon.sqf +/* + * Author: NouberNou and CAA-Picard + * Render a single interaction icon + * + * Argument: + * 0: Text + * 1: Color + * 2: 3d position ASL + * 3: ? + * 4: ? + * 5: ? + * 6: Icon + * + * Return value: + * None + * + * Public: No + */ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) private ["_color", "_pos", "_sPos", "_ctrl", "_icon"]; @@ -6,24 +23,23 @@ _text = _this select 0; _color = _this select 1; _pos = _this select 2; _icon = _this select 6; + _sPos = worldToScreen _pos; // _sPos = _pos; if(count _sPos > 0) then { - // player sideChat format["render!"]; - if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { - GVAR(iconCtrls) pushBack ((findDisplay 46) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); - }; - _ctrl = GVAR(iconCtrls) select GVAR(iconCount); - GVAR(iconCount) = GVAR(iconCount) + 1; + + if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { + GVAR(iconCtrls) pushBack ((findDisplay 46) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + }; + _ctrl = GVAR(iconCtrls) select GVAR(iconCount); + GVAR(iconCount) = GVAR(iconCount) + 1; if(_icon == "") then { _icon = DEFAULT_ICON; }; - _text = "" + _text; - _ctrl ctrlSetStructuredText (parseText _text); - _ctrl ctrlSetPosition [(_sPos select 0)-(0.011*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.025*SafeZoneW]; - _ctrl ctrlSetForegroundColor _color; - _opacity = _color select 3; - _control ctrlSetTextColor _color; - // _ctrl ctrlSetBackgroundColor [1,0,0,1]; - _ctrl ctrlCommit 0; + _text = format ["
%4", _icon, _color, _color, _text]; + _ctrl ctrlSetStructuredText (parseText _text); + _ctrl ctrlSetPosition [(_sPos select 0)-(0.2*SafeZoneW), (_sPos select 1)-(0.0095*SafeZoneW), 0.4*SafeZoneW, 0.035*SafeZoneW]; + //_ctrl ctrlSetBackgroundColor [1, 0, 0, 0.1]; + // _ctrl ctrlSetBackgroundColor [1,0,0,1]; + _ctrl ctrlCommit 0; }; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 0337d4e8c9..4c437aa6f3 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -1,64 +1,105 @@ -//fnc_renderMenu.sqf +/* + * Author: NouberNou and CAA-Picard + * Render a interaction menu + * + * Argument: + * 0: Object + * 1: Action data + * 2: ? + * 3: Angle range available for rendering + * 4: 3D position (Optional) + * 5: Path of UIDs (Optional) + * + * Return value: + * None + * + * Public: No + */ #include "script_component.hpp" -private ["_object", "_actionData", "_distance", "_index", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"]; +private ["_object", "_actionData", "_distance", "_uid", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"]; _object = _this select 0; _actionData = _this select 1; -_distance = _actionData select 5; -_index = _this select 2; +_uid = _actionData select 7;//_this select 2; +_angles = _this select 3; -if((count _this) > 3) then { - _pos = _this select 3; +_distance = _actionData select 5; +EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); + +if((count _this) > 4) then { + _pos = _this select 4; } else { - if(typeName (_actionData select 2) == "ARRAY") then { - _pos = _object modelToWorld (_actionData select 2); - } else { - _pos = _object modelToWorld (_object selectionPosition (_actionData select 2)); - }; + if(typeName (_actionData select 2) == "ARRAY") then { + _pos = _object modelToWorld (_actionData select 2); + } else { + _pos = _object modelToWorld (_object selectionPosition (_actionData select 2)); + }; }; _cursorScreenPos = (positionCameraToWorld [0, 0, 0]); if(_cursorScreenPos distance _pos <= _distance) then { - _path = []; - if((count _this) > 4) then { - _path = +(_this select 4); - }; - _menuDepth = (count GVAR(menuDepthPath)); + _path = []; + if((count _this) > 5) then { + _path = +(_this select 5); + }; + _menuDepth = (count GVAR(menuDepthPath)); - _opacity = 1; - if(_menuDepth > 0 && _index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then { - _opacity = ((GVAR(renderDepth)/_menuDepth)) max 0.25; - }; - _path set[(count _path), _index]; - // player sideChat format["r: %1", _actionData select 2]; - [_actionData select 0, [1,1,1,_opacity], _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); - GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]]; - _currentRenderDepth = -1; - _currentRenderDepth = GVAR(renderDepth); - GVAR(renderDepth) = GVAR(renderDepth) + 1; - if(_index == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then { - _radialOffset = 0; - { - // if(_index != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then { - this = _object; - _target = _object; - _player = ACE_player; - _active = [_object, ACE_player] call (_x select 4); - // diag_log text format["_active: %1: %2", (_x select 0), _active]; - if(_active) then { - _offset = [GVAR(vecLineMap), (270*(GVAR(renderDepth)%2))-(_radialOffset*45)] call FUNC(rotateVectLine); - _mod = 0.1*_distance; - _newPos = [ - (_pos select 0) + ((_offset select 0)*_mod), - (_pos select 1) + ((_offset select 1)*_mod), - (_pos select 2) + ((_offset select 2)*_mod) - ]; - // drawLine3D [_pos, _newPos, [1,0,0,1]]; - [_object, _x, _forEachIndex, _newPos, _path] call FUNC(renderMenu); - _radialOffset = _radialOffset + 1; + // ARGB Color (First Hex Pair is transparancy) + _color = "#FFFFFFFF"; + if(_menuDepth > 0 && _uid != (GVAR(menuDepthPath) select (GVAR(renderDepth)))) then { + _color = format ["#%1FFFFFF", [255 * (((GVAR(renderDepth)/_menuDepth)) max 0.25)] call EFUNC(common,toHex)]; + }; + _path set[(count _path), _uid]; + [_actionData select 0, _color, _pos, 1, 1, 0, _actionData select 1, 0.5, 0.025, "TahomaB"] call FUNC(renderIcon); + GVAR(currentOptions) set[(count GVAR(currentOptions)), [_this, _pos, _path]]; + _currentRenderDepth = -1; + _currentRenderDepth = GVAR(renderDepth); + GVAR(renderDepth) = GVAR(renderDepth) + 1; + if(_uid == (GVAR(menuDepthPath) select (GVAR(renderDepth)-1))) then { + // Count how many actions are active + private "_numActions"; + _numActions = 0; + { + this = _object; + _target = _object; + _player = ACE_player; + _active = [_object, ACE_player] call (_x select 4); + if(_active) then { + _numActions = _numActions + 1; + }; + } forEach (_actionData select 6); + systemChat format ["Menu %1, _numActions: %2", _actionData select 0, _numActions]; + + private "_angleSpan"; + _angleSpan = _maxAngleSpan min (55 * (_numActions - 1)); + + private "_angle"; + _angle = _centerAngle - _angleSpan / 2; + { + this = _object; + _target = _object; + _player = ACE_player; + _active = [_object, ACE_player] call (_x select 4); + // diag_log text format["_active: %1: %2", (_x select 0), _active]; + if(_active) then { + //systemChat format ["_angle: %1", _angle]; + _offset = [GVAR(vecLineMap), _angle] call FUNC(rotateVectLine); + _mod = 0.15 max (0.15 * (_cursorScreenPos distance _pos)); //0.5;//0.1*_distance; + _newPos = [ + (_pos select 0) + ((_offset select 0)*_mod), + (_pos select 1) + ((_offset select 1)*_mod), + (_pos select 2) + ((_offset select 2)*_mod) + ]; + // drawLine3D [_pos, _newPos, [1,0,0,0.5]]; + [_object, _x, _forEachIndex, [_angle, 150], _newPos, _path] call FUNC(renderMenu); + + if (_angle == 360) then { + _angle = _angle + _angleSpan / _numActions; + } else { + _angle = _angle + _angleSpan / ((_numActions-1) max 1); }; - // }; - } forEach (_actionData select 6); - }; - GVAR(renderDepth) = GVAR(renderDepth) - 1; + }; + } forEach (_actionData select 6); + }; + GVAR(renderDepth) = GVAR(renderDepth) - 1; }; diff --git a/addons/interact_menu/functions/fnc_rotateVectLine.sqf b/addons/interact_menu/functions/fnc_rotateVectLine.sqf index d411ffbf84..4639a50903 100644 --- a/addons/interact_menu/functions/fnc_rotateVectLine.sqf +++ b/addons/interact_menu/functions/fnc_rotateVectLine.sqf @@ -1,4 +1,16 @@ -//fnc_rotateVectLine.sqf +/* + * Author: NouberNou + * Rotate a vector line (?) + * + * Argument: + * 0: Map + * 1: Theta + * + * Return value: + * 0: ?? + * + * Public: No + */ #include "script_component.hpp" private ["_theta", "_p", "_map", "_p1", "_p2", "_q1", "_q2", "_u", "_d"]; diff --git a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf b/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf index 40a1d0ca0c..e695f3fa8e 100644 --- a/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf +++ b/addons/interact_menu/functions/fnc_rotateVectLineGetMap.sqf @@ -1,4 +1,17 @@ -//fnc_rotateVectLineGetMap.sqf +/* + * Author: NouberNou + * ? + * + * Argument: + * 0: p0 + * 1: p1 + * 2: p2 + * + * Return value: + * Map + * + * Public: No + */ #include "script_component.hpp" private ["_p", "_p1", "_p2", "_q1", "_q2", "_u", "_d"]; diff --git a/addons/interact_menu/functions/fnc_setToRender.sqf b/addons/interact_menu/functions/fnc_setToRender.sqf deleted file mode 100644 index 4cc7cfd68f..0000000000 --- a/addons/interact_menu/functions/fnc_setToRender.sqf +++ /dev/null @@ -1,6 +0,0 @@ -//fnc_setToRender.sqf -#include "script_component.hpp" -// No idea what this function was for, it was autogenerated out of my WIP file... -private ["_options"]; -_object = _this select 0; -_options = _this select 1; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index ce1a98abc5..801e564384 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -30,121 +30,142 @@ class CfgVehicles { class Man; class CAManBase: Man { class ACE_Actions { - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)}); + condition = QUOTE(true); statement = ""; - showDisabled = 0; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - subMenu[] = {"ACE_TeamManagement", 0}; - hotkey = "M"; - enableInside = 1; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = "spine3"; - class ACE_JoinTeamRed { - displayName = "$STR_ACE_Interaction_JoinTeamRed"; + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); - statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_red_ca.paa); - priority = 2.4; - hotkey = "R"; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)}); + statement = ""; + showDisabled = 0; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + enableInside = 1; + + class ACE_JoinTeamRed { + displayName = "$STR_ACE_Interaction_JoinTeamRed"; + distance = 4; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_red_ca.paa); + priority = 2.4; + hotkey = "R"; + enableInside = 1; + }; + class ACE_JoinTeamGreen { + displayName = "$STR_ACE_Interaction_JoinTeamGreen"; + distance = 4; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_green_ca.paa); + priority = 2.3; + hotkey = "G"; + enableInside = 1; + }; + class ACE_JoinTeamBlue { + displayName = "$STR_ACE_Interaction_JoinTeamBlue"; + distance = 4; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_blue_ca.paa); + priority = 2.2; + hotkey = "B"; + enableInside = 1; + }; + class ACE_JoinTeamYellow { + displayName = "$STR_ACE_Interaction_JoinTeamYellow"; + distance = 4; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); + statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + priority = 2.1; + hotkey = "Y"; + enableInside = 1; + }; + + class ACE_LeaveTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + distance = 4; + condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'}); + statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_white_ca.paa); + priority = 2.5; + hotkey = "N"; + enableInside = 1; + }; + }; + + class ACE_JoinGroup { + displayName = "$STR_ACE_Interaction_JoinGroup"; + distance = 4; + condition = QUOTE(side group _player == side group _target && {group _player != group _target}); + statement = QUOTE([_player] joinSilent group _target;); + showDisabled = 0; + priority = 2.6; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "J"; enableInside = 1; }; - class ACE_JoinTeamGreen { - displayName = "$STR_ACE_Interaction_JoinTeamGreen"; + + class ACE_GetDown { + displayName = "$STR_ACE_Interaction_GetDown"; distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); - statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_green_ca.paa); - priority = 2.3; - hotkey = "G"; - enableInside = 1; - }; - class ACE_JoinTeamBlue { - displayName = "$STR_ACE_Interaction_JoinTeamBlue"; - distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); - statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_blue_ca.paa); + condition = QUOTE([_target] call DFUNC(canInteractWith)); + statement = QUOTE([_target] call DFUNC(getDown)); + showDisabled = 0; priority = 2.2; - hotkey = "B"; - enableInside = 1; }; - class ACE_JoinTeamYellow { - displayName = "$STR_ACE_Interaction_JoinTeamYellow"; + class ACE_SendAway { + displayName = "$STR_ACE_Interaction_SendAway"; distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player}); - statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - priority = 2.1; - hotkey = "Y"; - enableInside = 1; + condition = QUOTE([_target] call DFUNC(canInteractWith)); + statement = QUOTE([_target] call DFUNC(sendAway)); + showDisabled = 0; + priority = 2.0; }; - - class ACE_LeaveTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; + class ACE_Pardon { + displayName = "$STR_ACE_Interaction_Pardon"; distance = 4; - condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'}); - statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_white_ca.paa); + condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); + statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); + showDisabled = 0; priority = 2.5; - hotkey = "N"; enableInside = 1; }; }; - class ACE_TapShoulder { + class ACE_TapShoulderRight { displayName = "$STR_ACE_Interaction_TapShoulder"; - distance = 4; + selection = "rightshoulder"; + distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_2(_player, _target)] call DFUNC(tapShoulder)); - showDisabled = 1; + statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); + showDisabled = 0; priority = 2.8; hotkey = "Q"; enableInside = 1; }; - class ACE_JoinGroup { - displayName = "$STR_ACE_Interaction_JoinGroup"; - distance = 4; - condition = QUOTE(side group _player == side group _target && {group _player != group _target}); - statement = QUOTE([_player] joinSilent group _target;); + class ACE_TapShoulderLeft { + displayName = "$STR_ACE_Interaction_TapShoulder"; + selection = "leftshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); showDisabled = 0; - priority = 2.6; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "J"; - enableInside = 1; - }; - - class ACE_GetDown { - displayName = "$STR_ACE_Interaction_GetDown"; - distance = 4; - condition = QUOTE([_target] call DFUNC(canInteractWith)); - statement = QUOTE([_target] call DFUNC(getDown)); - showDisabled = 0; - priority = 2.2; - }; - class ACE_SendAway { - displayName = "$STR_ACE_Interaction_SendAway"; - distance = 4; - condition = QUOTE([_target] call DFUNC(canInteractWith)); - statement = QUOTE([_target] call DFUNC(sendAway)); - showDisabled = 0; - priority = 2.0; - }; - class ACE_Pardon { - displayName = "$STR_ACE_Interaction_Pardon"; - distance = 4; - condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); - statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); - showDisabled = 0; - priority = 2.5; + priority = 2.8; + hotkey = "Q"; enableInside = 1; }; }; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 047e528ad6..85232d1fcd 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -16,78 +16,6 @@ GVAR(isOpeningDoor) = false; // Add keybinds -["ACE3", - localize "STR_ACE_Interaction_InteractionMenu", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(isNull (findDisplay 1713999)) exitWith {false}; - - // Statement - call FUNC(onButtonDown); - true - }, - [219, [false, false, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_Interaction_InteractionMenu", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), "ACE_Interaction_isNotSwimming"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false}; - - // Statement - if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)}; - true - }, - [219, [false, false, false]], - false, - "keyup" -] call cba_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_Interaction_InteractionMenuSelf", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(isNull (findDisplay 1713999)) exitWith {false}; - - // Statement - call FUNC(onButtonDownSelf); - true - }, - [219, [false, true, false]], - false, - "keydown" -] call cba_fnc_registerKeybind; - -["ACE3", - localize "STR_ACE_Interaction_InteractionMenuSelf", - { - // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", QEGVAR(captives,isNotEscorting), QEGVAR(captives,isNotSurrendering), "ACE_Interaction_isNotSwimming"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; - // Conditions: specific - if !(!isNull (findDisplay 1713999) && {QGVAR(AutoCloseMenu)}) exitWith {false}; - - // Statement - if (GVAR(MenuType) mod 2 == 1) then {call FUNC(onButtonUp)}; - true - }, - [219, [false, true, false]], - false, - "keyup" -] call cba_fnc_registerKeybind; - ["ACE3", localize "STR_ACE_Interaction_OpenDoor", { diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 02eed88542..262012dbb9 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -1,21 +1,22 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_message"]; - -_tapper = _this select 0; -_target = _this select 1; +EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); if (_target != ACE_player) exitWith { - addCamShake [4, 0.5, 5]; - if !(local _target) then { - [[_tapper, _target], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc); - }; + addCamShake [4, 0.5, 5]; + ACE_player playActionNow 'gestureAdvance'; + if !(local _target) then { + [[_tapper, _target, _shoulderNum], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc); + }; }; addCamShake [4, 0.5, 5]; -//_message = format ["%1 tapped you on your shoulder.", [_unit] call EFUNC(common,getName)]; -_message = localize "STR_ACE_Interaction_YouWereTapped"; +if (_shoulderNum == 0) then { + _message = localize "STR_ACE_Interaction_YouWereTappedRight"; +} else { + _message = localize "STR_ACE_Interaction_YouWereTappedLeft"; +}; [_message] call EFUNC(common,displayTextStructured); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index e58e808687..960d136c0f 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -2,6 +2,9 @@ + + Interactions >> + Interaction Menu Interaktionsmenü @@ -338,17 +341,29 @@ Tocar ombro Dai un colpetto - - You were tapped on the shoulder. - Dir wurde auf die Schulter geklopft - Te tocaron el hombro. - On te tape sur l'épaule. - Zostałeś klepnięty po ramieniu - Vállonveregettek - Někdo tě poklepal na rameno. - Вас похлопали по плечу - Você foi tocado no ombro. - Ti è stato dato un colpetto sulla spalla + + You were tapped on the RIGHT shoulder > + Te tocaron el hombro DERECHO > + Dir wurde auf die Schulter geklopft > + On te tape sur l'épaule > + Zostałeś klepnięty po ramieniu > + Vállonveregettek > + Někdo tě poklepal na rameno > + Вас похлопали по плечу > + Você foi tocado no ombro > + Ti è stato dato un colpetto sulla spalla > + + + < You were tapped on the LEFT shoulder. + < Te tocaron el hombro IZQUIERDO. + < Dir wurde auf die Schulter geklopft + < On te tape sur l'épaule. + < Zostałeś klepnięty po ramieniu + < Vállonveregettek + < Někdo tě poklepal na rameno. + < Вас похлопали по плечу + < Você foi tocado no ombro. + < Ti è stato dato un colpetto sulla spalla Cancel diff --git a/addons/logistics_uavbattery/CfgSounds.hpp b/addons/logistics_uavbattery/CfgSounds.hpp new file mode 100644 index 0000000000..530c5b86a9 --- /dev/null +++ b/addons/logistics_uavbattery/CfgSounds.hpp @@ -0,0 +1,7 @@ +class CfgSounds { + class ACE_replaceUAVBattery { + name = "ACE_replaceUAVBattery"; + sound[]={QUOTE(PATHTOF(sounds\exchange_battery.ogg)),1,1}; + titles[]={}; + }; +}; diff --git a/addons/logistics_uavbattery/CfgVehicles.hpp b/addons/logistics_uavbattery/CfgVehicles.hpp index 933079071a..a3a3fc763d 100644 --- a/addons/logistics_uavbattery/CfgVehicles.hpp +++ b/addons/logistics_uavbattery/CfgVehicles.hpp @@ -2,6 +2,7 @@ class CfgVehicles { class Helicopter_Base_F; class UAV_01_base_F: Helicopter_Base_F { class ACE_Actions { + class ACE_MainActions { class GVAR(RefuelUAV) { displayName = "$STR_ACE_logistics_uavbattery_Recharge"; distance = 4; @@ -11,9 +12,10 @@ class CfgVehicles { priority = 1.245; \ icon = QUOTE(PATHTOF(ui\UAV_battery.paa)); }; + }; }; }; - + // Misc box content class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { diff --git a/addons/logistics_uavbattery/config.cpp b/addons/logistics_uavbattery/config.cpp index 046a2665d0..32d8c49978 100644 --- a/addons/logistics_uavbattery/config.cpp +++ b/addons/logistics_uavbattery/config.cpp @@ -15,3 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgSounds.hpp" diff --git a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf index 4256ddabf9..aaaac3077d 100644 --- a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf @@ -1,17 +1,19 @@ -/* fnc_refuel.sqf -* -* Author: marc_book (modified by PabstMirror) -* -* Tests if unit can refuel the target UAV -* -* Argument: -* 0: OBJECT - Player unit -* 1: OBJECT - UAV to test -* -* Return value: -* BOOL -*/ - +/* + * Author: marc_book + * Tests if unit can refuel the target UAV + * + * Arguments: + * 0: Player + * 1: UAV + * + * Return Value: + * Can the player rechange the UAV + * + * Example: + * [player, theUAV] call ace_logistics_uavbattery_fnc_canRefuelUAV + * + * Public: No + */ #include "script_component.hpp" PARAMS_2(_caller,_target); diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 9384044f00..a23969aa9f 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -1,17 +1,19 @@ -/* fnc_refuel.sqf -* -* Author: marc_book (modified by PabstMirror) -* -* Starts refueling/recharging the 'Dartar' UAVs -* -* Argument: -* 0: OBJECT - Player unit -* 1: OBJECT - UAV -* -* Return value: -* NOTHING -*/ - +/* + * Author: marc_book + * Starts refueling/recharging the 'Dartar' UAVs + * + * Arguments: + * 0: Player + * 1: UAV + * + * Return Value: + * Nothing + * + * Example: + * [player, theUAV] call ace_logistics_uavbattery_fnc_refuelUAV + * + * Public: No + */ #include "script_component.hpp" PARAMS_2(_caller,_target); @@ -21,6 +23,7 @@ if (!(_this call FUNC(canRefuelUAV))) exitWith {}; _onFinish = { EXPLODE_2_PVT((_this select 0),_caller,_target); _caller removeItem "ACE_UAVBattery"; + playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; ["VehicleSetFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local }; diff --git a/addons/logistics_uavbattery/sounds/exchange_battery.ogg b/addons/logistics_uavbattery/sounds/exchange_battery.ogg new file mode 100644 index 0000000000..5a40ddb47a Binary files /dev/null and b/addons/logistics_uavbattery/sounds/exchange_battery.ogg differ diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 6c2d4a1ee1..eafc85cdf1 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -85,12 +85,14 @@ class CfgVehicles { }; class ACE_Actions { - class ACE_CopyMap { - displayName = "$STR_ACE_Map_CopyMap"; - condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); - showDisabled = 0; - priority = -1; + class ACE_MainActions { + class ACE_CopyMap { + displayName = "$STR_ACE_Map_CopyMap"; + condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); + showDisabled = 0; + priority = -1; + }; }; }; }; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index d172c6a532..e5328a7470 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -31,42 +31,49 @@ ctrlSetFocus _text; //Change ok button's text based on current channel - //if (isNull _buttonOK) exitWith {true}; + [{ + EXPLODE_2_PVT(_this,_params,_pfhId); + EXPLODE_1_PVT(_params,_buttonOK); - _channel = ""; - _textColor = [1,1,1,1]; - switch (call EFUNC(common,currentChannel)) do { + if (isNull _buttonOK) exitWith { + [_pfhId] call CBA_fnc_removePerFrameHandler; + }; + + _channel = ""; + _textColor = [1,1,1,1]; + switch (call EFUNC(common,currentChannel)) do { case ("global"): { - _channel = localize "str_channel_global"; - _textColor = [(216/255),(216/255),(216/255),1]; - }; + _channel = localize "str_channel_global"; + _textColor = [(216/255),(216/255),(216/255),1]; + }; case ("side"): { - _channel = localize "str_channel_side"; - _textColor = [(70/255),(211/255),(252/255),1]; - }; + _channel = localize "str_channel_side"; + _textColor = [(70/255),(211/255),(252/255),1]; + }; case ("group"): { - _channel = localize "str_channel_group"; - _textColor = [(181/255),(248/255),(98/255),1]; - }; + _channel = localize "str_channel_group"; + _textColor = [(181/255),(248/255),(98/255),1]; + }; case ("vehicle"): { - _channel = localize "str_channel_vehicle"; - _textColor = [(255/255),(208/255),(0/255),1]; - }; + _channel = localize "str_channel_vehicle"; + _textColor = [(255/255),(208/255),(0/255),1]; + }; case ("direct"): { - _channel = localize "str_channel_direct"; - _textColor = [(255/255),(255/255),(255/255),1]; - }; + _channel = localize "str_channel_direct"; + _textColor = [(255/255),(255/255),(255/255),1]; + }; case ("command"): { - _channel = localize "str_channel_command"; - _textColor = [(255/255),(255/255),(70/255),1]; + _channel = localize "str_channel_command"; + _textColor = [(255/255),(255/255),(70/255),1]; + }; }; - }; - //If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text) - if (_channel != "") then { - _buttonOK ctrlSetTextColor _textColor; - _buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel]; - }; + //If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text) + if (_channel != "") then { + _buttonOK ctrlSetTextColor _textColor; + _buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel]; + }; + }, 0, [_buttonOK]] call CBA_fnc_addPerFrameHandler; //--- Background _pos = ctrlposition _text; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 062df32ddf..6f5c1b5978 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -50,8 +50,8 @@ call FUNC(handleDisplayEffects); ["onUnconscious", FUNC(onUnconscious)] call ace_common_fnc_addEventHandler; ["carryObjectDropped", FUNC(onCarryObjectDropped)] call ace_common_fnc_addEventHandler; -if (isNil QGVAR(ENABLE_REVIVE_F)) then { - GVAR(ENABLE_REVIVE_F) = 0; +if (isNil QGVAR(ENABLE_REVIVE)) then { + GVAR(ENABLE_REVIVE) = 0; }; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 57800cd5b7..144c877aeb 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -141,8 +141,8 @@ PREP(setUnconsciousState); PREP(isUnconscious); PREP(getUnconsciousCondition); PREP(registerUnconsciousCondition); -PREP(cleanUpCopyOfBody_F); -PREP(makeCopyOfBody_F); +PREP(cleanUpCopyOfBody); +PREP(makeCopyOfBody); PREP(canGoUnconsciousState); PREP(setDead); PREP(moduleBasicRevive); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 96af8ac1ca..19fae7d3e8 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -7,7 +7,7 @@ class CfgPatches units[] = {"ACE_medical_supply_crate_cms", "ACE_bandage_basicItem","ACE_packing_bandageItem","ACE_bandageElasticItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_atropineItem","ACE_epinephrineItem","ACE_plasma_ivItem","ACE_plasma_iv_500Item","ACE_plasma_iv250Item","ACE_blood_ivItem","ACE_blood_iv_500Item","ACE_blood_iv_250Item","ACE_saline_ivItem","ACE_saline_iv_500Item","ACE_saline_iv_250Item","ACE_quikclotItem","ACE_nasopharyngeal_tubeItem","ACE_opaItem","ACE_liquidSkinItem","ACE_chestsealItem","ACE_personal_aid_kitItem"}; weapons[] = {"ACE_surgical_kit"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_gui","ACE_common"}; + requiredAddons[] = {"ACE_common"}; version = VERSION; author[] = {$STR_ACE_Common_ACETeam, "Glowbal"}; authorUrl = "http://csemod.com"; diff --git a/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf index 9f645e80ad..bd17d769ec 100644 --- a/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf @@ -51,7 +51,7 @@ if ([_caller] call FUNC(isMedic)) then { _title = format["STR_ACE_CHECK_BLOODPRESSURE"]; _content = ["STR_ACE_CHECK_BLOODPRESSURE_CHECKED_MEDIC", _output]; -[_caller, _title, _content, 0,[[_unit] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)] ] call EFUNC(gui,sendDisplayInformationTo); +[_caller, _title, _content, 0,[[_unit] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)] ] call EFUNC(common,sendDisplayInformationTo); if (_logOutPut != "") then { [_unit,"examine",format["%1 checked Blood Pressure: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog); diff --git a/addons/medical/functions/fnc_ActionCheckPulse.sqf b/addons/medical/functions/fnc_ActionCheckPulse.sqf index 52e9158329..00e7f49490 100644 --- a/addons/medical/functions/fnc_ActionCheckPulse.sqf +++ b/addons/medical/functions/fnc_ActionCheckPulse.sqf @@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; _title = format["STR_ACE_CHECK_PULSE"]; _content = ["STR_ACE_CHECK_PULSE_CONTENT"]; -[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); +[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [2 + round(random(1)), @@ -32,8 +32,8 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [_caller,false] call FUNC(treatmentMutex); }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0),false] call FUNC(treatmentMutex); }, // on failure [_caller, _target] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf index d96ae8b19c..2f79bad6b2 100644 --- a/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf @@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; _title = format["STR_ACE_CHECK_BLOODPRESSURE"]; _content = ["STR_ACE_CHECK_BLOODPRESSURE_CONTENT"]; -[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); +[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [2 + round(random(1)), @@ -32,9 +32,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [_caller,false] call FUNC(treatmentMutex); }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0),false] call FUNC(treatmentMutex); }, // on failure [_caller, _target] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_actionCarryUnit.sqf b/addons/medical/functions/fnc_actionCarryUnit.sqf index d3cfb35aee..984447f2f9 100644 --- a/addons/medical/functions/fnc_actionCarryUnit.sqf +++ b/addons/medical/functions/fnc_actionCarryUnit.sqf @@ -42,7 +42,7 @@ if (!alive _unit) exitwith { [_caller, false] call FUNC(treatmentMutex); [{ _this call FUNC(actionCarryUnit); - }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); + }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); }; if !([_caller,_unit] call EFUNC(common,carryObj)) exitwith { @@ -87,9 +87,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0), false] call FUNC(treatmentMutex); [(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj); }, // on failure [_caller, _unit, _killOnDrop] // arguments -] call EFUNC(gui,loadingBar); \ No newline at end of file +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index ae69f52272..5707f403df 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -44,7 +44,7 @@ if (_heartRate > 1.0) then { _title = "STR_ACE_CHECK_PULSE"; _content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput]; -[_caller, _title, _content, 0, [[_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(gui,sendDisplayInformationTo); +[_caller, _title, _content, 0, [[_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(common,sendDisplayInformationTo); if (_logOutPut != "") then { [_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog); diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index d2201e15f2..4ec2d269ad 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; _title = format["STR_ACE_CHECK_RESPONSE"]; _content = ["STR_ACE_CHECK_RESPONSE_CONTENT"]; -[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); +[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo); _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [2 + round(random(1)), @@ -38,14 +38,14 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; _title = format["STR_ACE_CHECK_RESPONSE"]; _content = [format[localize "STR_ACE_CHECK_REPONSE_YOU_CHECKED",[_target] call EFUNC(common,getName)],_output]; - [_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); + [_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo); [_target,"examine",_output] call FUNC(addToQuickViewLog); [_caller,false] call FUNC(treatmentMutex); }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0),false] call FUNC(treatmentMutex); }, // on failure [_caller, _target] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_actionDragUnit.sqf b/addons/medical/functions/fnc_actionDragUnit.sqf index d0fa1c70ea..285fdfe419 100644 --- a/addons/medical/functions/fnc_actionDragUnit.sqf +++ b/addons/medical/functions/fnc_actionDragUnit.sqf @@ -40,7 +40,7 @@ if (!alive _unit) exitwith { [_caller, false] call FUNC(treatmentMutex); [{ _this call FUNC(actionDragUnit); - }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); + }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); }; if (primaryWeapon _caller == "") then { @@ -94,9 +94,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0), false] call FUNC(treatmentMutex); [(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj); }, // on failure [_caller, _unit, _killOnDrop] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf index cd20140bdb..afe70746d2 100644 --- a/addons/medical/functions/fnc_actionLoadUnit.sqf +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -22,7 +22,7 @@ if ([_unit] call cse_fnc_isAwake) exitwith { [_caller,objNull] call cse_fnc_carryObj; [_unit,objNull] call cse_fnc_carryObj; -_vehicle = [_caller, _unit] call EFUNC(common,loadPerson_F); +_vehicle = [_caller, _unit] call EFUNC(common,loadPerson); if (!isNull _vehicle) then { if (!isnil QGVAR(DROP_ADDACTION)) then { _caller removeAction GVAR(DROP_ADDACTION); diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index 8df95c24d9..fc43fe06d8 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -36,7 +36,7 @@ _bodyBagCreated setvariable [QEGVAR(common,nameOfBody), _nameOfUnit, true]; // reset the position to ensure it is on the correct one. _bodyBagCreated setPos _onPosition; -[[_bodyBagCreated], QEFUNC(common,revealObject_f), true] call BIS_fnc_MP; +[[_bodyBagCreated], QEFUNC(common,revealObject), true] call BIS_fnc_MP; _bodyBagCreated setvariable [QEGVAR(logistics,enableDrag), true, true]; diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf index 30363453e2..4d747eb3b5 100644 --- a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -53,10 +53,10 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [_caller,false] call FUNC(treatmentMutex); }, // on success { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); [(_this select 0),false] call FUNC(treatmentMutex); }, // on failure [_caller, _target, _selectionName] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index 6eefb4b138..0b6b6fe9de 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -19,7 +19,7 @@ _drag = [_this, 2, false, [false]] call BIS_fnc_Param; if (vehicle _unit == _unit) exitwith {}; if (([_unit] call cse_fnc_isAwake)) exitwith {}; -if ([_caller, _unit] call EFUNC(common,unloadPerson_F)) then { +if ([_caller, _unit] call EFUNC(common,unloadPerson)) then { if (_drag) then { if ((vehicle _caller) == _caller) then { [[_caller,_unit], QUOTE(FUNC(actionDragUnit)), _caller, false] call BIS_fnc_MP; diff --git a/addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf b/addons/medical/functions/fnc_cleanUpCopyOfBody.sqf similarity index 76% rename from addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf rename to addons/medical/functions/fnc_cleanUpCopyOfBody.sqf index b20169e9f5..292f332f91 100644 --- a/addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf +++ b/addons/medical/functions/fnc_cleanUpCopyOfBody.sqf @@ -13,12 +13,12 @@ private ["_unit", "_copy"]; _unit = _this select 0; -_copy = _unit getvariable QGVAR(copyOfBody_f); +_copy = _unit getvariable QGVAR(copyOfBody); if (isnil "_copy") exitwith {false}; [format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call EFUNC(common,debug); // lets clean it up -_unit setvariable [QGVAR(originalCopy_f), nil, true]; -_unit setvariable [QGVAR(copyOfBody_f), nil, true]; +_unit setvariable [QGVAR(originalCopy), nil, true]; +_unit setvariable [QGVAR(copyOfBody), nil, true]; if (!isNull _copy) then { deleteVehicle _copy; }; diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index 69b240b1d7..cfec53e157 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -38,7 +38,7 @@ if (_bloodVolume < 100.0) then { _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; _ivVolume = (_unit getvariable [QGVAR(salineIVVolume), 0]) + IV_CHANGE_PER_SECOND; _unit setvariable [QGVAR(salineIVVolume),_ivVolume]; - if ([QEGVAR(fieldRations,module)] call EFUNC(common,isModuleEnabled_F)) then { + if ([QEGVAR(fieldRations,module)] call EFUNC(common,isModuleEnabled)) then { if ([_unit] call EFUNC(fieldRations,canDrink)) then { _unit setvariable [QEGVAR(fieldRations,drinkStatus), (_unit getvariable [QEGVAR(fieldRations,drinkStatus), 100]) + 0.2]; }; diff --git a/addons/medical/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf index 097a5682ec..a322439742 100644 --- a/addons/medical/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_getUnconsciousCondition.sqf @@ -13,8 +13,8 @@ private ["_unit","_return"]; _unit = _this select 0; -if (isnil QGVAR(unconsciousConditions_F)) then { - GVAR(unconsciousConditions_F) = []; +if (isnil QGVAR(unconsciousConditions)) then { + GVAR(unconsciousConditions) = []; }; _return = false; @@ -25,5 +25,5 @@ _return = false; }; }; if (_return) exitwith{}; -}foreach GVAR(unconsciousConditions_F); +}foreach GVAR(unconsciousConditions); _return \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleDropUnit.sqf b/addons/medical/functions/fnc_handleDropUnit.sqf index c82fe8ce79..45e1268d30 100644 --- a/addons/medical/functions/fnc_handleDropUnit.sqf +++ b/addons/medical/functions/fnc_handleDropUnit.sqf @@ -26,7 +26,7 @@ if ((isNull ([_caller] call EFUNC(common,getCarriedObj))) || !([_caller] call EF _caller removeWeapon "ACE_FakePrimaryWeapon"; }; - [_target, false] call EFUNC(common,disableAI_f); + [_target, false] call EFUNC(common,disableAI); _caller setvariable[QGVAR(onStartMovingUnitParams), nil]; // handle the drag & carry administration diff --git a/addons/medical/functions/fnc_handleHeal.sqf b/addons/medical/functions/fnc_handleHeal.sqf index 04e17a5d4c..ffd910116b 100644 --- a/addons/medical/functions/fnc_handleHeal.sqf +++ b/addons/medical/functions/fnc_handleHeal.sqf @@ -19,7 +19,7 @@ if (!(isPlayer _healer) && GVAR(setting_allowAIFullHeal) && !([_unit] call EFUNC [_unit, QGVAR(bandagedWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); if (_unit != _healer) then { - [_unit,"STR_ACE_BANDAGED","STR_ACE_IS_BANDAGING_YOU", 0, [[_healer] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo); + [_unit,"STR_ACE_BANDAGED","STR_ACE_IS_BANDAGING_YOU", 0, [[_healer] call EFUNC(common,getName)]] call EFUNC(common,sendDisplayMessageTo); }; [_unit,"treatment",format["%1 has patched up the patient",[_healer] call EFUNC(common,getName)]] call FUNC(addActivityToLog); diff --git a/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf index a140f74f6b..8d468aa60a 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf @@ -19,7 +19,7 @@ _removeItem = _this select 3; if (!local _target) exitwith{}; -[_target,"STR_ACE_AIRWAY","STR_ACE_IS_TREATING_YOUR_AIRWAY",0, [([_caller] call EFUNC(common,getName))]] call EFUNC(gui,sendDisplayMessageTo); +[_target,"STR_ACE_AIRWAY","STR_ACE_IS_TREATING_YOUR_AIRWAY",0, [([_caller] call EFUNC(common,getName))]] call EFUNC(common,sendDisplayMessageTo); [_target,_removeItem] call FUNC(addToTriageList); diff --git a/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf index c6a09fa4de..e39f12596e 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf @@ -24,7 +24,7 @@ if (!local _target) exitwith{ }; if (_caller != _target) then { - [_target,"STR_ACE_BANDAGING", "STR_ACE_IS_BANDAGING_YOU", 0, [[_treatingPerson] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo); + [_target,"STR_ACE_BANDAGING", "STR_ACE_IS_BANDAGING_YOU", 0, [[_treatingPerson] call EFUNC(common,getName)]] call EFUNC(common,sendDisplayMessageTo); }; [_target,_removeItem] call FUNC(addToTriageList); diff --git a/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf b/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf index 61e12687a7..eea3b459ee 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf @@ -56,7 +56,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; }, // on success { private ["_caller","_target", "_selectionName", "_prevAnim"]; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); @@ -66,6 +66,6 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf b/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf index a6e9156966..69e8848acf 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf @@ -23,7 +23,7 @@ _selectionName = _this select 2; _removeItem = _this select 3; _prevAnim = _this select 4; -[_caller,"STR_ACE_STITCHING","STR_ACE_START_STITCHING_INJURIES", 0, [[_injuredPerson] call EFUNC(common,getName),_selectionName]] call EFUNC(gui,sendDisplayMessageTo); +[_caller,"STR_ACE_STITCHING","STR_ACE_START_STITCHING_INJURIES", 0, [[_injuredPerson] call EFUNC(common,getName),_selectionName]] call EFUNC(common,sendDisplayMessageTo); _bandagedWounds = [_injuredPerson,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); _bodyPartN = [_selectionName] call FUNC(getBodyPartNumber); @@ -46,12 +46,12 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime]; _prevAnim = _args select 4; if ((vehicle _caller != _caller) || ((getPos _caller) distance (_caller getvariable GVAR(ORIGINAL_POSITION_PLAYER))) >= 1) then { - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); }; - [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); ["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; @@ -83,7 +83,7 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime]; if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); }; - [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); ["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; @@ -99,6 +99,6 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime]; {}, // on success {}, // on failure [_caller] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf index 53f82f74f0..d48ac82e1a 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf @@ -42,7 +42,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); }; - [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon); ["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on success @@ -54,18 +54,18 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; _removeItem = _this select 3; _prevAnim = _this select 4; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); }; - [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon); ["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); if (!(_unit getvariable [QEGVAR(common,isDead),false]) && alive _unit) then { diff --git a/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf index 1d08a00e23..414c5c4a28 100644 --- a/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf @@ -56,7 +56,7 @@ if (alive _unit) exitwith { _unit setDamage 0; // Resetting potential revive state - [_unit,QEGVAR(common,ENABLE_REVIVE_SETDEAD_F), 0] call EFUNC(common,setDefinedVariable); + [_unit,QEGVAR(common,ENABLE_REVIVE_SETDEAD), 0] call EFUNC(common,setDefinedVariable); [_unit,QEGVAR(common,ENABLE_REVIVE_COUNTER), 0] call EFUNC(common,setDefinedVariable); diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf index 2189a57a29..e74f86c438 100644 --- a/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf @@ -31,7 +31,7 @@ if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _call if (ACE_player == _caller) then { // Displaying the treatment icon action - [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); }; _isHandled = switch (_removeItem) do { @@ -77,7 +77,7 @@ _isHandled = switch (_removeItem) do { _selectionName = _this select 2; _removeItem = _this select 3; _prevAnim = _this select 4; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); @@ -87,7 +87,7 @@ _isHandled = switch (_removeItem) do { ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments - ] call EFUNC(gui,loadingBar); + ] call EFUNC(common,loadingBar); true; }; }; diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf index 3456e6df18..0c6d2b0f65 100644 --- a/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf @@ -31,7 +31,7 @@ if (_part == 0 || _part == 1) exitwith { if (ACE_player == _caller) then { // Displaying the treatment icon action - [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_airway_management.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_airway_management.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); }; // Get the current position for the treatment person @@ -57,7 +57,7 @@ if (_part == 0 || _part == 1) exitwith { }, // on success { private ["_caller","_target", "_selectionName", "_prevAnim"]; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); @@ -67,7 +67,7 @@ if (_part == 0 || _part == 1) exitwith { ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments - ] call EFUNC(gui,loadingBar); + ] call EFUNC(common,loadingBar); true; }; // TODO display message to caller diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf index c1113166f5..64239d7a83 100644 --- a/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf @@ -39,11 +39,11 @@ if (ACE_player == _caller) then { }; default { - [_caller, "STR_ACE_BANDAGING", "STR_ACE_APPLY_BANDAGE", 0, [[_target] call EFUNC(common,getName), _selectionName]] call EFUNC(gui,sendDisplayMessageTo); + [_caller, "STR_ACE_BANDAGING", "STR_ACE_APPLY_BANDAGE", 0, [[_target] call EFUNC(common,getName), _selectionName]] call EFUNC(common,sendDisplayMessageTo); }; }; // Displaying the treatment icon action - [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); }; // Get the current position for the treatment person @@ -83,7 +83,7 @@ if (isnil QGVAR(setting_bandageWaitingTime)) then { }, // on success { private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim"]; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); @@ -92,6 +92,6 @@ if (isnil QGVAR(setting_bandageWaitingTime)) then { ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf index f57ab20783..980c478226 100644 --- a/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf +++ b/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf @@ -28,7 +28,7 @@ if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _call if (ACE_player == _caller) then { // Displaying the treatment icon action - [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\medication_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\medication_small.paa)), [1,1,1,1]] call EFUNC(common,displayIcon); }; // Get the current position for the treatment person @@ -54,7 +54,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; }, // on success { private ["_caller","_target", "_selectionName", "_prevAnim"]; - [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo); if (_prevAnim != "") then { [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); @@ -64,6 +64,6 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; }, // on failure [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments -] call EFUNC(gui,loadingBar); +] call EFUNC(common,loadingBar); true; diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 7ced1ec393..cb2e77b342 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -93,7 +93,7 @@ if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) exitwit // Check vitals for medical status // TODO check for in revive state instead of variable - if ((_unit getvariable[QEGVAR(common,ENABLE_REVIVE_SETDEAD_F),0]) == 0) then { + if ((_unit getvariable[QEGVAR(common,ENABLE_REVIVE_SETDEAD),0]) == 0) then { _bloodPressureL = _bloodPressure select 0; _bloodPressureH = _bloodPressure select 1; diff --git a/addons/medical/functions/fnc_initalizeModuleCMS.sqf b/addons/medical/functions/fnc_initalizeModuleCMS.sqf index 40e50c6fb0..79d9f8083d 100644 --- a/addons/medical/functions/fnc_initalizeModuleCMS.sqf +++ b/addons/medical/functions/fnc_initalizeModuleCMS.sqf @@ -46,7 +46,7 @@ if (GVAR(setting_AdvancedLevel) == -1) exitwith{}; GVAR(isEnabled) = true; -waituntil{!isnil "ACE_gui" && !isnil "ACE_common"}; +waituntil{!isnil "ACE_common"}; if (GVAR(setting_AdvancedLevel) > 0) then { diff --git a/addons/medical/functions/fnc_makeCopyOfBody_f.sqf b/addons/medical/functions/fnc_makeCopyOfBody.sqf similarity index 100% rename from addons/medical/functions/fnc_makeCopyOfBody_f.sqf rename to addons/medical/functions/fnc_makeCopyOfBody.sqf diff --git a/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf b/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf index f26cfd9ffc..7ffeea2002 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf @@ -21,7 +21,6 @@ private ["_logic","_setting","_objects", "_medicsLoadout", "_nonMedics", "_code" _logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; if (!isNull _logic) then { _setting = _logic getvariable ["equipment",0]; - waituntil {!isnil "ACE_gui"}; // ensure the player unit is available. waituntil {time>0}; _start = diag_tickTime; diff --git a/addons/medical/functions/fnc_moduleBasicRevive.sqf b/addons/medical/functions/fnc_moduleBasicRevive.sqf index b02d873313..79da194024 100644 --- a/addons/medical/functions/fnc_moduleBasicRevive.sqf +++ b/addons/medical/functions/fnc_moduleBasicRevive.sqf @@ -15,10 +15,10 @@ _logic = _this select 0; GVAR(Module) = true; -[_logic, QGVAR(ENABLE_REVIVE_F), "enableFor" ] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(REVIVE_TIMER_MAX_F), "timer" ] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(REVIVE_NUMBER_MAX_F), "amountOf" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(ENABLE_REVIVE), "enableFor" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(REVIVE_TIMER_MAX), "timer" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(REVIVE_NUMBER_MAX), "amountOf" ] call EFUNC(common,readSettingFromModule); [ - {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD_F),0]) > 0)} + {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD),0]) > 0)} ] call FUNC(registerUnconsciousCondition); diff --git a/addons/medical/functions/fnc_onKilled.sqf b/addons/medical/functions/fnc_onKilled.sqf index e3609a57e5..2b8dd987b6 100644 --- a/addons/medical/functions/fnc_onKilled.sqf +++ b/addons/medical/functions/fnc_onKilled.sqf @@ -6,7 +6,7 @@ if (!local _unit) exitwith {}; [_unit, QGVAR(amountOfPain),0,true] call EFUNC(common,setDefinedVariable); [_unit, QGVAR(heartRate),0,true] call EFUNC(common,setDefinedVariable); [_unit, QGVAR(bloodPressure), [0,0],true] call EFUNC(common,setDefinedVariable); -if (_unit getvariable[QEGVAR(common,unconscious_non_captive_f),false]) then { +if (_unit getvariable[QEGVAR(common,unconscious_non_captive),false]) then { _unit setCaptive false; - _unit setvariable[QEGVAR(common,unconscious_non_captive_f),nil]; + _unit setvariable[QEGVAR(common,unconscious_non_captive),nil]; }; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onStartMovingUnit.sqf b/addons/medical/functions/fnc_onStartMovingUnit.sqf index 7fe3dd8d65..84678d5379 100644 --- a/addons/medical/functions/fnc_onStartMovingUnit.sqf +++ b/addons/medical/functions/fnc_onStartMovingUnit.sqf @@ -20,6 +20,6 @@ _dragging = _this select 3; _caller setvariable[QGVAR(onStartMovingUnitParams), [_caller, _target, _killOnDrop, _dragging]]; -[_target, true] call EFUNC(common,disableAI_f); +[_target, true] call EFUNC(common,disableAI); nil; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onTreatmentCompleted.sqf b/addons/medical/functions/fnc_onTreatmentCompleted.sqf index 4505575f00..146e55c3b1 100644 --- a/addons/medical/functions/fnc_onTreatmentCompleted.sqf +++ b/addons/medical/functions/fnc_onTreatmentCompleted.sqf @@ -23,4 +23,4 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { [_caller,false] call FUNC(treatmentMutex); // TODO: BUG: if AI finishes treatment, it will also hide the icon for the player -[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); +[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon); diff --git a/addons/medical/functions/fnc_registerUnconsciousCondition.sqf b/addons/medical/functions/fnc_registerUnconsciousCondition.sqf index f34d05b57d..1e0413e8d6 100644 --- a/addons/medical/functions/fnc_registerUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_registerUnconsciousCondition.sqf @@ -10,13 +10,13 @@ #include "script_component.hpp" -if (isnil QGVAR(unconsciousConditions_F)) then { - GVAR(unconsciousConditions_F) = []; +if (isnil QGVAR(unconsciousConditions)) then { + GVAR(unconsciousConditions) = []; }; if (typeName _this == typeName []) then { { if (typeName _x == typeName {}) then { - GVAR(unconsciousConditions_F) pushback _x; + GVAR(unconsciousConditions) pushback _x; }; }foreach _this; }; \ No newline at end of file diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index d43c1e1afc..2d91911a3c 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -24,11 +24,11 @@ if (!local _unit) exitwith { [[_unit, _force], QUOTE(FUNC(setDead)), _unit, false] call BIS_fnc_MP; }; -if (isnil QGVAR(ENABLE_REVIVE_F)) then { - GVAR(ENABLE_REVIVE_F) = 0; +if (isnil QGVAR(ENABLE_REVIVE)) then { + GVAR(ENABLE_REVIVE) = 0; }; -if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == 2)) && !_force && (alive (vehicle _unit))) exitwith { +if (((GVAR(ENABLE_REVIVE) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE) == 2)) && !_force && (alive (vehicle _unit))) exitwith { // enter revive state _unit setvariable ["ACE_inReviveState", true, true]; @@ -36,11 +36,11 @@ if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == [_unit] call FUNC(setUnconsciousState); // setting the revive default values - if (isnil QGVAR(REVIVE_TIMER_F)) then { - GVAR(REVIVE_TIMER_F) = 10; + if (isnil QGVAR(REVIVE_TIMER)) then { + GVAR(REVIVE_TIMER) = 10; }; - if (isnil QGVAR(REVIVE_NUMBER_MAX_F)) then { - GVAR(REVIVE_NUMBER_MAX_F) = -1; + if (isnil QGVAR(REVIVE_NUMBER_MAX)) then { + GVAR(REVIVE_NUMBER_MAX) = -1; }; [{ @@ -58,7 +58,7 @@ if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == }; _counter = _unit getvariable ["ACE_reviveCounterValue", 0]; - if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ + if (_counter >= GVAR(REVIVE_TIMER)) exitwith{ if (isPlayer _unit) then { titleText ["You died..","PLAIN DOWN"]; }; diff --git a/addons/medical/functions/fnc_setUnconsciousState.sqf b/addons/medical/functions/fnc_setUnconsciousState.sqf index 3f53e629e9..7fbd3c7f8a 100644 --- a/addons/medical/functions/fnc_setUnconsciousState.sqf +++ b/addons/medical/functions/fnc_setUnconsciousState.sqf @@ -41,17 +41,17 @@ _originalPos = unitPos _unit; // Handle the on screen effects if (isPlayer _unit) then { - [] call EFUNC(common,closeAllDialogs_f); + [] call EFUNC(common,closeAllDialogs); [true] call FUNC(effectBlackOut); ["unconscious", true] call EFUNC(common,setDisableUserInputStatus); - [false] call EFUNC(common,setVolume_f); + [false] call EFUNC(common,setVolume); } else { _unit setUnitPos "DOWN"; - [_unit, true] call EFUNC(common,disableAI_F); + [_unit, true] call EFUNC(common,disableAI); }; // So the AI does not get stuck, we are moving the unit to a temp group on its own. -[_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); +[_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); _captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch); [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); @@ -110,15 +110,15 @@ _minWaitingTime = (round(random(10)+5)); _unit setUnconscious false; // Swhich the unit back to its original group - [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); // Reset any visual and audio effects for players, or enable everything again for AI. if (isPlayer _unit) then { [false] call FUNC(effectBlackOut); - [true] call EFUNC(common,setVolume_f); + [true] call EFUNC(common,setVolume); ["unconscious", false] call EFUNC(common,setDisableUserInputStatus); } else { - [_unit, false] call EFUNC(common,disableAI_F); + [_unit, false] call EFUNC(common,disableAI); _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) }; diff --git a/addons/medical/ui/define.hpp b/addons/medical/ui/define.hpp index 3af837e4f1..be45e0ff90 100644 --- a/addons/medical/ui/define.hpp +++ b/addons/medical/ui/define.hpp @@ -1 +1 @@ -#include "\z\ace\addons\gui\UI\define.hpp" \ No newline at end of file +#include "\z\ace\addons\common\define.hpp" \ No newline at end of file diff --git a/addons/medical/ui/menu.hpp b/addons/medical/ui/menu.hpp index f65b5ab807..db7266d0e7 100644 --- a/addons/medical/ui/menu.hpp +++ b/addons/medical/ui/menu.hpp @@ -1,8 +1,8 @@ class GVAR(medicalMenu) { idd = 314412; movingEnable = true; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(gui,blurScreen); [_this select 0] call FUNC(onMenuOpen);); - onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(gui,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(common,blurScreen); [_this select 0] call FUNC(onMenuOpen);); + onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(common,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;); class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase{ idc = -1; diff --git a/addons/missionmodules/$PBOPREFIX$ b/addons/missionmodules/$PBOPREFIX$ new file mode 100644 index 0000000000..6e7c7ebfc1 --- /dev/null +++ b/addons/missionmodules/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\missionmodules \ No newline at end of file diff --git a/addons/missionmodules/CfgEventHandlers.hpp b/addons/missionmodules/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/missionmodules/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/missionmodules/CfgFactionClasses.hpp b/addons/missionmodules/CfgFactionClasses.hpp new file mode 100644 index 0000000000..792f4d31e3 --- /dev/null +++ b/addons/missionmodules/CfgFactionClasses.hpp @@ -0,0 +1,6 @@ +class CfgFactionClasses { + class NO_CATEGORY; + class ACE_missionModules: NO_CATEGORY { + displayName = "ACE Mission Modules"; + }; +}; \ No newline at end of file diff --git a/addons/missionmodules/CfgVehicles.hpp b/addons/missionmodules/CfgVehicles.hpp new file mode 100644 index 0000000000..92c379efb2 --- /dev/null +++ b/addons/missionmodules/CfgVehicles.hpp @@ -0,0 +1,68 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + + // TODO make a curator variant for this + class ACE_moduleAmbianceSound: Module_F { + scope = 2; + displayName = "Ambiance Sounds [ACE]"; + icon = QUOTE(PATHTOF(data\moduleSound.paa)); + category = "ACE_missionModules"; + function = QUOTE(FUNC(moduleAmbianceSound)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Glowbal"; + class Arguments { + class soundFiles { + displayName = "Sounds"; + description = "Classnames of the ambiance sounds played. Seperated by ','. "; + typeName = "STRING"; + defaultValue = ""; + }; + class minimalDistance { + displayName = "Minimal Distance"; + description = "Minimal Distance"; + typeName = "NUMBER"; + defaultValue = 400; + }; + class maximalDistance { + displayName = "Maximal Distance"; + description = "Maximal Distance"; + typeName = "NUMBER"; + defaultValue = 900; + }; + class minimalDelay { + displayName = "Minimal Delay"; + description = "Minimal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 10; + }; + class maximalDelay { + displayName = "Maximal Delay"; + description = "Maximal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 170; + }; + class followPlayers { + displayName = "Follow Players"; + description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + typeName = "BOOL"; + defaultValue = 0; + }; + class soundVolume { + displayName = "Volume"; + description = "The volume of the sounds played"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Ambiance sounds loop (synced across MP)"; + sync[] = {}; + }; + }; +}; diff --git a/addons/missionmodules/XEH_preInit.sqf b/addons/missionmodules/XEH_preInit.sqf new file mode 100644 index 0000000000..cadbbabdd1 --- /dev/null +++ b/addons/missionmodules/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(moduleAmbianceSound); + +ADDON = true; diff --git a/addons/missionmodules/config.cpp b/addons/missionmodules/config.cpp new file mode 100644 index 0000000000..0867b486c6 --- /dev/null +++ b/addons/missionmodules/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"cse_moduleAmbianceSound"}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Glowbal"}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgFactionClasses.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/missionmodules/data/moduleSound.paa b/addons/missionmodules/data/moduleSound.paa new file mode 100644 index 0000000000..bfe3b80327 Binary files /dev/null and b/addons/missionmodules/data/moduleSound.paa differ diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf new file mode 100644 index 0000000000..943d795b7a --- /dev/null +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -0,0 +1,123 @@ +/* + * Author: Glowbal + * Plays synchronized ambiance sounds while the module is alive. + * + * Arguments: + * 0: Logic + * 1: Units + * 2: Activated + * + * Return Value: + * Nothing + * + * Example: + * N/A + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +_units = [_this,1,[],[[]]] call BIS_fnc_param; +_activated = [_this,2,true,[true]] call BIS_fnc_param; + +// We only play this on the locality of the logic, since the sounds are broadcasted across the network +if (_activated && local _logic) then { + _ambianceSounds = []; + _unparsedSounds = _logic getvariable ["soundFiles", ""]; + _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; + _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; + _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; + _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; + _volume = (_logic getvariable ["soundVolume", 30]) max 1; + _followPlayers = _logic getvariable ["followPlayers", false]; + + _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; + + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,string_removeWhiteSpace); + _splittedList set [_foreachIndex, _x]; + }foreach _splittedList; + + _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; + { + if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + } else { + if (isclass (configFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + }; + }; + }foreach _splittedList; + + if (count _ambianceSounds == 0) exitwith {}; + { + if !([".", _x, true] call BIS_fnc_inString) then { + _ambianceSounds set [_foreachIndex, _x + ".wss"]; + }; + }foreach _ambianceSounds; + + [{ + private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; + _args = _this select 0; + _logic = _args select 0; + _minDelayBetweensounds = _args select 4; + _maxDelayBetweenSounds = _args select 5; + _lastTimePlayed = _args select 8; + + if (!alive _logic) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { + _ambianceSounds = _args select 1; + _minimalDistance = _args select 2; + _maximalDistance = _args select 3; + + _volume = _args select 6; + _followPlayers = _args select 7; + + // Find all players in session. + _allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]}; + + // Check if there are enough players to even start playing this sound. + if (count _allUnits > 0) then { + + // Select a target unit at random. + _targetUnit = _allUnits select (round(random((count _allUnits)-1))); + + // find the position from which we are going to play this sound from. + _newPos = (getPos _targetUnit); + if (!_followPlayers) then { + _newPos = getPos _logic; + }; + + // Randomize this position. + if (random(1) >= 0.5) then { + if (random(1) >= 0.5) then { + _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; + }; + } else { + if (random(1) >= 0.5) then { + _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; + }; + }; + + // If no unit is to close to this position, we will play the sound. + if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { + playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; + _args set [8, time]; + }; + }; + }; + }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, time] ] call cba_fnc_addPerFrameHandler; +}; + +true; diff --git a/addons/missionmodules/functions/script_component.hpp b/addons/missionmodules/functions/script_component.hpp new file mode 100644 index 0000000000..42d34d4801 --- /dev/null +++ b/addons/missionmodules/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\missionmodules\script_component.hpp" \ No newline at end of file diff --git a/addons/missionmodules/script_component.hpp b/addons/missionmodules/script_component.hpp new file mode 100644 index 0000000000..a567966c7b --- /dev/null +++ b/addons/missionmodules/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT missionModules +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MISSIONMODULES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MISSIONMODULES + #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSIONMODULES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/nightvision/CfgEventHandlers.hpp b/addons/nightvision/CfgEventHandlers.hpp index d76482dd7f..380f190f47 100644 --- a/addons/nightvision/CfgEventHandlers.hpp +++ b/addons/nightvision/CfgEventHandlers.hpp @@ -1,19 +1,19 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit) ); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); - }; + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + }; }; class Extended_FiredBIS_EventHandlers { - class AllVehicles { - class ADDON { - clientFiredBIS = QUOTE( _this call FUNC(blending) ); + class AllVehicles { + class ADDON { + clientFiredBIS = QUOTE( _this call FUNC(blending) ); + }; }; - }; }; diff --git a/addons/nightvision/CfgVehicles.hpp b/addons/nightvision/CfgVehicles.hpp index 63abfb47e2..d53ce54467 100644 --- a/addons/nightvision/CfgVehicles.hpp +++ b/addons/nightvision/CfgVehicles.hpp @@ -1,22 +1,22 @@ class CfgVehicles { - class All { - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - }; - - #define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ - }; - - class Box_NATO_Support_F; - class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_NVG_Gen1,6) - MACRO_ADDITEM(ACE_NVG_Gen2,6) - //MACRO_ADDITEM(ACE_NVG_Gen3,6) - MACRO_ADDITEM(ACE_NVG_Gen4,6) - MACRO_ADDITEM(ACE_NVG_Wide,6) + class All { + ACE_NightVision_grain = 0.75; + ACE_NightVision_blur = 0.055; + }; + +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_NVG_Gen1,6) + MACRO_ADDITEM(ACE_NVG_Gen2,6) + //MACRO_ADDITEM(ACE_NVG_Gen3,6) + MACRO_ADDITEM(ACE_NVG_Gen4,6) + MACRO_ADDITEM(ACE_NVG_Wide,6) + }; }; - }; }; diff --git a/addons/nightvision/CfgWeapons.hpp b/addons/nightvision/CfgWeapons.hpp index 99cc55db20..c40885c2c4 100644 --- a/addons/nightvision/CfgWeapons.hpp +++ b/addons/nightvision/CfgWeapons.hpp @@ -1,56 +1,56 @@ class CfgWeapons { - class Binocular; - class NVGoggles: Binocular { - displayName = "$STR_ACE_NightVision_NVG_Gen3_brown"; - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - ACE_NightVision_radBlur = 0.001; - }; - class NVGoggles_OPFOR: NVGoggles { - displayName = "$STR_ACE_NightVision_NVG_Gen3_black"; - }; - class NVGoggles_INDEP: NVGoggles { - displayName = "$STR_ACE_NightVision_NVG_Gen3_green"; - }; + class Binocular; + class NVGoggles: Binocular { + displayName = "$STR_ACE_NightVision_NVG_Gen3_brown"; + ACE_NightVision_grain = 0.75; + ACE_NightVision_blur = 0.055; + ACE_NightVision_radBlur = 0.001; + }; + class NVGoggles_OPFOR: NVGoggles { + displayName = "$STR_ACE_NightVision_NVG_Gen3_black"; + }; + class NVGoggles_INDEP: NVGoggles { + displayName = "$STR_ACE_NightVision_NVG_Gen3_green"; + }; - class ACE_NVG_Gen1: NVGoggles_OPFOR { - author = "$STR_ACE_Common_ACETeam"; - modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen1"; - ACE_NightVision_grain = 2.25; - ACE_NightVision_blur = 0.22; - ACE_NightVision_radBlur = 0.004; - }; - class ACE_NVG_Gen2: NVGoggles_INDEP { - author = "$STR_ACE_Common_ACETeam"; - modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen2"; - ACE_NightVision_grain = 1.5; - ACE_NightVision_blur = 0.11; - ACE_NightVision_radBlur = 0.002; - }; - /*class ACE_NVG_Gen3: NVGoggles { + class ACE_NVG_Gen1: NVGoggles_OPFOR { + author = "$STR_ACE_Common_ACETeam"; + modelOptics = "\A3\weapons_f\reticle\optics_night"; + displayName = "$STR_ACE_NightVision_NVG_Gen1"; + ACE_NightVision_grain = 2.25; + ACE_NightVision_blur = 0.22; + ACE_NightVision_radBlur = 0.004; + }; + class ACE_NVG_Gen2: NVGoggles_INDEP { + author = "$STR_ACE_Common_ACETeam"; + modelOptics = "\A3\weapons_f\reticle\optics_night"; + displayName = "$STR_ACE_NightVision_NVG_Gen2"; + ACE_NightVision_grain = 1.5; + ACE_NightVision_blur = 0.11; + ACE_NightVision_radBlur = 0.002; + }; + /*class ACE_NVG_Gen3: NVGoggles { author = "$STR_ACE_Common_ACETeam"; modelOptics = "\A3\weapons_f\reticle\optics_night"; displayName = "$STR_ACE_NightVision_NVG_Gen3"; ACE_NightVision_grain = 0.75; ACE_NightVision_blur = 0.055; ACE_NightVision_radBlur = 0.001; - };*/ - class ACE_NVG_Gen4: NVGoggles { - author = "$STR_ACE_Common_ACETeam"; - modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen4"; - ACE_NightVision_grain = 0.0; - ACE_NightVision_blur = 0.0; - ACE_NightVision_radBlur = 0.0; - }; - class ACE_NVG_Wide: NVGoggles { - author = "$STR_ACE_Common_ACETeam"; - modelOptics = QUOTE(PATHTOF(ACE_nvg_wide_optics)); - displayName = "$STR_ACE_NightVision_NVG_FullScreen"; - ACE_NightVision_grain = 0.75; - ACE_NightVision_blur = 0.055; - ACE_NightVision_radBlur = 0.001; - }; +};*/ + class ACE_NVG_Gen4: NVGoggles { + author = "$STR_ACE_Common_ACETeam"; + modelOptics = "\A3\weapons_f\reticle\optics_night"; + displayName = "$STR_ACE_NightVision_NVG_Gen4"; + ACE_NightVision_grain = 0.0; + ACE_NightVision_blur = 0.0; + ACE_NightVision_radBlur = 0.0; + }; + class ACE_NVG_Wide: NVGoggles { + author = "$STR_ACE_Common_ACETeam"; + modelOptics = QUOTE(PATHTOF(models\ACE_nvg_wide_optics)); + displayName = "$STR_ACE_NightVision_NVG_FullScreen"; + ACE_NightVision_grain = 0.75; + ACE_NightVision_blur = 0.055; + ACE_NightVision_radBlur = 0.001; + }; }; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index b81bedc07b..7513b1df16 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -35,3 +35,40 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); ["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); + +// Add keybinds +["ACE3", +localize "STR_ACE_NightVision_IncreaseNVGBrightness", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(captives,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if ((currentVisionMode _player != 1)) exitWith {false}; + + // Statement + [ACE_player, 1] call FUNC(changeNVGBrightness); + true +}, +[201, [false, false, true]], //PageUp + ALT +false, +"keydown" +] call cba_fnc_registerKeybind; + +["ACE3", +localize "STR_ACE_NightVision_DecreaseNVGBrightness", +{ + // Conditions: canInteract + _exceptions = [QEGVAR(captives,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if ((currentVisionMode _player != 1)) exitWith {false}; + + // Statement + [ACE_player, -1] call FUNC(changeNVGBrightness); + true +}, +[209, [false, false, true]], //PageDown + ALT +false, +"keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/nightvision/XEH_preInit.sqf b/addons/nightvision/XEH_preInit.sqf index 9f59a01418..27f8ea7d48 100644 --- a/addons/nightvision/XEH_preInit.sqf +++ b/addons/nightvision/XEH_preInit.sqf @@ -3,8 +3,7 @@ ADDON = false; PREP(blending); -PREP(decreaseNVGBrightness); -PREP(increaseNVGBrightness); +PREP(changeNVGBrightness); PREP(updatePPEffects); ADDON = true; diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index 32c563bfb6..4e6aa2e39a 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -1,42 +1,17 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"commy2", "KoffeinFlummi", "PabstMirror"}; - authorUrl = "https://github.com/commy2/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2", "KoffeinFlummi", "PabstMirror"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; }; #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - - -// class EGVAR(common,Default_Keys) { //??? -class ACE_common_Default_Keys { - class increaseNVGBrightness { - displayName = "$STR_ACE_NightVision_IncreaseNVGBrightness"; - condition = QUOTE( currentVisionMode _player == 1 ); - statement = QUOTE( [_player, _vehicle] call FUNC(increaseNVGBrightness) ); - key = 201; - shift = 0; - control = 0; - alt = 1; - allowHolding = 1; - }; - class decreaseNVGBrightness { - displayName = "$STR_ACE_NightVision_DecreaseNVGBrightness"; - condition = QUOTE( currentVisionMode _player == 1 ); - statement = QUOTE( [_player, _vehicle] call FUNC(decreaseNVGBrightness) ); - key = 209; - shift = 0; - control = 0; - alt = 1; - allowHolding = 1; - }; -}; diff --git a/addons/nightvision/functions/fnc_blending.sqf b/addons/nightvision/functions/fnc_blending.sqf index df46c62b58..96e7f404a5 100644 --- a/addons/nightvision/functions/fnc_blending.sqf +++ b/addons/nightvision/functions/fnc_blending.sqf @@ -1,4 +1,24 @@ -// by commy2 +/* + * Author: commy2 + * Change the blending when the player fires?? + * + * Arguments: + * 0: unit - Object the event handler is assigned to + * 1: weapon - Fired weapon + * 2: muzzle - Muzzle that was used + * 3: mode - Current mode of the fired weapon + * 4: ammo - Ammo used + * 5: magazine - magazine name which was used + * 6: projectile - Object of the projectile that was shot + * + * Return Value: + * Nothing + * + * Example: + * [clientFiredBIS-XEH] call ace_nightvision_fnc_blending + * + * Public: No + */ #include "script_component.hpp" private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"]; @@ -8,26 +28,26 @@ _weapon = _this select 1; _ammo = _this select 4; _magazine = _this select 5; -if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode _vehicle) != 1}) exitWith {}; - _player = ACE_player; - +//If our vehicle didn't shoot, or we're not in NVG mode, exit +if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {}; +//If we are mounted, and it wasn't our weapon system that fired, exit if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {}; private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"]; _silencer = switch (_weapon) do { - case (primaryWeapon _player) : {primaryWeaponItems _player select 0}; - case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0}; - case (handgunWeapon _player) : {handgunItems _player select 0}; - default {""}; +case (primaryWeapon _player) : {primaryWeaponItems _player select 0}; +case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0}; +case (handgunWeapon _player) : {handgunItems _player select 0}; + default {""}; }; _visibleFireCoef = 1; _visibleFireTimeCoef = 1; if (_silencer != "") then { - _visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire"); - _visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime"); + _visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire"); + _visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime"); }; _visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire"); @@ -36,24 +56,24 @@ _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTi _nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4; _fnc_isTracer = { - private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"]; + private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"]; - if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; + if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false}; - _indexShot = (_player ammo _weapon) + 1; + _indexShot = (_player ammo _weapon) + 1; - _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); - if (_indexShot <= _lastRoundsTracer) exitWith {true}; + _lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer"); + if (_indexShot <= _lastRoundsTracer) exitWith {true}; - _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); - if (_tracersEvery == 0) exitWith {false}; + _tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery"); + if (_tracersEvery == 0) exitWith {false}; - (_indexShot - _lastRoundsTracer) % _tracersEvery == 0 + (_indexShot - _lastRoundsTracer) % _tracersEvery == 0 }; if (call _fnc_isTracer) then { - _visibleFire = _visibleFire + 2; - _visibleFireTime = _visibleFireTime + 2; + _visibleFire = _visibleFire + 2; + _visibleFireTime = _visibleFireTime + 2; }; _darkness = 1 - (call EFUNC(common,ambientBrightness)); diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf new file mode 100644 index 0000000000..e1894aba00 --- /dev/null +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -0,0 +1,33 @@ +/* + * Author: commy2 + * Change the brightness of the unit's NVG + * + * Arguments: + * 0: The Unit + * 1: Change in brightness (1 or -1) + * + * Return Value: + * Nothing + * + * Example: + * [player, 1] call ace_nightvision_fnc_changeNVGBrightness + * + * Public: No + */ +#include "script_component.hpp" + +private ["_brightness"]; + +PARAMS_2(_player,_changeInBrightness); + +_brightness = _player getVariable [QGVAR(NVGBrightness), 0]; + +_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 1) max -1; + +_player setVariable [QGVAR(NVGBrightness), _brightness, false]; + +GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; +GVAR(ppEffectNVGBrightness) ppEffectCommit 0; + +[format [(localize "STR_ACE_NightVision_NVGBrightness"), (_brightness * 100)]] call EFUNC(common,displayTextStructured); +playSound "ACE_Sound_Click"; diff --git a/addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf b/addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf deleted file mode 100644 index 0fb2de9d33..0000000000 --- a/addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_player", "_vehicle", "_brightness"]; - -_player = _this select 0; -_vehicle = _this select 1; - -_brightness = _player getVariable [QGVAR(NVGBrightness), 0]; - -if (_brightness > -1) then { - _brightness = round (10 * _brightness - 1) / 10; - - _player setVariable [QGVAR(NVGBrightness), _brightness, false]; - - GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; - GVAR(ppEffectNVGBrightness) ppEffectCommit 0; - - [format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured); - playSound "ACE_Sound_Click"; -}; diff --git a/addons/nightvision/functions/fnc_increaseNVGBrightness.sqf b/addons/nightvision/functions/fnc_increaseNVGBrightness.sqf deleted file mode 100644 index e2143d5a5e..0000000000 --- a/addons/nightvision/functions/fnc_increaseNVGBrightness.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_player", "_vehicle", "_brightness"]; - -_player = _this select 0; -_vehicle = _this select 1; - -_brightness = _player getVariable [QGVAR(NVGBrightness), 0]; - -if (_brightness < 1) then { - _brightness = round (10 * _brightness + 1) / 10; - - _player setVariable [QGVAR(NVGBrightness), _brightness, false]; - - GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; - GVAR(ppEffectNVGBrightness) ppEffectCommit 0; - - [format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured); - playSound "ACE_Sound_Click"; -}; diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index 1fdfbb9778..3edfe28e74 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -1,4 +1,18 @@ -//by commy2, PabstMirror and CAA-Picard +/* + * Author: commy2, PabstMirror and CAA-Picard + * Update the ppEffects everytime something changes + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * [someEvent] call ace_nightvision_fnc_updatePPEffects + * + * Public: No + */ #include "script_component.hpp" private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"]; diff --git a/addons/nightvision/ace_nvg_wide_optics.p3d b/addons/nightvision/models/ace_nvg_wide_optics.p3d similarity index 100% rename from addons/nightvision/ace_nvg_wide_optics.p3d rename to addons/nightvision/models/ace_nvg_wide_optics.p3d diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index bdf4576eb3..cbf35b0baf 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -78,13 +78,18 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == west); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + selection = ""; + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE(side group _player == west); + statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; @@ -98,13 +103,18 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == east); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + selection = ""; + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE(side group _player == east); + statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; @@ -118,13 +128,18 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Rallypoint"; - distance = 4; - condition = QUOTE(side group _player == independent); - statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + selection = ""; + class ACE_Teleport { + displayName = "Teleport to Rallypoint"; + distance = 4; + condition = QUOTE(side group _player == independent); + statement = QUOTE([ARR_3(_player, side group _player, false)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; @@ -139,13 +154,17 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_nato_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == west); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE(side group _player == west); + statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; @@ -159,13 +178,17 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_CSAT_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == east); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE(side group _player == east); + statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; @@ -179,13 +202,17 @@ class CfgVehicles { init = QUOTE((_this select 0) setFlagTexture '\A3\Data_F\Flags\Flag_AAF_CO.paa'; _this call FUNC(initRallypoint)); }; class ACE_Actions : ACE_Actions { - class ACE_Teleport { - displayName = "Teleport to Base"; - distance = 4; - condition = QUOTE(side group _player == independent); - statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); - showDisabled = 1; - priority = 1; + class ACE_MainActions { + distance = 5; + condition = "true"; + class ACE_Teleport { + displayName = "Teleport to Base"; + distance = 4; + condition = QUOTE(side group _player == independent); + statement = QUOTE([ARR_3(_player, side group _player, true)] call FUNC(teleportToRallypoint)); + showDisabled = 1; + priority = 1; + }; }; }; }; diff --git a/addons/resting/data/icons/icon_bipod.paa b/addons/resting/data/icons/icon_bipod.paa new file mode 100644 index 0000000000..c2b6a2fb3e Binary files /dev/null and b/addons/resting/data/icons/icon_bipod.paa differ diff --git a/addons/resting/functions/fnc_restWeapon.sqf b/addons/resting/functions/fnc_restWeapon.sqf index 52b1932f62..793ef4fff3 100644 --- a/addons/resting/functions/fnc_restWeapon.sqf +++ b/addons/resting/functions/fnc_restWeapon.sqf @@ -27,6 +27,9 @@ _intersects = _this call FUNC(getIntersection); if (true in _intersects) then { _unit setVariable ["ACE_weaponRested", true]; + if (_unit == ACE_PLAYER) then { + [QGVAR(bipodDeployed), true, QUOTE(PATHTOF(data\icons\icon_bipod.paa)), [1,1,1,1], -1] call EFUNC(common,displayIcon); + }; private "_restedPosition"; _restedPosition = getPosASL _unit; diff --git a/addons/resting/functions/fnc_unRestWeapon.sqf b/addons/resting/functions/fnc_unRestWeapon.sqf index 86caa31ac8..2cf885676f 100644 --- a/addons/resting/functions/fnc_unRestWeapon.sqf +++ b/addons/resting/functions/fnc_unRestWeapon.sqf @@ -47,3 +47,7 @@ playSound QGVAR(unrest); _unit setVariable ["ACE_weaponRested", false]; _unit setVariable ["ACE_bipodDeployed", false]; + +if (_unit == ACE_PLAYER) then { + [QGVAR(bipodDeployed), false, "", [1,1,1,1], -1] call EFUNC(common,displayIcon); +}; \ No newline at end of file diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 79591280d8..2ffb4eee44 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -1,29 +1,34 @@ #define MACRO_LOCK_ACTIONS \ - class ACE_unlockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ - distance = 4; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ - statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ - priority = 0.3; \ - icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ - }; \ - class ACE_lockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lock"; \ - distance = 4; \ - condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ - statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ - showDisabled = 0; \ - priority = 0.2; \ - icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ - }; \ - class ACE_lockpickVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ - distance = 4; \ - condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ - statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ - showDisabled = 0; \ - priority = 0.1; \ + class ACE_MainActions { \ + selection = ""; \ + distance = 5; \ + condition = "true"; \ + class ACE_unlockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ + statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ + showDisabled = 0; \ + priority = 0.3; \ + icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lock"; \ + distance = 4; \ + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ + statement = QUOTE([ARR_3('SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ + showDisabled = 0; \ + priority = 0.2; \ + icon = QUOTE(PATHTOF(ui\key_menuIcon_ca.paa)); \ + }; \ + class ACE_lockpickVehicle { \ + displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ + distance = 4; \ + condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ + statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ + showDisabled = 0; \ + priority = 0.1; \ + }; \ }; class CfgVehicles {