diff --git a/TO_MERGE/agm/Scopes/clientInit.sqf b/TO_MERGE/agm/Scopes/clientInit.sqf deleted file mode 100644 index 106121cc8b..0000000000 --- a/TO_MERGE/agm/Scopes/clientInit.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Initializes vars needed for scope adjustment and watches for scope changes. - * - * Arguments: - * None - * - * Return Value: - * None - */ -AGM_Scopes_fadeScript = scriptNull; - -// show overlay after changing weapon/optic -0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - while {True} do { - waitUntil {[AGM_player, 0,0] call AGM_Scopes_fnc_canAdjustScope}; - _layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false]; - sleep 3; - _layer cutFadeOut 2; - - _weapon = currentWeapon AGM_player; - _optics = [AGM_player] call AGM_Scopes_fnc_getOptics; - waitUntil {sleep 0.05; !(_optics isEqualTo ([AGM_player] call AGM_Scopes_fnc_getOptics)) or (currentWeapon AGM_player != _weapon)}; - }; -}; - -// instantly hide when scoping in -0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - while {True} do { - waitUntil {sleep 0.05; cameraView == "GUNNER"}; - if !(isNull AGM_Scopes_fadeScript) then { - terminate AGM_Scopes_fadeScript; - }; - _layer cutText ["", "PLAIN", 0]; - }; -}; diff --git a/TO_MERGE/agm/Scopes/config.cpp b/TO_MERGE/agm/Scopes/config.cpp deleted file mode 100644 index c521d53df7..0000000000 --- a/TO_MERGE/agm/Scopes/config.cpp +++ /dev/null @@ -1,238 +0,0 @@ -class CfgPatches { - class AGM_Scopes { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi"; - }; -}; - -class CfgFunctions { - class AGM_Scopes { - class AGM_Scopes { - file = "AGM_Scopes\functions"; - class adjustScope; - class canAdjustScope; - class firedEH; - class getOptics; - class hideZeroing; - class inventoryCheck; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Scopes { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Scopes\clientInit.sqf';"; - }; -}; - -class Extended_Fired_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientFired = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_firedEH};"; - }; - }; -}; - -class Extended_Take_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientTake = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_Put_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientPut = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_InitPost_EventHandlers { - class CAManBase { - class AGM_Scopes { - init = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_Respawn_EventHandlers { - class CAManBase { - class AGM_Scopes { - respawn = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class AGM_Core_Default_Keys { - class adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustUp"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, 0.1] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0, 0.1] call AGM_Scopes_fnc_adjustScope;"; - allowHolding = 1; - key = 201; - shift = 0; - control = 0; - alt = 0; - }; - class adjustScopeDown: adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustDown"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, -0.1] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0, -0.1] call AGM_Scopes_fnc_adjustScope;"; - key = 209; - }; - class adjustScopeLeft: adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustLeft"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, -0.1, 0] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, -0.1, 0] call AGM_Scopes_fnc_adjustScope;"; - key = 209; - control = 1; - }; - class adjustScopeRight: adjustScopeLeft { - displayName = "$STR_AGM_Scopes_AdjustRight"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0.1, 0] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0.1, 0] call AGM_Scopes_fnc_adjustScope;"; - key = 201; - }; -}; - -class CfgSounds { - class AGM_Sound_Click; - class AGM_Scopes_Click_1: AGM_Sound_Click { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3, 2, 200}; - }; - class AGM_Scopes_Click_2: AGM_Scopes_Click_1 { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3.3, 1.8, 200}; - }; - class AGM_Scopes_Click_3: AGM_Scopes_Click_1 { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 2.8, 2.3, 200}; - }; -}; - -class CfgWeapons { - class ItemCore; - class InventoryOpticsItem_Base_F; - - class optic_LRPS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-50,50}; - AGM_ScopeAdjust_Vertical[] = {-70,70}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - - class optic_SOS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-50,50}; - AGM_ScopeAdjust_Vertical[] = {-60,60}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - - class optic_DMS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-40,40}; - AGM_ScopeAdjust_Vertical[] = {-40,40}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; -}; - -class RscTitles { - class AGM_Scope_Zeroing { - idd = -1; - movingEnable = 0; - enableSimulation = 1; - enableDisplay = 1; - onLoad = "_this spawn compile preprocessFileLineNumbers '\AGM_Scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable ['AGM_Scope_Debug', _this];"; - duration = 1e+011; - fadein = 0; - fadeout = 0; - name = "AGM_Scope_Zeroing"; - class RscPicture; - class RscText; - class controls { - class AGM_Scope_Zeroing_BG: RscPicture { - idc = 925001; - type = 0; - text = "AGM_Scopes\UI\scopes_bg.paa"; - style = 48 + 0x800; - scale = 1; - sizeEx = 1; - font = "PuristaMedium"; - colorText[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - shadow = 1; - - x = (0.5-0.4/2) * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 0.4 * safezoneW; - h = 0.3 * safezoneH; - }; - class AGM_Scope_Zeroing_Vertical: RscText { - idc = 925002; - type = 0; - style = 2; - sizeEx = 0.04; - lineSpacing = 1; - font = "PuristaMedium"; - text = ""; - colorText[] = {1,1,1, 0.9}; - colorBackground[] = {1,0,0, 0}; - shadow = 0; - - x = (0.5-0.4/2 + 0.45*0.4) * safezoneW + safezoneX; - y = (0 + 0.19*0.3) * safezoneH + safezoneY; - w = 0.04 * safezoneW; - h = 0.025 * safezoneH; - }; - class AGM_Scope_Zeroing_Horizontal: RscText { - idc = 925003; - type = 0; - style = 0; - sizeEx = 0.04; - lineSpacing = 1; - font = "PuristaMedium"; - text = ""; - colorText[] = {1,1,1, 0.9}; - colorBackground[] = {1,0,0, 0}; - shadow = 0; - - x = (0.5-0.4/2 + 0.6*0.4) * safezoneW + safezoneX; - y = (0 + 0.47*0.3) * safezoneH + safezoneY; - w = 0.04 * safezoneW; - h = 0.025 * safezoneH; - }; - }; - }; -}; - -class RscInGameUI { - class RscUnitInfo; - class RscWeaponZeroing: RscUnitInfo { - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['AGM_dlgWeaponZeroing', _this select 0];"; - }; -}; diff --git a/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf b/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf deleted file mode 100644 index 0b70913365..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Changes the adjustment for the current scope - * - * Arguments: - * 0: Horizontal adjustment - * 1: Vertical adjustment - * - * Return Value: - * True - */ - -private ["_unit", "_weapons", "_zeroing", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_hint"]; - -_unit = _this select 0; - -_weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit -]; - -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; -}; - -_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon _unit)); -_zeroing set [0, (round (((_zeroing select 0) + (_this select 1)) * 10)) / 10]; -_zeroing set [1, (round (((_zeroing select 1) + (_this select 2)) * 10)) / 10]; - -AGM_Scopes_Adjustment set [_weapons find (currentWeapon _unit), _zeroing]; - -playSound (["AGM_Scopes_Click_1", "AGM_Scopes_Click_2", "AGM_Scopes_Click_3"] select floor random 3); - -// slightly rotate the player if looking through optic -if (cameraView == "GUNNER") then { - _pitchbankyaw = [_unit] call AGM_Core_fnc_getPitchBankYaw; - // these are not exact mil-to-degree conversions, but instead chosen - // to minimize the effect of rounding errors - _pitch = (_pitchbankyaw select 0) + ((_this select 2) * -0.04); - _bank = _pitchbankyaw select 1; - _yaw = (_pitchbankyaw select 2) + ((_this select 1) * -0.04); - [_unit, _pitch, _bank, _yaw] call AGM_Core_fnc_setPitchBankYaw; -}; - -_display = uiNamespace getVariable ["AGM_Scopes_ZeroingDisplay", displayNull]; -if !(isNull _display) then { - _vertical = _display displayCtrl 925002; - _horizontal = _display displayCtrl 925003; - _vertical ctrlSetText (str (_zeroing select 1)); - _horizontal ctrlSetText (str (_zeroing select 0)); -}; - -if (!isNull (missionNamespace getVariable ["AGM_Scopes_fadeScript", scriptNull])) then { - terminate AGM_Scopes_fadeScript; -}; -if (cameraView != "GUNNER") then { - AGM_Scopes_fadeScript = 0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - _layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false]; - sleep 3; - _layer cutFadeOut 2; - }; -}; - -true diff --git a/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf b/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf deleted file mode 100644 index 9013a4155c..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf +++ /dev/null @@ -1,25 +0,0 @@ -// by commy2 - -private ["_state", "_ctrl"]; - -_state = _this select 0; - -disableSerialization; -_ctrl = (uiNamespace getVariable ['AGM_dlgWeaponZeroing', displayNull]) displayCtrl 168; - -if (_state) then { - _ctrl ctrlSetPosition [0,0,0,0]; -} else { - private "_config"; - - _config = configFile >> "RscInGameUI" >> "RscWeaponZeroing" >> "CA_Zeroing"; - - _ctrl ctrlSetPosition [ - getNumber (_config >> "x"), - getNumber (_config >> "y"), - getNumber (_config >> "w"), - getNumber (_config >> "h") - ]; -}; - -_ctrl ctrlCommit 0; diff --git a/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf b/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf deleted file mode 100644 index 008b204598..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by KoffeinFlummi / commy2 - -private "_new"; - -_new = _this call AGM_Scopes_fnc_getOptics; - -if (isNil "AGM_Scopes_Optics") then { - AGM_Scopes_Optics = ["", "", ""]; -}; - -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; -}; - -{ - if (_new select _forEachIndex != _x) then { - AGM_Scopes_Adjustment set [_forEachIndex, [0,0]]; - }; -} forEach AGM_Scopes_Optics; - -AGM_Scopes_Optics = _new; diff --git a/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf b/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf deleted file mode 100644 index d74c1b4d5f..0000000000 --- a/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf +++ /dev/null @@ -1,18 +0,0 @@ -disableSerialization; - -_display = _this select 0; -uiNamespace setVariable ["AGM_Scopes_ZeroingDisplay", _display]; -_vertical = _display displayCtrl 925002; -_horizontal = _display displayCtrl 925003; - -_weapons = [ - primaryWeapon player, - secondaryWeapon player, - handgunWeapon player -]; - -if ((currentWeapon player) in _weapons) then { - _zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon player)); - _horizontal ctrlSetText (str (_zeroing select 0)); - _vertical ctrlSetText (str (_zeroing select 1)); -}; diff --git a/TO_MERGE/cse/f_eh/CfgFunctions.h b/TO_MERGE/cse/f_eh/CfgFunctions.h deleted file mode 100644 index 36054c411f..0000000000 --- a/TO_MERGE/cse/f_eh/CfgFunctions.h +++ /dev/null @@ -1,20 +0,0 @@ -class CfgFunctions { - class CSE { - class eventhandlers { - file = "cse\cse_f_eh\functions"; - class initialization_f { - preInit = 1; - postInit = 1; - recompile = 1; - }; - class eventHandler_f { recompile = 1; }; - class HandleHeal_EH_F { recompile = 1; }; - class HandleDamage_EH_F { recompile = 1; }; - class customEventHandler_F { recompile = 1; }; - class getCustomResults_F { recompile = 1; }; - class setEventhandler_f { recompile = 1; }; - class removeEventHandler_f { recompile = 1; }; - class addModuleEventHandlers_f { recompile = 1; }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/CfgVehicles.h b/TO_MERGE/cse/f_eh/CfgVehicles.h deleted file mode 100644 index 15511631e1..0000000000 --- a/TO_MERGE/cse/f_eh/CfgVehicles.h +++ /dev/null @@ -1,180 +0,0 @@ -class CfgVehicles { - class All; - class AllVehicles : All { - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - - class Man; - class CAManBase: Man { - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - - class SoldierGB : CAManBase{ - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class SoldierWB : CAManBase { - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class SoldierEB : CAManBase{ - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class B_Soldier_base_F: SoldierWB { - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class B_Soldier_03_f: B_Soldier_base_F { - class EventHandlers { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - HandleHeal = "[_this,'handleHeal'] call CSE_fnc_HandleHeal_EH_F;"; - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - - class LandVehicle; - class Car: LandVehicle { - class EventHandlers { - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class Tank: LandVehicle { - class EventHandlers { - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - - class Air; - class Helicopter: Air { - class EventHandlers { - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class Plane: Air { - class EventHandlers { - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; - class Ship: AllVehicles { - class EventHandlers { - local = "_this call cse_eh_cba_compat_local;"; - killed = "_this call cse_eh_cba_compat_Killed"; - firedNear = "_this call cse_eh_cba_compat_FiredNear"; - fired = "_this call cse_eh_cba_compat_Fired"; - respawn = "_this call cse_eh_cba_compat_Respawn"; - Take = "_this call cse_eh_cba_compat_Take"; - Put = "_this call cse_eh_cba_compat_Put"; - GetIn = "_this call cse_eh_cba_compat_GetIn"; - GetOut = "_this call cse_eh_cba_compat_GetOut"; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/Combat_Space_Enhancement.h b/TO_MERGE/cse/f_eh/Combat_Space_Enhancement.h deleted file mode 100644 index f44a5fac89..0000000000 --- a/TO_MERGE/cse/f_eh/Combat_Space_Enhancement.h +++ /dev/null @@ -1,13 +0,0 @@ - -class Combat_Space_Enhancement { - class EventHandlers { - class PreInit_EventHandlers { - class cse_xeh_fired_eventHandler_Compat { - init = "call compile preprocessFile 'cse\cse_f_eh\cba_compat_init.sqf';"; - }; - }; - }; - - class CustomResults {}; - class CustomEventHandlers {}; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/Extended_Init_EventHandlers.h b/TO_MERGE/cse/f_eh/Extended_Init_EventHandlers.h deleted file mode 100644 index 953aa28c44..0000000000 --- a/TO_MERGE/cse/f_eh/Extended_Init_EventHandlers.h +++ /dev/null @@ -1,103 +0,0 @@ -class Extended_Fired_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH - { - Fired = "[_this,'fired'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_HandleDamage_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH - { - handleDamage = "[_this,'handleDamage'] call CSE_fnc_HandleDamage_EH_F;"; - }; - }; -}; - -class Extended_FiredNear_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH - { - FiredNear = "[_this,'firedNear'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_Killed_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH - { - Killed = "[_this,'killed'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_Local_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH - { - Local = "[_this,'local'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_Respawn_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH { - Respawn = "[_this,'respawn'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_Take_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH { - Take = "[_this,'take'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_Put_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH { - Put = "[_this,'put'] call cse_fnc_eventHandler_F;"; - }; - }; -}; - -class Extended_GetIn_Eventhandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH { - GetIn = "[_this,'getIn'] call cse_fnc_eventHandler_F;"; - }; - }; -}; -class Extended_GetOut_EventHandlers -{ - class AllVehicles - { - class cse_CBA_COMPAT_XEH { - GetOut = "[_this,'getOut'] call cse_fnc_eventHandler_F;"; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/cba_compat_init.sqf b/TO_MERGE/cse/f_eh/cba_compat_init.sqf deleted file mode 100644 index 129c8d9c4e..0000000000 --- a/TO_MERGE/cse/f_eh/cba_compat_init.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * cba_compat_init.sqf - * @Descr: CBA compatability wrapper. - * @Author: Glowbal - * - * @Arguments: [] - * @Return: void - * @PublicAPI: false - */ - -cse_eh_cba_compat_local = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'local'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_Respawn = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'respawn'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_Killed = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'killed'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_FiredNear = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'firedNear'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_Fired = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'fired'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_Take = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'Take'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_Put = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'Put'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_GetIn = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'GetIn'] call cse_fnc_eventHandler_F;} } else {{}}; -cse_eh_cba_compat_GetOut = if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { {[_this,'GetOut'] call cse_fnc_eventHandler_F;} } else {{}}; diff --git a/TO_MERGE/cse/f_eh/config.cpp b/TO_MERGE/cse/f_eh/config.cpp deleted file mode 100644 index eab6a20d7d..0000000000 --- a/TO_MERGE/cse/f_eh/config.cpp +++ /dev/null @@ -1,31 +0,0 @@ -class CfgPatches -{ - class cse_f_eh - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {/*"cba_extended_eventhandlers", "cba_xeh", "extended_eventhandlers"*/ "A3_Characters_F","A3_Boat_F","A3_animals_f","A3_air_f","A3_soft_f","A3_static_f","A3_weapons_f","a3_structures_f"}; - version = "0.10.0_rc"; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; - }; -}; -class CfgAddons { - class PreloadAddons { - class cse_f_eh { - list[] = {"cse_f_eh"}; - }; - }; -}; -/* Event handlers */ -#include "CfgVehicles.h" - -/* For CBA Compatability */ -#include "Extended_Init_EventHandlers.h" - - /* Ensures that the functions are being compiled */ -#include "CfgFunctions.h" - -/* To ensure that the custom eventhandler classes exist */ -#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_HandleHeal_eh_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_HandleHeal_eh_f.sqf deleted file mode 100644 index c59c985771..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_HandleHeal_eh_f.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/** - * fn_HandleHeal_eh_f.sqf - * @Descr: Execute the handleHeal Eventhandlers. Is currently bugged due to Arma Engine problem? - * @Author: Glowbal - * - * @Arguments: [] - * @Return: BOOL Returns true if handleHeal has been fully handled - * @PublicAPI: false - */ - -private ["_vehicle","_allPreInitHandlers","_handle","_totalValue","_cfg","_amountOfHandlers", "_newCfg","_returnValue","_ehCfg"]; -_vehicle = (_this select 0) select 1; -_handle = _this select 1; -_allPreInitHandlers = []; - -if (!local _vehicle) exitwith {}; -if (isnil "CSE_fnc_HandleHeal_EH_F") then { - CSE_fnc_HandleHeal_EH_F = compile preProcessFileLineNumbers '\cse\cse_f_eh\fn_HandleHeal_EH_F.sqf'; -}; - -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; -{ - - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x); - if (isClass _cfg) then { - if (isClass (_cfg >> "EventHandlers")) then { - _numberOfEH = count (_cfg >> "EventHandlers"); - for "_j" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_j=0}, {_j< _numberOfEH}, {_j=_j+1}] do { - _ehCfg = ((_cfg >> "EventHandlers") select _j); - if (isClass _ehCfg) then { - if (_vehicle isKindOf (ConfigName _ehCfg)) then { - _allPreInitHandlers pushback compile getText(_ehCfg >> _handle); - }; - }; - }; - }; - }; -}foreach CSE_F_MODULE_OBJ_EH; -{ - private ["_returnValue"]; - _returnValue = (_this select 0) call _x; -}foreach _allPreInitHandlers; -[_allPreInitHandlers] call cse_fnc_debug; - -AISFinishHeal [(_this select 0) select 0, (_this select 0) select 1, (_this select 0) select 2]; - -if (count _allPreInitHandlers > 0) then { - true; -} else { - false; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_addModuleEventhandlers_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_addModuleEventhandlers_f.sqf deleted file mode 100644 index 3830605364..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_addModuleEventhandlers_f.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/** - * fn_addModuleEventhandlers_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_entity", "_handle", "_eventHandlerName", "_eventHandlerCollection", "_cfg", "_numberOfEH", "_ehCfg", "_classType", "_text", "_code", "_eventHandlerCollection","_collectedEHIDs", "_collectedID_VarName"]; -_entity = _this select 0; -_handle = _this select 1; - -_eventHandlerName = ("cse_f_eventhandler_" + _handle); - -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x >> "EventHandlers"); - if (isClass (_cfg)) then { - _numberOfEH = count (_cfg); - - for "_EHiterator" from 0 to (_numberOfEH -1) do { - _ehCfg = ((_cfg) select _EHiterator); - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _text = getText(_ehCfg >> _handle); - if (_text != "") then { - _code = (compile _text); - _eventHandlerCollection pushBack [_classType, _code, _x]; - true; - }; - }; - }; - }; - }count CSE_F_MODULE_OBJ_EH; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; - if (isnil "cse_f_eventhandlers_collection") then { - cse_f_eventhandlers_collection = []; - }; - cse_f_eventhandlers_collection pushBack _eventHandlerName; -}; - -_collectedID_VarName = format["cse_addModuleEventHandlers_f_%1_ids", _handle]; - -// clear all module eventhandlers first -_collectedEHIDs = _entity getvariable [_collectedID_VarName, []]; -{ - [_entity, _handle, _x] call cse_fnc_removeEventHandler_F; -}foreach _collectedEHIDs; - -// now we add the new ones -_collectedEHIDs = []; -{ - if (_entity isKindOf (_x select 0)) then { - _collectedEHIDs pushback (format["cse_moduleEventhandlerID_", _foreachIndex]); - [_entity, _handle, format["cse_moduleEventhandlerID_", _foreachIndex], _x select 1] call cse_fnc_setEventhandler_f; - }; -}foreach _eventHandlerCollection; - -// Store the new IDs -_entity setvariable [_collectedID_VarName, _collectedEHIDs]; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_customEventHandler_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_customEventHandler_f.sqf deleted file mode 100644 index 00f7fa50dc..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_customEventHandler_f.sqf +++ /dev/null @@ -1,61 +0,0 @@ -/** - * fn_customEventHandler_f.sqf - * @Descr: Execute a custom defined eventhandler. - * @Author: Glowbal - * - * @Arguments: [arguments ANY, handle STRING (The name of the eventhandler)] - * @Return: ARRAY Array containing the results of the called eventhandlers. - * @PublicAPI: true - */ - - -private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"]; -_arguments = _this select 0; -_handle = _this select 1; - -_eventHandlerName = ("cse_f_custom_eventhandler_" + _handle); -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - [format["caching Custom Eventhandler: %1",_handle]] call cse_fnc_debug; - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //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; - }; - }; - }; - - _cfg = (MissionConfigFile >> "Combat_Space_Enhancement" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //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]; - [format["Custom Eventhandler: %1 cache: %2",_handle, _eventHandlerCollection]] call cse_fnc_debug; -}; - -_return = []; -{ - _return pushback (_arguments call (_x select 1)); -}foreach _eventHandlerCollection; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_eventHandler_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_eventHandler_f.sqf deleted file mode 100644 index beada7ec82..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_eventHandler_f.sqf +++ /dev/null @@ -1,65 +0,0 @@ -/** - * fn_eventHandler_f.sqf - * @Descr: Execute eventhandlers - * @Author: Glowbal - * - * @Arguments: [] - * @Return: void - * @PublicAPI: false - */ - -private ["_args","_handle","_entity","_cfgFile","_cfg","_numberOfEH","_ehCfg","_value", "_code", "_eventHandlerCollection", "_classType", "_eventHandlerName"]; -_args = _this select 0; -_handle = _this select 1; -_entity = _args select 0; - -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; - -if (!(local _entity) && _handle != "fired") exitwith {}; -_eventHandlerName = ("cse_f_eventhandler_" + _handle); - -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x >> "EventHandlers"); - if (isClass (_cfg)) then { - _numberOfEH = count (_cfg); - - for "_EHiterator" from 0 to (_numberOfEH -1) do { - _ehCfg = ((_cfg) select _EHiterator); - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _text = getText(_ehCfg >> _handle); - if (_text != "") then { - _code = (compile _text); - _eventHandlerCollection pushBack [_classType, _code, _x]; - true; - }; - }; - }; - }; - }count CSE_F_MODULE_OBJ_EH; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; - if (isnil "cse_f_eventhandlers_collection") then { - cse_f_eventhandlers_collection = []; - }; - cse_f_eventhandlers_collection pushBack _eventHandlerName; -}; - -_setHandler = _entity getvariable ("cse_f_setEventhandler_" + _handle); -if (isnil "_setHandler") then { - { - if (_entity isKindOf (_x select 0)) then { - _args call (_x select 1); - }; - false; - }count _eventHandlerCollection; -} else { - { - _args call (_X select 1); - false; - }count _setHandler; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_getCustomResults_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_getCustomResults_f.sqf deleted file mode 100644 index 0609a3229e..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_getCustomResults_f.sqf +++ /dev/null @@ -1,42 +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 - */ - - -private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"]; -_arguments = _this select 0; -_handle = _this select 1; - -_eventHandlerName = ("cse_f_custom_results_eventhandler_" + _handle); -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "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 set [ count _eventHandlerCollection, [_classType, _code]]; - true; - }; - }; - }; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; -}; - -_return = []; -{ - _return set [ count _return, _arguments call (_x select 1) ]; -}foreach _eventHandlerCollection; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_handleDamage_eh_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_handleDamage_eh_f.sqf deleted file mode 100644 index 6eb1017b77..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_handleDamage_eh_f.sqf +++ /dev/null @@ -1,79 +0,0 @@ -/** - * fn_handleDamage_eh_f.sqf - * @Descr: Execute the handleDamage Eventhandler - * @Author: Glowbal - * - * @Arguments: [] - * @Return: NUMBER Returns a number based on output of executed eventhandlers - * @PublicAPI: false - */ - -private ["_vehicle","_allPreInitHandlers","_handle","_totalValue","_cfg","_amountOfHandlers", "_newCfg","_returnValue","_ehCfg", "_fullDamage", "_returnDamage"]; -_vehicle = (_this select 0) select 0; -_handle = _this select 1; -if (!local _vehicle) exitwith {}; -if (_vehicle isKindOf "CAManBase") then { - _name = _vehicle getVariable "cse_name"; - if (isNil "_name") then { - _vehicle setvariable ["cse_name", name _vehicle, true]; - }; -}; - -_eventHandlerName = "cse_f_eventhandler_handleDamage"; -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; - }; - { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x); - if (isClass _cfg) then { - if (isClass (_cfg >> "EventHandlers")) then { - _numberOfEH = count (_cfg >> "EventHandlers"); - - for "_j" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_j=0}, {_j< _numberOfEH}, {_j=_j+1}] do { - _ehCfg = ((_cfg >> "EventHandlers") select _j); - if (isClass _ehCfg) then { - if (getText(_ehCfg >> _handle) != "") then { - _eventHandlerCollection pushBack [(ConfigName _ehCfg), compile getText(_ehCfg >> _handle)]; - }; - }; - }; - }; - }; - }foreach CSE_F_MODULE_OBJ_EH; - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; - - if (isnil "cse_f_eventhandlers_collection") then { - cse_f_eventhandlers_collection = []; - }; - cse_f_eventhandlers_collection pushBack _eventHandlerName; -}; -_returnDamage = (_this select 0) select 2; -{ - if (_vehicle isKindOf (_x select 0)) then { - private "_returnValue"; - _returnValue = (_this select 0) call (_x select 1); - if (!isnil "_returnValue") then { - if (typeName _returnValue == typeName 0) then { - _returnDamage = _returnValue; - }; - }; - }; -}foreach _eventHandlerCollection; - -if (typeName _returnDamage == typeName 0) then { - if (_returnDamage >= 0.9) then { - if (isnil "CSE_ENABLE_REVIVE_F") then { - CSE_ENABLE_REVIVE_F = 0; - }; - if ((CSE_ENABLE_REVIVE_F == 1 && isPlayer _vehicle) || (CSE_ENABLE_REVIVE_F == 2)) then { - _returnDamage = 0.9; - }; - }; -} else { - _returnDamage = (_this select 0) select 2; -}; -_returnDamage \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_initialization_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_initialization_f.sqf deleted file mode 100644 index 9433d8295d..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_initialization_f.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/** - * fn_initialization_f.sqf - * @Descr: Grabs all pre and post init defined events from the config files and executes those. - * @Author: Glowbal - * - * @Arguments: [setToExecute STRING] - * @Return: void - * @PublicAPI: false - */ - -private ["_allPreInitHandlers","_cfg","_cfgOpt","_text"]; -_allPreInitHandlers = []; - -if ((_this select 0) == "preInit") then { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "EventHandlers" >> "PreInit_EventHandlers"); - - for "_i" from 0 to ((count _cfg)-1) /* step +1 */ do { - _this spawn (compile (getText ((_cfg select _i) >> "init"))); - }; -} else { - if ((_this select 0) == "postInit") then { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "EventHandlers" >> "PostInit_EventHandlers"); - - for "_i" from 0 to ((count _cfg)-1) /* step +1 */ do { - _this spawn (compile (getText ((_cfg select _i) >> "init"))); - }; - }; -}; - -if (isnil "CSE_F_EH_ALLOW_MISSION_CONFIG") then { - CSE_F_EH_ALLOW_MISSION_CONFIG = true; -}; - -if (CSE_F_EH_ALLOW_MISSION_CONFIG) then { - _allPreInitHandlers = []; - if ((_this select 0) == "preInit") then { - _cfg = (missionConfigFile >> "Combat_Space_Enhancement" >> "EventHandlers" >> "PreInit_EventHandlers"); - - for "_i" from 0 to ((count _cfg)-1) /* step +1 */ do { - _this spawn (compile (getText ((_cfg select _i) >> "init"))); - }; - } else { - if ((_this select 0) == "postInit") then { - _cfg = (missionConfigFile >> "Combat_Space_Enhancement" >> "EventHandlers" >> "PostInit_EventHandlers"); - - for "_i" from 0 to ((count _cfg)-1) /* step +1 */ do { - _this spawn (compile (getText ((_cfg select _i) >> "init"))); - }; - }; - }; -}; - -if ((_this select 0) == "postInit") then { - cse_postInit = true; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_removeEventhandler_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_removeEventhandler_f.sqf deleted file mode 100644 index 38b13bfaba..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_removeEventhandler_f.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/** - * fn_removeEventhandler_f.sqf - * @Descr: Removes an eventhandler with the specified ID - * @Author: Glowbal - * - * @Arguments: [object OBJECT, handler STRING, id STRING] - * @Return: nil - * @PublicAPI: true - */ - -private ["_obj", "_handler", "_id", "_varName", "_handlers", "_newHandlers"]; -_obj = _this select 0; -_handler = _this select 1; -_id = _this select 2; - -_varName = "cse_f_setEventhandler_" + _handler; -_handlers = _obj getvariable [_varName, []]; - -_newHandlers = []; -{ - if (_x select 0 != _id) then { - _newHandlers pushback _x; - }; -}foreach _handlers; - -if (count _newHandlers > 0) then { - _obj setvariable [_varName, _newHandlers]; -} else { - // remove and default to original CSE handlers - _obj setvariable [_varName, nil]; -}; - -true; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/functions/fn_setEventhandler_f.sqf b/TO_MERGE/cse/f_eh/functions/fn_setEventhandler_f.sqf deleted file mode 100644 index 1eaf62bde4..0000000000 --- a/TO_MERGE/cse/f_eh/functions/fn_setEventhandler_f.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/** - * fn_setEventhandler_f.sqf - * @Descr: Set the event handler for a specific object. Stacks. Overwrites the CSE module eventhandlers. - * @Author: Glowbal - * - * @Arguments: [object OBJECT, handler STRING, id STRING, code CODE] - * @Return: nil - * @PublicAPI: true - */ - -private ["_obj", "_handler", "_id", "_code", "_varName", "_handlers", "_found"]; -_obj = _this select 0; -_handler = _this select 1; -_id = _this select 2; -_code = _this select 3; - -_varName = "cse_f_setEventhandler_" + _handler; -_handlers = _obj getvariable [_varName, []]; - -_found = -1; -{ - if (_x select 0 == _id) exitwith { - _found = _foreachIndex; - }; -}foreach _handlers; - -if (_found < 0) then { - _handlers pushback [_id, _code]; -} else { - _handlers set [_found, [_id, _code]]; -}; - -_obj setvariable [_varName, _handlers]; - -true; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/stringtable.xml b/TO_MERGE/cse/f_eh/stringtable.xml deleted file mode 100644 index 6927a1bdce..0000000000 --- a/TO_MERGE/cse/f_eh/stringtable.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/CfgFunctions.h b/TO_MERGE/cse/f_modules/CfgFunctions.h deleted file mode 100644 index 25e2f6cfaf..0000000000 --- a/TO_MERGE/cse/f_modules/CfgFunctions.h +++ /dev/null @@ -1,22 +0,0 @@ -class CfgFunctions -{ - class CSE - { - - class Modules - { - file = "cse\cse_f_modules\functions"; - class initalizeModule_F { recompile = 1; }; - class isModuleEnabled_F { recompile = 1; }; - class getModule_f { recompile = 1; }; - class getModuleCondition_f { recompile = 1; }; - class getModules_f { recompile = 1; }; - class initalizeModuleObjEH { recompile = 1; }; - class moduleIsActive_f { recompile = 1; }; - class enableModule_f { recompile = 1; }; - class getCfgModuleInits_f { recompile = 1; }; - class getCfgModuleArguments_f { recompile = 1; }; - class remoteModuleInit { recompile = 1; }; - }; - }; -}; diff --git a/TO_MERGE/cse/f_modules/Combat_Space_Enhancement.h b/TO_MERGE/cse/f_modules/Combat_Space_Enhancement.h deleted file mode 100644 index 1b7d525b36..0000000000 --- a/TO_MERGE/cse/f_modules/Combat_Space_Enhancement.h +++ /dev/null @@ -1,21 +0,0 @@ -class Combat_Space_Enhancement { - class EventHandlers { - class PreInit_EventHandlers { - class cse_f_modules { - init = " call compile preprocessFile 'cse\cse_f_modules\init.sqf';"; - }; - }; - class PostInit_EventHandlers { - class cse_f_modules { - init = " call compile preprocessFile 'cse\cse_f_modules\post-init.sqf';"; - }; - }; - }; - - class CustomEventHandlers { - /** - * Called when the enableModule_f function is called. Third argument is whatever or not the module has initalized. - */ - class moduleEnabled_f; // [moduleName, arguments, enabled] - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/config.cpp b/TO_MERGE/cse/f_modules/config.cpp deleted file mode 100644 index 0e5d5d7802..0000000000 --- a/TO_MERGE/cse/f_modules/config.cpp +++ /dev/null @@ -1,23 +0,0 @@ -class CfgPatches -{ - class cse_f_modules - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"cse_main"}; - version = "0.10.0_rc"; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; - }; -}; -class CfgAddons { - class PreloadAddons { - class cse_f_modules { - list[] = {"cse_f_modules"}; - }; - }; -}; - -#include "CfgFunctions.h" -#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_enableModule_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_enableModule_f.sqf deleted file mode 100644 index 6461eed738..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_enableModule_f.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/** - * fn_enableModule_f.sqf - * @Descr: Enable a CSE Module - * @Author: Glowbal - * - * @Arguments: [moduleName STRING, arguments ARRAY (Format: [[name STRING, value ANY]])] - * @Return: void - * @PublicAPI: true - */ - -private ["_moduleName", "_arguments", "_moduleInfo"]; -_moduleName = _this select 0; -_arguments = _this select 1; - -[format["enableModule_f %1 %2",_this, ([_moduleName] call cse_fnc_isModuleEnabled_F)]] call cse_fnc_debug; -if ([_moduleName] call cse_fnc_isModuleEnabled_F) exitwith { - [[_moduleName, _arguments, false],"moduleEnabled_f"] call cse_fnc_customEventHandler_F; -}; -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; -CSE_F_MODULE_OBJ_EH pushback _moduleName; - -_initField = getText(ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName >> "init"); -_arguments call compile _initField; - -if !(isnil "cse_f_eventhandlers_collection") then { - { - missionNamespace setvariable [_x, nil]; // clear all eventhandlers. - }foreach cse_f_eventhandlers_collection; -}; -[_moduleName] call cse_fnc_parseModuleForConfigurations; - -[[_moduleName, _arguments, true],"moduleEnabled_f"] call cse_fnc_customEventHandler_F; - -[format["Initalize module: %1 COMPLETED. Arguments: %2", _moduleName, _arguments], 3] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleArguments_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleArguments_f.sqf deleted file mode 100644 index 095dbf8a39..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleArguments_f.sqf +++ /dev/null @@ -1,98 +0,0 @@ -/** - * fn_getCfgModuleArguments_f.sqf - * @Descr: Grab Module arguments for a specific module in a config file. - * @Author: Glowbal - * - * @Arguments: [moduleName STRING (The classname of the CSE module), configPath CONFIG (Path to the module Config)] - * @Return: ARRAY An array with parameters for given module. If the parameters for the provided module have not been found within the config, default values will be used. - * @PublicAPI: true - */ - -private ["_configOfModule","_collectedInits","_cfgRoot","_amountOfClasses","_i","_arguments","_moduleName","_CfgVehEntry","_CfgModuleEntry","_moduleArguments","_j","_cfg","_value","_typeNameArgument", "_return"]; -_moduleName = _this select 0; -_configOfModule = _this select 1; -_return = []; -// Array for collection all initalization arguments for the given module. -_arguments = []; -// Grab necessary config entries - -_CfgVehEntry = (ConfigFile >> "CfgVehicles" >> _moduleName); -_CfgModuleEntry = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName); - -if (isClass _CfgModuleEntry) then { - if (isClass _CfgVehEntry) then { - // init with parameters - _moduleArguments = (_CfgVehEntry >> "Arguments"); - if (isClass _moduleArguments) then { - - // Looping through the expected arguments, based on what is defined in the module Argument Class in CfgVehicles. - for [{_j=0}, {_j < (count _moduleArguments)}, {_j=_j+1}] do { - // if the argument is a class, parse it. Otherwise we will be ignoring it. - if (isClass (_moduleArguments select _j)) then { - - // Grab the value from the argument defined in the description.ext and current class. - _value = 0; // (_configOfModule >> configName(_moduleArguments select _j)) call bis_fnc_getCfgData; - // This will be used to validate the retrieved value for a proper value. - _typeNameArgument = getText((_moduleArguments select _j) >> "typeName"); - - call { - if (_typeNameArgument == "BOOL") exitwith { - _value = getNumber(_configOfModule >> configName(_moduleArguments select _j)) == 1; - }; - if (_typeNameArgument == "NUMBER") exitwith { - _value = getNumber(_configOfModule >> configName(_moduleArguments select _j)); - }; - if (_typeNameArgument == "STRING") exitwith { - _value = getText(_configOfModule >> configName(_moduleArguments select _j)); - }; - }; - - // If the argument is defined in the description.ext, we will validate the typeName of the argument and store it in the argument array. - if (!isnil "_value") then { - if (typeName _value == _typeNameArgument || TRUE) then { // lets assume the values are correct until we write a function to properly compare the typeNames. - _arguments pushback [(ConfigName (_moduleArguments select _j)), _value]; - } else { - // Incase the typeName is invalid, we will set a default value and store this instead. - call { - if (_typeNameArgument == "BOOL") exitwith { - _value = getNumber((_moduleArguments select _j) >> "defaultValue") == 1; - }; - if (_typeNameArgument == "NUMBER") exitwith { - _value = getNumber((_moduleArguments select _j) >> "defaultValue"); - }; - if (_typeNameArgument == "STRING") exitwith { - _value = getText((_moduleArguments select _j) >> "defaultValue"); - }; - }; - [format["Module Argument has not been set %1 %2. Module need to be replaced. Value used: %4", _moduleName, (ConfigName (_moduleArguments select _j)), _typeNameArgument, _value], 1] call cse_fnc_debug; - _arguments pushback [(ConfigName (_moduleArguments select _j)), _value]; - }; - } else { - [format["Value is nil for %1 %2", _moduleName, (ConfigName (_moduleArguments select _j))], 1] call cse_fnc_debug; - // Because the value has not been defined, we will use a default value instead. - // TODO implement defaultValue retrieval for non defined arguments. - _value = ""; - if (_typeNameArgument != "") then { - call { - if (_typeNameArgument == "BOOL") exitwith { - _value = getNumber((_moduleArguments select _j) >> "defaultValue") == 1; - }; - if (_typeNameArgument == "NUMBER") exitwith { - _value = getNumber((_moduleArguments select _j) >> "defaultValue"); - }; - if (_typeNameArgument == "STRING") exitwith { - _value = getText((_moduleArguments select _j) >> "defaultValue"); - }; - }; - [format["Module Argument has not been set %1 %2. Module need to be replaced. Value used: %4", _moduleName, (ConfigName (_moduleArguments select _j)), _typeNameArgument, _value], 1] call cse_fnc_debug; - _arguments pushback [(ConfigName (_moduleArguments select _j)), _value]; - }; - }; - }; - }; - }; - } else { - // init with no parameters. We do not have to collect anything for this. - }; -}; -_arguments \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleInits_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleInits_f.sqf deleted file mode 100644 index e25bd089e6..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleInits_f.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/** - * fn_getCfgModuleInits_f.sqf - * @Descr: Grab all defined modules in the given config space, collect their arguments and return them. - * @Author: Glowbal - * - * @Arguments: [config CONFIG (For example: MissionConfigFile or ConfigFile)] - * @Return: ARRAY Array with format: [[moduleName STRING, moduleArgs ARRAY (Format: [argumentName STRING, value ANY])], ...] - * @PublicAPI: false - */ - -private ["_config","_collectedInits","_cfgRoot","_amountOfClasses","_i","_arguments","_moduleName","_CfgVehEntry","_CfgModuleEntry","_moduleArguments","_j","_cfg","_value","_moduleArgs"]; -_config = [_this, 0, MissionConfigFile, [MissionConfigFile]] call BIS_fnc_Param; - -_collectedInits = []; -_cfgRoot = (_config >> "Combat_Space_Enhancement" >> "Modules"); -_amountOfClasses = count _cfgRoot; -for [{_i=0}, {_i < _amountOfClasses}, {_i=_i+1}] do { - if (isClass (_cfgRoot select _i)) then { - _moduleName = ConfigName (_cfgRoot select _i); - _disableConfigExecution = getNumber (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName >> "disableConfigExecution"); - if (_disableConfigExecution > 0) exitwith {}; - if (!([_moduleName] call cse_fnc_isModuleEnabled_f)) then { - _moduleArgs = [_moduleName, (_cfgRoot select _i)] call cse_fnc_getCfgModuleArguments_f; - _collectedInits pushback [_moduleName, _moduleArgs]; - }; - }; -}; -_collectedInits \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_getModuleCondition_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_getModuleCondition_f.sqf deleted file mode 100644 index 8bfb2cadca..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_getModuleCondition_f.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * fn_getModuleCondition_f.sqf - * @Descr: N/A DEPRECATED - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_moduleName","_condition","_return","_cfgFile"]; - -_moduleName = _this select 0; -_return = ""; -_cfgFile = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName); -if (isClass _cfgFile) then { - _return = format["CSE_MODULE_CONDITION_%1",_moduleName]; - -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_getModule_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_getModule_f.sqf deleted file mode 100644 index 74f2762e99..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_getModule_f.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_getModule_f.sqf - * @Descr: Gets module information. DEPRECATED - * @Author: Glowbal - * - * @Arguments: [ModuleName STRING] - * @Return: ARRAY Returns an array with [ModuleName STRING, initLine STRING] - * @PublicAPI: false - */ - -private ["_module","_cfg","_init","_name"]; -_moduleName = _this select 0; -_cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName); -_module = []; -if (isClass _cfg) then { - _init = getText (_cfg >> "init"); - _name = getText (_cfg >> "name"); - //_module set [count _module,[_name,_init]]; - _module = [_name,_init]; -}; - -_module \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_getModules_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_getModules_f.sqf deleted file mode 100644 index 84fec9d862..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_getModules_f.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * fn_getModules_f.sqf - * @Descr: Returns all current active CSE Modules - * @Author: Glowbal - * - * @Arguments: [] - * @Return: ARRAY List of all current Modules [moduleName STRING (Module classname), ...] - * @PublicAPI: true - */ - -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; - -CSE_F_MODULE_OBJ_EH; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_initalizeModuleObjEH.sqf b/TO_MERGE/cse/f_modules/functions/fn_initalizeModuleObjEH.sqf deleted file mode 100644 index 02769a31cf..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_initalizeModuleObjEH.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/** - * fn_initalizeModuleObjEH.sqf - * @Descr: initalize module Object init Eventhandlers. DEPRICATED. DO NOT USE. - * @Author: Glowbal - * - * @Arguments: [object OBJECT, eventhandler STRING] - * @Return: void - * @PublicAPI: false - */ - - -private ["_entity","_handle","_cfg","_ehCfg","_numberOfEH"]; -_entity = (_this select 0) select 0; -_handle = _this select 1; - -if (!local _entity) exitwith{}; -if (isnil "cse_postInit") then { -_this spawn { - private ["_entity"]; - _entity = (_this select 0) select 0; - _handle = _this select 1; - waituntil{(!isnil 'cse_postInit')}; - { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x); - if (isClass _cfg) then { - if (isClass (_cfg >> "EventHandlers")) then { - _numberOfEH = count (_cfg >> "EventHandlers"); - for [{_j=0}, {_j< _numberOfEH}, {_j=_j+1}] do { - _ehCfg = ((_cfg >> "EventHandlers") select _j); - if (isClass _ehCfg) then { - if (_entity isKindOf (ConfigName _ehCfg)) then { - (_this select 0) call (compile getText(_ehCfg >> _handle)); - }; - }; - }; - }; - }; - }foreach (call cse_fnc_getModules); -}; -} else { - - if (!local _entity) exitwith{}; - { - _cfg = (ConfigFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _x); - if (isClass _cfg) then { - if (isClass (_cfg >> "EventHandlers")) then { - _numberOfEH = count (_cfg >> "EventHandlers"); - for [{_j=0}, {_j< _numberOfEH}, {_j=_j+1}] do { - _ehCfg = ((_cfg >> "EventHandlers") select _j); - if (isClass _ehCfg) then { - if (_entity isKindOf (ConfigName _ehCfg)) then { - (_this select 0) call (compile getText(_ehCfg >> _handle)); - }; - }; - }; - }; - }; - }foreach (call cse_fnc_getModules); -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_initalizeModule_F.sqf b/TO_MERGE/cse/f_modules/functions/fn_initalizeModule_F.sqf deleted file mode 100644 index fd9e659450..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_initalizeModule_F.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/** - * fn_initalizeModule_F.sqf - * @Descr: Initalize a CSE Module. To be called through the BI A3 Module Framework - * @Author: Glowbal - * - * @Arguments: [] - * @Return: void - * @PublicAPI: true - */ - -private ["_moduleName","_arguments","_logic","_units", "_activated","_cfg", "_moduleInfo", "_value", "_typeNameArgument"]; -if (count _this > 1) then { - _moduleName = typeOf (_this select 0); -} else { - _moduleName = _this select 0; -}; -[format["Initalize module: %1 IN QUE",_moduleName], 3] call cse_fnc_debug; -waituntil {(!isnil 'cse_f_modules')}; -[format["Initalize module: %1 STARTED",_moduleName], 3] call cse_fnc_debug; - -_arguments = []; -if (count _this >1) then { - _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; - _moduleName = typeOf _logic; - _cfg = (ConfigFile >> "CfgVehicles" >> _moduleName >> "Arguments"); - if (isClass _cfg) then { - for [{_i=0}, {_i < (count _cfg)}, {_i=_i+1}] do { - if (isClass (_cfg select _i)) then { - _value = _logic getvariable (ConfigName (_cfg select _i)); - if (!isnil "_value") then { - _arguments pushback [(ConfigName (_cfg select _i)), _value]; - } else { - _typeNameArgument = getText ((_cfg select _i) >> "typeName"); - _value = ""; - if (_typeNameArgument != "") then { - call { - if (_typeNameArgument == "BOOL") exitwith { - _value = getNumber((_cfg select _i) >> "defaultValue") == 1; - }; - if (_typeNameArgument == "NUMBER") exitwith { - _value = getNumber((_cfg select _i) >> "defaultValue"); - }; - if (_typeNameArgument == "STRING") exitwith { - _value = getText((_cfg select _i) >> "defaultValue"); - }; - }; - [format["Module Argument has not been set %1 %2. Module need to be replaced. Value used: %4", _moduleName, (ConfigName (_cfg select _i)), _typeNameArgument, _value], 1] call cse_fnc_debug; - _arguments pushback [(ConfigName (_cfg select _i)), _value]; - }; - }; - }; - }; - }; -} else { - _moduleName = _this select 0; -}; -[_moduleName, _arguments] call cse_fnc_enableModule_f; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_isModuleEnabled_F.sqf b/TO_MERGE/cse/f_modules/functions/fn_isModuleEnabled_F.sqf deleted file mode 100644 index 8e3f86c295..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_isModuleEnabled_F.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_isModuleEnabled_F.sqf - * @Descr: Check if given CSE Module class is enabled - * @Author: Glowbal - * - * @Arguments: [moduleName STRING] - * @Return: BOOL Returns true if module is currently enabled - * @PublicAPI: true - */ - -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; -((_this select 0) in CSE_F_MODULE_OBJ_EH); \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_moduleIsActive_f.sqf b/TO_MERGE/cse/f_modules/functions/fn_moduleIsActive_f.sqf deleted file mode 100644 index 55e2205876..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_moduleIsActive_f.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * fn_moduleIsActive_f.sqf - * @Descr: Check if given module name is active. DEPRICATED. DO NOT USE. - * @Author: Glowbal - * - * @Arguments: [moduleName STRING] - * @Return: BOOL Returns true if moduel is currently active - * @PublicAPI: false - */ - -private ["_moduleName","_return","_condition"]; -_moduleName = _this select 0; -_return = false; - -_condition = [_moduleNAme] call cse_fnc_getModuleCondition_F; -if (!isnil "_condition") then { - call compile format["_return = %1;",_condition]; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/functions/fn_remoteModuleInit.sqf b/TO_MERGE/cse/f_modules/functions/fn_remoteModuleInit.sqf deleted file mode 100644 index bd37d9ecda..0000000000 --- a/TO_MERGE/cse/f_modules/functions/fn_remoteModuleInit.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * fn_remoteModuleInit.sqf - * @Descr: Called by remote execution script to initialize modules. - * @Author: Glowbal - * - * @Arguments: [[moduleName STRING, arguments ARRAY (Format: [argumentName STRING, value ANY])], ...] - * @Return: nil - * @PublicAPI: false - */ - -private ["_toinitalizeModules"]; -_toinitalizeModules = _this select 0; -sleep 5; -{ - [format["initalize module through Cfg REMOTE: %1",_x]] call cse_fnc_debug; - _x call cse_fnc_enableModule_f; -}foreach _toinitalizeModules; diff --git a/TO_MERGE/cse/f_modules/init.sqf b/TO_MERGE/cse/f_modules/init.sqf deleted file mode 100644 index 8524b1f20c..0000000000 --- a/TO_MERGE/cse/f_modules/init.sqf +++ /dev/null @@ -1,3 +0,0 @@ - - -cse_f_modules = true; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/post-init.sqf b/TO_MERGE/cse/f_modules/post-init.sqf deleted file mode 100644 index bbc3015f39..0000000000 --- a/TO_MERGE/cse/f_modules/post-init.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// Collect cfg modules and initalize them. -[] spawn { - // by waiting, we ensure that CSE Config modules aren't initalized before the modules have been. - sleep 5; - _toinitalizeModules = [MissionConfigFile] call cse_fnc_getCfgModuleInits_f; - { - [format["initalize module through cfg: %1",_x]] call cse_fnc_debug; - _x call cse_fnc_enableModule_f; - }foreach _toinitalizeModules; - - // Check if we want to collect server side modules - _allowCfg = ((getNumber(MissionConfigFile >> "Combat_Space_Enhancement" >> "DisableModuleConfig")) == 0); - if (isServer && _allowCfg) then { - _toinitalizeModules = [configFile] call cse_fnc_getCfgModuleInits_f; - - [format["initalize modules through server cfg: %1",_toinitalizeModules]] call cse_fnc_debug; - if !(_toinitalizeModules isEqualTo []) then { - [[_toinitalizeModules], "cse_fnc_remoteModuleInit", true, true] spawn BIS_fnc_MP; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/stringtable.xml b/TO_MERGE/cse/f_modules/stringtable.xml deleted file mode 100644 index 735441ee0b..0000000000 --- a/TO_MERGE/cse/f_modules/stringtable.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/CfgFunctions.h b/TO_MERGE/cse/f_states/CfgFunctions.h deleted file mode 100644 index b52b213890..0000000000 --- a/TO_MERGE/cse/f_states/CfgFunctions.h +++ /dev/null @@ -1,49 +0,0 @@ -class CfgFunctions { - class CSE { - class Carry { - file = "cse\cse_f_states\carry\functions"; - class carryObj { recompile = 1; }; - class carriedByObj { recompile = 1; }; - class getCarriedObj { recompile = 1; }; - class getCarriedBy { recompile = 1; }; - class beingCarried { recompile = 1; }; - class setCarriedBy { recompile = 1; }; /* Should not be used by other developers */ - }; - class Unconscious { - file = "cse\cse_f_states\unconscious\functions"; - class setUnconsciousState { recompile = 1; }; - class isUnconscious { recompile = 1; }; - class getUnconsciousCondition { recompile = 1; }; - class registerUnconsciousCondition { recompile = 1; }; - class setCaptiveSwitch { recompile = 1; }; - class moveToTempGroup { recompile = 1; }; - class canGoUnconsciousState { recompile = 1; }; - class setWeaponsCorrectUnconscious { recompile = 1; }; - }; - class Visual { - file = "cse\cse_f_states\visual\functions"; - class effectPain { recompile = 1; }; - class effectBleeding { recompile = 1; }; - class effectBlackOut { recompile = 1; }; - }; - class Movement { - file = "cse\cse_f_states\movement\functions"; - class limitMovementSpeed { recompile = 1; }; - class limitSpeed { recompile = 1; }; - }; - class Arrest { - file = "cse\cse_f_states\arrest\functions"; - class setArrestState { recompile = 1; }; - class isArrested { recompile = 1; }; - }; - class LoadPerson { - file = "cse\cse_f_states\LoadPerson\functions"; - class loadPerson_F { recompile = 1; }; - class loadPersonLocal_F {recompile = 1; }; - class makeCopyOfBody_F { recompile = 1; }; - class makeCopyOfBodyLocal_F { recompile = 1; }; - class unloadPerson_F { recompile = 1; }; - class cleanUpCopyOfBody_F { recompile = 1; }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/Combat_Space_Enhancement.h b/TO_MERGE/cse/f_states/Combat_Space_Enhancement.h deleted file mode 100644 index d729a8bb80..0000000000 --- a/TO_MERGE/cse/f_states/Combat_Space_Enhancement.h +++ /dev/null @@ -1,26 +0,0 @@ -class Combat_Space_Enhancement -{ - class EventHandlers - { - class PostInit_EventHandlers - { - class cse_f_states - { - init = " call compile preprocessFile 'cse\cse_f_states\init.sqf';"; - }; - }; - }; - - - class CustomEventHandlers { - class setUnconsciousState {}; // [unit, bool] - class setArrestState {}; // [unit, bool] - class carryObject {}; // [_unit, _to, _fallDown],"carryObject" - - class carryObjectDropped { - class cleanUpCopiesAfterDrag { // [unit, droppedObject] - onCall = "[_this select 1] call cse_fnc_cleanUpCopyOfBody_f;"; - }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/arrest/functions/fn_setArrestState.sqf b/TO_MERGE/cse/f_states/arrest/functions/fn_setArrestState.sqf deleted file mode 100644 index 306d2d4a2c..0000000000 --- a/TO_MERGE/cse/f_states/arrest/functions/fn_setArrestState.sqf +++ /dev/null @@ -1,43 +0,0 @@ -/** - * fn_setArrestState.sqf - * @Descr: Set a unit in arrest state - * @Author: Glowbal - * - * @Arguments: [unitToBeArrested OBJECT, setArrested BOOL] - * @Return: void - * @PublicAPI: true - */ - -private ["_unit","_setArrest"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; -_setArrest = [_this, 1, false, [false]] call BIS_fnc_Param; - -if (_setArrest) then { - [_unit, "cse_state_arrested", true] call cse_fnc_setVariable; - - if ([_unit] call cse_fnc_isAwake) then { - if (vehicle _unit == _unit) then { - [_unit,"UnaErcPoslechVelitele2",true] call cse_fnc_broadcastAnim; - }; - }; - if (IsPlayer _unit) then { - [["arrested", true],"cse_fnc_disableUserInput_f",_unit,false] call BIS_fnc_MP; - }; - _unit disableAI "Move"; - _unit disableAI "ANIM"; -} else { - [_unit, "cse_state_arrested", false] call cse_fnc_setVariable; - - if ([_unit] call cse_fnc_isAwake) then { - if (vehicle _unit == _unit) then { - [_unit,"",true] call cse_fnc_broadcastAnim; - }; - _unit enableAI "Move"; - _unit enableAI "ANIM"; - }; - if (IsPlayer _unit) then { - [["arrested", false],"cse_fnc_disableUserInput_f",_unit,false] call BIS_fnc_MP; - }; -}; - -[[_unit, _setArrest],"setArrestState"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_carryObj.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_carryObj.sqf deleted file mode 100644 index 06a4e3620c..0000000000 --- a/TO_MERGE/cse/f_states/carry/functions/fn_carryObj.sqf +++ /dev/null @@ -1,74 +0,0 @@ -/** - * fn_carryObj.sqf - * @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)] - * @Return: BOOL Returns true if succesful - * @PublicAPI: true - */ - -private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"]; -_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param; -_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param; -_fallDown = false; -if (count _this > 3) then { - _fallDown = _this select 3; -}; -_return = false; - - [format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call cse_fnc_debug; - - if (((typeName _to) == "OBJECT" && (isNull ([_unit] call cse_fnc_getCarriedObj))) || isNull _to) then { - if (vehicle _unit != _unit) exitwith {}; - if (!isNull _to) then { - if ((isNull ([_to] call cse_fnc_getCarriedObj)) && ([_unit] call cse_fnc_canInteract)) then { - _return = true; - _unit setvariable ["cse_carriedObj",_to,true]; - if (_fallDown) then { - // [_unit,_fallDown] call cse_fnc_limitMovementSpeed; - }; - [_to, _unit] call cse_fnc_setCarriedBy; - if (count _this > 2) then { - if (count (_this select 2) == 3) then { - _to attachTo [_unit,(_this select 2)]; - [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call cse_fnc_debug; - }; - } else { - [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call cse_fnc_debug; - }; - - [[_unit, _to, _fallDown],"carryObject"] call cse_fnc_customEventHandler_F; - - }; - } else { - if (!isNull ([_unit] call cse_fnc_getCarriedObj)) then { - [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call cse_fnc_debug; - _carriedObj = ([_unit] call cse_fnc_getCarriedObj); - - detach _carriedObj; - //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0]; - if (!surfaceIsWater getPos _unit) then { - _positionUnit = getPosATL _carriedObj; - _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1]; - _carriedObj setPosATL _positionUnit; - } else { - _positionUnit = getPosASL _carriedObj; - _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; - _carriedObj setPosASL _positionUnit; - }; - [[_unit, _carriedObj],"carryObjectDropped"] call cse_fnc_customEventHandler_F; - - [[_unit] call cse_fnc_getCarriedObj, objNull] call cse_fnc_setCarriedBy; - _unit setvariable ["cse_carriedObj",_to,true]; - _return = true; - - [[_unit, _to, _fallDown],"carryObject"] call cse_fnc_customEventHandler_F; - }; - }; - } else { - [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call cse_fnc_debug; - }; - - //[format["UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call cse_fnc_debug; -_return diff --git a/TO_MERGE/cse/f_states/config.cpp b/TO_MERGE/cse/f_states/config.cpp deleted file mode 100644 index 8a0a71a719..0000000000 --- a/TO_MERGE/cse/f_states/config.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#define _ARMA_ -class CfgPatches -{ - class cse_f_states - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"cse_main"}; - version = "0.5"; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; - }; -}; -class CfgAddons { - class PreloadAddons { - class cse_f_states { - list[] = {"cse_f_states"}; - }; - }; -}; -#include "CfgFunctions.h" -#include "Combat_Space_Enhancement.h" -#include "define.hpp" -#include "visual\empty.hpp" -#include "visual\effects.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa b/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa deleted file mode 100644 index ff12bd993e..0000000000 Binary files a/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa and /dev/null differ diff --git a/TO_MERGE/cse/f_states/data/cse_fadingblack.paa b/TO_MERGE/cse/f_states/data/cse_fadingblack.paa deleted file mode 100644 index 9ed471597c..0000000000 Binary files a/TO_MERGE/cse/f_states/data/cse_fadingblack.paa and /dev/null differ diff --git a/TO_MERGE/cse/f_states/data/cse_painscreen.paa b/TO_MERGE/cse/f_states/data/cse_painscreen.paa deleted file mode 100644 index 026f994fa9..0000000000 Binary files a/TO_MERGE/cse/f_states/data/cse_painscreen.paa and /dev/null differ diff --git a/TO_MERGE/cse/f_states/functions.sqf b/TO_MERGE/cse/f_states/functions.sqf deleted file mode 100644 index 53534edef1..0000000000 --- a/TO_MERGE/cse/f_states/functions.sqf +++ /dev/null @@ -1,104 +0,0 @@ -/* - -*/ - - - cse_fnc_setCanSwitchAnim = { - private ["_unit","_to","_return"]; - _unit = _this select 0; - _to = _this select 1; - _return = false; - if (((typeName _to) == "BOOL")) then { - _unit setvariable ["cse_canSwitchAnimation",_to,true]; - _return = true; - }; - _return - }; - cse_fnc_getCanSwitchAnim = { - private ["_unit","_return"]; - _unit = _this select 0; - _return = _unit getvariable "cse_canSwitchAnimation"; - _return - }; - - cse_fnc_setCurrentMenu = { - _unit = _this select 0; - _to = _this select 1; - _return = false; - if ((typeName _to) == "STRING") then { - _unit setvariable ["cse_currentMenu",_to,true]; - _return = true; - }; - _return - }; - cse_fnc_getCurrentMenu = { - _unit = _this select 0; - _return = _unit getvariable ["cse_currentMenu",""]; - _return - }; - - cse_fnc_changeBlurialVisionState = { - private ["_unit","_to"]; - _unit = _this select 0; - _to = _this select 1; - _return = false; - if (((typeName _to) == "SCALAR")) then { - if (_to < -1) then { - _to = -1; - } else { - if (_to > 1) then { - _to = 1; - }; - }; - _unit setvariable ["cse_blurialVisualState", [_unit] call cse_fnc_getBlurialVisionState + _to,false]; - _return = true; - }; - _return - }; - cse_fnc_getBlurialVisionState = { - private ["_unit"]; - _unit = _this select 0; - _return = _unit getvariable ["cse_blurialVisualState",0]; - _return - }; - - // EVERYTHING BELOW HERE IS STILL WORK IN PROGRESS - - cse_fnc_setMovementState = { - private ["_unit","_to"]; - _unit = _this select 0; - _to = _this select 1; - _return = false; - if (((typeName _to) == "SCALAR")) then { - _unit setvariable ["cse_movementState",_to,false]; - _return = true; - }; - _return - }; - cse_fnc_getMovementState = { - private ["_unit"]; - _unit = _this select 0; - _return = _unit getvariable ["cse_movementState",0]; - _return - }; - - cse_fnc_setHearingState = { - private ["_unit","_to"]; - _unit = _this select 0; - _to = _this select 1; - _return = false; - if (((typeName _to) == "SCALAR")) then { - _unit setvariable ["cse_hearingState",_to,false]; - _return = true; - }; - _return - }; - cse_fnc_getHearingState = { - private ["_unit"]; - _unit = _this select 0; - _return = _unit getvariable ["cse_hearingState",0]; - _return - }; - - - diff --git a/TO_MERGE/cse/f_states/init.sqf b/TO_MERGE/cse/f_states/init.sqf deleted file mode 100644 index 881e02b95d..0000000000 --- a/TO_MERGE/cse/f_states/init.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - -*/ - - call compileFinal preprocessFile "cse\cse_f_states\functions.sqf"; - - if (!isDedicated) then { - 45 cutRsc ["RscCSEScreenEffectsBlack","PLAIN"]; - }; - - if (isServer) then { - CSE_LOGIC_OBJECT = (createGroup sideLogic) createUnit ["logic", [1,1,1], [], 0, "FORM"]; - publicVariable "CSE_LOGIC_OBJECT"; - }; - - - ["cse_isDead",false,true,"cse"] call cse_fnc_defineVariable; - ["cse_isDeadPlayer", false, true, "cse"] call cse_fnc_defineVariable; - ["cse_state_arrested",false,true,"cse"] call cse_fnc_defineVariable; - ["cse_state_unconscious",false,true,"cse"] call cse_fnc_defineVariable; - ["CSE_ENABLE_REVIVE_SETDEAD_F",0,false,"cse"] call cse_fnc_defineVariable; - ["cse_carriedBy",objNull,false,"cse"] call cse_fnc_defineVariable; - - if (isnil "CSE_MARKED_FOR_GABAGE_COLLECTION") then { - CSE_MARKED_FOR_GABAGE_COLLECTION = []; - }; - - [] spawn { - waituntil { - { - deleteVehicle _x; - false; - }count CSE_MARKED_FOR_GABAGE_COLLECTION; - CSE_MARKED_FOR_GABAGE_COLLECTION = CSE_MARKED_FOR_GABAGE_COLLECTION - [objNull]; - false; - }; - }; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPersonLocal_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPersonLocal_f.sqf deleted file mode 100644 index 7a6cee7202..0000000000 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPersonLocal_f.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * fn_loadPersonLocal_f.sqf - * @Descr: Load a person, local - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, vehicle OBJECT, caller OBJECT] - * @Return: void - * @PublicAPI: false - */ - -private ["_unit","_vehicle","_caller","_handle","_loaded"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_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 cse_fnc_makeCopyOfBody_F; -}; - -_unit moveInCargo _vehicle; -_loaded = _vehicle getvariable ["cse_loaded_persons_F",[]]; -_loaded pushback _unit; -_vehicle setvariable ["cse_loaded_persons_F",_loaded,true]; -if (!([_unit] call cse_fnc_isAwake)) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit == _vehicle}; - sleep 0.5; - [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; - }; -} else { - if ([_unit] call cse_fnc_isArrested) then { - - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPerson_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPerson_f.sqf deleted file mode 100644 index 5181d74372..0000000000 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPerson_f.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/** - * fn_loadPerson_f.sqf - * @Descr: Loads a specified unit into any nearby vehicle - * @Author: Glowbal - * - * @Arguments: [caller OBJECT, unitToBeLoaded OBJECT] - * @Return: OBJECT Returns the vehicle that the unitToBeloaded has been loaded in. Returns ObjNull if function failed - * @PublicAPI: true - */ - -#define GROUP_SWITCH_ID "cse_fnc_loadPerson_F" - -private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"]; -_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; -_vehicle = ObjNull; - -if (!([_caller] call cse_fnc_canInteract) || {_caller == _unit}) exitwith {_vehicle}; - -_loadcar = nearestObject [_unit, "car"]; -if (_unit distance _loadcar <= 10) then { - _vehicle = _loadcar; -} else { - _loadhelicopter = nearestObject [_unit, "air"]; - if (_unit distance _loadhelicopter <= 10) then { - _vehicle = _loadhelicopter; - } else { - _loadtank = nearestObject [_unit, "tank"]; - if (_unit distance _loadtank <= 10) then { - _vehicle = _loadtank; - }; - }; -}; -if (!isNull _vehicle) then { - [_unit, true, GROUP_SWITCH_ID, side group _caller] call cse_fnc_switchToGroupSide_f; - [_caller,objNull] call cse_fnc_carryObj; - [_unit,objNull] call cse_fnc_carryObj; - [[_unit, _vehicle,_caller], "cse_fnc_loadPersonLocal_F", _unit, false] spawn BIS_fnc_MP; -}; -_vehicle \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBodyLocal_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBodyLocal_f.sqf deleted file mode 100644 index 8e00653978..0000000000 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBodyLocal_f.sqf +++ /dev/null @@ -1,62 +0,0 @@ -/** - * fn_makeCopyOfBodyLocal_f.sqf - * @Descr: Makes a copy of a dead body. For handling dead bodies for actions such as load and carry. - * @Author: Glowbal - * - * @Arguments: [oldBody OBJECT, newUnit OBJECT] - * @Return: void - * @PublicAPI: false - */ - -private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariables"]; -_oldBody = _this select 0; -_newUnit = _this select 1; - - if (alive _oldBody) exitwith {}; // we only want to do this for dead bodies - _name = _oldBody getvariable ["cse_name","unknown"]; - _allVariables = [_oldBody] call cse_fnc_getAllSetVariables; - // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] - { - [_newUnit,_x select 0, _x select 2] call cse_fnc_setVariable; - }foreach _allVariables; - _newUnit setVariable ["cse_name",_name,true]; - - _newUnit disableAI "TARGET"; - _newUnit disableAI "AUTOTARGET"; - _newUnit disableAI "MOVE"; - _newUnit disableAI "ANIM"; - _newUnit disableAI "FSM"; - _newUnit setvariable ["cse_isDead",true,true]; - - removeallweapons _newUnit; - removeallassigneditems _newUnit; - removeUniform _newUnit; - removeHeadgear _newUnit; - removeBackpack _newUnit; - removeVest _newUnit; - - - _newUnit addHeadgear (headgear _oldBody); - _newUnit addBackpack (backpack _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - _newUnit addVest (vest _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - _newUnit addUniform (uniform _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - {_newUnit addMagazine _x} count (magazines _oldBody); - {_newUnit addWeapon _x} count (weapons _oldBody); - {_newUnit addItem _x} count (items _oldBody); - - _newUnit selectWeapon (primaryWeapon _newUnit); - //[_newUnit,([_newUnit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; - - deleteVehicle _oldBody; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBody_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBody_f.sqf deleted file mode 100644 index 77b3147a2d..0000000000 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBody_f.sqf +++ /dev/null @@ -1,88 +0,0 @@ -/** - * fn_makeCopyOfBody_f.sqf - * @Descr: Makes a copy of a dead body. For handling dead bodies for actions such as load and carry. - * @Author: Glowbal - * - * @Arguments: [oldBody OBJECT, caller OBJECT] - * @Return: newUnit OBJECT Returns the copy of the unit. If no copy could be made, returns the oldBody - * @PublicAPI: false - */ - -private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariables"]; -_oldBody = _this select 0; -_caller = _this select 1; - - if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies - _name = _oldBody getvariable ["cse_name","unknown"]; - _class = typeof _oldBody; - _side = side _caller; - _group = createGroup _side; - _position = getPos _oldBody; - - _newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; - - _allVariables = [_oldBody] call cse_fnc_getAllSetVariables; - // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] - { - [_newUnit,_x select 0, _x select 2] call cse_fnc_setVariable; - }foreach _allVariables; - _newUnit setVariable ["cse_name",_name,true]; - - _newUnit disableAI "TARGET"; - _newUnit disableAI "AUTOTARGET"; - _newUnit disableAI "MOVE"; - _newUnit disableAI "ANIM"; - _newUnit disableAI "FSM"; - _newUnit setvariable ["cse_isDead",true,true]; - - removeallweapons _newUnit; - removeallassigneditems _newUnit; - removeUniform _newUnit; - removeHeadgear _newUnit; - removeBackpack _newUnit; - removeVest _newUnit; - - - _newUnit addHeadgear (headgear _oldBody); - _newUnit addBackpack (backpack _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - _newUnit addVest (vest _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - _newUnit addUniform (uniform _oldBody); - clearItemCargoGlobal (backpackContainer _newUnit); - clearMagazineCargoGlobal (backpackContainer _newUnit); - clearWeaponCargoGlobal (backpackContainer _newUnit); - - {_newUnit addMagazine _x} count (magazines _oldBody); - {_newUnit addWeapon _x} count (weapons _oldBody); - {_newUnit addItem _x} count (items _oldBody); - - _newUnit selectWeapon (primaryWeapon _newUnit); - //_newUnit playMoveNow ([_newUnit] call cse_fnc_getDeathAnim); - - deleteVehicle _oldBody; - - // try and clean it up entirely. - if (!isNull _oldBody) then { - - if (isMultiplayer) then { - _oldBody hideObjectGlobal true; - } else { - _oldBody hideObject true; - }; - _oldBody setvariable ["cse_originalCopy_f", true]; - _newUnit setvariable ["cse_copyOfBody_f", _oldBody]; - if (isnil "CSE_MARKED_FOR_GABAGE_COLLECTION") then { - CSE_MARKED_FOR_GABAGE_COLLECTION = []; - }; - CSE_MARKED_FOR_GABAGE_COLLECTION pushback _oldBody; - }; - - _newUnit setDamage 0.9; -_newUnit \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_unloadPerson_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_unloadPerson_f.sqf deleted file mode 100644 index bbfcf52b3f..0000000000 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_unloadPerson_f.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/** - * fn_unloadPerson_f.sqf - * @Descr: Unload a person from a vehicle - * @Author: Glowbal - * - * @Arguments: [caller OBJECT, unit OBJECT] - * @Return: BOOL Returns true if succesfully unloaded person - * @PublicAPI: true - */ - -#define GROUP_SWITCH_ID "cse_fnc_loadPerson_F" - -private ["_caller", "_unit","_vehicle", "_loaded"]; -_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; -_vehicle = vehicle _unit; - -if (_vehicle == _unit) exitwith {false;}; -if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;}; -if (!([_caller] call cse_fnc_isAwake)) exitwith{false;}; - -moveOut _unit; -unassignVehicle _unit; -if (!alive _unit) then { - _unit action ["Eject", vehicle _unit]; -}; - -[_unit, false, GROUP_SWITCH_ID, side group _caller] call cse_fnc_switchToGroupSide_f; - -_loaded = _vehicle getvariable ["cse_loaded_persons_F",[]]; -_loaded = _loaded - [_unit]; -_vehicle setvariable ["cse_loaded_persons_F",_loaded,true]; - -if (!([_unit] call cse_fnc_isAwake)) then { - _handle = [_unit,_vehicle] spawn { - private ["_unit","_vehicle"]; - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; - [format["Unit should move into death anim: %1", _unit]] call cse_fnc_Debug; - }; -} else { - if ([_unit] call cse_fnc_isArrested) then { - _handle = [_unit,_vehicle] spawn { - _unit = _this select 0; - _vehicle = _this select 1; - waituntil {vehicle _unit != _vehicle}; - [_unit,"UnaErcPoslechVelitele2",true] call cse_fnc_broadcastAnim; - [format["Unit should move into arrested anim: %1", _unit]] call cse_fnc_Debug; - }; - } else { - [format["Unit should move into normal anim: %1", _unit]] call cse_fnc_Debug; - }; -}; - -true; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/movement/functions/fn_limitMovementSpeed.sqf b/TO_MERGE/cse/f_states/movement/functions/fn_limitMovementSpeed.sqf deleted file mode 100644 index 9a807abfd9..0000000000 --- a/TO_MERGE/cse/f_states/movement/functions/fn_limitMovementSpeed.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/** - * fn_limitMovementSpeed.sqf - * @Descr: Limits the movement speed of a unit - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, fallDown BOOL (Optional)] - * @Return: void - * @PublicAPI: true - */ - -_this spawn { - private ["_unit","_carriedObj"]; - _unit = _this select 0; - _fallDown = false; - if (count _this > 1) then { - _fallDown = _this select 1; - }; - _carriedObj = [_unit] call cse_fnc_getCarriedObj; - while {sleep 1;_carriedObj = [_unit] call cse_fnc_getCarriedObj; ((!isNull _carriedObj) && (alive _unit))} do { - if (speed _unit > 12 && vehicle _unit == _unit) then { - [format["Unit ran to fast (Speed: %1, is now dropping carrying obj",speed _unit],2] call cse_fnc_debug; - if (_fallDown) then { - _unit playMove "amovppnemstpsraswrfldnon"; - }; - - if (_carriedObj isKindOf "Man") then { - hint "You can not move this fast while transporting this person."; - } else { - hint "You can not move this fast while carrying this object"; - }; - [_unit,ObjNull] call cse_fnc_carryObj; - }; - }; -}; diff --git a/TO_MERGE/cse/f_states/movement/functions/fn_limitSpeed.sqf b/TO_MERGE/cse/f_states/movement/functions/fn_limitSpeed.sqf deleted file mode 100644 index 24af4ff1af..0000000000 --- a/TO_MERGE/cse/f_states/movement/functions/fn_limitSpeed.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/** - * fn_limitSpeed.sqf - * @Descr: Limits the speed of an object - * @Author: Glowbal - * - * @Arguments: [vehicle OBJECT, maxSpeed NUMBER] - * @Return: void - * @PublicAPI: true - */ - -_this spawn { - private ["_vehicle", "_maxSpeed", "_velocity"]; - - _vehicle = _this select 0; - _maxSpeed = _this select 1; - if ((_vehicle getvariable ["cse_f_limitSpeed",false])) then { - _vehicle setvariable ["cse_f_limitSpeed",nil,true]; - }; - - if (_maxSpeed < 0) exitwith {}; - _vehicle setvariable ["cse_f_limitSpeed",true,true]; - - waitUntil { - _speed = speed _vehicle; - if (_speed > _maxSpeed) then { - _velocity = velocity _vehicle; - _x = _velocity select 0; - _y = _velocity select 1; - _z = _velocity select 2; - - _diff = _speed - _maxSpeed; - _percentage = (_speed / 100) * _diff; - _newVelocity = [_x - (_x * _percentage), _y - (_y * _percentage), _z - (_z * _percentage)]; - _vehicle setVelocity _newVelocity; - }; - !(_vehicle getvariable ["cse_f_limitSpeed",false]) - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/stringtable.xml b/TO_MERGE/cse/f_states/stringtable.xml deleted file mode 100644 index db81cc6d02..0000000000 --- a/TO_MERGE/cse/f_states/stringtable.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_getUnconsciousCondition.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_getUnconsciousCondition.sqf deleted file mode 100644 index 6e3018baba..0000000000 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_getUnconsciousCondition.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * fn_getUnconsciousCondition.sqf - * @Descr: get whatever or not a unit should be or stay unconscious - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: BOOL True when the unit should be unconscious - * @PublicAPI: true - */ - -private ["_unit","_return"]; -_unit = _this select 0; - - -if (isnil "CSE_UNCONSCIOUS_CONDITIONS_F") then { - CSE_UNCONSCIOUS_CONDITIONS_F = []; -}; - -_return = false; -{ - - - if (typeName _x == typeName {}) then { - if (([_unit] call _x)) then { - _return = true; - }; - - }; - - if (_return) exitwith{}; -}foreach CSE_UNCONSCIOUS_CONDITIONS_F; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_moveToTempGroup.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_moveToTempGroup.sqf deleted file mode 100644 index 48df97777e..0000000000 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_moveToTempGroup.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_moveToTempGroup_f.sqf - * Moves a unit into a temporarly group and stores its original group to allow rejoining. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, moveToTempGroup BOOL] - * @Return: void - * @PublicAPI: false - */ - -private ["_unit","_moveTo","_previousGroup","_newGroup", "_currentGroup", "_switchToGroup"]; -_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_moveTo = [_this, 1,false,[false]] call BIS_fnc_Param; - -if (_moveTo) then { - _previousGroup = group _unit; - _newGroup = createGroup (side _previousGroup); - [_unit] joinSilent _newGroup; - _unit setvariable ["cse_previous_group_f",_previousGroup]; -} else { - _previousGroup = _unit getvariable "cse_previous_group_f"; - if (!isnil "_previousGroup") then { - _currentGroup = group _unit; - _unit setvariable ["cse_previous_group_f",nil]; - [_unit] joinSilent _previousGroup; - if (count units _currentGroup == 0) then { - deleteGroup _currentGroup; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_setUnconsciousState.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_setUnconsciousState.sqf deleted file mode 100644 index 8ae7c75172..0000000000 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_setUnconsciousState.sqf +++ /dev/null @@ -1,95 +0,0 @@ -/** - * fn_setUnconsciousState.sqf - * @Descr: Sets a unit in the unconscious state - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: void - * @PublicAPI: true - */ - - -private ["_unit", "_animState", "_dAnim"]; -_unit = _this select 0; - -_dAnim = ([_unit] call cse_fnc_getDeathAnim); -if !([_unit] call cse_fnc_canGoUnconsciousState) exitwith{}; -if (!local _unit) exitwith { - [[_unit], "cse_fnc_setUnconsciousState", _unit, false] spawn BIS_fnc_MP; -}; - -// get rid of the object we are carrying, before we go unconscious. -[_unit, ObjNull, [0,0,0]] call cse_fnc_carryObj; - -_unit setvariable ["cse_state_unconscious",true,true]; -[_unit] call cse_fnc_setWeaponsCorrectUnconscious; - -_animState = animationState _unit; - -_originalPos = unitPos _unit; -if (isPlayer _unit) then { - [] call cse_fnc_closeAllDialogs_f; - [true] call cse_fnc_effectBlackOut; - ["unconscious", true] call cse_fnc_disableUserInput_f; - [false] call cse_fnc_setVolume_f; - - /* Disable this, because the disableUserInput function call above - users already cannot leave vehicles because of that function. */ - //[_unit] spawn cse_fnc_lockVehicleOfUnitUntil; -} else { - _unit setUnitPos "DOWN"; - [_unit, true] call cse_fnc_disableAI_F; -}; -[_unit, true, "cse_unconsciousState", side group _unit] call cse_fnc_switchToGroupSide_f; - -_captiveSwitch = [_unit, true] call cse_fnc_setCaptiveSwitch; -_unit setUnconscious true; -[_unit, _dAnim] call cse_fnc_localAnim; - -[_unit,_animState, _captiveSwitch, _originalPos] spawn { - private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch"]; - _unit = _this select 0; - _oldAnimation = _this select 1; - _captiveSwitch = _this select 2; - _originalPos = _this select 3; - - _minWaitingTime = (round(random(10)+5)); - _counter = time; - while {(((time - _counter) < _minWaitingTime) && {alive _unit})} do { - if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(alive _unit)} && {(isNull ([_unit] call cse_fnc_getCarriedBy))}) then { - [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; - }; - sleep 0.1; - }; - waituntil{(!([_unit] call cse_fnc_getUnconsciousCondition) || !alive _unit)}; - [format["setUnconsciousState false - %1",_unit]] call cse_fnc_debug; - sleep 0.5; - if (_captiveSwitch) then { - [_unit, false] call cse_fnc_setCaptiveSwitch; - }; - _unit setUnconscious false; - [_unit, false, "cse_unconsciousState", side group _unit] call cse_fnc_switchToGroupSide_f; - - if (isPlayer _unit) then { - [false] call cse_fnc_effectBlackOut; - [true] call cse_fnc_setVolume_f; - ["unconscious", false] call cse_fnc_disableUserInput_f; - } else { - [_unit, false] call cse_fnc_disableAI_F; - _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) - }; - - waituntil {!([_unit] call cse_fnc_beingCarried)}; - if (alive _unit) then { - if (vehicle _unit == _unit) then { - [format["Resetting unit animiation to normal %1",_unit]] call cse_fnc_debug; - //[_unit,"",false] call cse_fnc_broadcastAnim; - [_unit,"amovppnemstpsnonwnondnon",false] call cse_fnc_broadcastAnim; - } else { - [format["Resetting unit animiation to oldAnimation %1 - %2",_unit, _oldAnimation]] call cse_fnc_debug; - [_unit, _oldAnimation,false] call cse_fnc_broadcastAnim; - }; - _unit setvariable ["cse_state_unconscious", false, true]; - }; - [[_unit, false],"setUnconsciousState"] call cse_fnc_customEventHandler_F; -}; -[[_unit, true],"setUnconsciousState"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/visual/effects.hpp b/TO_MERGE/cse/f_states/visual/effects.hpp deleted file mode 100644 index 17301fe662..0000000000 --- a/TO_MERGE/cse/f_states/visual/effects.hpp +++ /dev/null @@ -1,312 +0,0 @@ -class RscTitles{ - class RscCSEScreenEffectsBlack { - duration = 10e10; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEFadingBlackUI', _this select 0];"; - - class controlsBackground { - class cse_BlackScreen: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\black_out1.paa"; - colorText[] = {0.0, 0.0, 0.0, 0.0}; - idc = 11112; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class RscCSEScreenEffectsPain { - duration = 1; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEPainScreen', _this select 0];"; - - class controlsBackground { - class cse_PainScreen: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\pain_screen3.paa"; - colorText[] = {1, 1, 1, 0.5}; - idc = 11114; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class RscCSEScreenEffectsBleeding { - duration = 1; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEBleedingScreen', _this select 0];"; - - class controlsBackground { - class cse_BleedingScreen: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\cse_bleedingScreen_v5.paa"; - colorText[] = {0.9, 0.2, 0.2, 0.6}; - idc = 11113; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class RscCSEScreenEffectsHit{ - duration = 1.1; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEHitScreen', _this select 0];"; - - class controlsBackground { - class cse_EffectHit: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\hit_screen1.paa"; - colorText[] = {0.7, 0.2, 0.2, 0.4}; - idc = 11113; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class RscCSEScreenEffectsHitPain{ - duration = 1.1; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEHitPainScreen', _this select 0];"; - - class controlsBackground { - class cse_EffectHitNew: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\hit_screen1.paa"; - colorText[] = {0.9, 0.9, 0.9, 0.7}; - idc = 11113; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; -class RscCSEScreenEffectsBlur { - duration = 2; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSEBlurScreen', _this select 0];"; - - class controlsBackground { - class cse_BlurScreen: cse_gui_backgroundBase { - text = "cse\cse_f_states\data\cse_blurryScreen.paa"; - colorText[] = {0.5, 0.5, 0.5, 0.2}; - idc = 11114; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class cse_progressBar_Sample { - idd = -1; - onLoad = "uiNamespace setVariable ['cse_progressBar_Sample', _this select 0]; "; - fadein = 0; - fadeout = 0; - duration = 10e10; - class Controls { - - class background: cse_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: cse_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}; - // colorBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - }; - }; - }; - - - class CSE_DISPLAY_MESSAGE { - duration = 7; - idd = 86411; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSE_DISPLAY_MESSAGE', _this select 0];"; - fadein = 0; - class controlsBackground { - class header: cse_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 CSE_DISPLAY_INFORMATION { - duration = 15; - idd = 86412; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSE_DISPLAY_INFORMATION', _this select 0];"; - fadein = 0; - class controlsBackground { - class header: cse_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: cse_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"; - - }; - - }; - }; - - class CSE_DISPLAY_MESSAGE_CONCEPT { - duration = 15; - idd = 86413; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSE_DISPLAY_MESSAGE_CONCEPT', _this select 0];"; - fadein = 0; - class controlsBackground { - class header: cse_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 + ST_SHADOW; - font = "EtelkaMonospacePro"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 1.0}; - colorBackground[] = {0, 0, 0, 0.0}; - text = ""; - shadow = 2; - }; - class text: header { - idc = 2; - y = "safezoneY + (31 * (safeZoneH / 40))"; - w = "(safeZoneW / 10) * 1.3"; - text = ""; - }; - }; - }; - - class CSE_sys_field_rations_PlayerStatusUI { - duration = 1e+011; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['CSE_sys_field_rations_PlayerStatusUI', _this select 0];"; - class controlsBackground { - class FoodStatus: cse_gui_backgroundBase { - text = "cse\cse_sys_field_rations\data\hud_foodstatus.paa"; - colorText[] = {0.0,1.0,0.0,0.4}; - idc = 11112; - x = (safezoneW + safezoneX) - (2 * (((safezoneW / safezoneH) min 1.2) / 40)); - y = "28 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.75 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class drinkStatus: cse_gui_backgroundBase { - text = "cse\cse_sys_field_rations\data\hud_drinkstatus.paa"; - colorText[] = {0.0,1.0,0.0,0.4}; - idc = 11113; - x = (safezoneW + safezoneX) - (2 * (((safezoneW / safezoneH) min 1.2) / 40)); - y = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.75 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - /* class CamelBak: cse_gui_backgroundBase { - text = "cse\cse_sys_field_rations\data\hud_camelbak.paa"; - colorText[] = {0.0,1.0,0.0,0}; - idc = 11114; - x = "0.955313 * safezoneW + safezoneX"; - y = "0.80 * safezoneH + safezoneY"; - w = 0.05; - h = 0.09; - };*/ - }; - }; - -// class RscHealthTextures { -// onload = "uinamespace setvariable ['RscHealthTextures',_this select 0]; ['RscHealthTextures has activated'] call cse_fnc_debug;"; - // }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/visual/empty.hpp b/TO_MERGE/cse/f_states/visual/empty.hpp deleted file mode 100644 index 5489ad8565..0000000000 --- a/TO_MERGE/cse/f_states/visual/empty.hpp +++ /dev/null @@ -1,21 +0,0 @@ -class cse_empty_screen { - idd = 679123; - movingEnable = false; - onLoad = "uiNamespace setVariable ['cse_empty_screen', _this select 0];"; - onUnload = "if (!isnil 'CSE_DISABLE_USER_INPUT_SCREEN') then { createDialog 'cse_empty_screen';};"; - class controlsBackground { - class cse_background : cse_gui_backgroundBase { - idc = 1; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - text = ""; - moving = 0; - }; - }; - - class controls { - - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/visual/functions/fn_effectBlackOut.sqf b/TO_MERGE/cse/f_states/visual/functions/fn_effectBlackOut.sqf deleted file mode 100644 index 61a3951517..0000000000 --- a/TO_MERGE/cse/f_states/visual/functions/fn_effectBlackOut.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * fn_effectBlackOut.sqf - * @Descr: Displays the blacked out effect for clients. - * @Author: Glowbal - * - * @Arguments: [displayEffect BOOL] - * @Return: void - * @PublicAPI: true - */ - -private ["_displayEffect","_CSEFadingBlackUI"]; -_displayEffect = [_this, 0, false,[false]] call bis_fnc_param; -disableSerialization; -_CSEFadingBlackUI = uiNamespace getVariable "CSEFadingBlackUI"; -if (_displayEffect) then { - (_CSEFadingBlackUI displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.9]; -} else { - (_CSEFadingBlackUI displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.0]; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/visual/functions/fn_effectBleeding.sqf b/TO_MERGE/cse/f_states/visual/functions/fn_effectBleeding.sqf deleted file mode 100644 index 97f17c259f..0000000000 --- a/TO_MERGE/cse/f_states/visual/functions/fn_effectBleeding.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_effectBleeding.sqf - * @Descr: Displays the CSE Bleeding effect - * @Author: Glowbal - * - * @Arguments: [bloodLoss NUMBER] - * @Return: void - * @PublicAPI: true - */ - -private ["_handle"]; -if (isnil "cseDisplayingBleedingEffect") then { - cseDisplayingBleedingEffect = false; -}; -if (cseDisplayingBleedingEffect) exitwith {}; -_handle = _this spawn { - private ["_unit","_bloodLoss","_time"]; - _bloodLoss = _this select 0; - if (!(_bloodLoss > 0)) exitwith{}; - _time = 6 - _bloodLoss; - if (_time <1.5) then { - _time = 1.5; - }; - cseDisplayingBleedingEffect = true; - 47 cutRsc ["RscCSEScreenEffectsBleeding","PLAIN"]; - sleep _time; - cseDisplayingBleedingEffect = false; -}; - -_handle \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/visual/functions/fn_effectPain.sqf b/TO_MERGE/cse/f_states/visual/functions/fn_effectPain.sqf deleted file mode 100644 index 8f3cdb3d35..0000000000 --- a/TO_MERGE/cse/f_states/visual/functions/fn_effectPain.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/** - * fn_effectPain.sqf - * @Descr: Displays the CSE Pain effect - * @Author: Glowbal - * - * @Arguments: [painRatio NUMBER] - * @Return: void - * @PublicAPI: true - */ - -if (isnil "cseDisplayingPainEffect") then { - cseDisplayingPainEffect = false; -}; -if (cseDisplayingPainEffect) exitwith {}; -_this spawn { - private ["_ratio","_time"]; - _ratio = _this select 0; - if (!(_ratio > 0)) exitwith{}; - _time = 6 - _ratio; - if (_time <1.5) then { - _time = 1.5; - }; - cseDisplayingPainEffect = true; - 46 cutRsc ["RscCSEScreenEffectsPain","PLAIN"]; - sleep _time; - cseDisplayingPainEffect = false; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/CfgFunctions.h b/TO_MERGE/cse/gui/CfgFunctions.h deleted file mode 100644 index ef4e5c25b2..0000000000 --- a/TO_MERGE/cse/gui/CfgFunctions.h +++ /dev/null @@ -1,61 +0,0 @@ -class CfgFunctions { - class CSE - { - class GUI - { - file = "cse\cse_gui\functions"; - class gui_keyPressed { recompile = 1; }; - class gui_createInteractionMenu { recompile = 1; }; - class gui_addMenuEntry { recompile = 1; }; - class gui_getMenuEntries { recompile = 1; }; - class gui_displaySubMenuButtons { recompile = 1; }; - class gui_hideSubMenuButtons { recompile = 1; }; - class gui_hideSubSubMenuButtons { recompile = 1; }; - class gui_sortMenuEntries { recompile = 1; }; - class gui_refreshLastSubMenu { recompile = 1; }; - class gui_displayEventHandler { recompile = 1; }; - class gui_loadingBar { recompile = 1; }; - class gui_hasOptionAvailable { recompile = 1; }; - class gui_displayInformation { recompile = 1; }; - class gui_displayMessage { recompile = 1; }; - class gui_blurScreen { recompile = 1; }; - class gui_displayIcon { recompile = 1; }; - }; - class RadialMenu { - file = "cse\cse_gui\radialmenu"; - class findTargetOfMenu_GUI { recompile = 1; }; - class openRadialMenu_GUI {recompile = 1; }; - class openRadialSubMenu_GUI {recompile = 1; }; - class setRadialMenuOptions_GUI {recompile = 1; }; - class setRadialMenuName_GUI { recompile = 1; }; - class getcurrentRadialTarget_GUI { recompile = 1; }; - class returnToPreviousSubMenu_GUI { recompile = 1; }; - class setRadialSecondRing_GUI { recompile = 1; }; - class openRadialSecondRing_GUI { recompile = 1; }; - class closeRadialSecondRing_GUI { recompile = 1; }; - class setRadialMenuTargetName_GUI { recompile = 1; }; - class findtargetName_GUI { recompile = 1;}; - class setRadialOptionSelected_GUI { recompile = 1; }; - class isRadialOptionSelected_GUI { recompile = 1; }; - class isOpenSecondRing_GUI { recompile = 1; }; - class addEntryToRadialInteraction_F { recompile = 1; }; - class createRadialInteraction_F { recompile = 1; }; - class getRadialInteractionEntries_F { recompile = 1; }; - class openRadialInteractionMenu_F { recompile = 1; }; - class radialUsesSorter_F { recompile = 1; }; - class getEntryToMenuSorter_F { recompile = 1; }; - class addEntryToMenuSorter_F { recompile = 1; }; - class createCategoryRadialMenu_F { recompile = 1; }; - class getAllCategoryEntriesRadialMenu_F { recompile = 1; }; - class addCategoryEntryRadialMenu_F { recompile = 1; }; - class hasEntriesRadialInteraction_F { recompile = 1; }; - class addMultipleEntriesToRadialCategory_F { recompile = 1; }; - class getIcon_F { recompile = 1; }; - class categoryHasActionsAvailable_F { recompile = 1; }; - }; - class WeaponSelector { - file = "cse\cse_gui\WeaponSelector"; - class onWeaponSelectorOpened_GUI { recompile = 1; }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/Combat_Space_Enhancement.h b/TO_MERGE/cse/gui/Combat_Space_Enhancement.h deleted file mode 100644 index 62d1708f5c..0000000000 --- a/TO_MERGE/cse/gui/Combat_Space_Enhancement.h +++ /dev/null @@ -1,13 +0,0 @@ -class Combat_Space_Enhancement { - class EventHandlers { - class PostInit_EventHandlers { - class cse_gui { - init = " call compile preprocessFile 'cse\cse_gui\init.sqf';"; - }; - }; - }; - - class CustomEventHandlers { - class openRadialMenu {}; // [_menuName, _entries, _target] - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/GUI.h b/TO_MERGE/cse/gui/GUI.h deleted file mode 100644 index 4e22d8ae32..0000000000 --- a/TO_MERGE/cse/gui/GUI.h +++ /dev/null @@ -1,10 +0,0 @@ -#include "gui\define.hpp" -#include "gui\interactionMenu.hpp" -#include "gui\interactionMenu_white.hpp" -#include "gui\radial.h" -#include "gui\cseLogoPlain.hpp" -#include "gui\dynamicMenu.h" -#include "gui\RscTitles.h" - - -// #include "gui\weapon_selector.h" \ No newline at end of file diff --git a/TO_MERGE/cse/gui/config.cpp b/TO_MERGE/cse/gui/config.cpp deleted file mode 100644 index 918a9208b3..0000000000 --- a/TO_MERGE/cse/gui/config.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#define _ARMA_ -class CfgPatches -{ - class cse_gui - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"a3_ui_f", "cse_main"}; - version = "0.10.0_rc"; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; - }; -}; -class CfgAddons { - class PreloadAddons { - class cse_gui { - list[] = {"cse_gui"}; - }; - }; -}; - -#include "CfgFunctions.h" -#include "Combat_Space_Enhancement.h" -#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/gui/data/background_gradient.paa b/TO_MERGE/cse/gui/data/background_gradient.paa deleted file mode 100644 index 0a56125f7a..0000000000 Binary files a/TO_MERGE/cse/gui/data/background_gradient.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf b/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf deleted file mode 100644 index 5c45c5f466..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/** - * fn_addCatagoryEntry.sqf - * @Descr: Add a Catagory entry to a menu - * @Author: Glowbal - * - * @Arguments: [menuName STRING, categoryName STRING, code CODE, condition CODE] - * @Return: void - * @PublicAPI: true - */ - -private ["_menuName","_catagoryName","_code","_condition","_foundMenuName","_foundEntryName","_counter","_onPosMenu","_onPosCatagory","_catagoryCounter","_entryCollection","_entry"]; -_menuName = [_this,0,"",[""]] call BIS_fnc_Param; -_catagoryName = [_this,1, "",[""]] call BIS_fnc_Param; -_code = [_this,2,{},[{}]] call BIS_fnc_Param; -_condition = [_this,3,{},[{}]] call BIS_fnc_Param; - - -if (isnil "CSE_CATAGORY_LIST_ENTRIES") then { - CSE_CATAGORY_LIST_ENTRIES = []; -}; - -_foundMenuName = false; -_foundEntryName = false; -_onPosMenu = 0; -_onPosCatagory = 0; -_counter = 0; -{ - if ((_x select 0) == _menuName) exitwith { - // found entry - _foundMenuName = true; - _onPosMenu = _counter; - _catagoryCounter = 0; - { - if ((_x select 0) == _catagoryName) exitwith { - _foundEntryName = true; - _onPosCatagory = _catagoryCounter; - }; - _catagoryCounter = _catagoryCounter + 1; - }foreach (_x select 1); - }; - _counter = _counter + 1; -}foreach CSE_CATAGORY_LIST_ENTRIES; - - -if (!_foundMenuName) then { -} else { - if (!_foundEntryName) then { - } else { - _entry = [_catagoryName,_condition,_code]; - _arrayOfCatagories = CSE_CATAGORY_LIST_ENTRIES select _onPosMenu; - _entryCollection = _arrayOfCatagories select _onPosCatagory; - _entryCollection pushback _entry; - }; -}; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_addCatagory.sqf b/TO_MERGE/cse/gui/functions/fn_gui_addCatagory.sqf deleted file mode 100644 index 0d4e91bc19..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_addCatagory.sqf +++ /dev/null @@ -1,76 +0,0 @@ -/** - * fn_gui_addCatagory.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_catagoryCounter","_catagoryName","_condition","_priority","_foundEntryName","_foundMenuName", "_counter","_onPosCatagory","_onPosMenu","_catagoryCounter","_arrayOfCatagories"]; -_menuName = _this select 0; -_catagoryName = _this select 1; -_condition = _this select 2; -_priority = _this select 3; - - -if (isnil "CSE_CATAGORY_LIST_ENTRIES") then { - CSE_CATAGORY_LIST_ENTRIES = []; - CSE_CATAGORY_LIST_ENTRIES pushback [_menuName,[_catagoryName, [] ] ]; -}; - -_foundMenuName = false; -_foundEntryName = false; -_onPosMenu = 0; -_onPosCatagory = 0; -{ - if ((_x select 0) == _menuName) exitwith { - _foundMenuName = true; - _onPosMenu = _foreachIndex; - _catagoryCounter = 0; - { - if ((_x select 0) == _catagoryName) exitwith { - _foundEntryName = true; - _onPosCatagory = _catagoryCounter; - }; - _catagoryCounter = _catagoryCounter + 1; - }foreach (_x select 1); - }; -}foreach CSE_CATAGORY_LIST_ENTRIES; - -if (!_foundMenuName) then { - CSE_CATAGORY_LIST_ENTRIES pushback [_menuName,[_catagoryName, [] ] ]; -} else { - if (!_foundEntryName) then { - _arrayOfCatagories = CSE_CATAGORY_LIST_ENTRIES select _onPosMenu; - _arrayOfCatagories pushback [_catagoryName, [] ]; - }; -}; - - - cse_fnc_gui_getCatagoryEntries = { - - if (isnil "CSE_CATAGORY_LIST_ENTRIES") { - CSE_CATAGORY_LIST_ENTRIES = []; - }; - _return = []; - - { - if ((_x select 0) == (_this select 0)) exitwith { - { - if ((_x select 0) == (_this select 1)) exitwith { - _return = _x select 1; - }; - }foreach (_x select 1); - }; - }foreach CSE_CATAGORY_LIST_ENTRIES - - _return - }; - - [_menuName,_catagoryName + " >",_condition,{ - [_catagoryName,_this select 2,[_menuName,_catagoryName] call cse_fnc_gui_getCatagoryEntries] call cse_fnc_gui_displaySubMenuButtons; - },_priority] call cse_fnc_gui_addMenuEntry; - - diff --git a/TO_MERGE/cse/gui/functions/fn_gui_addCatagoryEntry.sqf b/TO_MERGE/cse/gui/functions/fn_gui_addCatagoryEntry.sqf deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf b/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf deleted file mode 100644 index 6cd4b22d01..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/** - * fn_gui_addMenuEntry.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -if (isDedicated) exitwith { [format["GUI - fnc_gui_addMenuEntry EXIT ON DEDICATED"],2] call cse_fnc_debug;}; - -if (isnil "cse_gui_availableMenuOptions") then { - cse_gui_availableMenuOptions = []; -}; -private ["_menuName","_optionName","_menuCondition","_menuAction","_priority"]; - _menuName = _this select 0; - _optionName = _this select 1; - _menuCondition = _this select 2; - _menuAction = _this select 3; - _priority = _this select 4; - -_MENU_VAR = format["CSE_GUI_MENU_OPTIONS_%1", _menuName]; -if (isnil _MENU_VAR) then { - call compile format["%1 = [];",_MENU_VAR]; -}; - -//[format["GUI - fnc_gui_addMenuEntry %1",_this, _MENU_VAR],2] call cse_fnc_debug; - -[_menuName,_optionName,_menuCondition,_menuAction,_priority] call compile format["%1 pushback _this;",_MENU_VAR]; - - //cse_gui_availableMenuOptions = cse_gui_availableMenuOptions + [[_menuName,_optionName,_menuCondition,_menuAction,_priority]]; - -/* -CSE_CONDITION_COMPARE_ARRAY_conditionCompareArray = []; -if (isnil 'CSE_CONDITION_COMPARE_CACHE') then { - CSE_CONDITION_COMPARE_CACHE = []; -}; -{ - _condition = _x select 2; - if !(_condition in CSE_CONDITION_COMPARE_CACHE) then { - CSE_CONDITION_COMPARE_CACHE set [ count CSE_CONDITION_COMPARE_CACHE , _condition ]; - } else { - player sidechat format["CACHING CONDITION: %1",_x]; - _x set [ 2 , CSE_CONDITION_COMPARE_CACHE find _condition]; - }; -}foreach (call compile (format["%1",_MENU_VAR]));*/ \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_blurScreen.sqf b/TO_MERGE/cse/gui/functions/fn_gui_blurScreen.sqf deleted file mode 100644 index 9c9a901dd4..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_blurScreen.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * fn_gui_blurScreen.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: true - */ - -private ["_id", "_show"]; -_id = [_this, 0, "", [""]] call BIS_fnc_Param; -_show = [_this, 1, false, [false]] call BIS_fnc_Param; - -if (isnil "CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION") then { - CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION = []; -}; - -if (_show) then { - CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION pushback _id; - // show blur - if (isnil 'CSE_MENU_ppHandle_GUI_BLUR_SCREEN') then { - CSE_MENU_ppHandle_GUI_BLUR_SCREEN = ppEffectCreate ["DynamicBlur", 102]; - CSE_MENU_ppHandle_GUI_BLUR_SCREEN ppEffectAdjust [0.9]; - CSE_MENU_ppHandle_GUI_BLUR_SCREEN ppEffectEnable true; - CSE_MENU_ppHandle_GUI_BLUR_SCREEN ppEffectCommit 0; - }; -} else { - CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION = CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION - [_id]; - if (CSE_GUI_SHOW_BLUR_SCREEN_COLLECTION isEqualTo []) then { - // hide blur - if (!isnil 'CSE_MENU_ppHandle_GUI_BLUR_SCREEN') then { - ppEffectDestroy CSE_MENU_ppHandle_GUI_BLUR_SCREEN; - CSE_MENU_ppHandle_GUI_BLUR_SCREEN = nil; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_createInteractionMenu.sqf b/TO_MERGE/cse/gui/functions/fn_gui_createInteractionMenu.sqf deleted file mode 100644 index 859aaf04c8..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_createInteractionMenu.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * fn_gui_createInteractionMenu.sqf - * @Descr: Creates a interaction menu - * @Author: Glowbal - * - * @Arguments: [name STRINg, keybinding ARRAY, idd NUMBER, condition CODE, type NUMBER] - * @Return: void - * @PublicAPI: true - */ - -private ["_name","_condition","_keyBinding","_idd","_type","_codeToExecute"]; -_name = _this select 0; -_keyBinding = _this select 1; -_idd = _this select 2; -_condition = _this select 3; -_type = _this select 4; - -_codeToExecute = compile format[ "%1 call cse_fnc_gui_keyPressed;", [_name,_condition,_type] ]; -[_name, _keyBinding, _codeToExecute, _idd] call cse_fnc_addKeyBindingForMenu_F; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayEventHandler.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displayEventHandler.sqf deleted file mode 100644 index 083a12ed26..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_displayEventHandler.sqf +++ /dev/null @@ -1,74 +0,0 @@ -/** - * fn_gui_displayEventHandler.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -[] spawn { - waitUntil {!isNull player && (player == player) && !(isNull (findDisplay 46))}; - CSE_KEY_COUNTER = 0; - CSE_DISPLAY_MENU = false; - CSE_MENU_ONRELEASE = false; - - - CSE_KEY_PRESSED_HANDLER = { - // state of Shift, Ctrl and Alt - //if (!(_this select 2)) then { - if !([player] call cse_fnc_isAwake) exitwith{}; - _MENU_VAR = format['CSE_GUI_MENU_%1', (_this select 1)]; - if (isnil _MENU_VAR) exitwith {}; - - _menu = (call compile _MENU_VAR) select 0; - - _states = _menu select 4; - if (((_states select 1) == 0) && (_this select 2)) exitwith {}; - if (((_states select 1) == 1) && !(_this select 2)) exitwith {}; - - if (((_states select 2) == 0) && (_this select 3)) exitwith {}; - if (((_states select 2) == 1) && !(_this select 3)) exitwith {}; - - if (((_states select 3) == 0) && (_this select 4)) exitwith {}; - if (((_states select 3) == 1) && !(_this select 4)) exitwith {}; - - if (CSE_DISPLAY_MENU && !CSE_KEY_RELEASED) exitwith {}; - if (CSE_DISPLAY_MENU && CSE_KEY_RELEASED) exitwith { closeDialog 145201;}; - if (dialog) exitwith { closeDialog 0; }; - - _STARTINGTIME = time; - CSE_DISPLAY_MENU = true; - CSE_KEY_RELEASED = false; - //null = [_this,_STARTINGTIME,(call compile _MENU_VAR) select 0] spawn { - _handle = [_this,_STARTINGTIME] spawn { - waituntil{CSE_KEY_RELEASED || (time - ((_this select 1)) > 0.25)}; - if (!CSE_KEY_RELEASED) then { - - CSE_MENU_ONRELEASE = true; - waituntil {CSE_KEY_RELEASED}; - CSE_MENU_ONRELEASE = false; - closeDialog 145201; - } else { - CSE_KEY_RELEASED = true; - }; - waituntil {!dialog}; - CSE_DISPLAY_MENU = false; - }; - [(_menu select 0),(_menu select 1),(_menu select 3)] call cse_fnc_gui_keyPressed; - //}; - false; - }; -/* - - cse_displayEventHandler_Dialog = findDisplay 46 displayAddEventHandler ["keyDown", CSE_KEY_PRESSED_HANDLER]; - cse_displayEventHandler_DialogReleased = findDisplay 46 displayAddEventHandler ["keyUp", { - _MENU_VAR = format['CSE_GUI_MENU_%1', (_this select 1)]; - if (CSE_DISPLAY_MENU) then { - if (!isnil _MENU_VAR) then { - CSE_KEY_RELEASED = true; - }; - }; - }];*/ -}; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf deleted file mode 100644 index 51b31d8873..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf +++ /dev/null @@ -1,104 +0,0 @@ -/** - * fn_gui_displaySubMenuButtons.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_rootButton","_allMenuEntries","_allAvailableMainButtons","_selectedMainMenuButton","_interactionDialog","_position","_placeEntry"]; -disableSerialization; -_interactionDialog = uiNamespace getvariable "cse_interactionGUI"; -_rootButton = (_interactionDialog displayCtrl (_this select 1)); -_allMenuEntries = _this select 2; - -_headerNumber = 112; -_selectedMainMenuButton = 201; -_maxCtrlNumber = 215; -if ((_this select 1) > 200 && (_this select 1) < 300) then { - _headerNumber = 113; - _selectedMainMenuButton = 301; - _maxCtrlNumber = 315; -}; -_allAvailableMainButtons = 15; - -//hint format ["ROOTBUTTON: %1",_rootButton]; -_position = ctrlPosition _rootButton; -//_position = [(_position select 0) + 0.26, (_position select 1)]; -_position = [(_position select 0) + 0.31, (_position select 1)]; - -CMS_GUI_LATEST_SUBMENU = _this; - - (_interactionDialog displayCtrl _headerNumber) ctrlSetText (_this select 0); - (_interactionDialog displayCtrl _headerNumber) ctrlSetPosition [_position select 0,(_position select 1) - 0.040]; - //(_interactionDialog displayCtrl _headerNumber) ctrlSetBackgroundColor [0, 0, 0.6, 0.75]; - (_interactionDialog displayCtrl _headerNumber) ctrlSetBackgroundColor [(profilenamespace getvariable ['IGUI_BCG_RGB_R',0]),(profilenamespace getvariable ['IGUI_BCG_RGB_G',1]),(profilenamespace getvariable ['IGUI_BCG_RGB_B',1]), 0.75]; - (_interactionDialog displayCtrl _headerNumber) ctrlSetBackgroundColor [(profilenamespace getvariable ['GUI_BCG_RGB_R',0]),(profilenamespace getvariable ['GUI_BCG_RGB_G',1]),(profilenamespace getvariable ['GUI_BCG_RGB_B',1]), 0.75]; - (_interactionDialog displayCtrl _headerNumber) ctrlCommit 0; - - -CSE_UI_EFFECT = true; // temp enabled - _placeEntry = { - private ["_entry"]; - _entry = (_interactionDialog displayCtrl _selectedMainMenuButton); - _entry ctrlSetText ( (_x select 0)); - _entry ctrlSetPosition _position; - if (_selectedMainMenuButton < 300) then { - _entry ctrlSetEventHandler ["ButtonClick", format["call cse_fnc_gui_hideSubSubMenuButtons;[player,CSE_interactionTarget,%2] call %1; call cse_fnc_gui_refreshLastSubMenu;",(_x select 2),_selectedMainMenuButton]]; - } else { - _entry ctrlSetEventHandler ["ButtonClick", format["[player,CSE_interactionTarget,%2] call %1; call cse_fnc_gui_refreshLastSubMenu;",(_x select 2),_selectedMainMenuButton]]; - }; - if (isnil "CSE_UI_EFFECT") then { - _entry ctrlCommit 0; - } else { - if (CSE_UI_EFFECT) then { - _entry ctrlCommit 0.2; - } else { - _entry ctrlCommit 0; - }; - }; - // updating new information - _position = [(_position select 0), (_position select 1) + 0.040]; - _selectedMainMenuButton = _selectedMainMenuButton + 1; - }; - - _returningEntries = []; - { - if ((typeName (_x select 1)) == "CODE") then { - if ([player,CSE_interactionTarget] call (_x select 1)) then { - _returningEntries set[count _returningEntries,_x]; - }; - } else { - if ((typeName (_x select 1)) == "BOOL") then { - if (_x select 1) then { - _returningEntries set[count _returningEntries,_x]; - }; - }; - }; - }foreach _allMenuEntries; - - - // for effects - { - - _entry = (_interactionDialog displayCtrl _selectedMainMenuButton); - _entry ctrlSetPosition _position; - _entry ctrlCommit 0; - _selectedMainMenuButton = _selectedMainMenuButton + 1; - - if (_selectedMainMenuButton >= _maxCtrlNumber + _allAvailableMainButtons) exitwith{}; - }foreach _returningEntries; - - - - _selectedMainMenuButton = 201; - if ((_this select 1) > 200 && (_this select 1) < 300) then { - _headerNumber = 113; - _selectedMainMenuButton = 301; - }; - { - call _placeEntry; - if (_selectedMainMenuButton >= _maxCtrlNumber + _allAvailableMainButtons) exitwith{}; - }foreach _returningEntries; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_getMenuEntries.sqf b/TO_MERGE/cse/gui/functions/fn_gui_getMenuEntries.sqf deleted file mode 100644 index 655dcf91e2..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_getMenuEntries.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/** - * fn_gui_getMenuEntries.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_returningEntries","_MENU_VAR","_cond"]; -_menuName = _this select 0; - -//[_menuName] call cse_fnc_gui_sortMenuEntries; -// in futute, look into splitting this all up into multiple threads - _returningEntries = []; - - _MENU_VAR = format["CSE_GUI_MENU_OPTIONS_%1", _menuName]; - if (isnil _MENU_VAR) then { - call compile format["%1 = [];",_MENU_VAR]; - }; - - { - - _cond = (_x select 2); - - if ((typeName _cond) == "CODE") then { - _passing = ([player,CSE_interactionTarget] call (_x select 2)); - if (typeName _passing != "BOOL") then { - _passing = false; - } else { - }; - if (_passing) then { - _returningEntries set[count _returningEntries,_x]; - }; - } else { - if ((typeName _cond) == "BOOL") then { - if (_cond) then { - _returningEntries set[count _returningEntries,_x]; - }; - }; - }; - }foreach (call compile _MENU_VAR); - -_returningEntries \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_hasOptionAvailable.sqf b/TO_MERGE/cse/gui/functions/fn_gui_hasOptionAvailable.sqf deleted file mode 100644 index 898a377fcc..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_hasOptionAvailable.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/** - * fn_gui_hasOptionAvailable.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_returningEntries","_MENU_VAR","_cond","_return","_target"]; -_menuName = _this select 0; -_target = _this select 1; -//[_menuName] call cse_fnc_gui_sortMenuEntries; -// in futute, look into splitting this all up into multiple threads - _returningEntries = []; - - _MENU_VAR = format["CSE_GUI_MENU_OPTIONS_%1", _menuName]; - if (isnil _MENU_VAR) then { - call compile format["%1 = [];",_MENU_VAR]; - }; - _return = false; - { - - _cond = (_x select 2); - - if ((typeName _cond) == "CODE") then { - _passing = ([player,_target] call (_x select 2)); - if (typeName _passing != "BOOL") then { - _passing = false; - } else { - }; - if (_passing) then { - _returningEntries set[count _returningEntries,_x]; - }; - } else { - if ((typeName _cond) == "BOOL") then { - if (_cond) then { - _returningEntries set[count _returningEntries,_x]; - }; - }; - }; - if (count _returningEntries > 0) exitwith { - _return = true; - }; - }foreach (call compile _MENU_VAR); - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_hideSubMenuButtons.sqf b/TO_MERGE/cse/gui/functions/fn_gui_hideSubMenuButtons.sqf deleted file mode 100644 index afce751b5a..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_hideSubMenuButtons.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * fn_gui_hideSubMenuButtons.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_allAvailableMainButtons","_selectedMainMenuButton","_interactionDialog","_position","_placeEntry"]; -disableSerialization; -_interactionDialog = uiNamespace getvariable "cse_interactionGUI"; - -_allAvailableMainButtons = 20; -_selectedMainMenuButton = 201; - -_position = [100,100]; -(_interactionDialog displayCtrl 112) ctrlSetPosition [_position select 0,(_position select 1) - 0.045]; -(_interactionDialog displayCtrl 112) ctrlCommit 0; - for [{_x=0},{_x < _allAvailableMainButtons},{_x=_x+1}] do - { - private ["_entry"]; - _entry = (_interactionDialog displayCtrl _selectedMainMenuButton); - _entry ctrlSetPosition _position; - _entry ctrlRemoveAllEventHandlers "ButtonClick"; - _entry ctrlCommit 0; - _selectedMainMenuButton = _selectedMainMenuButton +1; - }; - - -call cse_fnc_gui_hideSubSubMenuButtons; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_hideSubSubMenuButtons.sqf b/TO_MERGE/cse/gui/functions/fn_gui_hideSubSubMenuButtons.sqf deleted file mode 100644 index b73f70e5c5..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_hideSubSubMenuButtons.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/** - * fn_gui_hideSubSubMenuButtons.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_rootButton","_allMenuEntries","_allAvailableMainButtons","_selectedMainMenuButton","_interactionDialog","_position","_placeEntry"]; -disableSerialization; -_interactionDialog = uiNamespace getvariable "cse_interactionGUI"; - -_allAvailableMainButtons = 20; -_selectedMainMenuButton = 301; - -//if (((ctrlPosition (_interactionDialog displayCtrl _selectedMainMenuButton))select 0) == (0.4 + 0.26)) then { - - _position = [100,100]; - (_interactionDialog displayCtrl 113) ctrlSetPosition [_position select 0,(_position select 1) - 0.045]; - (_interactionDialog displayCtrl 113) ctrlCommit 0; - for [{_x=0},{_x < _allAvailableMainButtons},{_x=_x+1}] do - { - private ["_entry"]; - _entry = (_interactionDialog displayCtrl _selectedMainMenuButton); - _entry ctrlSetPosition _position; - _entry ctrlRemoveAllEventHandlers "ButtonClick"; - _entry ctrlCommit 0; - _selectedMainMenuButton = _selectedMainMenuButton +1; - }; -//}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_keyPressed.sqf b/TO_MERGE/cse/gui/functions/fn_gui_keyPressed.sqf deleted file mode 100644 index 324a504485..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_keyPressed.sqf +++ /dev/null @@ -1,180 +0,0 @@ -/** - * fn_gui_keyPressed.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menu","_condition","_target","_type","_allAvailableMainButtons","_selectedMainMenuButton","_menuName","_carriedObj", "_allMenuEntries"]; -_menu = _this select 0; -_condition = _this select 1; -_type = _this select 2; -if (isDedicated) exitwith{}; -if (! call _condition) exitwith {}; - -//if (cursortarget iskindof "MAN") then { -//}; -CMS_GUI_LATEST_SUBMENU = []; -_allAvailableMainButtons = 10; -_selectedMainMenuButton = 150; -_menuName = ""; -if (isnil "_type") then { - _type = 0; -}; - - -_target = switch (_type) do { - case 2: {if (isNull cursortarget) then {player} else{cursortarget};}; - case 1: {cursortarget}; - case 0: {player}; - default {player}; -}; -if ((_target distance player) > 10 && {(_type == 2)}) then { - _target = player; -}; -if (_target == player) then { - _menuName = "Your Person"; - if (_type == 2) then { - _menu = "SelfInteraction"; - }; - _targetName = [_target] call cse_fnc_getName; - -} else { - _carriedObj = [player] call cse_fnc_getCarriedObj; - if (!isNull _carriedObj) then { - _target = _carriedObj; - }; - - _menuName = switch (true) do { - case (_target isKindOf "CaManBase"): {([_target] call cse_fnc_getName)}; - case ((_target isKindOf "All")): {(getText(configFile >> "Cfgvehicles" >> typeof _target >> "displayName"))}; - default {"Object"}; - }; - if (_type == 2) then { - _menu = "InteractionMenu"; - }; -}; - -//_allMenuEntries = [_menu] call cse_fnc_gui_getMenuEntries; -if (!([_menu,_target] call cse_fnc_gui_hasOptionAvailable) && _type == 2 && (_menu != "SelfInteraction")) then { - //_allMenuEntries = ["SelfInteraction"] call cse_fnc_gui_getMenuEntries; - _menu = "SelfInteraction"; - _menuName = "Your Person"; - _target = player; - _targetName = [_target] call cse_fnc_getName; -}; -if (!([_menu,_target] call cse_fnc_gui_hasOptionAvailable)) exitwith {}; -//if (count _allMenuEntries <1) exitwith { [format["GUI - FAILED TO OPEN MENU: NO ENTRIES PASSED CONDITION TEST"],2] call cse_fnc_debug; }; - - -CSE_interactionTarget = _target; -//[format["GUI - MENU OPENING %1",_menu],3] call cse_fnc_debug; -[player,_target] call cse_fnc_registerInteractingWith; -if (isnil "cse_use_white_menu") then { - createDialog "cse_interactionGUI"; -} else { - createDialog "cse_interactionGUI_w"; -}; -setMousePosition [0.45, 0.55]; - -disableSerialization; -_interactionDialog = uiNamespace getvariable "cse_interactionGUI"; - -//_position = [0.46,0.5]; -_position = [safezoneX + (safezoneW / 1.9), safezoneY + (safezoneH / 1.9) ]; -//_position = [0.4 * safezoneW + safezoneX, 0.55 * safezoneH + safezoneY]; - -ctrlSetFocus (_interactionDialog displayCtrl 210) ; -(_interactionDialog displayCtrl 111) ctrlSetText _menuName; -(_interactionDialog displayCtrl 111) ctrlSetPosition [_position select 0,(_position select 1) - 0.040]; -//(_interactionDialog displayCtrl 111) ctrlSetBackgroundColor [0, 0, 0.6, 0.75]; -//(_interactionDialog displayCtrl 111) ctrlSetBackgroundColor [(profilenamespace getvariable ['IGUI_BCG_RGB_R',0]),(profilenamespace getvariable ['IGUI_BCG_RGB_G',1]),(profilenamespace getvariable ['IGUI_BCG_RGB_B',1]), 0.75]; -(_interactionDialog displayCtrl 111) ctrlSetBackgroundColor [(profilenamespace getvariable ['GUI_BCG_RGB_R',0]),(profilenamespace getvariable ['GUI_BCG_RGB_G',1]),(profilenamespace getvariable ['GUI_BCG_RGB_B',1]), 0.75]; -(_interactionDialog displayCtrl 111) ctrlCommit 0; - -_allMenuEntries = [_menu] call cse_fnc_gui_getMenuEntries; -{ - private ["_entry"]; - _entry = (_interactionDialog displayCtrl _selectedMainMenuButton); - _entry ctrlSetText ((_x select 1)); - _entry ctrlSetPosition _position; - _entry ctrlSetEventHandler ["ButtonClick", format["[] call cse_fnc_gui_hideSubMenuButtons; [player,CSE_interactionTarget,%2] spawn %1",(_x select 3),_selectedMainMenuButton]]; - _entry ctrlCommit 0; - - // updating new information - _position = [(_position select 0), (_position select 1) + 0.040]; - _selectedMainMenuButton = _selectedMainMenuButton + 1; - if (_selectedMainMenuButton >= 164 + _allAvailableMainButtons) exitwith{}; -}foreach _allMenuEntries; - -[] spawn { - waituntil {!dialog}; - [player,CSE_interactionTarget] call cse_fnc_unregisterInteractingWith; - //[format["GUI - MENU CLOSED"]] call cse_fnc_debug; -}; - -// ICONS SUPPORT - -// cse\cse_gui\data\icon_tags.paa - -_IDC_OF_ICON_OPTION = 400; -(_interactionDialog displayCtrl _IDC_OF_ICON_OPTION) ctrlSetText "cse\cse_gui\data\icon_settings.paa"; -(_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetEventHandler ["ButtonClick", " - CloseDialog 0; createDialog 'cse_settingsMenu'; -"]; -(_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetTooltip "Open the Settings Menu"; -_IDC_OF_ICON_OPTION = _IDC_OF_ICON_OPTION + 1; - - -if (["cse_sys_tags"] call cse_fnc_isModuleEnabled_F) then { - (_interactionDialog displayCtrl _IDC_OF_ICON_OPTION) ctrlSetText "cse\cse_gui\data\icon_tags.paa"; - (_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetEventHandler ["ButtonClick", " - if (isnil 'CSE_DRAW_TAG_ICONS_TAGS') then { - CSE_DRAW_TAG_ICONS_TAGS = false; - }; - CSE_DRAW_TAG_ICONS_TAGS = !CSE_DRAW_TAG_ICONS_TAGS; - if (CSE_DRAW_TAG_ICONS_TAGS) then { - hintSilent 'Enabled Tags'; - } else { - hintSilent 'Disabled Tags'; - }; - "]; - - (_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetTooltip "Toggle CSE Tag System ON/OFF"; - _IDC_OF_ICON_OPTION = _IDC_OF_ICON_OPTION + 1; -}; - -if (isnil "CSE_DEBUG_ALLOW_RESET_MODE_ENABLED") then { - CSE_DEBUG_ALLOW_RESET_MODE_ENABLED = false; -}; -if (CSE_DEBUG_ALLOW_RESET_MODE_ENABLED) then { - (_interactionDialog displayCtrl _IDC_OF_ICON_OPTION) ctrlSetText "cse\cse_gui\data\icon_reset_small.paa"; - (_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetEventHandler ["ButtonClick", " - [CSE_interactionTarget] spawn cse_fnc_resetAllDefaults; - "]; - - (_interactionDialog displayCtrl (_IDC_OF_ICON_OPTION + 100)) ctrlSetTooltip "Full CSE reset off target"; - _IDC_OF_ICON_OPTION = _IDC_OF_ICON_OPTION + 1; -}; - -while {(_IDC_OF_ICON_OPTION < 403)} do { - ctrlEnable[_IDC_OF_ICON_OPTION+100,false]; - _IDC_OF_ICON_OPTION = _IDC_OF_ICON_OPTION + 1; -}; - -/* -if (["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) then { - if (CSE_interactionTarget isKindOf "CAManBase") then { - [] spawn { - while {(dialog)} do { - _status = [CSE_interactionTarget] call cse_fnc_getTriageStatus_CMS; - [[CSE_interactionTarget] call cse_fnc_getName,["Triage status: "+ (_status select 0)],0] call cse_fnc_gui_displayInformation; - sleep 0.1; - }; - ["",[""],0] call cse_fnc_gui_displayInformation; - }; - }; -};*/ \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_loadingbar.sqf b/TO_MERGE/cse/gui/functions/fn_gui_loadingbar.sqf deleted file mode 100644 index d17321ba94..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_loadingbar.sqf +++ /dev/null @@ -1,46 +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 - */ - -private ["_timeToWait","_cond","_onfailure","_onSuccess","_args","_dialog","_ctrl","_newStatus","_start","_return"]; -_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) then { - disableSerialization; - 1534 cutRsc ["cse_progressBar_Sample","plain"]; - _dialog = uiNamespace getvariable "cse_progressBar_Sample"; - _ctrl = _dialog displayCtrl 6; - _newStatus = 0; - _start = diag_tickTime; - while {(_newStatus <= 1.00 && (call _cond))} do { - uisleep 0.01; - _ctrl progressSetPosition _newStatus; - _newStatus = (diag_tickTime - _start) / _timeToWait; - }; - 1534 cutText ["","plain"]; - _return = false; - if (_newStatus >= 1.00) then { - _return = true; - _args call _onSuccess; - } else { - _args call _onfailure; - }; -} else { - if ((call _cond)) then { - _return = true; - _args call _onSuccess; - } else { - _args call _onfailure; - }; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_refreshLastSubMenu.sqf b/TO_MERGE/cse/gui/functions/fn_gui_refreshLastSubMenu.sqf deleted file mode 100644 index 9c1db43f91..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_refreshLastSubMenu.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/** - * fn_gui_refreshLastSubMenu.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_lastMenu"]; -_lastMenu = CMS_GUI_LATEST_SUBMENU; - -if ((_lastMenu select 1) > 200 && (_lastMenu select 1) < 300) then { - call cse_fnc_gui_hideSubSubMenuButtons; -} else { - call cse_fnc_gui_hideSubMenuButtons; -}; -_lastMenu call cse_fnc_gui_displaySubMenuButtons; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_sortMenuEntries.sqf b/TO_MERGE/cse/gui/functions/fn_gui_sortMenuEntries.sqf deleted file mode 100644 index 373cd980bf..0000000000 --- a/TO_MERGE/cse/gui/functions/fn_gui_sortMenuEntries.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_gui_sortMenuEntries.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - - -private ["_menuName"]; -_menuName = _this select 0; - -_MENU_VAR = format["CSE_GUI_MENU_OPTIONS_%1", _menuName]; -if (isnil _MENU_VAR) then { - call compile format["%1 = [];",_MENU_VAR]; -}; - -if (count (call compile _MENU_VAR) > 1) then { - format["%1 = [%1,[],{_x}] call BIS_fnc_sortBy;",_MENU_VAR]; -}; -true \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/RscTitles.h b/TO_MERGE/cse/gui/gui/RscTitles.h deleted file mode 100644 index f4e8b8a5cf..0000000000 --- a/TO_MERGE/cse/gui/gui/RscTitles.h +++ /dev/null @@ -1,50 +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 cse_gui_iconsDisplay { - duration = 1e+011; - idd = 1111; - movingenable = 0; - onLoad = "uiNamespace setVariable ['cse_gui_iconsDisplay', _this select 0];"; - class controlsBackground { - class icon_1: cse_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); - }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/cseLogoPlain.hpp b/TO_MERGE/cse/gui/gui/cseLogoPlain.hpp deleted file mode 100644 index 248556fedc..0000000000 --- a/TO_MERGE/cse/gui/gui/cseLogoPlain.hpp +++ /dev/null @@ -1,31 +0,0 @@ - -class CSE_LogoPlain { - idd = 432350; - movingenable = 0; - fadein = 1; - fadeout = 1; - onLoad = "uiNamespace setVariable ['CSE_LogoPlain', _this select 0];"; - onUnload = "uiNamespace setVariable ['CSE_LogoPlain', nil];"; - onMouseButtonClick = "closeDialog 432350;"; - class controlsBackground { - class backgroundTop: cse_gui_backgroundBase{ - idc = 1; - type = CT_STATIC; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - text = "cse\cse_gui\data\logo_black_background.paa"; - onMouseButtonClick = "closeDialog 432350;"; - }; - - }; - - class controls { - - }; -}; diff --git a/TO_MERGE/cse/gui/gui/define.hpp b/TO_MERGE/cse/gui/gui/define.hpp deleted file mode 100644 index c521de470f..0000000000 --- a/TO_MERGE/cse/gui/gui/define.hpp +++ /dev/null @@ -1,797 +0,0 @@ - -#ifndef CSE_DEFINE_H -#define CSE_DEFINE_H -// define.hpp - -#define true 1 -#define false 0 - -#define CT_STATIC 0 -#define CT_BUTTON 1 -#define CT_EDIT 2 -#define CT_SLIDER 3 -#define CT_COMBO 4 -#define CT_LISTBOX 5 -#define CT_TOOLBOX 6 -#define CT_CHECKBOXES 7 -#define CT_PROGRESS 8 -#define CT_HTML 9 -#define CT_STATIC_SKEW 10 -#define CT_ACTIVETEXT 11 -#define CT_TREE 12 -#define CT_STRUCTURED_TEXT 13 -#define CT_CONTEXT_MENU 14 -#define CT_CONTROLS_GROUP 15 -#define CT_SHORTCUTBUTTON 16 -#define CT_XKEYDESC 40 -#define CT_XBUTTON 41 -#define CT_XLISTBOX 42 -#define CT_XSLIDER 43 -#define CT_XCOMBO 44 -#define CT_ANIMATED_TEXTURE 45 -#define CT_OBJECT 80 -#define CT_OBJECT_ZOOM 81 -#define CT_OBJECT_CONTAINER 82 -#define CT_OBJECT_CONT_ANIM 83 -#define CT_LINEBREAK 98 -#define CT_ANIMATED_USER 99 -#define CT_MAP 100 -#define CT_MAP_MAIN 101 -#define CT_LISTNBOX 102 - -// Static styles -#define ST_POS 0x0F -#define ST_HPOS 0x03 -#define ST_VPOS 0x0C -#define ST_LEFT 0x00 -#define ST_RIGHT 0x01 -#define ST_CENTER 0x02 -#define ST_DOWN 0x04 -#define ST_UP 0x08 -#define ST_VCENTER 0x0c - -#define ST_TYPE 0xF0 -#define ST_SINGLE 0 -#define ST_MULTI 16 -#define ST_TITLE_BAR 32 -#define ST_PICTURE 48 -#define ST_FRAME 64 -#define ST_BACKGROUND 80 -#define ST_GROUP_BOX 96 -#define ST_GROUP_BOX2 112 -#define ST_HUD_BACKGROUND 128 -#define ST_TILE_PICTURE 144 -#define ST_WITH_RECT 160 -#define ST_LINE 176 - -#define ST_SHADOW 0x100 -#define ST_NO_RECT 0x200 // this style works for CT_STATIC in conjunction with ST_MULTI -#define ST_KEEP_ASPECT_RATIO 0x800 - -#define ST_TITLE ST_TITLE_BAR + ST_CENTER - -// Slider styles -#define SL_DIR 0x400 -#define SL_VERT 0 -#define SL_HORZ 0x400 - -#define SL_TEXTURES 0x10 - -// Listbox styles -#define LB_TEXTURES 0x10 -#define LB_MULTI 0x20 -#define FontCSE "PuristaMedium" - -class cse_gui_backgroundBase { - type = CT_STATIC; - idc = -1; - style = ST_PICTURE; - colorBackground[] = {0,0,0,0}; - colorText[] = {1, 1, 1, 1}; - font = FontCSE; - text = ""; - sizeEx = 0.032; -}; -class cse_gui_editBase -{ - access = 0; - type = 2; - x = 0; - y = 0; - h = 0.04; - w = 0.2; - colorBackground[] = - { - 0, - 0, - 0, - 1 - }; - colorText[] = - { - 0.95, - 0.95, - 0.95, - 1 - }; - colorSelection[] = - { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", - 1 - }; - autocomplete = ""; - text = ""; - size = 0.2; - style = "0x00 + 0x40"; - font = "PuristaMedium"; - shadow = 2; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorDisabled[] = - { - 1, - 1, - 1, - 0.25 - }; -}; - - - -class cse_gui_buttonBase { - idc = -1; - type = 16; - style = ST_LEFT; - text = ""; - action = ""; - x = 0.0; - y = 0.0; - w = 0.25; - h = 0.04; - size = 0.03921; - sizeEx = 0.03921; - color[] = {1.0, 1.0, 1.0, 1}; - color2[] = {1.0, 1.0, 1.0, 1}; - /*colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.5])"}; - colorbackground2[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.4}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - colorFocused[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])", 0.8}; - colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.8}; - */ - - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {1,1,1,1}; - colorBackgroundFocused[] = {1,1,1,1}; - periodFocus = 1.2; - periodOver = 0.8; - default = false; - class HitZone { - left = 0.00; - top = 0.00; - right = 0.00; - bottom = 0.00; - }; - - class ShortcutPos { - left = 0.00; - top = 0.00; - w = 0.00; - h = 0.00; - }; - - class TextPos { - left = 0.002; - top = 0.0004; - right = 0.0; - bottom = 0.00; - }; - textureNoShortcut = ""; - animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa"; - animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - period = 0.5; - font = FontCSE; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; - class Attributes { - font = FontCSE; - color = "#E5E5E5"; - align = "center"; - shadow = "true"; - }; - class AttributesImage { - font = FontCSE; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; -}; - -class cse_gui_RscProgress { - type = 8; - style = 0; - colorFrame[] = {1,1,1,0.7}; - colorBar[] = {1,1,1,0.7}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((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.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; -}; - - -class cse_gui_staticBase { - idc = -1; - type = CT_STATIC; - x = 0.0; - y = 0.0; - w = 0.183825; - h = 0.104575; - style = ST_LEFT; - font = FontCSE; - sizeEx = 0.03921; - colorText[] = {0.95, 0.95, 0.95, 1.0}; - colorBackground[] = {0, 0, 0, 0}; - text = ""; -}; - -class RscListBox; -class cse_gui_listBoxBase : RscListBox{ - type = CT_LISTBOX; - style = ST_MULTI; - font = FontCSE; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - colorText[] = {0.543, 0.5742, 0.4102, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 1}; - colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - period = 1.2; - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 1}; - maxHistoryDelay = 1.0; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - soundCollapse[] = {"",0.1,1}; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = ""; - arrowFull = ""; - arrowEmpty = ""; - border = ""; - }; -}; - - -class cse_gui_listNBox { - access = 0; - type = CT_LISTNBOX;// 102; - style =ST_MULTI; - w = 0.4; - h = 0.4; - font = FontCSE; - sizeEx = 0.031; - - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - columns[] = {0.0}; - color[] = {1, 1, 1, 1}; - - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; - colorText[] = {1,1, 1, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 0.0}; - colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; - colorActive[] = {0,0,0,1}; - colorDisabled[] = {0,0,0,0.3}; - rows = 1; - - drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; - maxHistoryDelay = 1; - soundSelect[] = {"", 0.1, 1}; - period = 1; - shadow = 2; - class ScrollBar { - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - border = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - thumb = "#(argb,8,8,3)color(1,1,1,1)"; - }; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; - - -class RscCombo; -class cse_gui_comboBoxBase: RscCombo { - idc = -1; - type = 4; - style = "0x10 + 0x200"; - x = 0; - y = 0; - w = 0.3; - h = 0.035; - color[] = {0,0,0,0.6}; - colorActive[] = {1,0,0,1}; - colorBackground[] = {0,0,0,1}; - colorDisabled[] = {1,1,1,0.25}; - colorScrollbar[] = {1,0,0,1}; - colorSelect[] = {0,0,0,1}; - colorSelectBackground[] = {1,1,1,0.7}; - colorText[] = {1,1,1,1}; - - arrowEmpty = ""; - arrowFull = ""; - wholeHeight = 0.45; - font = FontCSE; - sizeEx = 0.031; - soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; - soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; - soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; - maxHistoryDelay = 1.0; - class ScrollBar - { - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = ""; - }; - class ComboScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; - - - -class cse_gui_mapBase { - moveOnEdges = 1; - x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - type = 100; // Use 100 to hide markers - style = 48; - shadow = 0; - - ptsPerSquareSea = 5; - ptsPerSquareTxt = 3; - ptsPerSquareCLn = 10; - ptsPerSquareExp = 10; - ptsPerSquareCost = 10; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; - ptsPerSquareRoad = 6; - ptsPerSquareObj = 9; - showCountourInterval = 0; - scaleMin = 0.001; - scaleMax = 1.0; - scaleDefault = 0.16; - maxSatelliteAlpha = 0.85; - alphaFadeStartScale = 0.35; - alphaFadeEndScale = 0.4; - colorBackground[] = {0.969,0.957,0.949,1.0}; - colorSea[] = {0.467,0.631,0.851,0.5}; - colorForest[] = {0.624,0.78,0.388,0.5}; - colorForestBorder[] = {0.0,0.0,0.0,0.0}; - colorRocks[] = {0.0,0.0,0.0,0.3}; - colorRocksBorder[] = {0.0,0.0,0.0,0.0}; - colorLevels[] = {0.286,0.177,0.094,0.5}; - colorMainCountlines[] = {0.572,0.354,0.188,0.5}; - colorCountlines[] = {0.572,0.354,0.188,0.25}; - colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6}; - colorCountlinesWater[] = {0.491,0.577,0.702,0.3}; - colorPowerLines[] = {0.1,0.1,0.1,1.0}; - colorRailWay[] = {0.8,0.2,0.0,1.0}; - colorNames[] = {0.1,0.1,0.1,0.9}; - colorInactive[] = {1.0,1.0,1.0,0.5}; - colorOutside[] = {0.0,0.0,0.0,1.0}; - colorTracks[] = {0.84,0.76,0.65,0.15}; - colorTracksFill[] = {0.84,0.76,0.65,1.0}; - colorRoads[] = {0.7,0.7,0.7,1.0}; - colorRoadsFill[] = {1.0,1.0,1.0,1.0}; - colorMainRoads[] = {0.9,0.5,0.3,1.0}; - colorMainRoadsFill[] = {1.0,0.6,0.4,1.0}; - colorGrid[] = {0.1,0.1,0.1,0.6}; - colorGridMap[] = {0.1,0.1,0.1,0.6}; - colorText[] = {1, 1, 1, 0.85}; -font = "PuristaMedium"; -sizeEx = 0.0270000; -stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; -stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; -onMouseButtonClick = ""; -onMouseButtonDblClick = ""; - - fontLabel = "PuristaMedium"; - sizeExLabel = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontGrid = "TahomaB"; - sizeExGrid = 0.02; - fontUnits = "TahomaB"; - sizeExUnits = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontNames = "PuristaMedium"; - sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; - fontInfo = "PuristaMedium"; - sizeExInfo = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontLevel = "TahomaB"; - sizeExLevel = 0.02; - text = "#(argb,8,8,3)color(1,1,1,1)"; - class ActiveMarker { - color[] = {0.30, 0.10, 0.90, 1.00}; - size = 50; - }; - class Legend - { - x = "SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorBackground[] = {1,1,1,0.5}; - color[] = {0,0,0,1}; - }; - class Task - { - icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; - iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; - iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; - iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; - iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; - color[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"}; - colorCreated[] = {1,1,1,1}; - colorCanceled[] = {0.7,0.7,0.7,1}; - colorDone[] = {0.7,1,0.3,1}; - colorFailed[] = {1,0.3,0.2,1}; - size = 27; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Waypoint - { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class WaypointCompleted - { - icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class CustomMark - { - icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; - size = 24; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {0,0,0,1}; - }; - class Command - { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - size = 18; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {1,1,1,1}; - }; - class Bush - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = "14/2"; - importance = "0.2 * 14 * 0.05 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Rock - { - icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; - color[] = {0.1,0.1,0.1,0.8}; - size = 12; - importance = "0.5 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class SmallTree - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.6 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Tree - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.9 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class busstop - { - icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class fuelstation - { - icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class hospital - { - icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class church - { - icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class lighthouse - { - icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class power - { - icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powersolar - { - icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwave - { - icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwind - { - icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class quay - { - icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class shipwreck - { - icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class transmitter - { - icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class watertower - { - icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class Cross - { - icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Chapel - { - icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Bunker - { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 14; - importance = "1.5 * 14 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fortress - { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 16; - importance = "2 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fountain - { - icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; - size = 11; - importance = "1 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Ruin - { - icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; - size = 16; - importance = "1.2 * 16 * 0.05"; - coefMin = 1; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Stack - { - icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; - size = 20; - importance = "2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Tourism - { - icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; - size = 16; - importance = "1 * 16 * 0.05"; - coefMin = 0.7; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class ViewTower - { - icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; - size = 16; - importance = "2.5 * 16 * 0.05"; - coefMin = 0.5; - coefMax = 4; - color[] = {0,0,0,1}; - }; -}; - -#endif \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/dynamicMenu.h b/TO_MERGE/cse/gui/gui/dynamicMenu.h deleted file mode 100644 index 1ae5206fe2..0000000000 --- a/TO_MERGE/cse/gui/gui/dynamicMenu.h +++ /dev/null @@ -1,12 +0,0 @@ -class cse_dynamicMenuGUI { - idd = 176890; - movingEnable = false; - onLoad = "uiNamespace setVariable ['cse_dynamicMenuGUI', _this select 0];"; - - class controlsBackground { - }; - - class controls { - - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/interactionMenu.hpp b/TO_MERGE/cse/gui/gui/interactionMenu.hpp deleted file mode 100644 index b93918c407..0000000000 --- a/TO_MERGE/cse/gui/gui/interactionMenu.hpp +++ /dev/null @@ -1,494 +0,0 @@ -class cse_interactionGUI { - idd = 145201; - movingEnable = false; - onLoad = "uiNamespace setVariable ['cse_interactionGUI', _this select 0];"; - - - class controlsBackground { - class cse_background : cse_gui_backgroundBase { - idc = -1; - x = 0.138; - y = 0.17; - w = 1.2549; - h = 0.836601; - text = ""; - }; - }; - - class controls { - - class cse_interactionName { - idc = 111; - type = CT_STATIC; - x = 10.44; - y = 10.75; - w = 0.3; - h = 0.04; - style = ST_CENTER + ST_SHADOW; - font = "PuristaMedium"; - sizeEx = 0.0406536; - colorText[] = {0.95, 0.95, 0.95, 1}; - //colorBackground[] = {1, 1, 1, 0}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.9}; - text = ""; - }; - class cse_subMenuName: cse_interactionName { - idc = 112; - }; - class cse_subSubMenuName: cse_interactionName { - idc = 113; - }; - - class cse_option1 : cse_gui_buttonBase { - - idc = 150; - text = ""; - onButtonClick = ""; - x = 10.4; // add 5 to each - y = 10.45; - w = 0.3; - h = 0.04; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorText[] = {1, 1, 1,1}; - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {0,0,0,1}; - colorBackgroundFocused[] = {1,1,1,1}; - animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa"; - animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top_w.paa"; - animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top_w.paa"; - animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top_w.paa"; - animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - - /* animTextureNormal = ""; - animTextureDisabled = ""; - animTextureOver = ""; - animTextureFocused = ""; - animTexturePressed = ""; - animTextureDefault = ""; */ - }; - class cse_option2 : cse_option1 { - idc = 151; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.5; - }; - class cse_option3 : cse_option1 { - idc = 152; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.55; - }; - class cse_option4 : cse_option1 { - idc = 153; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.6; - }; - class cse_option5 : cse_option1 { - idc = 154; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.65; - }; - class cse_option6 : cse_option1 { - idc = 155; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.7; - }; - class cse_option7 : cse_option1 { - idc = 156; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.75; - }; - class cse_option8 : cse_option1 { - idc = 157; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.8; - }; - class cse_option9 : cse_option1 { - idc = 158; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.85; - }; - class cse_option10 : cse_option1 { - idc = 159; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option11 : cse_option1 { - idc = 160; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option12 : cse_option1 { - idc = 161; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option13 : cse_option1 { - idc = 162; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option14 : cse_option1 { - idc = 163; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option15 : cse_option1 { - idc = 164; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - - - // Sub menu Options - class cse_subMenuButton1 : cse_option1 { - idc = 201; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.75; - }; - class cse_subMenuButton2 : cse_option1 { - idc = 202; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.8; - }; - class cse_subMenuButton3 : cse_option1 { - idc = 203; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.85; - }; - class cse_subMenuButton4 : cse_option1 { - idc = 204; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.9; - }; - class cse_subMenuButton5 : cse_option1 { - idc = 205; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.95; - }; - class cse_subMenuButton6 : cse_option1 { - idc = 206; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton7 : cse_option1 { - idc = 207; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton8 : cse_option1 { - idc = 208; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton9 : cse_option1 { - idc = 209; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton10 : cse_option1 { - idc = 210; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton11 : cse_option1 { - idc = 211; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton12 : cse_option1 { - idc = 212; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton13 : cse_option1 { - idc = 213; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton14 : cse_option1 { - idc = 214; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton15 : cse_option1 { - idc = 215; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - - - class cse_subMenuSub1 : cse_option1 { - idc = 301; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.75; - }; - class cse_subMenuSub2 : cse_option1 { - idc = 302; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.8; - }; - class cse_subMenuSub3 : cse_option1 { - idc = 303; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.85; - }; - class cse_subMenuSub4 : cse_option1 { - idc = 304; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.9; - }; - class cse_subMenuSub5 : cse_option1 { - idc = 305; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.95; - }; - class cse_subMenuSub6 : cse_option1 { - idc = 306; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub7 : cse_option1 { - idc = 307; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub8 : cse_option1 { - idc = 308; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub9 : cse_option1 { - idc = 309; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub10 : cse_option1 { - idc = 310; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub11 : cse_option1 { - idc = 311; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub12 : cse_option1 { - idc = 312; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub13 : cse_option1 { - idc = 313; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub14 : cse_option1 { - idc = 314; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub15 : cse_option1 { - idc = 315; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - - class iconImg1: cse_gui_backgroundBase { - idc = 400; - x = (safezoneX + (safeZoneW - 0.1)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - size = 0.1; - SizeEx = 0.1; - colorBackground[] = {0,0,0,1}; - colorPicture[] = {1,1,1,1}; - colorText[] = {1,1,1,1}; - text = ""; - }; - - class option_tags : cse_gui_buttonBase { - idc = 500; - text = ""; - onButtonClick = ""; - x = (safezoneX + (safeZoneW - 0.1)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - class TextPos { - left = 0; - top = 0; - right = 0.0; - bottom = 0.00; - }; - animTextureNormal = ""; - animTextureDisabled = ""; - animTextureOver = ""; - animTextureFocused = ""; - animTexturePressed = ""; - animTextureDefault = ""; - }; - - class iconImg2: iconImg1 { - idc = 401; - x = (safezoneX + (safeZoneW - 0.15)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - size = 0.1; - SizeEx = 0.1; - colorBackground[] = {0,0,0,1}; - colorPicture[] = {1,1,1,1}; - colorText[] = {1,1,1,1}; - text = ""; - }; - class iconImg3: iconImg1 { - idc = 402; - x = (safezoneX + (safeZoneW - 0.2)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - size = 0.1; - SizeEx = 0.1; - colorBackground[] = {0,0,0,1}; - colorPicture[] = {1,1,1,1}; - colorText[] = {1,1,1,1}; - text = ""; - }; - - class option_icon2 : option_tags { - idc = 501; - text = ""; - onButtonClick = ""; - x = (safezoneX + (safeZoneW - 0.15)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - class TextPos { - left = 0; - top = 0; - right = 0.0; - bottom = 0.00; - }; - animTextureNormal = ""; - animTextureDisabled = ""; - animTextureOver = ""; - animTextureFocused = ""; - animTexturePressed = ""; - animTextureDefault = ""; - }; - - class option_icon3 : option_tags { - idc = 502; - text = ""; - onButtonClick = ""; - x = (safezoneX + (safeZoneW - 0.2)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.05; - h = 0.05; - class TextPos { - left = 0; - top = 0; - right = 0.0; - bottom = 0.00; - }; - animTextureNormal = ""; - animTextureDisabled = ""; - animTextureOver = ""; - animTextureFocused = ""; - animTexturePressed = ""; - animTextureDefault = ""; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/interactionMenu_white.hpp b/TO_MERGE/cse/gui/gui/interactionMenu_white.hpp deleted file mode 100644 index d32752f42d..0000000000 --- a/TO_MERGE/cse/gui/gui/interactionMenu_white.hpp +++ /dev/null @@ -1,417 +0,0 @@ -class cse_interactionGUI_w { - idd = 145201; - movingEnable = false; - onLoad = "uiNamespace setVariable ['cse_interactionGUI', _this select 0];"; - - - class controlsBackground { - class cse_background : cse_gui_backgroundBase { - idc = -1; - x = 0.138; - y = 0.17; - w = 1.2549; - h = 0.836601; - text = ""; - }; - }; - - class controls { - - class cse_interactionName { - idc = 111; - type = CT_STATIC; - x = 10.44; - y = 10.75; - w = 0.3; - h = 0.04; - style = ST_CENTER + ST_SHADOW; - font = "PuristaMedium"; - sizeEx = 0.0406536; - colorText[] = {0.95, 0.95, 0.95, 1}; - //colorBackground[] = {1, 1, 1, 0}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.9}; - text = ""; - }; - class cse_subMenuName: cse_interactionName { - idc = 112; - }; - class cse_subSubMenuName: cse_interactionName { - idc = 113; - }; - - class cse_option1 : cse_gui_buttonBase { - - idc = 150; - text = ""; - onButtonClick = ""; - x = 10.4; // add 5 to each - y = 10.45; - w = 0.3; - h = 0.04; - color[] = {0,0,0, 1}; - color2[] = {1,1,1, 1}; - colorText[] = {0,0,0,1}; - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {0,0,0,1}; - colorBackgroundFocused[] = {1,1,1,1}; - animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top_w.paa"; - animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa"; - animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top_w.paa"; - }; - class cse_option2 : cse_option1 { - idc = 151; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.5; - }; - class cse_option3 : cse_option1 { - idc = 152; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.55; - }; - class cse_option4 : cse_option1 { - idc = 153; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.6; - }; - class cse_option5 : cse_option1 { - idc = 154; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.65; - }; - class cse_option6 : cse_option1 { - idc = 155; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.7; - }; - class cse_option7 : cse_option1 { - idc = 156; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.75; - }; - class cse_option8 : cse_option1 { - idc = 157; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.8; - }; - class cse_option9 : cse_option1 { - idc = 158; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.85; - }; - class cse_option10 : cse_option1 { - idc = 159; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option11 : cse_option1 { - idc = 160; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option12 : cse_option1 { - idc = 161; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option13 : cse_option1 { - idc = 162; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option14 : cse_option1 { - idc = 163; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - class cse_option15 : cse_option1 { - idc = 164; - text = ""; - onButtonClick = ""; - x = 10.4; - y = 10.9; - }; - - - // Sub menu Options - class cse_subMenuButton1 : cse_option1 { - idc = 201; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.75; - }; - class cse_subMenuButton2 : cse_option1 { - idc = 202; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.8; - }; - class cse_subMenuButton3 : cse_option1 { - idc = 203; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.85; - }; - class cse_subMenuButton4 : cse_option1 { - idc = 204; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.9; - }; - class cse_subMenuButton5 : cse_option1 { - idc = 205; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.95; - }; - class cse_subMenuButton6 : cse_option1 { - idc = 206; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton7 : cse_option1 { - idc = 207; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton8 : cse_option1 { - idc = 208; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton9 : cse_option1 { - idc = 209; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuButton10 : cse_option1 { - idc = 210; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton11 : cse_option1 { - idc = 211; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton12 : cse_option1 { - idc = 212; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton13 : cse_option1 { - idc = 213; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton14 : cse_option1 { - idc = 214; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuButton15 : cse_option1 { - idc = 215; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - - - class cse_subMenuSub1 : cse_option1 { - idc = 301; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.75; - }; - class cse_subMenuSub2 : cse_option1 { - idc = 302; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.8; - }; - class cse_subMenuSub3 : cse_option1 { - idc = 303; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.85; - }; - class cse_subMenuSub4 : cse_option1 { - idc = 304; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.9; - }; - class cse_subMenuSub5 : cse_option1 { - idc = 305; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.95; - }; - class cse_subMenuSub6 : cse_option1 { - idc = 306; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub7 : cse_option1 { - idc = 307; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub8 : cse_option1 { - idc = 308; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub9 : cse_option1 { - idc = 309; - text = ""; - onButtonClick = ""; - x = 10.88; - y = 10.0; - }; - class cse_subMenuSub10 : cse_option1 { - idc = 310; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub11 : cse_option1 { - idc = 311; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub12 : cse_option1 { - idc = 312; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub13 : cse_option1 { - idc = 313; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub14 : cse_option1 { - idc = 314; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - class cse_subMenuSub15 : cse_option1 { - idc = 315; - text = ""; - onButtonClick = ""; - x = 100.88; - y = 100.0; - }; - - class iconImg1: cse_gui_backgroundBase { - idc = 400; - x = (safezoneX + (safeZoneW - 0.1)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.1; - h = 0.1; - size = 0.1; - SizeEx = 0.1; - colorBackground[] = {0,0,0,1}; - colorPicture[] = {1,1,1,1}; - colorText[] = {1,1,1,1}; - text = ""; - }; - - class option_tags : cse_gui_buttonBase { - idc = 500; - text = ""; - onButtonClick = ""; - x = (safezoneX + (safeZoneW - 0.1)); - y = (safezoneY + (safeZoneH - 0.1)); - w = 0.1; - h = 0.1; - class TextPos { - left = 0; - top = 0; - right = 0.0; - bottom = 0.00; - }; - animTextureNormal = ""; - animTextureDisabled = ""; - animTextureOver = ""; - animTextureFocused = ""; - animTexturePressed = ""; - animTextureDefault = ""; - }; - - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/gui/radial.h b/TO_MERGE/cse/gui/gui/radial.h deleted file mode 100644 index 2b56b40a14..0000000000 --- a/TO_MERGE/cse/gui/gui/radial.h +++ /dev/null @@ -1,648 +0,0 @@ - -class CSE_RADIAL_MENU { - idd = 432341; - movingenable = 0; - fadein = 0; - fadeout = 0; - onLoad = "uiNamespace setVariable ['CSE_RADIAL_MENU', _this select 0]; ['CSE_RADIAL_MENU', true] call cse_fnc_gui_blurScreen;"; - onUnload = "['CSE_RADIAL_MENU', false] call cse_fnc_gui_blurScreen; "; - class controlsBackground { - class backgroundTop: cse_gui_backgroundBase{ - idc = 800; - type = CT_STATIC; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0, 0, 0, 0.66}; - colorBackground[] = {0, 0, 0, 0.66}; - text = "cse\cse_gui\radialmenu\data\radial_background_top_w.paa"; - }; - class backgroundTopLeft: backgroundTop{ - idc = 801; - text = "cse\cse_gui\radialmenu\data\radial_background_topleft_w.paa"; - }; - class backgroundTopRight: backgroundTop{ - idc = 802; - text = "cse\cse_gui\radialmenu\data\radial_background_topright_w.paa"; - }; - class backgroundCenterLeft: backgroundTop{ - idc = 803; - text = "cse\cse_gui\radialmenu\data\radial_background_centerleft_w.paa"; - }; - class backgroundCenterRight: backgroundTop{ - idc = 804; - text = "cse\cse_gui\radialmenu\data\radial_background_centerright_w.paa"; - }; - - class backgroundBottomLeft: backgroundTop{ - idc = 805; - text = "cse\cse_gui\radialmenu\data\radial_background_bottomleft_w.paa"; - }; - class backgroundBottomRight: backgroundTop{ - idc = 806; - text = "cse\cse_gui\radialmenu\data\radial_background_bottomright_w.paa"; - }; - class backgroundBottom: backgroundTop{ - idc = 807; - text = "cse\cse_gui\radialmenu\data\radial_background_bottom_w.paa"; - }; - class backgroundCenter: backgroundTop{ - idc = 808; - text = "cse\cse_gui\radialmenu\data\radial_center_info_background.paa"; - }; - class submenu_background_topleft: cse_gui_backgroundBase{ - idc = 700; - type = CT_STATIC; - x = "5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "-1.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "30 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0, 0, 0, 0.0}; - colorBackground[] = {0, 0, 0, 0.66}; - text = "cse\cse_gui\radialmenu\data\radial_submenu_topleft.paa"; - }; - class submenu_background_topright: submenu_background_topleft{ - idc = 701; - text = "cse\cse_gui\radialmenu\data\radial_submenu_topright.paa"; - }; - class submenu_background_bottomleft: submenu_background_topleft{ - idc = 702; - text = "cse\cse_gui\radialmenu\data\radial_submenu_bottomleft.paa"; - }; - class submenu_background_bottomright: submenu_background_topleft{ - idc = 703; - text = "cse\cse_gui\radialmenu\data\radial_submenu_bottomright.paa"; - }; - - - class iconCenter: cse_gui_backgroundBase{ - idc = 710; - type = CT_STATIC; - x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.4}; - colorBackground[] = {1,1,1, 0.0}; - text = ""; - }; - class iconCenter_return: cse_gui_backgroundBase{ - idc = 711; - type = CT_STATIC; - x = "19.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "16.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.4}; - colorBackground[] = {1,1,1, 0.0}; - text = "cse\cse_gui\radialmenu\data\icons\icon_return.paa"; - }; - - }; - class controls { - class LabelmenuName: cse_gui_staticBase{ - idc = 1; - x = "17 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorText[] = {0.97,0.97,0.97,1}; - colorBackground[] = {0,0,0, 0.0}; - text = ""; - style = ST_CENTER; - }; - - class LabeltargetName: LabelmenuName{ - idc = 2; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.6)"; - }; - class actionToPrevious : cse_gui_buttonBase { - idc = 2315; - text = ""; - /*x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "23.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";*/ - x = "19.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "16.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0.0)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0.0)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0.0)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0.0)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = "[] call cse_fnc_returnToPreviousSubMenu_GUI;"; - }; - - /** ICONS FOR INNER CYCIRLE */ - class InnerCycle_iconTop: cse_gui_backgroundBase{ - idc = 100; - type = CT_STATIC; - x = "19 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.75 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.66}; - text = ""; - }; - class InnerCycle_iconTopLeft : InnerCycle_iconTop { - idc = 101; - x = "15 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - - }; - class InnerCycle_iconTopRight : InnerCycle_iconTop { - idc = 102; - x = "23.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconCenterLeft : InnerCycle_iconTop { - idc = 103; - x = "13.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconCenterRight : InnerCycle_iconTop { - idc = 104; - x = "24.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconBottomLeft : InnerCycle_iconTop { - idc = 105; - x = "15 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "17.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconBottomRight : InnerCycle_iconTop { - idc = 106; - x = "23.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "17.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - class InnerCycle_iconBottom : InnerCycle_iconTop { - idc = 107; - x = "19 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - /** TEXT */ - class InnerCycle_TextTop: cse_gui_staticBase{ - idc = 200; - x = "18 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.0}; - text = ""; - style = ST_CENTER; - }; - class InnerCycle_TextTopLeft : InnerCycle_TextTop { - idc = 201; - x = "14.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - - }; - class InnerCycle_TextTopRight : InnerCycle_TextTop { - idc = 202; - x = "22.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_TextCenterLeft : InnerCycle_TextTop { - idc = 203; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "15.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_TextCenterRight : InnerCycle_TextTop { - idc = 204; - x = "23.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "15.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_TextBottomLeft : InnerCycle_TextTop { - idc = 205; - x = "14.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "19.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_TextBottomRight : InnerCycle_TextTop { - idc = 206; - x = "22.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "19.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - class InnerCycle_TextBottom : InnerCycle_TextTop { - idc = 207; - x = "18 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "20.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - -class InnerCycle_actionTop : cse_gui_buttonBase { - idc = 10; - text = ""; - x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - /*animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.6)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0.5)";*/ - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = ""; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_10;"; - }; - - class InnerCycle_actionTopLeft : InnerCycle_actionTop { - idc = 11; - text = ""; - x = "14.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_11;"; - }; - class InnerCycle_actionTopRight : InnerCycle_actionTop { - idc = 12; - text = ""; - x = "22.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_12;"; - }; - - - - class InnerCycle_actionCenterLeft : InnerCycle_actionTop { - idc = 13; - text = ""; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_13;"; - }; - class InnerCycle_actionCenterRight : InnerCycle_actionTop { - idc = 14; - text = ""; - x = "23.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_14;"; - }; - - - class InnerCycle_actionBottomLeft : InnerCycle_actionTop { - idc = 15; - text = ""; - x = "14.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "17.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_15;"; - }; - class InnerCycle_actionBottomRight : InnerCycle_actionTop { - idc = 16; - text = ""; - x = "22.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "17.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_16;"; - }; - - class InnerCycle_actionBottom : InnerCycle_actionTop { - idc = 17; - text = ""; - x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "[] call compile CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_17;"; - }; - - - - - class secondCycle_iconBottomLeft: cse_gui_backgroundBase{ - idc = 350; - type = CT_STATIC; - x = "10.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "1.75 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.66}; - text = ""; - }; - class secondCycle_iconBottomLeftTwo : secondCycle_iconBottomLeft { - idc = 351; - x = "9.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconBottomLeftThree : secondCycle_iconBottomLeft { - idc = 352; - x = "9.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopLeftOne : secondCycle_iconBottomLeft { - idc = 353; - x = "10.75 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "8.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopLeftTwo : secondCycle_iconBottomLeft { - idc = 354; - text = ""; - x = "13.75 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopLeftThree : secondCycle_iconBottomLeft { - idc = 355; - x = "17.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopRightOne : secondCycle_iconBottomLeft { - idc = 356; - x = "21.35 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopRightTwo : secondCycle_iconBottomLeft { - idc = 357; - x = "24.84 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconTopRightThree : secondCycle_iconBottomLeft { - idc = 358; - x = "27.48 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "8.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconBottomRightOne : secondCycle_iconBottomLeft { - idc = 359; - x = "29.65 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconBottomRightTwo : secondCycle_iconBottomLeft { - idc = 360; - x = "29.65 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_iconBottomRightThree : secondCycle_iconBottomLeft { - idc = 361; - x = "28.65 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - - class secondCycle_TextBottomLeft: cse_gui_staticBase{ - idc = 400; - x = "8.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "20 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.0}; - text = ""; - style = ST_CENTER; - }; - - - class secondCycle_textBottomLeftTwo : secondCycle_TextBottomLeft { - idc = 401; - x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textBottomLeftThree : secondCycle_TextBottomLeft { - idc = 402; - x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopLeftOne : secondCycle_TextBottomLeft { - idc = 403; - x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopLeftTwo : secondCycle_TextBottomLeft { - idc = 404; - text = ""; - x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopLeftThree : secondCycle_TextBottomLeft { - idc = 405; - x = "15.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopRightOne : secondCycle_TextBottomLeft { - idc = 406; - x = "19.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopRightTwo : secondCycle_TextBottomLeft { - idc = 407; - x = "22.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textTopRightThree : secondCycle_TextBottomLeft { - idc = 408; - x = "25.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textBottomRightOne : secondCycle_TextBottomLeft { - idc = 409; - x = "27.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textBottomRightTwo : secondCycle_TextBottomLeft { - idc = 410; - x = "27.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class secondCycle_textBottomRightThree : secondCycle_TextBottomLeft { - idc = 411; - x = "26.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "20 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - class secondCycle_actionBottomLeft : cse_gui_buttonBase { - idc = 300; - text = ""; - x = "9.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - /*animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.6)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0.5)";*/ - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = ""; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 350) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 350) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - class secondCycle_actionBottomLeftTwo : secondCycle_actionBottomLeft { - idc = 301; - x = "8.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 351) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 351) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionBottomLeftThree : secondCycle_actionBottomLeft { - idc = 302; - x = "8.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 352) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 352) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - class secondCycle_actionTopLeftOne : secondCycle_actionBottomLeft { - idc = 303; - x = "10 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 353) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 353) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionTopLeftTwo : secondCycle_actionBottomLeft { - idc = 304; - text = ""; - x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 354) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 354) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionTopLeftThree : secondCycle_actionBottomLeft { - idc = 305; - x = "16.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 355) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 355) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionTopRightOne : secondCycle_actionBottomLeft { - idc = 306; - x = "20.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 356) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 356) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionTopRightTwo : secondCycle_actionBottomLeft { - idc = 307; - x = "23.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 357) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 357) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionTopRightThree : secondCycle_actionBottomLeft { - idc = 308; - x = "26.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 358) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 358) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionBottomRightOne : secondCycle_actionBottomLeft { - idc = 309; - x = "28.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "11.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 359) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 359) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionBottomRightTwo : secondCycle_actionBottomLeft { - idc = 310; - x = "28.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "14.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 360) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 360) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class secondCycle_actionBottomRightThree : secondCycle_actionBottomLeft { - idc = 311; - x = "27.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 361) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RADIAL_MENU') displayCtrl 361) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - }; -}; diff --git a/TO_MERGE/cse/gui/gui/weapon_selector.h b/TO_MERGE/cse/gui/gui/weapon_selector.h deleted file mode 100644 index ec1e7c3451..0000000000 --- a/TO_MERGE/cse/gui/gui/weapon_selector.h +++ /dev/null @@ -1,195 +0,0 @@ - -class CSE_RscWeaponSelector { - idd = 432342; - movingenable = 0; - fadein = 0; - fadeout = 0; - onLoad = "uiNamespace setVariable ['CSE_RscWeaponSelector', _this select 0]; _this call cse_fnc_onWeaponSelectorOpened_GUI;"; - - class controlsBackground { - class backgroundTop: cse_gui_backgroundBase{ - idc = 800; - type = CT_STATIC; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "15 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {0.5, 0.2, 0.1, 0.4}; - colorBackground[] = {0, 0, 0, 0.4}; - text = "cse\cse_gui\radialmenu\data\radial_center_background_full_512.paa"; - }; - class backgroundCenter: backgroundTop{ - idc = 808; - text = "cse\cse_gui\radialmenu\data\radial_center_info_background.paa"; - }; - class iconCenter: cse_gui_backgroundBase{ - idc = 710; - type = CT_STATIC; - x = "17 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.4}; - colorBackground[] = {1,1,1, 0.0}; - text = ""; - }; - }; - - class controls { - class LabelmenuName: cse_gui_staticBase{ - idc = 1; - x = "17 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorText[] = {1,1,1, 1}; - colorBackground[] = {0,0,0, 0.2}; - text = ""; - style = ST_CENTER; - }; - - class labelCurrentSelectedName: LabelmenuName{ - idc = 2; - y = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.6)"; - }; - - /** ICONS FOR INNER CYCIRLE */ - class InnerCycle_iconTop: cse_gui_backgroundBase{ - idc = 100; - type = CT_STATIC; - x = "17.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.66}; - text = ""; - }; - - class InnerCycle_iconCenterLeft : InnerCycle_iconTop { - idc = 103; - x = "13.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconCenterRight : InnerCycle_iconTop { - idc = 104; - x = "24.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_iconBottom : InnerCycle_iconTop { - idc = 107; - x = "17.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - /** TEXT */ - class InnerCycle_TextTop: cse_gui_staticBase{ - idc = 200; - x = "18 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "3.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; - colorText[] = {1,1,1, 0.66}; - colorBackground[] = {1,1,1, 0.0}; - text = ""; - style = ST_CENTER; - }; - - class InnerCycle_TextCenterLeft : InnerCycle_TextTop { - idc = 203; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "15.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - class InnerCycle_TextCenterRight : InnerCycle_TextTop { - idc = 204; - x = "23.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "15.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - class InnerCycle_TextBottom : InnerCycle_TextTop { - idc = 207; - x = "18 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "20.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - }; - - class InnerCycle_actionTop : cse_gui_buttonBase { - idc = 10; - text = ""; - x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "7.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - /*animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.6)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0.5)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0.5)";*/ - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,0)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,0)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,0)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = ""; - onMouseEnter = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 100) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 100) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - - class InnerCycle_actionCenterLeft : InnerCycle_actionTop { - idc = 13; - text = ""; - x = "12.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 103) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 103) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - class InnerCycle_actionCenterRight : InnerCycle_actionTop { - idc = 14; - text = ""; - x = "23.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "13.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 104) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 104) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - - class InnerCycle_actionBottom : InnerCycle_actionTop { - idc = 17; - text = ""; - x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "2.7 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - onMouseEnter = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 107) ctrlSetTextColor [1, 1, 1, 1];"; - onMouseExit = "((uiNamespace getvariable 'CSE_RscWeaponSelector') displayCtrl 107) ctrlSetTextColor [1, 1, 1, 0.66];"; - }; - - - }; -}; diff --git a/TO_MERGE/cse/gui/init.sqf b/TO_MERGE/cse/gui/init.sqf deleted file mode 100644 index 96dfd03389..0000000000 --- a/TO_MERGE/cse/gui/init.sqf +++ /dev/null @@ -1,37 +0,0 @@ -CSE_ALLOW_ON_MOUSE_OVER_OPEN_RADIALMENU = false; -CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; - -if (!isDedicated) then { - call cse_fnc_gui_displayEventHandler; - [format["GUI - REGISTERING INTERACTION MENUS"],3] call cse_fnc_debug; - #include "init_action_ui.sqf" // radis menu + action keybindings - - if ((((["CombinedInteractionMenu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F) select 0) != 0) && (((["radius_menu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F) select 0) == 0)) then { - ["radius_menu", (["CombinedInteractionMenu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F)] call cse_fnc_updateMenuKeyBinding_f; - ["CombinedInteractionMenu", [0,0,0,0]] call cse_fnc_updateMenuKeyBinding_f; - }; -}; -cse_gui = true; - -[format["GUI - INIT COMPLETE"],3] call cse_fnc_debug; - - -["cse_gui_radialMenu_AllowOnMouseOver", ["Enable", "Disable"], (["cse_gui_radialMenu_AllowOnMouseOver", 0] call cse_fnc_getClientSideOptionFromProfile_F), { - CSE_ALLOW_ON_MOUSE_OVER_OPEN_RADIALMENU = (_this select 1) == 0; -}] call cse_fnc_addClientSideOptions_f; - -["cse_gui_radialMenu_AllowOnMouseOver","option","Radial Menu (Hover)","Open the radial menu category when you hover your mouse over the button."] call cse_fnc_settingsDefineDetails_F; - - -cse_fnc_interactWithVehicle_Crew_Condition = { -private ["_return"]; - _return = false; - if (((_this select 0) distance (_this select 1) < 10)) then { - if (((_this select 1) isKindOf "Car") || ((_this select 1) isKindOf "Air") || ((_this select 1) isKindOf "Tank")) then { - if (count (crew (_this select 1)) > 0) then { - _return = true; - }; - }; - }; - _return -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/init_action_ui.sqf b/TO_MERGE/cse/gui/init_action_ui.sqf deleted file mode 100644 index f86d1ec9fc..0000000000 --- a/TO_MERGE/cse/gui/init_action_ui.sqf +++ /dev/null @@ -1,63 +0,0 @@ -#define ACTION_MENU "ActionMenu" - - -[ACTION_MENU, "Action Menu", {[player] call cse_fnc_isAwake && vehicle player == cameraOn}, 2, "", {}, false] call cse_fnc_createRadialInteraction_F; -cse_fnc_openActionMenu_GUI = { - - ["ActionMenu"] call cse_fnc_openRadialInteractionMenu_F; - if ([player] call cse_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { - [player, 'amovppnemstpsnonwnondnon'] call cse_fnc_broadcastAnim; - }; -}; - -["radius_menu", (["radius_menu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), cse_fnc_openActionMenu_GUI, 800] call cse_fnc_addKeyBindingForMenu_F; -["radius_menu","menu","Open Action Menu","Opens the CSE Radial Action Menu"] call cse_fnc_settingsDefineDetails_F; - - -cse_fnc_playerCanInteractWithPerson = { - private ["_person","_modify"]; - _person = _this select 0; - _modify = _this select 1; - _return = false; - if (_person isKindOf "CAManBase") then { - _return = switch (_modify) do { - case 0: {([_person] call cse_fnc_isAwake)}; - case 1: {true}; - default {false}; - }; - }; - _return -}; - -// CATEGORIES -[ACTION_MENU,"interaction", "Interact", {["ActionMenu", "interaction", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_interact.paa", 0, "Interact with"] call cse_fnc_createCategoryRadialMenu_F; -[ACTION_MENU,"equipment", "Equipment", {["ActionMenu", "equipment", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_backpack_radio.paa", 1, "Equipment & Gear"] call cse_fnc_createCategoryRadialMenu_F; -[ACTION_MENU,"medical_menu", "Medical", {["ActionMenu", "medical_menu", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_examine_patient.paa", 2, "Medical Interaction"] call cse_fnc_createCategoryRadialMenu_F; -[ACTION_MENU,"group_actions", "Group", {["ActionMenu", "group_actions", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_group.paa", 3, "Your Group"] call cse_fnc_createCategoryRadialMenu_F; -[ACTION_MENU,"survival", "Survival", {["ActionMenu", "survival", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_survival.paa", 4, "Survival actions"] call cse_fnc_createCategoryRadialMenu_F; - -if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { - [ACTION_MENU,"alive_actions", "ALiVE", {["ActionMenu", "alive_actions", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_alive_mod.paa", 5, "ALiVE actions"] call cse_fnc_createCategoryRadialMenu_F; -}; - -[ACTION_MENU,"custom_actions", "Custom", {["ActionMenu", "custom_actions", _this select 1] call cse_fnc_categoryHasActionsAvailable_F}, CSE_ICON_PATH + "icon_lines_horizontal_s.paa", 6, "Custom actions"] call cse_fnc_createCategoryRadialMenu_F; - -// Entries -[ACTION_MENU,"custom_actions", [["Curator", {getAssignedCuratorLogic player in allCurators}, CSE_ICON_PATH + "icon_curator.paa", {closeDialog 0; openCuratorInterface; }, "Open Curator Interface"]] ] call cse_fnc_addMultipleEntriesToRadialCategory_F; - - - - -/* -["myID_1", true, CSE_ICON_PATH + "icon_group.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_2", true, CSE_ICON_PATH + "icon_backpack_radio.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_3", true, CSE_ICON_PATH + "icon_interact.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_4", true, CSE_ICON_PATH + "icon_survival.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; - - -["myID_1", false, CSE_ICON_PATH + "icon_group.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_2", false, CSE_ICON_PATH + "icon_backpack_radio.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_3", false, CSE_ICON_PATH + "icon_interact.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; -["myID_4", false, CSE_ICON_PATH + "icon_survival.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; - -*/ \ No newline at end of file diff --git a/TO_MERGE/cse/gui/init_interaction_ui.sqf b/TO_MERGE/cse/gui/init_interaction_ui.sqf deleted file mode 100644 index b7354a0e24..0000000000 --- a/TO_MERGE/cse/gui/init_interaction_ui.sqf +++ /dev/null @@ -1,6 +0,0 @@ - - if ((((["CombinedInteractionMenu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F) select 0) != 0) && (((["radius_menu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F) select 0) == 0)) then { - ["radius_menu", (["CombinedInteractionMenu","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F)] call cse_fnc_updateMenuKeyBinding_f; - ["CombinedInteractionMenu", [0,0,0,0]] call cse_fnc_updateMenuKeyBinding_f; - }; - diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottom_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottom_w.paa deleted file mode 100644 index 5142a62573..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottom_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomleft_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomleft_w.paa deleted file mode 100644 index bcc441512b..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomleft_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomright_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomright_w.paa deleted file mode 100644 index bd7746a142..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomright_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerleft_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerleft_w.paa deleted file mode 100644 index ab4dea1e5f..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerleft_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerright_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerright_w.paa deleted file mode 100644 index 9f36be9c30..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerright_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_top_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_top_w.paa deleted file mode 100644 index f1695ce4da..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_top_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_topleft_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_topleft_w.paa deleted file mode 100644 index ac8e507323..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_topleft_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_background_topright_w.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_background_topright_w.paa deleted file mode 100644 index 57204f2116..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_background_topright_w.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background.paa deleted file mode 100644 index 9f468feee7..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_512.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_512.paa deleted file mode 100644 index de28c44dad..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_512.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_full_512.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_full_512.paa deleted file mode 100644 index af1c2f97cc..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_full_512.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_center_info_background.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_center_info_background.paa deleted file mode 100644 index 51e5ea0e18..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_center_info_background.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa deleted file mode 100644 index 1fe76a1086..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomleft.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomleft.paa deleted file mode 100644 index b1dcf36875..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomleft.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomright.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomright.paa deleted file mode 100644 index de5763a4bf..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomright.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topleft.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topleft.paa deleted file mode 100644 index a888959e5a..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topleft.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topright.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topright.paa deleted file mode 100644 index b612277b25..0000000000 Binary files a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topright.paa and /dev/null differ diff --git a/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf b/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf deleted file mode 100644 index 38f901cb8d..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * fn_addCategoryEntryRadialMenu_F.sqf - * @Descr: Addes a new category entry to a radial menu - * @Author: Glowbal - * - * @Arguments: [menuName STRING, categoryName STRING, displayName STRING, condition CODE, icon STRING, onPressed CODE, toolTip STRING] - * @Return: BOOL True if succesfully added - * @PublicAPI: true - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - -private ["_menuName","_condition","_icon","_onOpened", "_position","_toolTip","_currentEntries", "_categoryName"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_categoryName = [_this, 1, "",[""]] call BIS_fnc_Param; -_displayNameEntry = [_this, 2, "",[""]] call BIS_fnc_Param; -_condition = [_this, 3, {true;}, [{}]] call BIS_fnc_Param; -_icon = [_this, 4, "", [""]] call BIS_fnc_Param; -_onOpened = [_this, 5, {}, [{}]] call BIS_fnc_Param; -_toolTip = [_this, 6, _displayNameEntry, [""]] call BIS_fnc_Param; - - // TODO parse menu name for correct value - _currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_category_entries_"+_menuName + _categoryName, []]; - _currentEntries pushback [_displayNameEntry,_icon,_onOpened,_condition, _toolTip]; - missionNamespace setvariable ["cse_radiusInteraction_f_category_entries_"+_menuName + _categoryName, _currentEntries]; - true; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_addEntryToMenuSorter_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_addEntryToMenuSorter_f.sqf deleted file mode 100644 index 8ab6e03f9a..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_addEntryToMenuSorter_f.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * fn_addEntryToMenuSorter_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_condition","_icon","_onOpened", "_priority","_toolTip","_currentEntries"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_displayNameEntry = [_this, 1, "",[""]] call BIS_fnc_Param; -_condition = [_this, 2, {true;}, [{}]] call BIS_fnc_Param; -_icon = [_this, 3, "", [""]] call BIS_fnc_Param; -_onOpened = [_this, 4, {}, [{}]] call BIS_fnc_Param; -_priority = [_this, 5, 0, [0]] call BIS_fnc_Param; -_toolTip = [_this, 6, _displayNameEntry, [""]] call BIS_fnc_Param; - - - -_currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_sorter_"+_menuName, []]; -_currentEntries pushback [_displayNameEntry,_icon,_onOpened,_condition, _toolTip]; -missionNamespace setvariable ["cse_radiusInteraction_f_entries_sorter_"+_menuName, _currentEntries]; - -// [[1,-80,0,480,15,-40],[],{_x},"ASCEND"] call BIS_fnc_sortBy; diff --git a/TO_MERGE/cse/gui/radialmenu/fn_addEntryToRadialInteraction_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_addEntryToRadialInteraction_f.sqf deleted file mode 100644 index 5f98b2664a..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_addEntryToRadialInteraction_f.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_addEntryToRadialInteraction_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - -private ["_menuName","_condition","_icon","_onOpened", "_position","_toolTip","_currentEntries"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_displayNameEntry = [_this, 1, "",[""]] call BIS_fnc_Param; -_condition = [_this, 2, {true;}, [{}]] call BIS_fnc_Param; -_icon = [_this, 3, "", [""]] call BIS_fnc_Param; -_onOpened = [_this, 4, {}, [{}]] call BIS_fnc_Param; -_position = [_this, 5, 0, [0]] call BIS_fnc_Param; -_toolTip = [_this, 6, _displayNameEntry, [""]] call BIS_fnc_Param; - -if (_position < 8) then { - // TODO parse menu name for correct value - _currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_"+_menuName, [DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY , DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY]]; - _currentEntries set [ _position, [_displayNameEntry,_icon,_onOpened,_condition, _toolTip]]; - missionNamespace setvariable ["cse_radiusInteraction_f_entries_"+_menuName, _currentEntries]; - true; -} else { - false; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_addMultipleEntriesToRadialCategory_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_addMultipleEntriesToRadialCategory_f.sqf deleted file mode 100644 index 4dadd9e205..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_addMultipleEntriesToRadialCategory_f.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * fn_addMultipleEntriesToRadialCategory_f.sqf - * @Descr: Addes multiple entries to a specific category for a radial menu - * @Author: Glowbal - * - * @Arguments: [menuName STRING, categoryName STRING, entries ARRAY (Format in [menuName STRING, categoryName STRING, displayName STRING, condition CODE, icon STRING, onPressed CODE, toolTip STRING])] - * @Return: void - * @PublicAPI: true - */ - -private ["_menuName","_condition","_icon","_onOpened", "_position","_toolTip","_currentEntries", "_categoryName", "_entries"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_categoryName = [_this, 1, "",[""]] call BIS_fnc_Param; -_entries = [ _this, 2, [], [[]]] call BIS_fnc_Param; - -{ - if (typeName _x == typeName []) then { - _displayNameEntry = [_x, 0, "",[""]] call BIS_fnc_Param; - _condition = [_x, 1, {false;}, [{}]] call BIS_fnc_Param; - _icon = [_x, 2, "", [""]] call BIS_fnc_Param; - _onOpened = [_x, 3, {}, [{}]] call BIS_fnc_Param; - _toolTip = [_x, 4, _displayNameEntry, [""]] call BIS_fnc_Param; - [_menuName,_categoryName, _displayNameEntry, _condition,_icon,_onOpened,_toolTip] call cse_fnc_addCategoryEntryRadialMenu_F; - }; -}foreach _entries; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_categoryHasActionsAvailable_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_categoryHasActionsAvailable_f.sqf deleted file mode 100644 index acf99521d1..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_categoryHasActionsAvailable_f.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/** - * fn_categoryHasActionsAvailable_f.sqf - * @Descr: Checks if a category has any actions available. - * @Author: Glowbal - * - * @Arguments: [menuName STRING, categoryName STRING, target OBJECT (The target object for which conditions will be parsed)] - * @Return: BOOL True if actions are available - * @PublicAPI: true - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - - -private ["_menuName","_categoryName", "_entries", "_entriesAvailable", "_entry", "_target"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_categoryName = [_this, 1, "",[""]] call BIS_fnc_Param; -_target = [_this, 2, objNull, [objNull]] call BIS_fnc_Param; -_entriesAvailable = false; -_entries = [_menuName, _categoryName] call cse_fnc_getAllCategoryEntriesRadialMenu_f; - { - _entry = + ([_entries, _foreachIndex, DEFAULT_ENTRY,[[]],[4,5]] call BIS_fnc_Param); - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _entriesAvailable = true; - }; - } else { - if (_entry select 3) then { - _entriesAvailable = true; - }; - }; - if (_entriesAvailable) exitwith {}; - }foreach _entries; - -_entriesAvailable \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_closeRadialSecondRing_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_closeRadialSecondRing_gui.sqf deleted file mode 100644 index e17517788d..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_closeRadialSecondRing_gui.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_closeRadialSecondRing_gui.sqf - * @Descr: Closes the second ring from the radial menu - * @Author: Glowbal - * - * @Arguments: [] - * @Return: void - * @PublicAPI: true - */ - -private ["_numberOf","_target","_menuName","_entryToSwitchTo", "_entries"]; - -[ObjNull, []] call cse_fnc_setRadialSecondRing_GUI; - -private ["_numberOf","_entries","_entryToSwitchTo","_target","_menuName"]; -if (isnil "CSE_RADIAL_SUB_MENU_GUI") then { - CSE_RADIAL_SUB_MENU_GUI = []; -}; -_numberOf = count CSE_RADIAL_SUB_MENU_GUI - 1; -if (_numberOf < 0) then { - _numberOf = 0; -}; -if (count CSE_RADIAL_SUB_MENU_GUI == 0) exitwith {}; -_entryToSwitchTo = CSE_RADIAL_SUB_MENU_GUI select _numberOf; -_target = _entryToSwitchTo select 0; -_menuName = _entryToSwitchTo select 1; -_entries = _entryToSwitchTo select 2; -[_target, _entries] call cse_fnc_setRadialMenuOptions_GUI; -[_menuName] call cse_fnc_setRadialMenuName_GUI; -[-1, false] call cse_fnc_setRadialOptionSelected_GUI; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_createCategoryRadialMenu_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_createCategoryRadialMenu_f.sqf deleted file mode 100644 index 501839ca07..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_createCategoryRadialMenu_f.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/** - * fn_createCategoryRadialMenu_f.sqf - * @Descr: Creates a category for a radial menu (Inner cycle) - * @Author: Glowbal - * - * @Arguments: [menuName STRING, categoryName STRING, displayName STRING, condition CODE, icon STRING, position NUMBER (0 to 7), toolTip STRING] - * @Return: BOOL True if succesfully created - * @PublicAPI: true - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - - -private ["_menuName","_condition","_icon","_onOpened", "_position","_toolTip","_currentEntries", "_categorycode", "_displayNameEntry","_categoryName","_icon"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_categoryName = [_this, 1, "",[""]] call BIS_fnc_Param; -_displayNameEntry = [_this, 2, "",[""]] call BIS_fnc_Param; -_condition = [_this, 3, {true;}, [{}]] call BIS_fnc_Param; -_icon = [_this, 4, "", [""]] call BIS_fnc_Param; -_position = [_this, 5, 0, [0]] call BIS_fnc_Param; -_toolTip = [_this, 6, _displayNameEntry, [""]] call BIS_fnc_Param; - -if (_position < 8) then { - _onOpened = compile format[" - [ _this select 3, - ['%1', '%2'] call cse_fnc_getAllCategoryEntriesRadialMenu_f, - _this select 1, _this select 2 - ] call cse_fnc_openRadialSecondRing_GUI;",_menuName, _categoryName]; - - // TODO parse menu name for correct value - _currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_"+_menuName, [DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY , DEFAULT_ENTRY, DEFAULT_ENTRY, DEFAULT_ENTRY]]; - _currentEntries set [ _position, [_displayNameEntry, _icon,_onOpened,_condition, _toolTip]]; - missionNamespace setvariable ["cse_radiusInteraction_f_entries_"+_menuName, _currentEntries]; - - missionNamespace setvariable ["cse_radiusInteraction_f_category_entries_"+_menuName+_categoryName, []]; - - true; -} else { - false; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_createRadialInteraction_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_createRadialInteraction_f.sqf deleted file mode 100644 index 0ec48b353b..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_createRadialInteraction_f.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_createRadialInteraction_f.sqf - * @Descr: Creates a radial interaction menu - * @Author: Glowbal - * - * @Arguments: [menuName STRING, displayName STRING, condition CODE, type NUMBER (0 = self, 1 = other, 2 = combined), icon STRING, onOpened CODE] - * @Return: BOOL. True if menu has succesfully been created - * @PublicAPI: true - */ - - -private ["_menuName","_condition","_typeOfMenu","_icon","_onOpened", "_currentEntries" , "_useSorter"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_displayName = [_this, 1, "",[""]] call BIS_fnc_Param; -_condition = [_this, 2, {false},[{}]] call BIS_fnc_Param; -_typeOfMenu = [_this, 3, 0, [0]] call BIS_fnc_Param; -_icon = [_this, 4, "", [""]] call BIS_fnc_Param; -_onOpened = [_this, 5, {}, [{}]] call BIS_fnc_Param; -_useSorter = [_this, 6, false, [false]] call BIS_fnc_Param; - -_currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_allMenuNames", []]; -missionNamespace setvariable ["cse_radiusInteraction_f_"+_menuName, [_menuName,_displayName,_condition,_typeOfMenu,_icon,_onOpened, _useSorter]]; // if it exist, we want to overwrite it with new values - -if (!(_menuName in _currentEntries)) then { - _currentEntries pushback _menuName; - missionNamespace setvariable ["cse_radiusInteraction_f_allMenuNames", _currentEntries]; - true; -} else { - false; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_findTargetName_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_findTargetName_gui.sqf deleted file mode 100644 index dc5386a09e..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_findTargetName_gui.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * fn_findTargetName_gui.sqf - * @Descr: Get the target name - * @Author: Glowbal - * - * @Arguments: [target OBJECT] - * @Return: STRING name of Target - * @PublicAPI: true - */ - -private ["_target","_targetName"]; -_target = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; - -_targetName = switch (true) do { - case (_target isKindOf "CaManBase"): {([_target] call cse_fnc_getName)}; - case ((_target isKindOf "All")): {(getText(configFile >> "Cfgvehicles" >> typeof _target >> "displayName"))}; - default {"Object"}; -}; - -_targetName \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_findTargetOfMenu_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_findTargetOfMenu_gui.sqf deleted file mode 100644 index 9a5ca534ef..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_findTargetOfMenu_gui.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/** - * fn_findTargetOfMenu_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_type", "_target","_carriedObj","_allowed"]; -_type = [_this, 0, 0,[0]] call BIS_fnc_Param; -_allowedClasses = [_this, 1, ["all"],[[]]] call BIS_fnc_Param; - -if (vehicle player != player) exitwith { - vehicle player; -}; - -_target = switch (_type) do { - case 2: {if (isNull cursortarget) then {player} else{cursortarget};}; - case 1: {cursortarget}; - case 0: {player}; - default {ObjNull}; -}; - - - -if ((_target distance player) > 10 && {(_type == 2)}) then { - _target = player; -}; -if (_target != player) then { - _carriedObj = [player] call cse_fnc_getCarriedObj; - if (!isNull _carriedObj) then { - _target = _carriedObj; - }; -}; -_allowed = false; -{ - if (_target isKindOf _x) exitwith { - _allowed = true; - }; -}foreach _allowedClasses; -if (!_allowed) then { - _target = ObjNull; -}; -_target \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_getAllCategoryEntriesRadialMenu_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_getAllCategoryEntriesRadialMenu_f.sqf deleted file mode 100644 index d9cb1763d7..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_getAllCategoryEntriesRadialMenu_f.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * fn_getAllCategoryEntriesRadialMenu_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_categoryName"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_categoryName = [_this, 1, "",[""]] call BIS_fnc_Param; - -(missionNamespace getvariable ["cse_radiusInteraction_f_category_entries_"+_menuName+_categoryName, []]) \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_getCurrentRadialTarget_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_getCurrentRadialTarget_gui.sqf deleted file mode 100644 index 47e8e6fb60..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_getCurrentRadialTarget_gui.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_getCurrentRadialTarget_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_target"]; -if (isnil "CSE_interactionTarget") then { - _target = objNull; -} else { - disableSerialization; - - if (isNull (uiNamespace getvariable "CSE_RADIAL_MENU")) then { - _target = objNull; - } else { - _target = CSE_interactionTarget; - }; -}; -_target \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_getEntryToMenuSorter_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_getEntryToMenuSorter_f.sqf deleted file mode 100644 index 175520ffd5..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_getEntryToMenuSorter_f.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * fn_getEntryToMenuSorter_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_currentEntries", "_returnEntries", "_target", "_toAddEntry"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_target = [_this, 1, ObjNull, [ObjNull]] call BIS_fnc_Param; - -_currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_sorter_"+_menuName, []]; -_returnEntries = []; -{ - _entry = _x; - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _toAddEntry = +_entry; - _toAddEntry set [ 3, true]; - _returnEntries pushback _toAddEntry; - }; - } else { - if (_entry select 3) then { - _returnEntries pushback (+ _x); - }; - }; -}foreach _currentEntries; -_returnEntries; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_getIcon_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_getIcon_f.sqf deleted file mode 100644 index 03236d36b8..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_getIcon_f.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * fn_getIcon_f.sqf - * @Descr: Grab an icon from the CSE Icon collection - * @Author: Glowbal - * - * @Arguments: [name STRING] - * @Return: STRING Path to icon. Returns empty path if icon does not exist - * @PublicAPI: true - */ - -#define CSE_ICON_PATH "cse\cse_gui\radialmenu\data\icons\" - -private ["_iconName","_return"]; -_iconName = [_this, 0, "",[""]] call bis_fnc_param; -if (_iconName == "") then { - _iconName = "icon_cse"; -}; -_return = CSE_ICON_PATH + _iconName + ".paa"; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_getRadialInteractionEntries_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_getRadialInteractionEntries_f.sqf deleted file mode 100644 index 02d295621b..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_getRadialInteractionEntries_f.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/** - * fn_getRadialInteractionEntries_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_currentEntries"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; - -_currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_"+_menuName, []]; - -_currentEntries; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_hasEntriesRadialInteraction_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_hasEntriesRadialInteraction_f.sqf deleted file mode 100644 index 7813a497d1..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_hasEntriesRadialInteraction_f.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * fn_hasEntriesRadialInteraction_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - - -private ["_menuName","_entries", "_hasEntriesAvailable", "_target"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -_target = [_this, 1, ObjNull, [ObjNull]] call BIS_fnc_Param; - -if ([_menuName, _target] call cse_fnc_radialUsesSorter_F) then { - _entries = missionNamespace getvariable ["cse_radiusInteraction_f_entries_sorter_"+_menuName, []]; // getting the direct list, otherwise it will call the conditions first -} else { - _entries = [_menuName] call cse_fnc_getRadialInteractionEntries_F; // FORMAT [ [_menuName,_icon,_onOpened,_condition] , .. ] -}; -_hasEntriesAvailable = false; -{ - _entry = _x; - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _hasEntriesAvailable = true; - }; - } else { - if (_entry select 3) then { - _hasEntriesAvailable = true; - }; - }; - - if (_hasEntriesAvailable) exitwith {}; -}count _entries; - -_hasEntriesAvailable; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_isOpenSecondRing_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_isOpenSecondRing_gui.sqf deleted file mode 100644 index 9907647f16..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_isOpenSecondRing_gui.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/** - * fn_isOpenSecondRing_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define OPTION_BOTTOM_LEFT_ONE 300 -#define OPTION_BOTTOM_LEFT_TWO 301 -#define OPTION_BOTTOM_LEFT_THREE 302 -#define OPTION_TOP_LEFT_ONE 303 -#define OPTION_TOP_LEFT_TWO 304 -#define OPTION_TOP_LEFT_THREE 305 -#define OPTION_TOP_RIGHT_ONE 306 -#define OPTION_TOP_RIGHT_TWO 307 -#define OPTION_TOP_RIGHT_THREE 308 -#define OPTION_BOTTOM_RIGHT_ONE 309 -#define OPTION_BOTTOM_RIGHT_TWO 310 -#define OPTION_BOTTOM_RIGHT_THREE 311 - - -private ["_return", "_availableOptionSpots"]; -_availableOptionSpots = [OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE]; - -_return = false; -{ - if (ctrlEnabled _x) exitwith { - _return = true; - }; -}foreach _availableOptionSpots; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_isRadialOptionSelected_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_isRadialOptionSelected_gui.sqf deleted file mode 100644 index b8dcc39bc1..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_isRadialOptionSelected_gui.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/** - * fn_isRadialOptionSelected_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_number","_return"]; -_number = [_this, 0, 0, [0]] call BIS_fnc_Param; -if (isnil "CSE_SELECTED_RADIAL_OPTION_N_GUI") then { - _return = false; -} else { - _return = (CSE_SELECTED_RADIAL_OPTION_N_GUI == _number); -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_openRadialInteractionMenu_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_openRadialInteractionMenu_f.sqf deleted file mode 100644 index 3536bc929f..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_openRadialInteractionMenu_f.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * fn_openRadialInteractionMenu_f.sqf - * @Descr: Opens a radial menu that has been registered if condition is met - * @Author: Glowbal - * - * @Arguments: [menuName STRING] - * @Return: void - * @PublicAPI: true - */ - - -#define DEFAULT_ENTRY ["","",{}, false, ""] - -private ["_menuName", "_entries", "_menu", "_target"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; - -_menu = missionNamespace getvariable "cse_radiusInteraction_f_"+_menuName; // [ _menuName, _displayNameMenu, _condition,_typeOfMenu,_icon,_onOpened ] -if (!isnil "_menu") then { - _menuName = _menu select 0; - _displayNameMenu = _menu select 1; - _conditionOfMenu = _menu select 2; - _typeOfMenu = _menu select 3; - _icon = _menu select 4; - _onOpened = _menu select 5; - _target = [_typeOfMenu] call cse_fnc_findTargetOfMenu_GUI; - if (isNull _target) exitwith {}; - if (!([player, _target, _menuName] call _conditionOfMenu)) exitwith {}; - if (!([_menuName,_target] call cse_fnc_hasEntriesRadialInteraction_F) && (_target != player)) then {_target = player;}; - if (isNull _target) exitwith {}; - if !([_menuName,_target] call cse_fnc_hasEntriesRadialInteraction_F) exitwith {}; - if ([_menuName, _target] call cse_fnc_radialUsesSorter_F) then { - _entries = [_menuName] call cse_fnc_getEntryToMenuSorter_F; - } else { - _entries = [_menuName] call cse_fnc_getRadialInteractionEntries_F; // FORMAT [ [_menuName,_icon,_onOpened,_condition] , .. ] - }; - [_displayNameMenu, _entries, _target] call cse_fnc_openRadialMenu_GUI; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_openRadialMenu_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_openRadialMenu_gui.sqf deleted file mode 100644 index b62bf87e68..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_openRadialMenu_gui.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_openRadialMenu_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_entries", "_menuName","_target"]; -disableSerialization; -createDialog "CSE_RADIAL_MENU"; -CSE_RADIAL_SUB_MENU_GUI = []; - -_menuName = [_this, 0, "Main Menu", [""]] call BIS_fnc_Param; -_entries = [_this, 1, [], [[]]] call BIS_fnc_Param; -_target = [_this, 2, ObjNull, [ObjNull]] call BIS_fnc_Param; -setMousePosition [ 0.5, 0.6 ]; -[_menuName,_entries, _target] call cse_fnc_openRadialSubMenu_GUI; - -[[_menuName, _entries, _target],"openRadialMenu"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_openRadialSecondRing_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_openRadialSecondRing_gui.sqf deleted file mode 100644 index c5f1577a57..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_openRadialSecondRing_gui.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/** - * fn_openRadialSecondRing_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - - -private ["_entries","_menuName", "_target", "_from", "_passEntries", "_force"]; -_menuName = [_this, 0, "Main Menu",[""]] call BIS_fnc_Param; -_entries = [_this, 1, [],[[]]] call BIS_fnc_Param; -_target = [_this, 2, ObjNull, [ObjNull]] call BIS_fnc_Param; -_from = [_this, 3, 10, [0]] call BIS_fnc_Param; -_force = [_This, 4, false, [false]] call BIS_fnc_Param; - -if (([_from] call cse_fnc_isRadialOptionSelected_GUI) && !_force) then { - [] call cse_fnc_closeRadialSecondRing_GUI; -} else { - _passEntries = []; - - { - _entry = + ([_entries, _foreachIndex, DEFAULT_ENTRY,[[]],[4,5]] call BIS_fnc_Param); - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _entry set [ 3, true]; - _passEntries pushback _entry; - }; - } else { - if (_entry select 3) then { - _passEntries pushback _entry; - }; - }; - }foreach _entries; - [_target, _passEntries, _from] call cse_fnc_setRadialSecondRing_GUI; - [_from, true] call cse_fnc_setRadialOptionSelected_GUI; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_openRadialSubMenu_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_openRadialSubMenu_gui.sqf deleted file mode 100644 index 245cdf00a5..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_openRadialSubMenu_gui.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * fn_openRadialSubMenu_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_entries","_menuName", "_target"]; -_menuName = [_this, 0, "Main Menu",[""]] call BIS_fnc_Param; -_entries = [_this, 1, [],[[]]] call BIS_fnc_Param; -_target = [_this, 2, ObjNull, [ObjNull]] call BIS_fnc_Param; -[] call cse_fnc_closeRadialSecondRing_GUI; -CSE_RADIAL_SUB_MENU_GUI pushback [_target, _menuName, _entries]; -[_target, _entries] call cse_fnc_setRadialMenuOptions_GUI; -[_menuName] call cse_fnc_setRadialMenuName_GUI; -[-1, false] call cse_fnc_setRadialOptionSelected_GUI; -[ ([_target] call cse_fnc_findTargetName_GUI) ] call cse_fnc_setRadialMenuTargetName_GUI; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_radialUsesSorter_f.sqf b/TO_MERGE/cse/gui/radialmenu/fn_radialUsesSorter_f.sqf deleted file mode 100644 index 8ae3b84e7b..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_radialUsesSorter_f.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * fn_radialUsesSorter_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName","_currentEntries"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; - -_currentEntries = missionNamespace getvariable ["cse_radiusInteraction_f_"+_menuName, []]; -if (_currentEntries isEqualTo []) exitwith { false }; - -(_currentEntries select 6); \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_returnToPreviousSubMenu_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_returnToPreviousSubMenu_gui.sqf deleted file mode 100644 index b7166aff2f..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_returnToPreviousSubMenu_gui.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/** - * fn_returnToPreviousSubMenu_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_numberOf","_entries","_entryToSwitchTo","_target","_menuName"]; -if (isnil "CSE_RADIAL_SUB_MENU_GUI") then { - CSE_RADIAL_SUB_MENU_GUI = []; -}; -_numberOf = count CSE_RADIAL_SUB_MENU_GUI - 1; -if (_numberOf < 0) then { - _numberOf = 0; -}; -if (count CSE_RADIAL_SUB_MENU_GUI == 0 || ((_numberOf - 1) < 0)) exitwith { - closedialog 432341; -}; -_entryToSwitchTo = CSE_RADIAL_SUB_MENU_GUI select (_numberOf - 1); -CSE_RADIAL_SUB_MENU_GUI resize _numberOf; -_target = _entryToSwitchTo select 0; -_menuName = _entryToSwitchTo select 1; -_entries = _entryToSwitchTo select 2; - -[_target, _entries] call cse_fnc_setRadialMenuOptions_GUI; -[_menuName] call cse_fnc_setRadialMenuName_GUI; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuName_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuName_gui.sqf deleted file mode 100644 index 7ac2cf648b..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuName_gui.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_setRadialMenuName_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName", "_buttonName", "_display", "_countOf"]; -_menuName = [_this, 0, "Main Menu",[""]] call BIS_fnc_Param; -ctrlSetText [1, _menuName]; - -if (count CSE_RADIAL_SUB_MENU_GUI > 1) then { - _countOf = (count CSE_RADIAL_SUB_MENU_GUI) - 2; - _buttonName = "Return to " + ((CSE_RADIAL_SUB_MENU_GUI select _countOf) select 1); -} else { - _buttonName = "Close Menu"; -}; - -disableSerialization; -_display = uiNamespace getvariable "CSE_RADIAL_MENU"; -(_display displayCtrl 2315) ctrlSetTooltip _buttonName; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuOptions_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuOptions_gui.sqf deleted file mode 100644 index dc151cc954..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuOptions_gui.sqf +++ /dev/null @@ -1,86 +0,0 @@ -/** - * fn_setRadialMenuOptions_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - -private ["_display","_availableOptions","_buttonCtrl","_iconCtrl","_textCtrl","_entry","_textCtrl", "_entries", "_target", "_title", "_backgroundCtrl"]; - -_target = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; -_entries = [_this, 1, [], [[]]] call BIS_fnc_Param; -CSE_interactionTarget = _target; - - -disableSerialization; -_display = uiNamespace getvariable "CSE_RADIAL_MENU"; -_availableOptions = [10, 11, 12, 13, 14, 15, 16, 17]; -{ - _buttonCtrl = _display displayCtrl _x; - _iconCtrl = _display displayCtrl (_x + 90); - _textCtrl = _display displayCtrl (_x + 190); - _backgroundCtrl = _display displayCtrl (_x + 790); - _buttonCtrl ctrlEnable true; - _entry = [_entries, _foreachIndex, DEFAULT_ENTRY,[[]],[4,5]] call BIS_fnc_Param; - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - _title = _entry select 4; - if (isnil "_title") then { - _title = _entry select 0; - }; - missionnamespace setvariable ["CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_"+ str _x, format["if (!([] call cse_fnc_isOpenSecondRing_GUI) && CSE_ALLOW_ON_MOUSE_OVER_OPEN_RADIALMENU) then {[player,CSE_interactionTarget, %1, '%3'] call %2; }; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetEventHandler ["ButtonClick", format["[player,CSE_interactionTarget, %1, '%3'] call %2; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetTooltip (_entry select 4); - _backgroundCtrl ctrlSetTextColor [0,0,0,0.66]; - _iconCtrl ctrlSetTextColor [1,1,1,0.66]; - _textCtrl ctrlSetTextColor [1,1,1,0.66]; - } else { - _buttonCtrl ctrlEnable false; - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - _iconCtrl ctrlSetTextColor [1,1,1,0.2]; - _textCtrl ctrlSetTextColor [1,1,1,0.2]; - _buttonCtrl ctrlSetTooltip ""; - _backgroundCtrl ctrlSetTextColor [0,0,0,0.66]; - - missionnamespace setvariable ["CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_"+ str _x, ""]; - }; - } else { - if (_entry select 3) then { - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - - _iconCtrl ctrlSetTextColor [1,1,1,0.66]; - _textCtrl ctrlSetTextColor [1,1,1,0.66]; - _title = _entry select 4; - if (isnil "_title") then { - _title = _entry select 0; - }; - missionnamespace setvariable ["CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_"+ str _x, format["if (!([] call cse_fnc_isOpenSecondRing_GUI) && CSE_ALLOW_ON_MOUSE_OVER_OPEN_RADIALMENU) then {[player,CSE_interactionTarget, %1, '%3'] call %2; }; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetEventHandler ["ButtonClick", format["[player,CSE_interactionTarget,%1 , '%3'] call %2; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetTooltip (_entry select 4); - _backgroundCtrl ctrlSetTextColor [0,0,0,0.66]; - } else { - _buttonCtrl ctrlEnable false; - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - _iconCtrl ctrlSetTextColor [1,1,1,0.2]; - _textCtrl ctrlSetTextColor [1,1,1,0.2]; - missionnamespace setvariable ["CSE_RADIAL_MENU_CODE_ON_MOUSE_IN_BUTTON_"+ str _x, ""]; - _buttonCtrl ctrlSetTooltip ""; - _backgroundCtrl ctrlSetTextColor [0,0,0,0.66]; - }; - }; - - _textCtrl ctrlCommit 0; - _iconCtrl ctrlCommit 0; - _backgroundCtrl ctrlCommit 0; - _buttonCtrl ctrlCommit 0; -}foreach _availableOptions; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuTargetName_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuTargetName_gui.sqf deleted file mode 100644 index 9eb7cc903e..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuTargetName_gui.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_setRadialMenuTargetName_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_menuName"]; -_menuName = [_this, 0, "",[""]] call BIS_fnc_Param; -ctrlSetText [2, _menuName]; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_setRadialOptionSelected_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_setRadialOptionSelected_gui.sqf deleted file mode 100644 index 5cf550a48b..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_setRadialOptionSelected_gui.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/** - * fn_setRadialOptionSelected_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_number","_selected","_display","_backgroundCtrl"]; -_number = [_this, 0, 10, [0]] call BIS_fnc_Param; -_selected = [_this, 1, false, [false]] call BIS_fnc_Param; - -if (_number > 9 && _number < 18 || _number == -1) then { - disableSerialization; - _display = uiNamespace getvariable "CSE_RADIAL_MENU"; - - for "_i" from 800 to 808 do { - _backgroundCtrl = _display displayCtrl _i; - _backgroundCtrl ctrlSetTextColor [ 0, 0, 0, 0.66]; - }; - CSE_SELECTED_RADIAL_OPTION_N_GUI = _number; - if (_number != -1) then { - _backgroundCtrl = _display displayCtrl (_number + 790); - if (_selected) then { - _backgroundCtrl ctrlSetTextColor [ 0.77, 0.5, 0.0, 0.66]; - } else { - _backgroundCtrl ctrlSetTextColor [ 0, 0, 0, 0.66]; - }; - _backgroundCtrl ctrlCommit 0; - }; - -}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/radialmenu/fn_setRadialSecondRing_gui.sqf b/TO_MERGE/cse/gui/radialmenu/fn_setRadialSecondRing_gui.sqf deleted file mode 100644 index 64694cde61..0000000000 --- a/TO_MERGE/cse/gui/radialmenu/fn_setRadialSecondRing_gui.sqf +++ /dev/null @@ -1,180 +0,0 @@ -/** - * fn_setRadialSecondRing_gui.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define DEFAULT_ENTRY ["","",{}, false, ""] - -#define ACTION_TOP 10 -#define ACTION_TOP_LEFT 11 -#define ACTION_TOP_RIGHT 12 -#define ACTION_CENTER_LEFT 13 -#define ACTION_CENTER_RIGHT 14 -#define ACTION_BOTTOM_LEFT 15 -#define ACTION_BOTTOM_RIGHT 16 -#define ACTION_BOTTOM 17 - -#define OPTION_BOTTOM_LEFT_ONE 300 -#define OPTION_BOTTOM_LEFT_TWO 301 -#define OPTION_BOTTOM_LEFT_THREE 302 -#define OPTION_TOP_LEFT_ONE 303 -#define OPTION_TOP_LEFT_TWO 304 -#define OPTION_TOP_LEFT_THREE 305 -#define OPTION_TOP_RIGHT_ONE 306 -#define OPTION_TOP_RIGHT_TWO 307 -#define OPTION_TOP_RIGHT_THREE 308 -#define OPTION_BOTTOM_RIGHT_ONE 309 -#define OPTION_BOTTOM_RIGHT_TWO 310 -#define OPTION_BOTTOM_RIGHT_THREE 311 - -private ["_entries","_fromInnerRing","_display","_entry","_actionFillOrder","_availableSpots","_availableOptionSpots","_buttonCtrl","_iconCtrl", "_textCtrl","_title"]; -_target = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; -_entries = [_this, 1, [], [[]]] call BIS_fnc_Param; -_fromInnerRing = [_this, 2, ACTION_TOP, [0]] call BIS_fnc_Param; - -_availableOptionSpots = [OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE]; - -_bottomLeftCollection = [OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE]; -_topLeftCollection = [OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE]; -_bottomRightCollection = [OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE]; -_topRightCollection = [OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE]; - -_actionFillOrder = switch (_fromInnerRing) do { - case ACTION_TOP: { [ OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE , OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO , OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE]}; - - case ACTION_TOP_LEFT: {[OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE, OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO , OPTION_BOTTOM_LEFT_ONE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE ]}; - - case ACTION_TOP_RIGHT: { [OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE, OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO , OPTION_BOTTOM_LEFT_ONE ]}; - - case ACTION_CENTER_LEFT: {[OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO , OPTION_BOTTOM_LEFT_ONE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE]}; - - case ACTION_CENTER_RIGHT: {[OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_RIGHT_THREE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_ONE, OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE, OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_ONE]}; - - case ACTION_BOTTOM_LEFT: {[OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE]}; - - case ACTION_BOTTOM_RIGHT: {[OPTION_BOTTOM_RIGHT_THREE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_ONE, OPTION_TOP_RIGHT_THREE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_ONE, OPTION_TOP_LEFT_THREE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_ONE, OPTION_BOTTOM_LEFT_THREE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_ONE ] }; - - case ACTION_BOTTOM: {[OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE]}; - - default {[OPTION_BOTTOM_LEFT_ONE, OPTION_BOTTOM_LEFT_TWO, OPTION_BOTTOM_LEFT_THREE, OPTION_TOP_LEFT_ONE, OPTION_TOP_LEFT_TWO, OPTION_TOP_LEFT_THREE, OPTION_BOTTOM_RIGHT_ONE, OPTION_BOTTOM_RIGHT_TWO, OPTION_BOTTOM_RIGHT_THREE, OPTION_TOP_RIGHT_ONE, OPTION_TOP_RIGHT_TWO, OPTION_TOP_RIGHT_THREE]}; -}; - -_showBottomLeft = false; -_showTopLeft = false; -_showTopRight = false; -_showBottomRight = false; - -_determineShowBackGroundVariables = { - private ["_idc"]; - _idc = (_this select 0); - if (_idc in _bottomLeftCollection) then { - _showBottomLeft = true; - } else { - if (_idc in _topLeftCollection) then { - _showTopLeft = true; - } else { - if (_idc in _topRightCollection) then { - _showTopRight = true; - } else { - if (_idc in _bottomRightCollection) then { - _showBottomRight = true; - }; - }; - }; - }; -}; - - - - -disableSerialization; -_display = uiNamespace getvariable "CSE_RADIAL_MENU"; - -{ - _buttonCtrl = _display displayCtrl _x; - _iconCtrl = _display displayCtrl (_x + 50); - _textCtrl = _display displayCtrl (_x + 100); - _buttonCtrl ctrlEnable true; - _entry = [_entries, _foreachIndex, DEFAULT_ENTRY,[[]],[4,5]] call BIS_fnc_Param; - if (typeName (_entry select 3) == typeName {}) then { - if ([player, _target] call (_entry select 3)) then { - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - if (count _entry < 5) then { - _title = _entry select 0; - } else { - _title = _entry select 4; - }; - _buttonCtrl ctrlSetEventHandler ["ButtonClick", format["[player,CSE_interactionTarget,%1 , '%3'] call %2; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetTooltip _title; - - [_x] call _determineShowBackGroundVariables; - } else { - _buttonCtrl ctrlEnable false; - _iconCtrl ctrlSetText ""; - _textCtrl ctrlSetText ""; - _buttonCtrl ctrlSetTooltip ""; - }; - } else { - if (_entry select 3) then { - _textCtrl ctrlSetText (_entry select 0); - _iconCtrl ctrlSetText (_entry select 1); - - if (count _entry < 5) then { - _title = _entry select 0; - } else { - _title = _entry select 4; - }; - _buttonCtrl ctrlSetEventHandler ["ButtonClick", format["[player,CSE_interactionTarget,%1 , '%3'] call %2; true;",_x, _entry select 2, _title]]; - _buttonCtrl ctrlSetTooltip _title; - [_x] call _determineShowBackGroundVariables; - } else { - _buttonCtrl ctrlEnable false; - _iconCtrl ctrlSetText ""; - _textCtrl ctrlSetText ""; - _buttonCtrl ctrlSetTooltip ""; - }; - }; - - _textCtrl ctrlCommit 0; - _iconCtrl ctrlCommit 0; - _buttonCtrl ctrlCommit 0; -}foreach _actionFillOrder; - - -if (_showBottomLeft) then { - (_display displayCtrl 702) ctrlSetTextColor [0,0,0,0.66]; -} else { - (_display displayCtrl 702) ctrlSetTextColor [0,0,0,0.0]; -}; -(_display displayCtrl 702) ctrlCommit 0; - - -if (_showTopLeft) then { - (_display displayCtrl 700) ctrlSetTextColor [0,0,0,0.66]; -} else { - (_display displayCtrl 700) ctrlSetTextColor [0,0,0,0.0]; -}; -(_display displayCtrl 700) ctrlCommit 0; - - -if (_showTopRight) then { - (_display displayCtrl 701) ctrlSetTextColor [0,0,0,0.66]; -} else { - (_display displayCtrl 701) ctrlSetTextColor [0,0,0,0.0]; -}; -(_display displayCtrl 701) ctrlCommit 0; - - -if (_showBottomRight) then { - (_display displayCtrl 703) ctrlSetTextColor [0,0,0,0.66]; -} else { - (_display displayCtrl 703) ctrlSetTextColor [0,0,0,0.0]; -}; -(_display displayCtrl 703) ctrlCommit 0; - diff --git a/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf b/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf deleted file mode 100644 index e7ad59a6ee..0000000000 --- a/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf +++ /dev/null @@ -1,20 +0,0 @@ -private ["_display", "_currentWeapon", "_primaryWeapon", "_secondairyWeapon", "_pistol"]; -_display = _this select 0; - -_currentWeapon = currentWeapon player; -_primaryWeapon = primaryWeapon player; -_secondairyWeapon = secondaryWeapon player; -_pistol = handgunWeapon player; - -// getText(configFile >> "CfgMagazines" >> "%1" >> "displayName"), getText(configFile >> "CfgMagazines" >> "%1" >> "picture"); - - -(_display displayCtrl 710) ctrlSetText (getText(configFile >> "CfgWeapons" >> _currentWeapon >> "picture")); - -(_display displayCtrl 100) ctrlSetText (getText(configFile >> "CfgWeapons" >> _currentWeapon >> "picture")); - -(_display displayCtrl 103) ctrlSetText (getText(configFile >> "CfgWeapons" >> _secondairyWeapon >> "picture")); - -(_display displayCtrl 104) ctrlSetText (getText(configFile >> "CfgWeapons" >> _pistol >> "picture")); - -// (_display displayCtrl 107) ctrlSetText (getText(configFile >> "CfgWeapons" >> _currentWeapon >> "picture")); \ No newline at end of file diff --git a/TO_MERGE/cse/main/CfgFactionClasses.h b/TO_MERGE/cse/main/CfgFactionClasses.h deleted file mode 100644 index 6dce67e747..0000000000 --- a/TO_MERGE/cse/main/CfgFactionClasses.h +++ /dev/null @@ -1,22 +0,0 @@ -class CfgFactionClasses -{ - class NO_CATEGORY; - class cseModules: NO_CATEGORY { - displayName = "CSE Modules"; - }; - class cseDebug: NO_CATEGORY { - displayName = "CSE Debug"; - }; - class cseMisc: NO_CATEGORY { - displayName = "CSE Misc"; - }; - class cse_equipment: NO_CATEGORY { - displayName = "CSE Equipment"; - }; - class cse_medical: NO_CATEGORY { - displayName = "CSE Medical"; - }; - class cseCCModule: NO_CATEGORY { - displayName = "CSE Command & Control"; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/CfgFunctions.h b/TO_MERGE/cse/main/CfgFunctions.h deleted file mode 100644 index 29cb3d875e..0000000000 --- a/TO_MERGE/cse/main/CfgFunctions.h +++ /dev/null @@ -1,154 +0,0 @@ -class CfgFunctions { - class CSE { - class Strings { - file = "cse\cse_main\strings\functions"; - class stringCompare { recompile = 1; }; - class string_removeWhiteSpace { recompile = 1; }; - }; - class HC { - file = "cse\cse_main\hc\functions"; - class isHC { recompile = 1; }; - }; - class Requests { - file = "cse\cse_main\requests\functions"; - class sendRequest_f { recompile = 1; }; - class requestCallback { recompile = 1; }; - class receiveRequest { recompile = 1; }; - class onAnswerRequest { recompile = 1; }; - }; - - class Debug { - file = "cse\cse_main\debug\functions"; - class debug { recompile = 1; }; - class debugModule { recompile = 1; }; - class traceModule { recompile = 1; }; - }; - - class TaskPool { - file = "cse\cse_main\tasks\functions"; - class addTaskToPool_f { recompile = 1; }; - class removeTaskFromPool_f { recompile = 1; }; - class loopThroughPool_f { recompile = 1; }; - }; - - class Mutex { - file = "cse\cse_main\mutex\functions"; - class createMutex { recompile = 1; }; - class releaseMutex { recompile = 1; }; - class waitForSingleMutex { recompile = 1; }; - class waitForMultipleMutex { recompile = 1; }; - class lockMutex { recompile = 1; }; - }; - - class Variables { - file = "cse\cse_main\variables\functions"; - class defineVariable { recompile = 1; }; - class setVariable { recompile = 1; }; - class getVariable { recompile = 1; }; - class getAllSetVariables { recompile = 1; }; - class getVariableInfo { recompile = 1; }; - class getVariableDefault { recompile = 1; }; - }; - - class Messages { - file = "cse\cse_main\messages\functions"; - class sendHintTo { recompile = 1; }; - class sendMessageTo { recompile = 1; }; - class sendDisplayInformationTo { recompile = 1; }; - class sendDisplayMessageTo { recompile = 1; }; - }; - - class Anim { - file = "cse\cse_main\anim\functions"; - class broadcastAnim { recompile = 1; }; - class getDeathAnim { recompile = 1; }; - class switchAnim { recompile = 1; }; - class playMoveNow { recompile = 1; }; - class localAnim { recompile = 1; }; - }; - - class Arrays { - file = "cse\cse_main\arrays\functions"; - class insertionSort { recompile = 1; }; - class findIf { recompile = 1; }; - class findIn { recompile = 1; }; - class findAll { recompile = 1; }; - class uniqueElementsOnly { recompile = 1; }; - class foreachDo { recompile = 1; }; - class sortAlphabeticallyBy { recompile = 1; }; - }; - - class EquipmentLib { - file = "cse\cse_main\equipment\functions"; - class hasMagazine { recompile = 1; }; - class useMagazine { recompile = 1; }; - class findMagazine { recompile = 1; }; - class hasItem { recompile = 1; }; - class useItem { recompile = 1; }; - class findItem { recompile = 1; }; - class getNumberMagazinesIn { recompile = 1; }; - }; - - class Interaction { - file = "cse\cse_main\interaction\functions"; - class registerInteractingWith { recompile = 1; }; - class getInteractionTarget { recompile = 1; }; - class isRegisteredInteractingWith { recompile = 1; }; - class unregisterInteractingWith { recompile = 1; }; - class getAllMonitoredVariables { recompile = 1; }; - class registerVariableMonitor { recompile = 1; }; - class setOnUpdateVariableEH { recompile = 1; }; - class getOnUpdateVariableEH { recompile = 1; }; - class getRegisteredMonitorVariablesOwners { recompile = 1; }; - class getMonitoredVariableName { recompile = 1; }; - class getMonitoredVariableValue { recompile = 1; }; - class setMonitoredVariableValue { recompile = 1; }; - class broadcastMonitoredVariable { recompile = 1; }; - class setCanInteract { recompile = 1; }; - class getCanInteract { recompile = 1; }; - class canInteract { recompile = 1; }; - }; - class Misc { - file = "cse\cse_main\misc\functions"; - class resetAllDefaults_f { recompile = 1; }; - class broadcastSound3D_f { recompile = 1; }; - class getName { recompile = 1; }; - class setDead { recompile = 1; }; - class isAwake { recompile = 1; }; - class setProne { recompile = 1; }; - class isInBuilding { recompile = 1; }; - class disableKeyInput_f { recompile = 1; }; - class disableUserInput_f { recompile = 1; }; - class dropWeapon_f { recompile = 1; }; - class inWater_f { recompile = 1; }; - class setVolume_f { recompile = 1; }; - class lockVehicleOfUnitUntil { recompile = 1; }; - class closeAllDialogs_f { recompile = 1; }; - class disableAI_f { recompile = 1; }; - class moduleEnableBasicRevive { recompile = 1; }; - class switchToGroupSide_f { recompile = 1; }; - class hasItem_f { recompile = 1; }; - class getFirstObjectIntersection { recompile = 1; }; - class getFirstTerrainIntersection { recompile = 1; }; - class setHearingCapability { recompile = 1; }; - class revealObject_f { recompile = 1; }; - class getWeaponItems_f { recompile = 1; }; - }; - class Mods { - file = "cse\cse_main\mods\functions"; - class ALiVE_Bus_Mod { recompile = 1; }; - class isLoaded_ALiVE_Mod { recompile = 1; }; - class isModLoaded_f { recompile = 1; }; - }; - - - class Config { - file = "cse\cse_main\config\functions"; - class inheritsFrom; - }; - class Version { - file = "cse\cse_main\version\functions"; - class getVersion; - }; - }; -}; diff --git a/TO_MERGE/cse/main/CfgHints.h b/TO_MERGE/cse/main/CfgHints.h deleted file mode 100644 index 23611db6cc..0000000000 --- a/TO_MERGE/cse/main/CfgHints.h +++ /dev/null @@ -1,27 +0,0 @@ -class CfgHints -{ - class Combat_Space_Enhancement - { - displayName = "Combat Space Enhancement"; - class Main - { - displayName = "Combat Space Enhancement"; - displayNameShort = "Combat Space Enhancement"; - description = "Combat Space Enhancement is a standalone modification for the game Arma III and is developed by the team behind Combat Medical System. All features from CSE are build on top of our in house developed framework, allowing for compatibility between various modules/features with ease by both our in house created modules and any third party made content."; - tip = ""; - arguments[] = {}; - image = ""; - noImage = true; - }; - class Credits - { - displayName = "Credits"; - displayNameShort = "Credits"; - description = "Glowbal, Project Lead & lead developer (Scripting, Graphics, Design) %2Kieran, Webmaster %2Rye, PR & Testing %1%1Contributions by:%2Aposky, Artist (Graphics & Models)%2Janus, Artist (Graphics & Models)%2DocScarle (Medical Knowledge)%2-FM- (Medical Knowledge)%2Carrot (Medical Knowledge)%2Ogirdor (Graphics)%2Beardmoresam (Medical Knowledge)%2Raptor 6 Actual (Medical Knowledge)%2Bovine3dom (Some script contributions & assistance with calculations)%2Donny (Models)%2Deadman (Graphics & Models)%1%1Additional:%2This project contains some free icons by http://icons8.com/%2ALIVE Team (ALiVE & CSE integration)%2LondonLad (Allowing use of dedicated server for testing)%2bodybag.p3d file and textures by Bohemia Interactive."; - tip = ""; - arguments[] = {}; - image = ""; - noImage = true; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/CfgVehicles.h b/TO_MERGE/cse/main/CfgVehicles.h deleted file mode 100644 index e717a10d4f..0000000000 --- a/TO_MERGE/cse/main/CfgVehicles.h +++ /dev/null @@ -1,115 +0,0 @@ -#include "CfgFactionClasses.h" - -class CfgVehicles { - class Logic; - class Module_F: Logic { - class ArgumentsBaseUnits { - }; - }; - class cse_enableLogging: Module_F { - scope = 2; - displayName = "Logging [CSE]"; - icon = "\cse\cse_main\data\cse_logging_icon.paa"; - category = "cseDebug"; - function = "cse_fnc_debugModule"; - functionPriority = 1; - isGlobal = 1; - isTriggerActivated = 0; - class Arguments { - class logLevel { - displayName = "Enable Logging at"; - description = "The maximum level of logging"; - typeName = "STRING"; - class values { - class NONE {name="None"; value=4; default=1; }; - class INFO {name="Information"; value=3; }; - class DEBUG {name="Debug"; value=2; }; - class WARN {name="Warnings"; value=1; }; - class ERROR {name="Errors"; value=0; }; - }; - }; - class logDisplayLevel { - displayName = "Show in chat"; - description = "The maximum level of log messages to be shown in chat"; - typeName = "STRING"; - class values { - class NONE {name="None"; value=4; default=1; }; - class INFO {name="Information"; value=3; }; - class DEBUG {name="Debug"; value=2; }; - class WARN {name="Warnings"; value=1; }; - class ERROR {name="Errors"; value=0; }; - }; - }; - }; - class ModuleDescription { - description = "Lets you modify the logging settings within CSE."; // Short description, will be formatted as structured text - sync[] = {}; - }; - }; - class cse_traceValuesObject: Module_F { - - scope = 2; - displayName = "Trace variables [CSE]"; - icon = "\cse\cse_main\data\cse_debug_icon.paa"; - category = "cseDebug"; - function = "cse_fnc_traceModule"; - functionPriority = 1; - isGlobal = 1; - isTriggerActivated = 1; - class Arguments { - class enableFor { - displayName = "Trace player variables"; - description = "Whatever or not a debug message will be printed when a value for a player changes"; - typeName = "STRING"; - class values { - class DISABLED {name="Disable"; value=0; default=1; }; - class ENABLE {name="Enable"; value=1; }; - }; - }; - }; - class ModuleDescription { - description = "Trace variables of given object"; // Short description, will be formatted as structured text - sync[] = {}; - }; - }; - - - class cse_basicRevive: Module_F { - scope = 2; - displayName = "Basic Revive [CSE]"; - icon = "\cse\cse_main\data\cse_medical_module.paa"; - category = "cse_medical"; - function = "cse_fnc_initalizeModule_F"; - functionPriority = 1; - isGlobal = 1; - isTriggerActivated = 0; - class Arguments { - class enableFor { - displayName = "Enable for"; - description = "Should the basic revive be enabled for players, AI or both?"; - typeName = "NUMBER"; - class values { - class disable {name="Disable"; value=0; default=1; }; - class playersOnly {name="Players only"; value=1; }; - class playersAndAI { name="Players and AI"; value = 2; }; - }; - }; - class timer { - displayName = "Timer"; - description = "How long can a unit spend in unconscious mode (In seconds)"; - typeName = "NUMBER"; - defaultValue = 600; - }; - class amountOf { - displayName = "Hits while unconscious"; - description = "number of times a unit can be hit/killed before being force killed. -1 is disabled."; - typeName = "NUMBER"; - defaultValue = -1; - }; - }; - class ModuleDescription { - description = "Enables the basic revive script for all damage done through CSE.
Any unit that is killed, will be put in an unconscious state until their timer runs out."; - sync[] = {}; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/Combat_Space_Enhancement.h b/TO_MERGE/cse/main/Combat_Space_Enhancement.h deleted file mode 100644 index 9046550f26..0000000000 --- a/TO_MERGE/cse/main/Combat_Space_Enhancement.h +++ /dev/null @@ -1,60 +0,0 @@ -#define MENU_KEYBINDING 1 -#define ACTION_KEYBINDING 2 -#define CLIENT_SETTING 3 - -class Combat_Space_Enhancement -{ - class EventHandlers { - class PostInit_EventHandlers { - class cse_main { - init = " call compile preprocessFile 'cse\cse_main\init.sqf';"; - }; - }; - }; - class cfgModules { - class cse_main { - init = ""; - name = "Main"; - class EventHandlers { - class CAManBase { - respawn = "_this call cse_fnc_resetAllDefaults_F;"; - }; - }; - - class Configurations { - class ActionAcceptRequest_f { - type = ACTION_KEYBINDING; - title = $STR_CSE_ACTION_ACCEPT_REQUEST_KEY_TITLE; - description = $STR_CSE_ACTION_ACCEPT_REQUEST_KEY_TOOLTIP; - value[] = {0,0,0,0}; - onPressed = "if (!isnil 'CSE_RECIEVE_REQUEST_ID_KEY_BINDING') then {[player,CSE_RECIEVE_REQUEST_ID_KEY_BINDING, true] call cse_fnc_onAnswerRequest;};"; - }; - class ActionDeclineRequest_f { - type = ACTION_KEYBINDING; - title = $STR_CSE_ACTION_DECLINE_REQUEST_KEY_TITLE; - description = $STR_CSE_ACTION_DECLINE_REQUEST_KEY_TOOLTIP; - value[] = {0,0,0,0}; - onPressed = "if (!isnil 'CSE_RECIEVE_REQUEST_ID_KEY_BINDING') then {[player,CSE_RECIEVE_REQUEST_ID_KEY_BINDING, false] call cse_fnc_onAnswerRequest;};"; - }; - }; - }; - - class cse_basicRevive { - init = "_this call cse_fnc_moduleEnableBasicRevive;"; - name = "Basic Revive"; - }; - - class cse_basic_revive : cse_basicRevive { - init = "_this call cse_fnc_moduleEnableBasicRevive; ['Incorrect basic revive classname. Please change cse_basic_revive to cse_basicRevive in your enabledModules_sample.hpp file.'] call BIS_fnc_error; "; - }; - }; - class CustomEventHandlers { - class variableDefined {}; // [_name,_value,_defaultGlobal,_catagory,_code, _persistent] - class AddedTotaskPool {}; // [_args, _code] - class killed {}; // [unit, bool] - class setVolume {}; // [bool] - class disableKeyInput {}; // [bool] - class switchToGroupSide {}; // [unit, bool, id (String), side] - class resetToDefaults {}; // [unit] - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf deleted file mode 100644 index 82a9535799..0000000000 --- a/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/** - * fn_broadcastAnim.sqf - * @Descr: Broadcast an animation across the network using switchMove - * @Author: Glowbal - * - * @Arguments: [unit OBJECt, animation STRING] - * @Return: void - * @PublicAPI: true - */ - - -private ["_unit","_anim","_persistent"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_anim = [_this, 1, "",[""]] call BIS_fnc_Param; - - if (count _this >2) then { - _persistent = [_this, 2, false, [false]] call BIS_fnc_Param; - [[_unit,_anim], "cse_fnc_switchAnim", true, _persistent] spawn BIS_fnc_MP; - } else { - [[_unit,_anim], "cse_fnc_switchAnim", true, false] spawn BIS_fnc_MP; - }; diff --git a/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf deleted file mode 100644 index 2722e16ffb..0000000000 --- a/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/** - * fn_getDeathAnim.sqf - * @Descr: Get the death animation for the unit at current time - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: STRING animation - * @PublicAPI: true - */ - - -private ["_unit", "_curAnim", "_animation", "_cfg","_unitAnimation", "_animationState"]; -_unit = _this select 0; -_animation = ""; -_animationState = (animationState _unit); -_unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); -if (isText (_unitAnimation >> "actions")) then { - if ((vehicle _unit) != _unit) then { - _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); - if (isArray (_cfg >> "interpolateTo")) then { - _animation = getArray (_cfg >> "interpolateTo") select 0; - }; - } else { - _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); - if (isText _cfg) then { - _animation = getText _cfg; - }; - }; -}; -if (isnil "_animation") then { - _animation = ""; -}; -_animation \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf deleted file mode 100644 index 919a7176c6..0000000000 --- a/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_localAnim.sqf - * @Descr: Play an animation on a local machine using playMoveNow - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, animation STRING] - * @Return: void - * @PublicAPI: true - */ - -private ["_unit","_anim","_persistent"]; -_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; -_anim = [_this, 1, "",[""]] call BIS_fnc_Param; - -if (!local _unit) then { - if (count _this >2) then { - _persistent = [_this, 2, false, [false]] call BIS_fnc_Param; - [[_unit,_anim], "cse_fnc_playMoveNow", _unit, _persistent] spawn BIS_fnc_MP; - } else { - [[_unit,_anim], "cse_fnc_playMoveNow", _unit, false] spawn BIS_fnc_MP; - }; -} else { - [_unit,_anim] call cse_fnc_playMoveNow; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf b/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf deleted file mode 100644 index 03ffda17fb..0000000000 --- a/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_playMoveNow.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit", "_anim"]; -_unit = [_this,0,objNull,[objNull]] call BIS_fnc_Param; -_anim = [_this,1,"",[""]] call BIS_fnc_Param; -_unit playMoveNow _anim; \ No newline at end of file diff --git a/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf b/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf deleted file mode 100644 index 73a0260ef6..0000000000 --- a/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * fn_switchAnim.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit", "_anim"]; -_unit = [_this,0,objNull,[objNull]] call BIS_fnc_Param; -_anim = [_this,1,"",[""]] call BIS_fnc_Param; -_unit switchMove _anim; -_unit playMove _anim; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf deleted file mode 100644 index 9a2255f45b..0000000000 --- a/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_findAll.sqf - * @Descr: Find all elements for which the code returns true - * @Author: Glowbal - * - * @Arguments: [array ARRAY, if CODE (Code called for each element. Should return a bool)] - * @Return: ARRAY Array with elements for which the if code returned true. - * @PublicAPI: true - */ - -private ["_array", "_if", "_return"]; -_array = _this select 0; -_if = _this select 1; - -_return = []; -{ - if (_x call _if) then { - _return pushback _x; - }; -}foreach _array; - -_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf deleted file mode 100644 index 9fe7c57869..0000000000 --- a/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_findIf.sqf - * @Descr: Get the first element that returns true. - * @Author: Glowbal - * - * @Arguments: [array ARRAY, if CODE (Code called for each element. Should return a bool)] - * @Return: ANY. Any element. Default return is an empty array ([]) - * @PublicAPI: true - */ - -private ["_array", "_if"]; -_array = _this select 0; -_if = _this select 1; - -_return = []; -{ - if (_x call _if) exitwith { - _return = _array select _foreachIndex; - }; -}foreach _array; - -_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf b/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf deleted file mode 100644 index d8001d03c2..0000000000 --- a/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_findIn.sqf - * @Descr: Get the index of the first element that is equal to compare value - * @Author: Glowbal - * - * @Arguments: [array ARRAY, value ANY (The compared value)] - * @Return: NUMBER (-1 is not found. Else index of element in array) - * @PublicAPI: true - */ - -private ["_array", "_value", "_return"]; -_array = _this select 0; -_value = _this select 1; - -_return = -1; -{ - if (_x isEqualTo _value) exitwith { - _return = _foreachIndex; - }; -}foreach _array; - -_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf b/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf deleted file mode 100644 index 1c18a746eb..0000000000 --- a/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/** - * fn_foreachDo.sqf - * @Descr: Execute code for each element in an array and collect the return values. - * @Author: Glowbal - * - * @Arguments: [array ARRAY, do CODE (Code executed for each element)] - * @Return: ARRAY Array with return values. - * @PublicAPI: true - */ - -private ["_array", "_do", "_return"]; -_array = _this select 0; -_do = _this select 1; - -_return = []; -{ - _return pushback(_x call _do); - false; -}count _array; - -_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf b/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf deleted file mode 100644 index 91f4c837e5..0000000000 --- a/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf +++ /dev/null @@ -1,42 +0,0 @@ -/** - * fn_sortAlphabeticallyBy.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: true - */ - -private ["_array", "_elements", "_elementN", "_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; -_array = _this select 0; -_elementN = _this select 1; - -_indexes = []; -_elements = []; - -{ - _theElement = toArray (_x select _elementN); - _indexes pushback _foreachIndex; - _elements pushback _theElement; -}foreach _array; - -for "_i" from 1 to (count _elements) - 1 do { - _tmp = _elements select _i; - _tempIndex = _indexes select _i; - _j = _i; - while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { - _elements set [_j, _elements select (_j - 1)]; - _indexes set [_j, _indexes select (_j - 1)]; - _j = _j - 1; - }; - _elements set[_j, _tmp]; - _indexes set [_j, _tempIndex]; -}; - -_returnArray = []; -{ - _returnArray pushback (_array select _x); -}foreach _indexes; - -_returnArray; \ No newline at end of file diff --git a/TO_MERGE/cse/main/config.cpp b/TO_MERGE/cse/main/config.cpp deleted file mode 100644 index 3620b37e7a..0000000000 --- a/TO_MERGE/cse/main/config.cpp +++ /dev/null @@ -1,33 +0,0 @@ -class CfgPatches -{ - class cse_main - { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.1; - requiredAddons[] = {"A3_Modules_F", "cse_f_eh"}; - version = "0.10.0_rc"; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; - }; -}; -class CfgAddons { - class PreloadAddons { - class cse_main { - list[] = {"cse_main"}; - }; - }; -}; -class CfgUnitInsignia { - class CSE { - displayName = "Combat Space Enhancement"; // Name displayed in Arsenal - author = "Combat Space Enhancement"; // Author displayed in Arsenal - texture = "\cse\cse_main\data\cse_insignia.paa"; // Image path - textureVehicle = ""; // Does nothing currently, reserved for future use - }; -}; - -#include "Combat_Space_Enhancement.h" -#include "CfgVehicles.h" -#include "CfgFunctions.h" -#include "CfgHints.h" \ No newline at end of file diff --git a/TO_MERGE/cse/main/data/cse_aim_module.paa b/TO_MERGE/cse/main/data/cse_aim_module.paa deleted file mode 100644 index 0bd682d3d2..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_aim_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_backblast_module.paa b/TO_MERGE/cse/main/data/cse_backblast_module.paa deleted file mode 100644 index 527c516c22..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_backblast_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_ballistics_module.paa b/TO_MERGE/cse/main/data/cse_ballistics_module.paa deleted file mode 100644 index 4be1f5869f..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_ballistics_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_basic_module.paa b/TO_MERGE/cse/main/data/cse_basic_module.paa deleted file mode 100644 index 8ef2af6867..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_basic_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_cc_module.paa b/TO_MERGE/cse/main/data/cse_cc_module.paa deleted file mode 100644 index 4833873c60..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_cc_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_debug_icon.paa b/TO_MERGE/cse/main/data/cse_debug_icon.paa deleted file mode 100644 index e5cbceeebb..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_debug_icon.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_earmuffs_module.paa b/TO_MERGE/cse/main/data/cse_earmuffs_module.paa deleted file mode 100644 index d0d571112c..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_earmuffs_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_explosive_module.paa b/TO_MERGE/cse/main/data/cse_explosive_module.paa deleted file mode 100644 index 5837932776..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_explosive_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_groups_module.paa b/TO_MERGE/cse/main/data/cse_groups_module.paa deleted file mode 100644 index 067eb7ef0c..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_groups_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_logging_icon.paa b/TO_MERGE/cse/main/data/cse_logging_icon.paa deleted file mode 100644 index 7339a44899..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_logging_icon.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_medical_module.paa b/TO_MERGE/cse/main/data/cse_medical_module.paa deleted file mode 100644 index 9cb6c4782d..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_medical_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_nvg_module.paa b/TO_MERGE/cse/main/data/cse_nvg_module.paa deleted file mode 100644 index 3d0a8bc050..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_nvg_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_rifle_module.paa b/TO_MERGE/cse/main/data/cse_rifle_module.paa deleted file mode 100644 index f386713736..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_rifle_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/data/cse_tags_module.paa b/TO_MERGE/cse/main/data/cse_tags_module.paa deleted file mode 100644 index 1710ef74c9..0000000000 Binary files a/TO_MERGE/cse/main/data/cse_tags_module.paa and /dev/null differ diff --git a/TO_MERGE/cse/main/debug/Debug.h b/TO_MERGE/cse/main/debug/Debug.h deleted file mode 100644 index 16095b6db1..0000000000 --- a/TO_MERGE/cse/main/debug/Debug.h +++ /dev/null @@ -1,9 +0,0 @@ -// debug constants - -#define ERROR 0 -#define WARN 1 -#define DEBUG 2 -#define INFO 3 -#define NONE 4 - -#define DEFAULTLOGLEVEL INFO diff --git a/TO_MERGE/cse/main/debug/functions/fn_debug.sqf b/TO_MERGE/cse/main/debug/functions/fn_debug.sqf deleted file mode 100644 index 3c87285e10..0000000000 --- a/TO_MERGE/cse/main/debug/functions/fn_debug.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/** - * fn_debug.sqf - * @Descr: Print logging messages through the CSE framework. - * @Author: Glowbal - * - * @Arguments: [message ANY, level NUMBER (Optional)] - * @Return: BOOL True if message has been printed - * @PublicAPI: true - */ - -#define ERROR 0 -#define WARN 1 -#define DEBUG 2 -#define INFO 3 -#define NONE 4 - -#define DEFAULTLOGLEVEL NONE -#define DEFAULTTEXTDISPLAY WARN - -private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; -_msg = _this select 0; -_level = _this select 1; - -if (isNil "CSE_LOGLEVEL") then { - _defaultLoglevel = DEFAULTLOGLEVEL; -} else { - _defaultLoglevel = CSE_LOGLEVEL; -}; - -if (isnil "CSE_LOGDISPLAY_LEVEL") then { - _defaultLogDisplayLevel = DEFAULTTEXTDISPLAY; -} else { - _defaultLogDisplayLevel = CSE_LOGDISPLAY_LEVEL; -}; - -if (isNil "_level") then { - _level = DEBUG; -}; -if (_defaultLoglevel == 4) exitwith {false}; -if (_level <= _defaultLoglevel) then { - switch (_level) do { - case ERROR: { _prefix = "CSE Error" }; - case WARN: { _prefix = "CSE Warn" }; - case DEBUG: { _prefix = "CSE Debug" }; - case INFO: { _prefix = "CSE Info" }; - default { _prefix = "CSE Unknown" }; - }; - _message = format["[%1] %2",_prefix,_msg]; - - if (isnil "CSE_LOGIC_OBJECT") then { - _group = createGroup sideLogic; - CSE_LOGIC_OBJECT = _group createUnit ["logic", [1,1,1], [], 0, "FORM"]; - }; - if (isNull CSE_LOGIC_OBJECT) then { - _group = createGroup sideLogic; - CSE_LOGIC_OBJECT = _group createUnit ["logic", [1,1,1], [], 0, "FORM"]; - }; - - - if (_level <= _defaultLogDisplayLevel) then { - showChat true; - CSE_LOGIC_OBJECT globalChat _message; - }; - diag_log _message; -}; -true \ No newline at end of file diff --git a/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf b/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf deleted file mode 100644 index f0a9902ef8..0000000000 --- a/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/** - * fn_debugModule.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_entity"]; -_entity = _this select 0; - -CSE_LOGDISPLAY_LEVEL = call compile (_entity getvariable ["logDisplayLevel","4"]); -CSE_LOGLEVEL = call compile (_entity getvariable ["logLevel","4"]); diff --git a/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf b/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf deleted file mode 100644 index ef64fa09f8..0000000000 --- a/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_traceModule.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_entity"]; -_entity = _this select 0; - -_enableForPlayer = call compile (_entity getvariable ["logDisplayLevel","0"]); -if (isnil "CSE_OBJECTS_TRACING") then { - CSE_OBJECTS_TRACING = []; -}; - -if (!isDedicated) then { - if (_enableForPlayer==1) then { - CSE_OBJECTS_TRACING set [count CSE_OBJECTS_TRACING, PLAYER]; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf deleted file mode 100644 index fd07398aad..0000000000 --- a/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/** - * fn_useItem.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: true - */ - -private ["_unit","_item","_return"]; -_unit = _this select 0; -_item = _this select 1; -_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; - -if (!_vehicleUsage) then { - if (_item != "") then { - if (_item in (items _unit)) then { - _unit removeItem _item; - _return = true; - } else { - if (_item in (assignedItems _unit)) then { - _unit unassignItem _item; - _unit removeItem _item; - _return = true; - }; - }; - } else { - _return = false; - }; - [format["fnc_useItem: %1 | %2",_this,_return]] call cse_fnc_debug; -_return -} else -{ - // TODO implement shared item functionality -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/init.sqf b/TO_MERGE/cse/main/init.sqf deleted file mode 100644 index 3ab0f5f3c4..0000000000 --- a/TO_MERGE/cse/main/init.sqf +++ /dev/null @@ -1,81 +0,0 @@ -CSE_AI_COLLECTION_LOOP = [[]]; -if (isnil "CSE_OBJECTS_TRACING") then { - CSE_OBJECTS_TRACING = []; -}; - -["cse_interactionRegister",[],true,"cse_framework"] call cse_fnc_defineVariable; -["cse_interactionTarget",objNull,true,"cse_framework"] call cse_fnc_defineVariable; -["cse_variableMonitor",[],false,"cse_framework"] call cse_fnc_defineVariable; -["CSE_ENABLE_REVIVE_COUNTER",0,false,"cse_framework"] call cse_fnc_defineVariable; -["cse_inReviveState", false, true, "cse_framework"] call cse_fnc_defineVariable; - -cse_main = true; - -if (isnil "CSE_F_MODULE_OBJ_EH") then { - CSE_F_MODULE_OBJ_EH = []; -}; -CSE_F_MODULE_OBJ_EH pushback "cse_main"; -if (isnil "CSE_TASK_POOL_COLLECTION_F") then { - CSE_TASK_POOL_COLLECTION_F = []; -}; -if (isNil "CSE_ENABLE_REVIVE_F") then { - CSE_ENABLE_REVIVE_F = 0; -}; -if (hasInterface) then{ - [] spawn { - - sleep 1; - waitUntil {!isNull player && !(isNull (findDisplay 46))}; - player setvariable ["cse_name", name player, true]; - player addEventHandler ["respawn", {_this call cse_fnc_resetAllDefaults_F;}]; - 11401 cutRsc ["cse_gui_iconsDisplay","PLAIN"]; - - if (["cse_sys_vehicles"] call cse_fnc_isModLoaded_F) then { - call compile preprocessFile "cse\cse_sys_vehicles\init.sqf"; - }; - }; -}; - -["Task Loop is starting"] call cse_fnc_debug; -["cse_main_taskPool_f", "oneachframe", cse_fnc_loopThroughPool_f] call BIS_fnc_addStackedEventHandler; - -if (["cse_sys_ieds"] call cse_fnc_isModLoaded_F) then { - ["cse_sys_ieds", []] call cse_fnc_enableModule_f; -}; - -if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { - // integrate ALiVE menu with CSE Radial Action menu - // call compile preprocessFile "cse\cse_main\integration\alive\alive_gui_integration.sqf"; - // call compile preprocessFile "cse\cse_main\integration\alive\alive_flexiMenu_integration.sqf"; -}; - -// version checks -if !(isServer) exitwith {}; -if (isnil "cse_fnc_getVersion") exitwith {}; - -_versionCheckCode = compile format[' - if (isServer) exitwith {}; - sleep 5; - _serverVersion = "%1"; - CSE_SERVER_VERSION = _serverVersion; - if (!isnil "cse_fnc_getVersion") then { - _clientVersion = [] call cse_fnc_getVersion; - if (_serverVersion != _clientVersion) then { - // incorrect version - _warningMessage = format["WARNING: CSE Version mismatch. Server version: %1 Client version: %2", _serverVersion, _clientVersion]; - diag_log _warningMessage; - systemChat _warningMessage; - - [[{sysemChat format["%1" has an incorrect version of CSE", _this];}, player], "BIS_fnc_spawn", true, true] call BIS_fnc_MP; - } else { - ["Passed version check - same as server"] call cse_fnc_debug; - }; - } else { - // incorrect version - _warningMessage = format["WARNING: CSE Version mismatch: Server version: %1 Client version: unknown"]; - diag_log _warningMessage; - systemChat _warningMessage; - }; -', call cse_fnc_getVersion]; - -[_versionCheckCode, "BIS_fnc_spawn", true, true] call BIS_fnc_MP; diff --git a/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf b/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf deleted file mode 100644 index 51804eec13..0000000000 --- a/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf +++ /dev/null @@ -1,182 +0,0 @@ - -#include "\x\alive\addons\ui\script_component.hpp" -#define ALiVE_ICON "cse\cse_gui\radialmenu\data\icons\icon_alive_mod.paa" - -/* - [ - "player", - [SELF_INTERACTION_KEY], - -9500, - [ - "call ALIVE_fnc_adminActionsMenuDef", - "main" - ] - ] -*/ - - - [ - ["player",[[221,[false,false,false]]],-9500,["call ALIVE_fnc_newsFeedMenuDef","main"],true], - ["player",[[221,[false,false,false]]],-9500,["call ALIVE_fnc_adminActionsMenuDef","main"],true] - ]; - -/* - 4 [ - 5 "caption", - 6 "action", - 7 "icon", - 8 "tooltip", - 9 {"submenu"|["menuName", "", {0|1} (optional - use embedded list menu)]}, -10 -1 (shortcut DIK code), -11 {0|1/"0"|"1"/false|true} (enabled), -12 {-1|0|1/"-1"|"0"|"1"/false|true} (visible) -13 ] -*/ - -[format["ALIVE FlexiMenu integration started"]] call cse_fnc_debug; -_menusources = GVAR(typeMenuSources); -{ - - // This is a string. defines classnames ? - _type = _x select 0; - - // not relevant for us - _keybindings = _x select 1; - - // not relevant for us - _priority = _x select 2; - - // array format: [code STRING, name STRING] - _details = _x select 3; - _code = _details select 0; - _menuName = _details select 1; - - // condition. BOOL or CODE ? - _condition = _x select 4; - - // TODO figure out parsing - [format["ALiVE FlexiMenu entry: %1", _x]] call cse_fnc_debug; - - if (_type == "player") then { - - if (typeName _condition == typeName true) then { - - } else { - // calling condition - }; - - _target = player; - _params = [_menuName, "popup"]; - - if (typeName _code == typeName "") then { - - // this has to be called upon menu open. - _res = [_target, _params] call compile _code; - [format["ALIVE FlexiMenu call res: %1", _res]] call cse_fnc_debug; - // [["main","ALiVE","popup"],[["Player Combat Support",{["radio"] call ALIVE_fnc_radioAction},"","ALiVE Combat Support System (CAS/Artillery/Transport)","",-1,1,false]] - if (_res isEqualTo []) exitwith {}; - _entryDetails = _res select 1 select 0; - - - // [["main","ALiVE","popup"],[["Admin Actions >","","","Server admin functions",["call ALiVE_fnc_adminActionsMenuDef","adminActions",1],-1,1,true]]] - //_menuName = _entryDetails select 4 select 1; - _compiledCode = compile format['[_this, "%1"] call cse_fnc_aliveFlexiMenuDisplayOptions', _menuName]; - [format["compiled code: %1", _compiledCode]] call cse_fnc_debug; - _entries = [ - [_entryDetails select 0, {true /* Condition should check for activation of ALiVE menu entries */}, ALiVE_ICON, _compiledCode, _entryDetails select 3] - ]; - ["ActionMenu","alive_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; - - /*{ - if (_foreachIndex > 0) then { - [format["BUTTON FORMAT: %1",_x]] call cse_fnc_debug; - _info = _x select 0; - _title = _info select 0; - _code = _info select 1; - _toolTip = _info select 2; - _allow = _info select 7; - [format["Showing button: %1", _info]] call cse_fnc_debug - }; - }foreach _res;*/ - }; - - }; -}foreach _menusources; - - - -cse_fnc_aliveFlexiMenuDisplayOptions = { - _args = _this select 0; - _checkMenuName = _this select 1; - [format["cse_fnc_aliveFlexiMenuDisplayOptions %1",_this]] call cse_fnc_debug; - _menusources = GVAR(typeMenuSources); - { - // This is a string. defines classnames ? - _type = _x select 0; - - // not relevant for us - _keybindings = _x select 1; - - // not relevant for us - _priority = _x select 2; - - // array format: [code STRING, name STRING] - _details = _x select 3; - _code = _details select 0; - _menuName = _details select 1; - - // condition. BOOL or CODE ? - _condition = _x select 4; - - if (_menuName == _checkMenuName) exitwith { - [format["ALiVE FlexiMenu entry: %1", _x]] call cse_fnc_debug; - if (_type == "player") then { - _continue = false; - if (typeName _condition == typeName true) then { - _continue = _condition; - }; - if (!_continue) exitwith {}; - - _target = player; - _params = [_menuName, "popup"]; - - if (typeName _code == typeName "") then { - // this has to be called upon menu open. - _res = [_target, _params] call compile _code; - // [["main","ALiVE","popup"],[["Player Combat Support",{["radio"] call ALIVE_fnc_radioAction},"","ALiVE Combat Support System (CAS/Artillery/Transport)","",-1,1,false]] - - if (_res isEqualTo []) exitwith {}; - _entryDetails = _res select 1; - - _cse_menu_entries = []; - { - _info = _x select 0; - if (_foreachIndex > 0) then { - _title = _info select 0; - _code = _info select 1; - _toolTip = _info select 2; - _allow = _info select 7; - - if (_allow) then { - _cse_menu_entries pushback [_title, ALiVE_ICON, _code, true, _toolTip]; - }; - }; - }foreach _res; - [format["Showing entries: %1 - %2", _cse_menu_entries, _res]] call cse_fnc_debug; - - if !(_cse_menu_entries isEqualTo []) then { - hintSilent "displaying alive entries"; - [ _args select 3, - _cse_menu_entries, - _args select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true - ] call cse_fnc_openRadialSecondRing_GUI; - }; - - }; - - }; - - }; - }foreach _menusources; - -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf b/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf deleted file mode 100644 index 1ecbbe1767..0000000000 --- a/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/** - * alive_gui_integration.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#include <\x\alive\addons\sys_adminactions\script_component.hpp> -#include <\x\cba\addons\ui_helper\script_dikCodes.hpp> - -#define ALiVE_ICON "cse\cse_gui\radialmenu\data\icons\icon_alive_mod.paa" - -private ["_entries", "_openAdminActions"]; - -waitUntil{!isnil "cse_gui"}; - -// ALiVE Admin Actions - -_alive_openAdminActions = { - private ["_entries"]; - _entries = []; - if ((MOD(adminActions) getVariable ["ghost", 0]) == "1") then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_GHOST_ENABLE", ALiVE_ICON, {player setCaptive true; _this call cse_alive_openAdminActions; }, (!captive player), localize "STR_ALIVE_ADMINACTIONS_GHOST_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_GHOST_DISABLE", ALiVE_ICON, {player setCaptive false; _this call cse_alive_openAdminActions; }, (captive player), localize "STR_ALIVE_ADMINACTIONS_GHOST_COMMENT"]]; - }; - if ((MOD(adminActions) getVariable ["teleport", 0]) == "1") then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORT_ENABLE", ALiVE_ICON, { MOD(adminActions) setVariable ["teleport_enabled", true]; onMapSingleClick {vehicle player setPos _pos;}; _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["teleport_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_TELEPORT_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORT_DISABLE",ALiVE_ICON, { MOD(adminActions) setVariable ["teleport_enabled", false]; onMapSingleClick DEFAULT_MAPCLICK; _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["teleport_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_TELEPORT_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_TELEPORTUNITS", ALiVE_ICON, { ["CAManBase"] spawn ALiVE_fnc_AdminActionsTeleportUnits; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_TELEPORTUNITS_COMMENT"]]; - }; - if ((MOD(adminActions) getVariable ["mark_units", 0]) == "1") then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_MARK_UNITS_ENABLE", ALiVE_ICON, { [] call ALIVE_fnc_markUnits; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_MARK_UNITS_COMMENT"]]; - }; - if (["ALiVE_mil_CQB"] call ALiVE_fnc_isModuleAvailable) then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CQB_ENABLE", ALiVE_ICON, { {MOD(adminActions) setVariable ["CQB_enabled", true]; [_x,"debug",true] call ALiVE_fnc_CQB} foreach (MOD(CQB) getVariable ["instances",[]]); _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["CQB_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_CQB_ENABLE_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CQB_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["CQB_enabled", false]; {[_x,"debug",false] call ALiVE_fnc_CQB} foreach (MOD(CQB) getVariable ["instances",[]]); _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["CQB_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_CQB_DISABLE_COMMENT"]]; - }; - if (["ALiVE_sys_profile"] call ALiVE_fnc_isModuleAvailable) then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_ENABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["PROFILES_enabled", true]; [] call ALIVE_fnc_profileSystemDebug;_this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["PROFILES_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["PROFILES_enabled", false]; [] call ALIVE_fnc_profileSystemDebug; _this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["PROFILES_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; - }; - if ((MOD(adminActions) getVariable ["profiles_create", 0]) == "1") then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CREATE_PROFILES_ENABLE", ALiVE_ICON,{ [] call ALIVE_fnc_adminCreateProfiles; _this call cse_alive_openAdminActions; }, true, localize "STR_ALIVE_ADMINACTIONS_CREATE_PROFILES_COMMENT"]]; - }; - if (["ALiVE_amb_civ_population"] call ALiVE_fnc_isModuleAvailable) then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_ENABLE", ALiVE_ICON,{MOD(adminActions) setVariable ["AGENTS_enabled", true]; [] call ALIVE_fnc_agentSystemDebug; _this call cse_alive_openAdminActions; }, !(MOD(adminActions) getVariable ["AGENTS_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_COMMENT"]]; - - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_AGENTS_DEBUG_DISABLE", ALiVE_ICON,{ MOD(adminActions) setVariable ["AGENTS_enabled", false]; [] call ALIVE_fnc_agentSystemDebug;_this call cse_alive_openAdminActions; }, (MOD(adminActions) getVariable ["AGENTS_enabled", false]), localize "STR_ALIVE_ADMINACTIONS_PROFILES_DEBUG_COMMENT"]]; - }; - if ((MOD(adminActions) getVariable ["console", 0]) == "1") then { - _entries set [ count _entries, [localize "STR_ALIVE_ADMINACTIONS_CONSOLE_ENABLE", ALiVE_ICON,{ closeDialog 0; createDialog "RscDisplayDebugPublic"; }, true, localize "STR_ALIVE_ADMINACTIONS_CONSOLE_COMMENT"]]; - }; - - [ _this select 3, - _entries, - _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true - ] call cse_fnc_openRadialSecondRing_GUI; -}; - -_entries = [ - [localize "STR_ALIVE_ADMINACTIONS", {true /* Condition should check for activation of ALiVE Admin */}, ALiVE_ICON, _alive_openAdminActions, localize "STR_ALIVE_ADMINACTIONS"] -]; -["ActionMenu","alive_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; - diff --git a/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf b/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf deleted file mode 100644 index 4ddb76b131..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_broadcastMonitoredVariable.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_variable","_owners"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variable = [_this,1,"",[""]] call BIS_fnc_Param; - -if (_variable == "cse_variableMonitor" || _variable == "cse_interactionRegister") exitwith{}; - -if (!local _target) exitwith { - [_this, "cse_fnc_broadcastMonitoredVariable",owner _target, false] spawn BIS_fnc_MP; -}; -_owners = ([_target,_variable] call cse_fnc_getRegisteredMonitorVariablesOwners); -{ - [_this, "cse_fnc_setMonitoredVariableValue",owner _x, false] spawn BIS_fnc_MP; -}foreach _owners; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf deleted file mode 100644 index 62d3e2a989..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_getAllMonitoredVariables.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -if (isnil "CSE_REGISTERED_MONITORED_VARIABLES") then { - CSE_REGISTERED_MONITORED_VARIABLES = []; -}; -CSE_REGISTERED_MONITORED_VARIABLES \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf deleted file mode 100644 index f90af6758c..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/** - * fn_getCanInteract.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_return"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -(_unit getvariable ["cse_canInteract",0]) \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf deleted file mode 100644 index d81bfdc24a..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/** - * fn_getInteractionTarget.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_prevTarget"]; -_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_prevTarget = [_unit,"cse_interactionTarget"] call cse_fnc_getVariable; -_prevTarget \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf deleted file mode 100644 index 7a721e4c54..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/** - * fn_getMonitoredVariableName.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_stagingName","_name","_variableName"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variableName = [_this,1,"",[""]] call BIS_fnc_Param; -//_name = ""; -//{ -// _name = _name + _x; -//}foreach ([format["%",_target], " "] call BIS_fnc_splitString); - -_stagingName = format["CSE_MONITORED_VARIABLE_%1", _variableName]; -_stagingName \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf deleted file mode 100644 index 7f2658afec..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * fn_getMonitoredVariableValue.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_returnValue","_stagingName","_variable"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variable = [_this,1,"",[""]] call BIS_fnc_Param; - -_returnValue = ""; -_stagingName = [_target,_variable] call cse_fnc_getMonitoredVariableName; -_unknown = false; -if (isnil _stagingName) then { - // default value for variable, else "" - _returnValue = [_variable] call cse_fnc_getVariableDefault; - [_target,_variable,_returnValue] call cse_fnc_setMonitoredVariableValue; - _unknown = true; -} else { - _returnValue = call compile _stagingName; - if (isnil "_returnValue") then { - _returnValue = [_variable] call cse_fnc_getVariableDefault; - _unknown = true; - } else { - if (typeName _returnValue == typeName "") then { - if (_returnValue == "") then { - call compile format["%1 = '';",_stagingName]; - player sidechat format["Return didnt function propery"]; - }; - _returnValue = [_variable] call cse_fnc_getVariableDefault; - _unknown = true; - }; - }; -}; -_returnValue \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf deleted file mode 100644 index 8ecae2ba6a..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_getOnUpdateVariableEH.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_target","_variable","_name","_return","_variableName"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variableName = [_this,1,"",[""]] call BIS_fnc_Param; -_name = [_target,_variableName] call cse_fnc_getMonitoredVariableName; -_name = _name + "_UPDATE_EH"; -_return = ""; -if (isnil _name) then { - -} else { - _return = call compile _name; - //[format["cse_fnc_getOnUpdateVariableEH %1 | %2",_return, _name]] call cse_fnc_debug; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf deleted file mode 100644 index 90eeed1aa1..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * fn_getRegisteredMonitorVariablesOwners.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_returnOwners","_register","_variableName","_registerMonitorCol"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variableName = [_this,1,"",[""]] call BIS_fnc_Param; -_returnOwners = []; - -_registerMonitorCol = + ([_target,"cse_variableMonitor",[]] call cse_fnc_getVariable); - -//if (count _registerMonitor > 0) then { - { - if ((_x select 1) == _variableName) then { - _returnOwners pushback (_x select 0); - }; - }foreach _registerMonitorCol; -//}; -_returnOwners \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf deleted file mode 100644 index 436979399f..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_isRegisteredInteractingWith.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_register"]; -_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; -_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; -_return = false; -{ - if (_x == _unit) exitwith { - _return = true; - }; -}foreach _register; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf deleted file mode 100644 index bb48949687..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/** - * fn_registerInteractingWith.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_prevTarget","_register"]; -_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; - -if (local _unit) then { - _prevTarget = [_unit,"cse_interactionTarget"] call cse_fnc_getVariable; - if (!isNull _prevTarget) then { - [_unit,_prevTarget] call cse_fnc_unregisterInteractingWith; - //waituntil {sleep 0.1; !([_unit,_prevTarget] call cse_fnc_isRegisteredInteractingWith)}; - }; - [_unit,"cse_interactionTarget",_target] call cse_fnc_setVariable; -}; -if (!local _target) exitwith { - [_this, "cse_fnc_registerInteractingWith",owner _target, false] spawn BIS_fnc_MP; -}; - -// local on target ! -_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; -_register pushback _unit; -[_target,"cse_interactionRegister",_register] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf b/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf deleted file mode 100644 index 51f273faa6..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/** - * fn_registerVariableMonitor.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_varName","_register","_onUpdate","_registerMonitor"]; -_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; -_varName = _this select 2; -_onUpdate = ""; -if (count _this >3) then { - _onUpdate = _this select 3; - [_target,_varName,_onUpdate] call cse_fnc_setOnUpdateVariableEH; -}; -if (local _unit) then { - if (isnil "CSE_REGISTERED_MONITORED_VARIABLES") then { - CSE_REGISTERED_MONITORED_VARIABLES = []; - }; - CSE_REGISTERED_MONITORED_VARIABLES pushback _varName; - [_target,_varName] call cse_fnc_getMonitoredVariableValue; -}; - -if (!local _target) exitwith { - [_this, "cse_fnc_registerVariableMonitor",owner _target, false] spawn BIS_fnc_MP; -}; -_registerMonitor = [_target,"cse_variableMonitor",[]] call cse_fnc_getVariable; -_registerMonitor pushback [_unit,_varName]; -[_target,"cse_variableMonitor",_registerMonitor] call cse_fnc_setVariable; -// [[_target,_varName,([_target,_varName] call cse_fnc_getVariable)], "cse_fnc_setMonitoredVariableValue", _unit, false] spawn BIS_fnc_MP; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf deleted file mode 100644 index c0da8c58f6..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/** - * fn_setMonitoredVariableValue.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -_this spawn { - private ["_unit","_target","_variable","_eh"]; - _target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; - _variable = [_this,1,"",[""]] call BIS_fnc_Param; 1; - - _stagingName = [_target,_variable] call cse_fnc_getMonitoredVariableName; - if (count _this >2) then { - call compile format["%1 = %2;",_stagingName,_this select 2]; - } else { - call compile format["%1 = nil;",_stagingName]; - }; - - - _eh = [_target,_variable] call cse_fnc_getOnUpdateVariableEH; - if (!isnil _eh) then { - if (typeName _eh == typeName "") then { - [_target,_variable,_this select 2] spawn compile _eh; - } else { - if (typeName _eh == typeName {}) then { - [_target,_variable,_this select 2] spawn _eh; - }; - }; - }; - -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf deleted file mode 100644 index 63021c0287..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * fn_setOnUpdateVariableEH.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_target","_name","_eh","_variableName"]; -_target = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_variableName = [_this,1,"",[""]] call BIS_fnc_Param; -_eh = _this select 2; // what data type? -_name = [_target,_variableName] call cse_fnc_getMonitoredVariableName; -_name = _name + "_UPDATE_EH"; -[_eh] call compile format["%1 = (_this select 0);",_name,_eh]; \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf b/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf deleted file mode 100644 index d3621d1462..0000000000 --- a/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/** - * fn_unregisterInteractingWith.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_target","_register","_toRemove","_newRegister","_registerMonitor"]; -_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_target = [_this,1,ObjNull,[ObjNull]] call BIS_fnc_Param; - -if (local _unit) then { - [_unit,"cse_interactionTarget"] call cse_fnc_setVariable; - { - _name = [_target, _x] call cse_fnc_getMonitoredVariableName; - call compile format["%1 = nil;",_name]; - }foreach (call cse_fnc_getAllMonitoredVariables); -}; -if (!local _target) exitwith { - [_this, "cse_fnc_unregisterInteractingWith",owner _target, false] spawn BIS_fnc_MP; -}; -_register = [_target,"cse_interactionRegister",[]] call cse_fnc_getVariable; -_register = _register - [_unit]; -[_target,"cse_interactionRegister",_register] call cse_fnc_setVariable; - -_registerMonitor = [_target,"cse_variableMonitor",[]] call cse_fnc_getVariable; -_newRegister = []; -{ - if ((_x select 0) == _unit) then { - - } else { - _newRegister pushback _x; - }; -}foreach _registerMonitor; -[_target,"cse_variableMonitor",_newRegister] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf deleted file mode 100644 index 679ca870a1..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf +++ /dev/null @@ -1,77 +0,0 @@ -/** - * fn_disableKeyInput_f.sqf - * @Descr: Disable the keyinput - * @Author: Glowbal - * - * @Arguments: [disable BOOL] - * @Return: void - * @PublicAPI: false - */ - - - -private["_disable"]; -_disable = [_this, 0, false, [false]] call BIS_fnc_Param; -if (!hasInterface) exitwith {}; -CSE_DISABLE_KEY_INPUT_F = _disable; - -[format["Disable Key input: %1",_disable]] call cse_fnc_debug; -if (_disable) then { - if (isNil "CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F") then { - [format["Keyinput has not yet been disabled, now disabling",_disable]] call cse_fnc_debug; - - CSE_DISABLE_USER_INPUT_SCREEN = true; - createDialog 'cse_empty_screen'; - disableSerialization; - _display = uiNamespace getvariable "cse_empty_screen"; - CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F = _display displayAddEventHandler ["KeyDown", { - _return = true; - if ((_this select 1) == 1) then { - if (isNull finddisplay 49) then { - [format["Assigning ctrlEventhandlers to buttons"]] call cse_fnc_debug; - if (isMultiplayer) then { - createDialog "RscDisplayMPInterrupt"; - _ctrl = (finddisplay 49) displayctrl 103; - _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; failMission 'LOSER';"]; - - _ctrl = (finddisplay 49) displayctrl 104; - _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; player setDamage 1;"]; - } else { - createDialog "RscDisplayInterrupt"; - _ctrl = (finddisplay 49) displayctrl 104; - _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; [false] call cse_fnc_disableKeyInput_f; failMission 'LOSER';"]; - }; - } else { - closeDialog 49; - }; - }; - - if ((_this select 1) in actionKeys "CuratorInterface" && {player in allCurators}) then { - openCuratorInterface - }; - if (serverCommandAvailable "#missions") then { - }; - [format["Returning %1 for disable key input keyDown handler", _return]] call cse_fnc_debug; - _return; - }]; - CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F = _display displayAddEventHandler ["KeyUp", {true;}]; - }; -} else { - if (!isNil "CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F") then { - [format["Keyinput has been disabled, now enabling",_disable]] call cse_fnc_debug; - CSE_DISABLE_USER_INPUT_SCREEN = false; - disableSerialization; - _display = uiNamespace getvariable "cse_empty_screen"; - if (isnil "_display") then { - _display = displayNull; - }; - closeDialog 679123; - _display closeDisplay 1; - _display displayRemoveEventHandler ["KeyDown", CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F]; - _display displayRemoveEventHandler ["KeyUp", CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F]; - CSE_DISABLE_KEY_DOWN_INPUT_DISPLAY_EH_F = nil; - CSE_DISABLE_KEY_UP_INPUT_DISPLAY_EH_F = nil; - }; -}; - -[[_disable], "disableKeyInput"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf deleted file mode 100644 index a2832cfebc..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/** - * fn_disableUserInput_f.sqf - * @Descr: Disables the user input. Works stacked. - * @Author: Glowbal - * - * @Arguments: [id STRING, disable BOOL] - * @Return: void - * @PublicAPI: true - */ - -private ["_id","_disable"]; -_id = _this select 0; -_disable = _this select 1; - - -if (isnil "CSE_DISABLE_USER_INPUT_COLLECTION_F") then { - CSE_DISABLE_USER_INPUT_COLLECTION_F = []; -}; - -if (_disable) then { - CSE_DISABLE_USER_INPUT_COLLECTION_F pushback _id; - [true] call cse_fnc_disableKeyInput_f; -} else { - CSE_DISABLE_USER_INPUT_COLLECTION_F = CSE_DISABLE_USER_INPUT_COLLECTION_F - [_id]; - if (CSE_DISABLE_USER_INPUT_COLLECTION_F isEqualTo []) then { - [false] call cse_fnc_disableKeyInput_f; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf deleted file mode 100644 index 86457e708c..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/** - * fn_endRadioTransmission_f.sqf - * @Descr: force end all radio transmissions by TFAR or ACRE - * @Author: Glowbal - * - * @Arguments: [] - * @Return: nil - * @PublicAPI: true - */ - - -if (["acre_api"] call cse_fnc_isModLoaded_F) then { - [-1] call acre_sys_core_fnc_handleMultiPttKeyPressUp; - [0] call acre_sys_core_fnc_handleMultiPttKeyPressUp; - [1] call acre_sys_core_fnc_handleMultiPttKeyPressUp; - [2] call acre_sys_core_fnc_handleMultiPttKeyPressUp; -}; - -if (["task_force_radio"] call cse_fnc_isModLoaded_F) then { - call TFAR_fnc_onSwTangentReleased; - call TFAR_fnc_onAdditionalSwTangentReleased; - - call TFAR_fnc_onLRTangentReleased; - call TFAR_fnc_onAdditionalLRTangentReleased; - - call TFAR_fnc_onDDTangentReleased; -}; - -nil; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_getName.sqf b/TO_MERGE/cse/main/misc/functions/fn_getName.sqf deleted file mode 100644 index b7b4c9bda8..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_getName.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * fn_getName.sqf - * @Descr: Get the name of unit - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: STRING Name of object - * @PublicAPI: true - */ - -private["_unit","_return"]; -_unit = _this select 0; -_return = "Unknown"; - -if (alive _unit) then { - if (_unit iskindof "CAManBase") then { - if (_unit getvariable ["cse_isDead",false]) then { - _return = _unit getvariable ["cse_name","Unknown"]; - } else { - _return = name _unit; - }; - }; -} else { - _return = _unit getvariable ["cse_name","Unknown"]; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf deleted file mode 100644 index 6091895503..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/** - * fn_hasItem_f.sqf - * @Descr: Check if a unit has item - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, item STRING (Classname of item)] - * @Return: BOOL True if unit has the item in it's inventory - * @PublicAPI: true - */ - - -private ["_unit","_item"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; -_item = [_this, 1, "", [""]] call BIS_fnc_Param; - -(_item in items _unit); \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf b/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf deleted file mode 100644 index 6b08e969f0..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * fn_isInBuilding.sqf - * @Descr: Check is unit is within a building - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: BOOL True if unit is under a roof - * @PublicAPI: true - */ - -private ["_unit","_eyePos","_obj","_isInBuilding"]; -_unit = _this select 0; - -_eyePos = eyePos _unit; -_isInBuilding = false; -_obj = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]); -{ - if (_x isKindOf "Building") exitwith { - _isInBuilding = true; - }; -}foreach _obj; - -_isInBuilding \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf b/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf deleted file mode 100644 index adf55eed55..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/** - * fn_lockVehicleOfUnitUntil.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_vehicleOfUnit","_lockSwitch"]; -_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_vehicleOfUnit = vehicle _unit; -_lockSwitch = false; -waituntil{ - if (!_lockSwitch) then { - if (_vehicleOfUnit != _unit) then { - if (locked _vehicleOfUnit != 0) then { - _lockSwitch = true; - _vehicleOfUnit lock true; - [format["VEHICLE LOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; - }; - }; - } else { - if (vehicle _unit == _unit) then { - _vehicleOfUnit lock false; - _lockSwitch = false; - [format["VEHICLE UNLOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; - }; - }; - (!(_unit getvariable ["cse_state_unconscious", false]) || !alive _unit)}; - -if (_lockSwitch) then { - _vehicleOfUnit lock false; - [format["VEHICLE UNLOCKED %1", _vehicleOfUnit]] call cse_fnc_debug; -} else { - [format["NO VEHICLE TO UNLOCKED %1", _unit]] call cse_fnc_debug; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf b/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf deleted file mode 100644 index f7541e4d58..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/** - * fn_moduleEnableBasicRevive.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_args", "_units", "_activated"]; -_args = _this; - -CSE_ENABLE_REVIVE_F = 0; -CSE_REVIVE_TIMER_F = 600; -CSE_REVIVE_NUMBER_MAX_F = -1; -{ - _value = _x select 1; - if (!isnil "_value") then { - if (_x select 0 == "enableFor") then { - CSE_ENABLE_REVIVE_F = _x select 1; - }; - if (_x select 0 == "timer") then { - CSE_REVIVE_TIMER_F = _x select 1; - }; - if (_x select 0 == "amountOf") then { - CSE_REVIVE_NUMBER_MAX_F = _x select 1; - }; - }; -}foreach _args; - -[ - {(((_this select 0) getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > 0)} -] call cse_fnc_registerUnconsciousCondition; - -[format["Enabled Basic Revive Module - ENABLED FOR: %1. TIMER: %2. NUMBER: %3", CSE_ENABLE_REVIVE_F, CSE_REVIVE_TIMER_F, CSE_REVIVE_NUMBER_MAX_F]] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf deleted file mode 100644 index 7937c359a2..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf +++ /dev/null @@ -1,51 +0,0 @@ -/** - * fn_resetAllDefaults_f.sqf - * @Descr: reset all variables that have been defined - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_oldUnit","_sets","_CSEFadingBlackUI","_ctrlFadingBlackUI"]; -_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; -_oldUnit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; - -//_unit setvariable["cse_unconscious_non_captive_f",nil]; -if (missionNamespace getvariable ["cse_unconscious_non_captive_f",false]) then { - _unit setCaptive false; - missionNamespace setvariable["cse_unconscious_non_captive_f",nil]; - [format["Detected unit as a non captive but in captive state. RESETTING"]] call cse_fnc_debug; -} else { - [format["didn't trigger but unit is: %1 - %2", captive _unit, (missionNamespace getvariable ["cse_unconscious_non_captive_f",false])]] call cse_fnc_debug; -}; - -_unit setvariable ["cse_isDead",nil,true]; -_unit setvariable ["cse_state_unconscious", nil, true]; - -if (isPlayer _unit) then { - [true] call cse_fnc_setVolume_f; - [false] call cse_fnc_disableKeyInput_f; - [false] call cse_fnc_effectBlackOut; - [player, -1] call cse_fnc_limitSpeed; - if (isnil "CSE_DISABLE_USER_INPUT_COLLECTION_F") then { - CSE_DISABLE_USER_INPUT_COLLECTION_F = []; - }; - { - [_X, false] call cse_fnc_disableUserInput_f; - }foreach CSE_DISABLE_USER_INPUT_COLLECTION_F; -}; -_sets = [_unit] call cse_fnc_getAllSetVariables; -[format["defaults for %1 : %2",_unit,_sets]] call cse_fnc_debug; -if ((count _sets) > 0) then { - { - if (!(_x select 4)) then { - _unit setvariable [(_x select 0),nil,_x select 3]; - [format["RESETTING: %1",[(_x select 0),_unit, _x select 1, (_unit getvariable (_x select 0))]]] call cse_fnc_debug; - }; - }foreach _sets; -} else { - ["No defaults have been set"] call cse_fnc_debug; -}; -[[_unit],"resetToDefaults"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf deleted file mode 100644 index e711fe6c91..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf +++ /dev/null @@ -1,4 +0,0 @@ - -if (hasInterface) then { - player reveal (_this select 0); -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf b/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf deleted file mode 100644 index dd85ecea06..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf +++ /dev/null @@ -1,101 +0,0 @@ -/** - * fn_setDead.sqf - * @Descr: Kills a unit - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: void - * @PublicAPI: true - */ - -private ["_unit"]; -_unit = _this select 0; -_force = false; -if (count _this >= 2) then { - _force = _this select 1; -}; - -if (!alive _unit) exitwith{}; -if (!local _unit) exitwith { - [[_unit, _force], "cse_fnc_setDead", _unit, false] spawn BIS_fnc_MP; - diag_log format["WARNING: cse_fnc_setDead triggered on non local unit %1", _unit]; -}; -if (isnil "CSE_ENABLE_REVIVE_F") then { - CSE_ENABLE_REVIVE_F = 0; -}; -_name = _unit getvariable "cse_name"; -if (isnil "_name") then { - _unit setvariable ["cse_name", name _unit, true]; -}; - -if (((CSE_ENABLE_REVIVE_F == 1 && isPlayer _unit) || (CSE_ENABLE_REVIVE_F == 2)) && !_force) then { - [format["CSE_ENABLE_REVIVE_F %1",_unit]] call cse_fnc_debug; - _unit spawn { - private ["_unit","_counter"]; - _unit = _this; - _playerDead = isPlayer _unit; - - if ((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > 0) exitwith { - _unit setvariable["CSE_ENABLE_REVIVE_SETDEAD_F",(_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) + 1]; - }; - _unit setvariable["CSE_ENABLE_REVIVE_SETDEAD_F",1]; - [_unit] call cse_fnc_setUnconsciousState; - if (isnil "CSE_REVIVE_TIMER_F") then { - CSE_REVIVE_TIMER_F = 10; - }; - if (isnil "CSE_REVIVE_NUMBER_MAX_F") then { - CSE_REVIVE_NUMBER_MAX_F = -1; - }; - waituntil {([_unit] call cse_fnc_isUnconscious)}; - _counter = 0; - if (alive (vehicle _unit)) then { - _unit setvariable ["cse_inReviveState", true, true]; - while {([_unit] call cse_fnc_isUnconscious)} do { - _counter = _unit getvariable ["CSE_ENABLE_REVIVE_COUNTER",_counter]; - if (_counter > CSE_REVIVE_TIMER_F || (((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > CSE_REVIVE_NUMBER_MAX_F) && (CSE_REVIVE_NUMBER_MAX_F > 0))) exitwith{ - if (_counter > CSE_REVIVE_TIMER_F) then { - [format["Timer ran out for %1",_unit]] call cse_fnc_debug; - }; - if (((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > CSE_REVIVE_NUMBER_MAX_F) && (CSE_REVIVE_NUMBER_MAX_F > 0)) then { - [format["amount of calls for setDead ran out for %1",_unit]] call cse_fnc_debug; - }; - if (isPlayer _unit) then { - titleText ["You died..","PLAIN DOWN"]; - }; - [format["cse_isDead %1",_unit]] call cse_fnc_debug; - [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; - if (_playerDead) then { - [_unit,"cse_isDeadPlayer",true,true] call cse_fnc_setVariable; - }; - _unit setdamage 1; - [[_unit, true],"killed"] call cse_fnc_customEventHandler_F; - }; - sleep 1; - _unit setvariable ["CSE_ENABLE_REVIVE_COUNTER",_counter + 1]; - _counter = _counter + 1; - }; - _unit setvariable ["cse_inReviveState", nil, true]; - [format["no longer unconscious %1",_unit]] call cse_fnc_debug; - } else { - if (isPlayer _unit) then { - titleText ["You died..","PLAIN DOWN"]; - }; - [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; - _unit setdamage 1; - [[_unit, false],"killed"] call cse_fnc_customEventHandler_F; - }; - }; -} else { - [format["INSTANT KILL %1",_unit]] call cse_fnc_debug; - _unit setvariable ["cse_isUnconscious", true, true]; - if (isPlayer _unit) then { - titleText ["You died..","PLAIN DOWN"]; - }; - if (isPLayer _unit) then { - [_unit,"cse_isDeadPlayer",true,true] call cse_fnc_setVariable; - }; - _unit setdamage 1; - [_unit,"cse_isDead",true,true] call cse_fnc_setVariable; - - [[_unit, false],"killed"] call cse_fnc_customEventHandler_F; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf b/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf deleted file mode 100644 index 0ad2a231eb..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * fn_setProne.sqf - * @Descr: Force a unit to go prone - * @Author: Glowbal - * - * @Arguments: [unit OBJECT] - * @Return: void - * @PublicAPI: true - */ - -private ["_unit"]; -_unit = [_this,0, ObjNull,[ObjNull]] call BIS_fnc_Param; -switch (currentWeapon _unit) do { - case (primaryWeapon _unit): { - [_unit,"amovppnemstpsraswrfldnon"] call cse_fnc_localAnim; - }; - case (secondaryWeapon _unit): { - [_unit,"amovppnemstpsraswlnrdnon"] call cse_fnc_localAnim; - }; - case (handgunWeapon _unit): { - [_unit,"AmovPpneMstpSrasWpstDnon"] call cse_fnc_localAnim; - }; - default { - [_unit,"amovppnemstpsnonwnondnon"] call cse_fnc_localAnim; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf deleted file mode 100644 index 44d4179091..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/** - * fn_setVolume_f.sqf - * @Descr: Sets the volume of the game, including third party radio modifications such as TFAR and ACRE. - * @Author: Glowbal - * - * @Arguments: [setVolume BOOL] - * @Return: void - * @PublicAPI: true - */ -#define MUTED_LEVEL 0.2 -#define NORMAL_LEVEL 1 -#define NO_SOUND 0 - -private ["_setVolume"]; -_setVolume = [_this, 0, false, [false]] call BIS_fnc_Param; - -if (_setVolume) then { - // Vanilla Game - 2 fadeSound NORMAL_LEVEL; - - // TFAR - player setVariable ["tf_voiceVolume", NORMAL_LEVEL, true]; - player setVariable ["tf_globalVolume", NORMAL_LEVEL]; - player setVariable ["tf_unable_to_use_radio", false]; - - // ACRE2 - player setVariable ["acre_sys_core_globalVolume", NORMAL_LEVEL]; - player setVariable ["acre_sys_core_isDisabled", false, true]; - -} else { - // Vanilla Game - 2 fadeSound MUTED_LEVEL; - - // TFAR - player setVariable ["tf_voiceVolume", NO_SOUND, true]; - player setVariable ["tf_globalVolume", MUTED_LEVEL]; - player setVariable ["tf_unable_to_use_radio", true]; - - // ACRE2 - player setVariable ["acre_sys_core_globalVolume", MUTED_LEVEL]; - player setVariable ["acre_sys_core_isDisabled", true, true]; - -}; - -[[_setVolume],"setVolume"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf deleted file mode 100644 index 6a28fa473a..0000000000 --- a/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf +++ /dev/null @@ -1,65 +0,0 @@ -/** - * fn_switchToGroupSide_f.sqf - * @Descr: Stack group switches. Will always trace back to original group. - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, switch BOOL, id STRING, side SIDE] - * @Return: void - * @PublicAPI: true - */ - - -private ["_unit","_side","_previousGroup","_newGroup", "_currentGroup", "_switch", "_originalSide", "_previousGroupsList", "_id"]; -_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; -_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 ["cse_previous_group_switchTo_f",[]]; -if (_switch) then { - // go forward - _previousGroup = group _unit; - _originalSide = side group _unit; - - if (count units _previousGroup == 1 && _originalSide == _side) exitwith { - [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call cse_fnc_debug; - }; - - _newGroup = createGroup _side; - [_unit] joinSilent _newGroup; - - _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; - _unit setvariable ["cse_previous_group_switchTo_f", _previousGroupsList, true]; -} else { - // go one back - { - if (_id == (_x select 2)) exitwith { - _x set [ 3, false]; - _previousGroupsList set [_foreachIndex, _x]; - [format["found group with ID: %1", _id]] call cse_fnc_debug; - }; - }foreach _previousGroupsList; - reverse _previousGroupsList; - - { - if (_x select 3) exitwith {}; // stop at first id set to true - if !(_x select 3) then { - _currentGroup = group _unit; - if (!isNull (_x select 0)) then { - [_unit] joinSilent (_x select 0); - } else { - _newGroup = createGroup (_x select 1); - [_unit] joinSilent _newGroup; - }; - if (count units _currentGroup == 0) then { - deleteGroup _currentGroup; - }; - _previousGroupsList set [_foreachIndex, ObjNull]; - }; - }foreach _previousGroupsList; - _previousGroupsList = _previousGroupsList - [objNull]; - reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. - _unit setvariable ["cse_previous_group_switchTo_f", _previousGroupsList, true]; -}; - -[[_unit, _switch, _id, _side],"switchToGroupSide"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf b/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf deleted file mode 100644 index 7ccf6c5d27..0000000000 --- a/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/** - * fn_ALiVE_BUS_Mod.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_busArguments","_return"]; -_busArguments = [_this, 0, [], [[]]] call BIS_fnc_Param; -if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { - _return = _busArguments call ALiVE_fnc_BUS; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf b/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf deleted file mode 100644 index 12a37391ae..0000000000 --- a/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf +++ /dev/null @@ -1,12 +0,0 @@ -/** - * fn_isLoaded_ALiVE_Mod.sqf - * Descr: Check if the ALiVE Modification is loaded - * Author: Glowbal - * - * Arguments: [] - * Return: BOOL true if ALiVE is loaded - * PublicAPI: true - */ - - -(["ALIVE_main"] call cse_fnc_isModLoaded_f) \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf deleted file mode 100644 index 895687082f..0000000000 --- a/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_createMutex.sqf - * @Descr: Create a Mutex - * @Author: Glowbal - * - * @Arguments: [mutexName STRING, intialStatus BOOL (True if initial status is locked)] - * @Return: BOOL True if mutex has been created. - * @PublicAPI: true - */ - -private ["_mutexName","_initalStatus","_return"]; -_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; -_initalStatus = [_this, 1, false, [false]] call BIS_fnc_param; -_return = false; -if (_mutexName != "") then { - private["_mutexCombinedName"]; - _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; - if (isnil _mutexCombinedName) then { - missionNamespace setvariable [_mutexCombinedName, _initalStatus]; - _return = true; - }; -}; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf deleted file mode 100644 index 536176bcba..0000000000 --- a/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_lockMutex.sqf - * @Descr: Lock a mutex. If mutex exists and is locked, will wait until mutex becomes free, before locking it again. - * @Author: Glowbal - * - * @Arguments: [mutexName STRING] - * @Return: BOOL True if succesfullly locked. - * @PublicAPI: true - */ - -private ["_mutexName","_initalStatus","_return"]; -_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; - -_return = false; -if (_mutexName != "")then { - private["_mutexCombinedName"]; - _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; - if !(isnil _mutexCombinedName) then { - [_mutexName] call cse_fnc_waitForSingleMutex; - missionNamespace setvariable [_mutexCombinedName, 1]; - _return = true; - }; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf deleted file mode 100644 index 8e29633dc5..0000000000 --- a/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * fn_releaseMutex.sqf - * @Descr: Releases or unlocks a mutex. - * @Author: Glowbal - * - * @Arguments: [mutexName STRING] - * @Return: True if succesfully unlocked or mutex was never locked. - * @PublicAPI: true - */ - - -private ["_mutexName","_initalStatus","_return"]; -_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; - -_return = false; -if (_mutexName != "")then { - private["_mutexCombinedName"]; - _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; - if !(isnil _mutexCombinedName) then { - missionNamespace setvariable [_mutexCombinedName, 0]; - _return = true; - }; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf deleted file mode 100644 index 4e626cc6c1..0000000000 --- a/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/** - * fn_waitForMultipleMutex.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - - -private ["_mutexes"]; -_mutexes = _this; -{ - if (typeName _x == typeName "") then { - [_x, -1] call cse_fnc_waitForSingleMutex; - }; -}foreach _mutexes; \ No newline at end of file diff --git a/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf b/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf deleted file mode 100644 index 5d04a60968..0000000000 --- a/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/** - * fn_waitForSingleMutex.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - - -private ["_mutexName","_timeout","_return"]; -_mutexName = [_this, 0, "", [""]] call BIS_fnc_param; -if (count _this > 1) then { - _timeout = [_this, 1, -1, [-1]] call BIS_fnc_param; -}; - -_return = false; -if (_mutexName != "") then { - private["_mutexCombinedName"]; - _mutexCombinedName = format["CSE_FRAMEWORK_MUTEX_%1",_mutexName]; - if !(isnil _mutexCombinedName) then { - _startTime = time; - waituntil {((missionNamespace getvariable [_mutexCombinedName, 0]) == 0) || ((time - _startTime > (_timeout*accTime)) && _timeout > 0)}; - _return = (missionNamespace getvariable [_mutexCombinedName, 0]) == 0; - }; -}; -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf b/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf deleted file mode 100644 index 8f2420f7ba..0000000000 --- a/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/** - * fn_onAnswerRequest.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; -_unit = _this select 0; -_id = _this select 1; -_accepted = _this select 2; - -_info = _unit getvariable _id; -if (!isnil "_info") then { - _caller = _info select 0; - _target = _info select 1; - _requestID = _info select 2; - _requestMessage = _info select 3; - _callBack = _info select 4; - _replyParams = [_info, _accepted]; - [_replyParams, "cse_fnc_requestCallback", _caller, false] spawn BIS_fnc_MP; - _unit setvariable [_id, nil]; -}; - -CSE_RECIEVE_REQUEST_ID_KEY_BINDING = nil; - -if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { - _unit removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; - CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; -}; -if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { - _unit removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; - CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; -}; diff --git a/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf b/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf deleted file mode 100644 index 8e1502edc1..0000000000 --- a/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/** - * fn_recieveRequest.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -_caller = _this select 0; -_target = _this select 1; -_requestID = _this select 2; -_requestMessage = _this select 3; -_callBack = _this select 4; - -_requestID = ("cse_fnc_recieveRequest_f"+_requestID); - -_target setvariable [_requestID, _this]; - -if (isLocalized _requestMessage) then { - _requestMessage = format[localize _requestMessage,[_caller] call cse_fnc_getName]; -} else { - _requestMessage = format[_requestMessage,[_caller] call cse_fnc_getName]; -}; - -hint format["%1",_requestMessage]; -if !(isnil "CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT") then { - terminate CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT; -}; - -if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { - _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; - CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; -}; -if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { - _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; - CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; -}; - -CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = _target addAction ["Accept", compile format["[player,'%1', true] call cse_fnc_onAnswerRequest;", _requestID]]; -CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = _target addAction ["Decline", compile format["[player,'%1', false] call cse_fnc_onAnswerRequest;", _requestID]]; - -CSE_RECIEVE_REQUEST_ID_KEY_BINDING = _requestID; - -CSE_RECIEVE_REQUEST_TIME_OUT_SCRIPT = [time, _target, _requestID] spawn { - _t = (_this select 0) + 40; - _target = _this select 1; - _requestID = _this select 2; - _id = _target getvariable _requestID; - waituntil { - _id = _target getvariable _requestID; - - (time > _t || isnil "_id")}; - _target setvariable [_requestID, nil]; - CSE_RECIEVE_REQUEST_ID_KEY_BINDING = nil; - if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT") then { - _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT; - CSE_RECIEVE_REQUEST_ADD_ACTION_ACCEPT = nil; - }; - if (!isnil "CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE") then { - _target removeAction CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE; - CSE_RECIEVE_REQUEST_ADD_ACTION_DECLINE = nil; - }; - -}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/stringtable.xml b/TO_MERGE/cse/main/stringtable.xml deleted file mode 100644 index a0493c1ae5..0000000000 --- a/TO_MERGE/cse/main/stringtable.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Accept Requests - Akceptuj prośby - Aceptar Peticiones - - - Decline Requests - Ignoruj prośby - Rechazar Peticiones - - - Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. - Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. - Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. - - - Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. - 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. - - - - diff --git a/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf deleted file mode 100644 index d9d9776bed..0000000000 --- a/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * fn_addTaskToPool_f.sqf - * @Descr: N/A - * @Author: Glowbal - * - * @Arguments: [id STRING, args ARRAY, code COE] - * @Return: nil; - * @PublicAPI: false - */ - -private ["_id", "_args","_code"]; -_id = _this select 0; -_args = _this select 1; -_code = [_this, 2, {}, [{}]] call BIS_fnc_Param; - -if (isnil "CSE_TASK_POOL_COLLECTION_F") then { - CSE_TASK_POOL_COLLECTION_F = []; -}; -CSE_TASK_POOL_COLLECTION_F pushback [_id, _args, _code ]; - -[format["Added task to task pool: %1", CSE_TASK_POOL_COLLECTION_F]] call cse_fnc_debug; -[[_id, _args, _code],"AddedTotaskPool"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf deleted file mode 100644 index 5a44c14bdb..0000000000 --- a/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * fn_loopThroughPool_f.sqf - * @Descr: - * @Author: Glowbal - * - * @Arguments: [] - * @Return: - * @PublicAPI: false - */ - -#define TASK_PARAMETERS (_x select 1) -#define TASK_CODE (_x select 2) - -{ - TASK_PARAMETERS call TASK_CODE; - false; -}count CSE_TASK_POOL_COLLECTION_F; diff --git a/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf b/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf deleted file mode 100644 index 0699208043..0000000000 --- a/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * fn_removeTaskFromPool_f.sqf - * @Descr: Remove a task from the task pool. - * @Author: Glowbal - * - * @Arguments: [id STRING] - * @Return: nil - * @PublicAPI: true - */ - -private ["_id", "_index"]; -_id = _this select 0; -_index = -1; - -if (isnil "CSE_TASK_POOL_COLLECTION_F") exitwith {nil}; - -{ - if ((_x select 0) == _id) exitwith { - _index = _foreachIndex; - CSE_TASK_POOL_COLLECTION_F set [ _foreachIndex, objNull]; - }; -}foreach CSE_TASK_POOL_COLLECTION_F; -CSE_TASK_POOL_COLLECTION_F = CSE_TASK_POOL_COLLECTION_F - [objNull]; - -nil; \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf deleted file mode 100644 index da83e326fc..0000000000 --- a/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/** - * fn_defineVariable.sqf - * @Descr: Define a variable for the CSE variable framework - * @Author: Glowbal - * - * @Arguments: [name STRING, defaultValue ANY, publicFlag BOOL, category STRING, type NUMBER, persistentFlag BOOL] - * @Return: - * @PublicAPI: true - */ - -private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"]; -_name = _this select 0; -_value = _this select 1; -_defaultGlobal = _this select 2; -_catagory = _this select 3; -_code = 0; -_persistent = false; - -if (count _this < 3) exitwith {}; -if (count _this > 4) then { - _code = _this select 4; - if (count _this > 5) then { - _persistent = _this select 5; - }; -}; - -if (typeName _name != typeName "") then { - throw "IllegalArgument"; -}; - -if (isnil 'CSE_OBJECT_VARIABLES_STORAGE') then { - CSE_OBJECT_VARIABLES_STORAGE = []; -}; - -CSE_OBJECT_VARIABLES_STORAGE pushback [_name,_value,_defaultGlobal,_catagory,_code, _persistent]; - -missionNamespace setvariable ["cse_object_variables_storage_" + _name, [_name,_value,_defaultGlobal,_catagory,_code, _persistent]]; - -[[_name,_value,_defaultGlobal,_catagory,_code, _persistent],"variableDefined"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf deleted file mode 100644 index 84f37c9387..0000000000 --- a/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/** - * fn_getVariable.sqf - * @Descr: Grabs a variable. If variable has not been set, attempts to use default defined value - * @Author: Glowbal - * - * @Arguments: [unit OBJECT, variableName STRING] - * @Return: ANY - * @PublicAPI: true - */ - -#define UNIT (_this select 0) -#define VARIABLE (_this select 1) - -private "_value"; - -_value = UNIT getvariable VARIABLE; -if (isnil "_value") then { - if (count _this >2) then { - _value = _this select 2; - } else { - private "_definedVariable"; - _definedVariable = ([VARIABLE] call cse_fnc_getVariableInfo); - if (count _definedVariable > 1) then { - _value = _definedVariable select 1; - }; - }; - if (isnil "_value") then { - _value = 0; - }; -}; -_value \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf b/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf deleted file mode 100644 index f187f3b05a..0000000000 --- a/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/** - * fn_getvariableDefault.sqf - * @Descr: Get the variable default value - * @Author: Glowbal - * - * @Arguments: [variableName STRING] - * @Return: ANY - * @PublicAPI: true - */ - -private ["_name","_return"]; -_name = _this select 0; -_variableDefinition = ([_name] call cse_fnc_getVariableInfo); -if (count _variableDefinition > 0) then { - _return = _variableDefinition select 1; -}; - -_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf b/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf deleted file mode 100644 index c3953426f0..0000000000 --- a/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf +++ /dev/null @@ -1,11 +0,0 @@ -/** - * fn_getVersion.sqf - * @Descr: Get the version number of the current CSE Build - * @Author: Glowbal - * - * @Arguments: [] - * @Return: STRING String containing the version - * @PublicAPI: true - */ - -getText (configFile >> "cfgPatches" >> "cse_main" >> "version"); \ No newline at end of file diff --git a/ace_fcs.dll b/ace_fcs.dll new file mode 100644 index 0000000000..9907d9e1a0 Binary files /dev/null and b/ace_fcs.dll differ diff --git a/addons/attach/config.cpp b/addons/attach/config.cpp index e3db2b64e6..4143f6eb44 100644 --- a/addons/attach/config.cpp +++ b/addons/attach/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_IR_Strobe_Item"}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common", "ace_interaction"}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"}; authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; }; }; diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index 42f05e0c20..a96cf7af88 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -38,5 +38,8 @@ class Extended_Respawn_EventHandlers { class GVAR(setName) { respawn = QUOTE(_this call FUNC(setName)); }; + class GVAR(RESETDefaults) { + respawn = QUOTE(_this call FUNC(resetAllDefaults_F)); + }; }; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 59b5d7734e..91c586c43d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -8,7 +8,7 @@ QGVAR(remoteFnc) addPublicVariableEventHandler { [missionNamespace] call FUNC(executePersistent); // check previous version number from profile -_currentVersion = getText (configFile >> "CfgPatches" >> ADDON >> "version"); +_currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; if (_currentVersion != _previousVersion) then { @@ -71,6 +71,7 @@ enableCamShake true; if (alive _oldPlayer) then { [_oldPlayer] call FUNC(setName) }; + }] call FUNC(addEventhandler); GVAR(OldPlayerInventory) = ACE_player call FUNC(getAllGear); @@ -140,3 +141,22 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); }; }, 0, []] call cba_fnc_addPerFrameHandler; + + +[QGVAR(reviveCounter_f), 0, false, QGVAR(ADDON)] call FUNC(defineVariable); +[QGVAR(inReviveState), false, true, QGVAR(ADDON)] call FUNC(defineVariable); +[QGVAR(isDead),false,true,QUOTE(ADDON)] call FUNC(defineVariable); +[QGVAR(isDeadPlayer), false, true, QUOTE(ADDON)] call FUNC(defineVariable); +[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); +["ACE_isUnconscious",false,true,QUOTE(ADDON)] call FUNC(defineVariable); +[QGVAR(ENABLE_REVIVE_SETDEAD_F),0,false,QUOTE(ADDON)] call FUNC(defineVariable); +[QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable); + +if (isNil QGVAR(ENABLE_REVIVE_F)) then { + GVAR(ENABLE_REVIVE_F) = 0; +}; + + +[ + {((_this select 0) getvariable [QGVAR(inReviveState), false])} +] call EFUNC(common,registerUnconsciousCondition); \ No newline at end of file diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index a4e4f9bd22..f33b3c47fe 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -182,6 +182,81 @@ if (hasInterface) then { }; +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(setDead); +PREP(isAwake); +PREP(setProne); +PREP(raiseScriptedEvent_f); +PREP(setDisableUserInputStatus); +PREP(dropWeapon_f); +PREP(inWater_f); +PREP(setVolume_f); +PREP(closeAllDialogs_f); +PREP(disableAI_f); +PREP(moduleBasicRevive); +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(setUnconsciousState); +PREP(isUnconscious); +PREP(getUnconsciousCondition); +PREP(registerUnconsciousCondition); +PREP(setCaptiveSwitch); +PREP(moveToTempGroup); +PREP(canGoUnconsciousState); +PREP(setWeaponsCorrectUnconscious); +PREP(limitMovementSpeed); +PREP(setArrestState); +PREP(isArrested); +PREP(loadPerson_F); +PREP(loadPersonLocal_F); +PREP(makeCopyOfBody_F); +PREP(unloadPerson_F); +PREP(cleanUpCopyOfBody_F); + +ADDON = true; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index a11bbc80b7..158c4cbead 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {"ACE_Box_Misc"}; weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main"}; + requiredAddons[] = {"ace_main", "ace_gui"}; author[] = {"KoffeinFlummi"}; authorUrl = "https://github.com/KoffeinFlummi/"; VERSION_CONFIG; @@ -80,3 +80,4 @@ class RscAttributeInventory: RscControlsGroupNoScrollbars { #include #include #include + diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_beingCarried.sqf b/addons/common/functions/fnc_beingCarried.sqf similarity index 61% rename from TO_MERGE/cse/f_states/carry/functions/fn_beingCarried.sqf rename to addons/common/functions/fnc_beingCarried.sqf index ae3dd0f6d7..ed0c7832bb 100644 --- a/TO_MERGE/cse/f_states/carry/functions/fn_beingCarried.sqf +++ b/addons/common/functions/fnc_beingCarried.sqf @@ -7,7 +7,6 @@ * @Return: BOOL True if object is being carried * @PublicAPI: true */ +#include "script_component.hpp" -private["_object"]; -_object = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; -!(isNull ([_object] call cse_fnc_getCarriedObj)); \ No newline at end of file +!(isNull ([_this select 0] call FUNC(getCarriedObj))); \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf b/addons/common/functions/fnc_broadcastSound3D_f.sqf similarity index 85% rename from TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf rename to addons/common/functions/fnc_broadcastSound3D_f.sqf index b44904ae10..93f95bb431 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf +++ b/addons/common/functions/fnc_broadcastSound3D_f.sqf @@ -8,7 +8,7 @@ * @PublicAPI: true */ - +#include "script_component.hpp" if (isDedicated) exitwith{}; _unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf b/addons/common/functions/fnc_canGoUnconsciousState.sqf similarity index 86% rename from TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf rename to addons/common/functions/fnc_canGoUnconsciousState.sqf index d716df49de..905dc56a43 100644 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf +++ b/addons/common/functions/fnc_canGoUnconsciousState.sqf @@ -8,7 +8,10 @@ * @PublicAPI: true */ + +#include "script_component.hpp" + private ["_unit"]; _unit = _this select 0; -(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call cse_fnc_isAwake)}) \ No newline at end of file +(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call FUNC(isAwake))}) \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf b/addons/common/functions/fnc_canInteract.sqf similarity index 68% rename from TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf rename to addons/common/functions/fnc_canInteract.sqf index 496c0a43e5..e7c2ba1441 100644 --- a/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf +++ b/addons/common/functions/fnc_canInteract.sqf @@ -7,7 +7,7 @@ * @Return: BOOL True if unit can interact with enviroment. * @PublicAPI: true */ - +#include "script_component.hpp" private ["_unit","_return"]; _unit = _this select 0; -(((_unit getvariable ["cse_canInteract",0]) < 1) && ([_unit] call cse_fnc_isAwake) && !([_unit] call cse_fnc_isArrested)) \ No newline at end of file +(((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested))) \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf b/addons/common/functions/fnc_carriedByObj.sqf similarity index 60% rename from TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf rename to addons/common/functions/fnc_carriedByObj.sqf index afc76bc7d8..139a449c77 100644 --- a/TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf +++ b/addons/common/functions/fnc_carriedByObj.sqf @@ -8,8 +8,6 @@ * @PublicAPI: true */ -private ["_unit","_to"]; -_to = _this select 0; -_unit = _this select 1; +#include "script_component.hpp" -([_to] call cse_fnc_getCarriedBy == [_unit] call cse_fnc_getCarriedBy); \ No newline at end of file +([(_this select 0)] call FUNC(getCarriedBy) == [(_this select 1)] call FUNC(getCarriedBy)); \ No newline at end of file diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf new file mode 100644 index 0000000000..a5cea92a9b --- /dev/null +++ b/addons/common/functions/fnc_carryObj.sqf @@ -0,0 +1,74 @@ +/** + * fn_carryObj.sqf + * @Descr: Have a unit carry an object. Use ObjNull for second parameter if you want the unit to carry nothing + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, objectToCarry OBJECT, attachToVector ARRAY (Optional)] + * @Return: BOOL Returns true if succesful + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_to","_return", "_fallDown", "_carriedObj", "_positionUnit"]; +_unit = [_this, 0,ObjNull, [ObjNull]] call bis_fnc_param; +_to = [_this, 1,ObjNull, [ObjNull]] call bis_fnc_param; +_fallDown = false; +if (count _this > 3) then { + _fallDown = _this select 3; +}; +_return = false; + +[format["fnc_carryObj - UNIT: %1 ATTEMPTS TO CARRY %2",_unit,_to],2] call FUNC(debug); + +if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) || isNull _to) then { + if (vehicle _unit != _unit) exitwith {}; + if (!isNull _to) then { + if ((isNull ([_to] call FUNC(getCarriedObj))) && ([_unit] call FUNC(canInteract))) then { + _return = true; + _unit setvariable [QGVAR(carriedObj),_to,true]; + if (_fallDown) then { + // [_unit,_fallDown] call FUNC(limitMovementSpeed); + }; + [_to, _unit] call FUNC(setCarriedBy); + if (count _this > 2) then { + if (count (_this select 2) == 3) then { + _to attachTo [_unit,(_this select 2)]; + [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); + }; + } else { + [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call FUNC(debug); + }; + + [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + + }; + } else { + if (!isNull ([_unit] call FUNC(getCarriedObj))) then { + [format["fnc_carryObj - UNIT: %1 DROPING CARRIED OBJECT",_unit],2] call FUNC(debug); + _carriedObj = ([_unit] call FUNC(getCarriedObj)); + + detach _carriedObj; + //_carriedObj setPosATL [(getPosATL _carriedObj) select 0, (getPosATL _carriedObj) select 1,0]; + if (!surfaceIsWater getPos _unit) then { + _positionUnit = getPosATL _carriedObj; + _positionUnit set [2, ((getPosATL _unit) select 2) + 0.1]; + _carriedObj setPosATL _positionUnit; + } else { + _positionUnit = getPosASL _carriedObj; + _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; + _carriedObj setPosASL _positionUnit; + }; + [[_unit, _carriedObj],"carryObjectDropped"] call FUNC(raiseScriptedEvent_f); + + [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); + _unit setvariable [QGVAR(carriedObj),_to,true]; + _return = true; + + [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + }; + }; +} else { + [format["fnc_carryObj - UNIT: %1 FAILED TO CARRY %2 - not an object or already carrying",_unit,_to],2] call FUNC(debug); +}; +_return diff --git a/TO_MERGE/cse/f_states/loadPerson/functions/fn_cleanUpCopyOfBody_f.sqf b/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf similarity index 65% rename from TO_MERGE/cse/f_states/loadPerson/functions/fn_cleanUpCopyOfBody_f.sqf rename to addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf index ad9f200b8a..8831b438b0 100644 --- a/TO_MERGE/cse/f_states/loadPerson/functions/fn_cleanUpCopyOfBody_f.sqf +++ b/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf @@ -8,17 +8,19 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit", "_copy"]; _unit = _this select 0; -_copy = _unit getvariable "cse_copyOfBody_f"; +_copy = _unit getvariable QGVAR(copyOfBody_f); if (isnil "_copy") exitwith {false}; -[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call cse_fnc_debug; +[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call FUNC(debug); // lets clean it up -_unit setvariable ["cse_originalCopy_f", nil, true]; -_unit setvariable ["cse_copyOfBody_f", nil, true]; +_unit setvariable [QGVAR(originalCopy_f), nil, true]; +_unit setvariable [QGVAR(copyOfBody_f), nil, true]; if (!isNull _copy) then { - deleteVehicle _copy; + deleteVehicle _copy; }; true; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf b/addons/common/functions/fnc_closeAllDialogs_f.sqf similarity index 75% rename from TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf rename to addons/common/functions/fnc_closeAllDialogs_f.sqf index 4d9cb33837..b5ce1bc280 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf +++ b/addons/common/functions/fnc_closeAllDialogs_f.sqf @@ -7,8 +7,8 @@ * @Return: void * @PublicAPI: true */ - +#include "script_component.hpp" while {dialog} do { - closeDialog 0; + closeDialog 0; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf new file mode 100644 index 0000000000..65edb41094 --- /dev/null +++ b/addons/common/functions/fnc_debug.sqf @@ -0,0 +1,53 @@ +/** + * fn_debug.sqf + * @Descr: Print logging messages through the ACE framework. + * @Author: Glowbal + * + * @Arguments: [message ANY, level NUMBER (Optional)] + * @Return: BOOL True if message has been printed + * @PublicAPI: true + */ +#include "script_component.hpp" + +#define DEFAULT_LOGGING_LEVEL -1 +#define DEFAULT_TEXT_DISPLAY -1 + +private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; +_msg = _this select 0; +_level = if (count _this > 1) then {_this select 1} else { 2 }; + +_defaultLoglevel = if (isNil QGVAR(LOGLEVEL)) then { + DEFAULT_LOGGING_LEVEL; +} else { + GVAR(LOGLEVEL); +}; + +_defaultLogDisplayLevel = if (isnil QGVAR(LOGDISPLAY_LEVEL)) then { + DEFAULT_TEXT_DISPLAY; +} else { + GVAR(LOGDISPLAY_LEVEL); +}; + +if (_defaultLoglevel < 0) exitwith { + false +}; +if (_level <= _defaultLoglevel) then { + + _prefix = switch (_level) do { + case 0: { "ACE Error" }; + case 1: { "ACE Warn" }; + case 2: { "ACE Debug" }; + case 3: { "ACE Info" }; + default { "ACE Unknown" }; + }; + _message = format["[%1] %2",_prefix,_msg]; + + if (_level >= _defaultLogDisplayLevel) then { + systemChat _message; + }; + diag_log _message; + + // pass it onwards to the log function: + // [0, [], compile format["%1",_msg], true] call FUNC(log); +}; +true \ No newline at end of file diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf new file mode 100644 index 0000000000..f36bd97014 --- /dev/null +++ b/addons/common/functions/fnc_debugModule.sqf @@ -0,0 +1,15 @@ +/** + * fn_debugModule.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" +private ["_entity"]; +_entity = _this select 0; + +GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); +GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf new file mode 100644 index 0000000000..3085fc56fa --- /dev/null +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -0,0 +1,40 @@ +/** + * fn_defineVariable.sqf + * @Descr: Define a variable for the ACE variable framework + * @Author: Glowbal + * + * @Arguments: [name STRING, defaultValue ANY, publicFlag BOOL, category STRING, type NUMBER, persistentFlag BOOL] + * @Return: + * @PublicAPI: true + */ +#include "script_component.hpp" + +private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"]; +_name = _this select 0; +_value = _this select 1; +_defaultGlobal = _this select 2; +_catagory = _this select 3; +_code = 0; +_persistent = false; + +if (count _this < 3) exitwith {}; +if (count _this > 4) then { + _code = _this select 4; + if (count _this > 5) then { + _persistent = _this select 5; + }; +}; + +if (typeName _name != typeName "") exitwith { + [format["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); +}; + +if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) then { + GVAR(OBJECT_VARIABLES_STORAGE) = []; +}; + +GVAR(OBJECT_VARIABLES_STORAGE) pushback [_name,_value,_defaultGlobal,_catagory,_code, _persistent]; + +missionNamespace setvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + _name, [_name,_value,_defaultGlobal,_catagory,_code, _persistent]]; + +[[_name,_value,_defaultGlobal,_catagory,_code, _persistent],"variableDefined"] call FUNC(raiseScriptedEvent_f); diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf b/addons/common/functions/fnc_disableAI_f.sqf similarity index 59% rename from TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf rename to addons/common/functions/fnc_disableAI_f.sqf index d2ad392559..9e1bf59a6f 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf +++ b/addons/common/functions/fnc_disableAI_f.sqf @@ -7,17 +7,17 @@ * @Return: * @PublicAPI: false */ - +#include "script_component.hpp" private ["_unit","_disable"]; _unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; _disable = [_this, 1,false,[false]] call BIS_fnc_Param; if (local _unit && !(IsPlayer _unit)) then { - if (_disable) then { - _unit disableAI "Move"; - _unit disableAI "TARGET"; - } else { - _unit enableAI "Move"; - _unit enableAI "TARGET"; - }; + if (_disable) then { + _unit disableAI "Move"; + _unit disableAI "TARGET"; + } else { + _unit enableAI "Move"; + _unit enableAI "TARGET"; + }; }; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf b/addons/common/functions/fnc_dropWeapon_f.sqf similarity index 83% rename from TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf rename to addons/common/functions/fnc_dropWeapon_f.sqf index 4a23b214b5..bf1358b5e7 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf +++ b/addons/common/functions/fnc_dropWeapon_f.sqf @@ -7,7 +7,7 @@ * @Return: * @PublicAPI: false */ - +#include "script_component.hpp" private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"]; _unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; @@ -26,14 +26,14 @@ _secondairyWeapon = secondaryWeapon _unit; _handGunWeapon = handgunWeapon _unit; switch (_currentWeapon) do { - case _primairyWeapon: { + case _primairyWeapon: { - }; - case _secondairyWeapon: { + }; + case _secondairyWeapon: { - }; - case _handGunWeapon: { + }; + case _handGunWeapon: { - }; - default {}; + }; + default {}; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf index 47710fad9c..58c6ced4f3 100644 --- a/addons/common/functions/fnc_execNextFrame.sqf +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_func,_params,_delay,_interval); +EXPLODE_2_PVT(_this,_func,_params); [ { diff --git a/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf b/addons/common/functions/fnc_findItem.sqf similarity index 95% rename from TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf rename to addons/common/functions/fnc_findItem.sqf index b53adb3315..5c4469ea7f 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf +++ b/addons/common/functions/fnc_findItem.sqf @@ -7,7 +7,7 @@ * @Return: * @PublicAPI: true */ - +#include "script_component.hpp" private ["_unit","_magazine","_return"]; _unit = _this select 0; _item = _this select 1; diff --git a/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf b/addons/common/functions/fnc_findMagazine.sqf similarity index 95% rename from TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf rename to addons/common/functions/fnc_findMagazine.sqf index 14d6a455ec..549d016e8d 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf +++ b/addons/common/functions/fnc_findMagazine.sqf @@ -7,7 +7,7 @@ * @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; diff --git a/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf similarity index 60% rename from TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf rename to addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 52ffe02a36..529c11c549 100644 --- a/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -8,20 +8,23 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_object", "_return", "_val", "_category"]; _object = _this select 0; _category = if (count _this > 1) then { _this select 1 } else { "" }; -if (isnil 'CSE_OBJECT_VARIABLES_STORAGE') then { - CSE_OBJECT_VARIABLES_STORAGE = []; +if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith { + []; }; + _return = []; { - _val = _object getvariable (_x select 0); - if (!isnil "_val") then { - if (_category == "" || _category == _x select 3) then { - _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; - }; - }; -}foreach CSE_OBJECT_VARIABLES_STORAGE; + _val = _object getvariable (_x select 0); + if (!isnil "_val") then { + if (_category == "" || _category == _x select 3) then { + _return pushback [_x select 0, typeName _val, _val, _x select 2, _x select 5]; + }; + }; +}foreach GVAR(OBJECT_VARIABLES_STORAGE); _return \ No newline at end of file diff --git a/addons/common/functions/fnc_getCanInteract.sqf b/addons/common/functions/fnc_getCanInteract.sqf new file mode 100644 index 0000000000..87f572b93d --- /dev/null +++ b/addons/common/functions/fnc_getCanInteract.sqf @@ -0,0 +1,12 @@ +/** + * 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/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedBy.sqf b/addons/common/functions/fnc_getCarriedBy.sqf similarity index 62% rename from TO_MERGE/cse/f_states/carry/functions/fn_getCarriedBy.sqf rename to addons/common/functions/fnc_getCarriedBy.sqf index de2effafbf..2b3c374eb3 100644 --- a/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedBy.sqf +++ b/addons/common/functions/fnc_getCarriedBy.sqf @@ -8,7 +8,6 @@ * @PublicAPI: true */ - private ["_unit","_return"]; - _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; - _return = _unit getvariable ["cse_carriedBy",objNull]; -_return +#include "script_component.hpp" + +((_this select 0) getvariable [QGVAR(carriedBy),objNull]); \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf b/addons/common/functions/fnc_getCarriedObj.sqf similarity index 68% rename from TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf rename to addons/common/functions/fnc_getCarriedObj.sqf index 5da37a0099..8cb1209791 100644 --- a/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf +++ b/addons/common/functions/fnc_getCarriedObj.sqf @@ -8,7 +8,6 @@ * @PublicAPI: true */ - private ["_unit","_return"]; - _unit = _this select 0; - _return = _unit getvariable ["cse_carriedObj",objNull]; -_return +#include "script_component.hpp" + +((_this select 0) getvariable [QGVAR(carriedObj),objNull]); diff --git a/addons/common/functions/fnc_getCustomResults_f.sqf b/addons/common/functions/fnc_getCustomResults_f.sqf new file mode 100644 index 0000000000..4b68f85c9c --- /dev/null +++ b/addons/common/functions/fnc_getCustomResults_f.sqf @@ -0,0 +1,45 @@ +/** + * 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_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf new file mode 100644 index 0000000000..d5185e6562 --- /dev/null +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -0,0 +1,38 @@ +/** + * fn_getDeathAnim.sqf + * @Descr: Get the death animation for the unit at current time + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: STRING animation + * @PublicAPI: true + */ +#include "script_component.hpp" + +private ["_unit", "_curAnim", "_animation", "_cfg","_unitAnimation", "_animationState"]; +_unit = _this select 0; + +if (vehicle _unit != _unit) exitwith { + _animation = ""; + _animationState = (animationState _unit); + _unitAnimation = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); + if (isText (_unitAnimation >> "actions")) then { + if ((vehicle _unit) != _unit) then { + _cfg = (configFile >> "CfgMovesMaleSdr" >> "States" >> _animationState); + if (isArray (_cfg >> "interpolateTo")) then { + _animation = getArray (_cfg >> "interpolateTo") select 0; + }; + } else { + _cfg = (configFile >> "CfgMovesBasic" >> "Actions" >> (getText (_unitAnimation >> "actions")) >> "die"); + if (isText _cfg) then { + _animation = getText _cfg; + }; + }; + }; + if (isnil "_animation") then { + _animation = ""; + }; + _animation; +}; + +"Unconscious"; diff --git a/addons/common/functions/fnc_getDefinedVariable.sqf b/addons/common/functions/fnc_getDefinedVariable.sqf new file mode 100644 index 0000000000..6c10c4f682 --- /dev/null +++ b/addons/common/functions/fnc_getDefinedVariable.sqf @@ -0,0 +1,33 @@ +/** + * fn_getVariable.sqf + * @Descr: Grabs a variable. If variable has not been set, attempts to use default defined value + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, variableName STRING] + * @Return: ANY + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#define UNIT (_this select 0) +#define VARIABLE (_this select 1) + +private "_value"; + +_value = UNIT getvariable VARIABLE; +if (isnil "_value") then { + if (count _this >2) then { + _value = _this select 2; + } else { + private "_definedVariable"; + _definedVariable = ([VARIABLE] call FUNC(getDefinedVariableInfo)); + if (count _definedVariable > 1) then { + _value = _definedVariable select 1; + }; + }; + if (isnil "_value") then { + _value = 0; + }; +}; +_value \ No newline at end of file diff --git a/addons/common/functions/fnc_getDefinedVariableDefault.sqf b/addons/common/functions/fnc_getDefinedVariableDefault.sqf new file mode 100644 index 0000000000..cd4e4f08f2 --- /dev/null +++ b/addons/common/functions/fnc_getDefinedVariableDefault.sqf @@ -0,0 +1,19 @@ +/** + * fn_getvariableDefault.sqf + * @Descr: Get the variable default value + * @Author: Glowbal + * + * @Arguments: [variableName STRING] + * @Return: ANY + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private "_variableDefinition"; +_variableDefinition = ([_this select 0] call FUNC(getDefinedVariableInfo)); +if (count _variableDefinition > 0) exitwith { + _variableDefinition select 1; +}; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf b/addons/common/functions/fnc_getDefinedVariableInfo.sqf similarity index 50% rename from TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf rename to addons/common/functions/fnc_getDefinedVariableInfo.sqf index 0909925f17..d371af6769 100644 --- a/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf +++ b/addons/common/functions/fnc_getDefinedVariableInfo.sqf @@ -7,5 +7,5 @@ * @Return: * @PublicAPI: false */ - -+(missionNamespace getvariable ["cse_object_variables_storage_" + (_this select 0),[]]) \ No newline at end of file +#include "script_component.hpp" ++(missionNamespace getvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + (_this select 0),[]]) diff --git a/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf similarity index 52% rename from TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf rename to addons/common/functions/fnc_getFirstObjectIntersection.sqf index 9d57ea57a1..4cd493ec2c 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -7,8 +7,8 @@ * @Return: [intersects BOOL, intersection PositionASL] * @PublicAPI: true */ - - + #include "script_component.hpp" + private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; _source = _this select 0; _destination = _this select 1; @@ -19,26 +19,26 @@ _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; if (count (lineIntersectsWith [_source, _destination]) > 0) then { - _lower = 0; - _upper = 1; - _mid = 0.5; - - _dir = _source vectorFromTo _destination; - - while {(_upper - _lower) * _distance > _accuracy} do { - _mid = _lower + (_upper - _lower) / 2; - - _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); - - if (_intersections > 0) then { - _upper = _mid; - } else { - _lower = _mid; - }; - }; - - _mid = _lower + (_upper - _lower) / 2; - _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + _lower = 0; + _upper = 1; + _mid = 0.5; + + _dir = _source vectorFromTo _destination; + + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; + + _intersections = count (lineIntersectsWith [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]); + + if (_intersections > 0) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; + + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; }; _result diff --git a/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf similarity index 52% rename from TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf rename to addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 57ff80fa60..1b645bcdb2 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -7,8 +7,8 @@ * @Return: [intersects BOOL, intersection PositionASL] * @PublicAPI: true */ - - + #include "script_component.hpp" + private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; _source = _this select 0; _destination = _this select 1; @@ -19,26 +19,26 @@ _result = [false, [0, 0, 0]]; _distance = _source vectorDistance _destination; if (terrainIntersectASL [_source, _destination]) then { - _lower = 0; - _upper = 1; - _mid = 0.5; - - _dir = _source vectorFromTo _destination; - - while {(_upper - _lower) * _distance > _accuracy} do { - _mid = _lower + (_upper - _lower) / 2; - - _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; - - if (_intersection) then { - _upper = _mid; - } else { - _lower = _mid; - }; - }; - - _mid = _lower + (_upper - _lower) / 2; - _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + _lower = 0; + _upper = 1; + _mid = 0.5; + + _dir = _source vectorFromTo _destination; + + while {(_upper - _lower) * _distance > _accuracy} do { + _mid = _lower + (_upper - _lower) / 2; + + _intersection = terrainIntersectASL [_source, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; + + if (_intersection) then { + _upper = _mid; + } else { + _lower = _mid; + }; + }; + + _mid = _lower + (_upper - _lower) / 2; + _result = [true, _source vectorAdd (_dir vectorMultiply (_mid * _distance))]; }; _result diff --git a/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf similarity index 50% rename from TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf rename to addons/common/functions/fnc_getNumberMagazinesIn.sqf index 0b470c1a20..ec4e9b5755 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -8,19 +8,21 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_magazine"]; _unit = _this select 0; _magazine = _this select 1; _return = 0; if (_unit isKindOf "CAManBase") then { - _return = {_x == _magazine} count magazines _unit; + _return = {_x == _magazine} count magazines _unit; } else { - { - _return = _return + {_x == _magazine} count magazines _x; - }foreach (crew _unit); + { + _return = _return + {_x == _magazine} count magazines _x; + }foreach (crew _unit); - _return = _return + ({_x == _magazine} count getMagazineCargo _unit); + _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_getUnconsciousCondition.sqf b/addons/common/functions/fnc_getUnconsciousCondition.sqf new file mode 100644 index 0000000000..097a5682ec --- /dev/null +++ b/addons/common/functions/fnc_getUnconsciousCondition.sqf @@ -0,0 +1,29 @@ +/** + * fn_getUnconsciousCondition.sqf + * @Descr: get whatever or not a unit should be or stay unconscious + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True when the unit should be unconscious + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_return"]; +_unit = _this select 0; + +if (isnil QGVAR(unconsciousConditions_F)) then { + GVAR(unconsciousConditions_F) = []; +}; + +_return = false; +{ + if (typeName _x == typeName {}) then { + if (([_unit] call _x)) then { + _return = true; + }; + }; + if (_return) exitwith{}; +}foreach GVAR(unconsciousConditions_F); +_return \ No newline at end of file diff --git a/addons/common/functions/fnc_getVersion.sqf b/addons/common/functions/fnc_getVersion.sqf new file mode 100644 index 0000000000..e1bd95cdab --- /dev/null +++ b/addons/common/functions/fnc_getVersion.sqf @@ -0,0 +1,11 @@ +/** + * fn_getVersion.sqf + * @Descr: Get the version number of the current ACE Build + * @Author: Glowbal + * + * @Arguments: [] + * @Return: STRING String containing the version + * @PublicAPI: true + */ +#include "script_component.hpp" +getText (configFile >> "cfgPatches" >> "ACE_main" >> "version"); \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf b/addons/common/functions/fnc_getWeaponItems_f.sqf similarity index 86% rename from TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf rename to addons/common/functions/fnc_getWeaponItems_f.sqf index 7128ceb09c..d18ce28a72 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf +++ b/addons/common/functions/fnc_getWeaponItems_f.sqf @@ -7,7 +7,7 @@ * @Return: * @PublicAPI: false */ - +#include "script_component.hpp" private "_unit"; _unit = _this select 0; diff --git a/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf b/addons/common/functions/fnc_hasItem.sqf similarity index 73% rename from TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf rename to addons/common/functions/fnc_hasItem.sqf index a0b07f1852..00c5ed5846 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf +++ b/addons/common/functions/fnc_hasItem.sqf @@ -7,5 +7,7 @@ * @Return: BOOL * @PublicAPI: true */ + #include "script_component.hpp" + // item classname in items unit ((_this select 1) in items (_this select 0)); \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf similarity index 72% rename from TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf rename to addons/common/functions/fnc_hasMagazine.sqf index 468c955290..0157fab8e3 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -8,14 +8,15 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_magazine","_return"]; _unit = _this select 0; _magazine = _this select 1; if (_magazine != "") then { - _return = (_magazine in magazines _unit); + _return = (_magazine in magazines _unit); } else { - _return = false; + _return = false; }; -//[format["fnc_hasMagazine: %1 | %2",_this,_return]] call cse_fnc_debug; _return \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf b/addons/common/functions/fnc_inWater_f.sqf similarity index 63% rename from TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf rename to addons/common/functions/fnc_inWater_f.sqf index 93027ffe7d..ea511d388d 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf +++ b/addons/common/functions/fnc_inWater_f.sqf @@ -8,13 +8,15 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_return","_aslPos"]; _unit = _this select 0; _return = false; if ((surfaceIsWater getPos _unit)) then { - _aslPos = _unit modelToWorld (_unit selectionPosition "head"); - if ((_aslPos select 2) <= 0) then { - _return = true; - }; + _aslPos = _unit modelToWorld (_unit selectionPosition "head"); + if ((_aslPos select 2) <= 0) then { + _return = true; + }; }; _return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf similarity index 77% rename from TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf rename to addons/common/functions/fnc_inheritsFrom.sqf index e0c942c40d..6a39152b9b 100644 --- a/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_configEntry","_configMatch", "_match"]; _configEntry = _this select 0; _configMatch = _this select 1; @@ -17,8 +19,8 @@ if (configName _configEntry == ",") exitWith { false }; _match = false; while {configName _configEntry != ""} do { - if (configName _configEntry == _configMatch) exitWith { _match = true }; - _configEntry = inheritsFrom(_configEntry); + if (configName _configEntry == _configMatch) exitWith { _match = true }; + _configEntry = inheritsFrom(_configEntry); }; _match \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf b/addons/common/functions/fnc_insertionSort.sqf similarity index 58% rename from TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf rename to addons/common/functions/fnc_insertionSort.sqf index 5653256621..bdafa70592 100644 --- a/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf +++ b/addons/common/functions/fnc_insertionSort.sqf @@ -8,25 +8,27 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_list", "_ascending", "_tmp", "_i", "_j"]; _list = +(_this select 0); _ascending = true; if (count _this > 1) then { - _ascending = _this select 1; + _ascending = _this select 1; }; for "_i" from 1 to (count _list) - 1 do { - _tmp = _list select _i; - _j = _i; - while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { - _list set [_j, _list select (_j - 1)]; - _j = _j - 1; - }; - _list set[_j, _tmp]; + _tmp = _list select _i; + _j = _i; + while {_j >= 1 && {_tmp < _list select (_j - 1)}} do { + _list set [_j, _list select (_j - 1)]; + _j = _j - 1; + }; + _list set[_j, _tmp]; }; - + if (!_ascending) then { - reverse _list; + reverse _list; }; _list \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/arrest/functions/fn_isArrested.sqf b/addons/common/functions/fnc_isArrested.sqf similarity index 70% rename from TO_MERGE/cse/f_states/arrest/functions/fn_isArrested.sqf rename to addons/common/functions/fnc_isArrested.sqf index 555a77a408..36fb44bd1a 100644 --- a/TO_MERGE/cse/f_states/arrest/functions/fn_isArrested.sqf +++ b/addons/common/functions/fnc_isArrested.sqf @@ -8,4 +8,6 @@ * @PublicAPI: true */ -((_this select 0) getvariable ["cse_state_arrested",false]) \ No newline at end of file +#include "script_component.hpp" + +((_this select 0) getvariable [QGVAR(StateArrested),false]) \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf similarity index 67% rename from TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf rename to addons/common/functions/fnc_isAwake.sqf index a8afe16aa6..462968efa4 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_return"]; _unit = _this select 0; -(!([_unit] call cse_fnc_isUnconscious)) && alive _unit && !(_unit getvariable ["cse_isDead",false]); +(!([_unit] call FUNC(isUnconscious))) && alive _unit && !(_unit getvariable [QGVAR(isDead),false]); diff --git a/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf b/addons/common/functions/fnc_isHC.sqf similarity index 59% rename from TO_MERGE/cse/main/hc/functions/fn_isHC.sqf rename to addons/common/functions/fnc_isHC.sqf index 443e6d48f2..82a9d49ba2 100644 --- a/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf +++ b/addons/common/functions/fnc_isHC.sqf @@ -8,15 +8,17 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_return"]; if (!isMultiplayer) then { - _return = true; + _return = true; } else { - if (isServer && !isDedicated) then { - _return = true; - } else { - _return = !(hasInterface || isDedicated); - }; + if (isServer && !isDedicated) then { + _return = true; + } else { + _return = !(hasInterface || isDedicated); + }; }; _return \ No newline at end of file diff --git a/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf b/addons/common/functions/fnc_isModLoaded_f.sqf similarity index 66% rename from TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf rename to addons/common/functions/fnc_isModLoaded_f.sqf index 3be56bff11..622c27a94b 100644 --- a/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf +++ b/addons/common/functions/fnc_isModLoaded_f.sqf @@ -8,7 +8,6 @@ * PublicAPI: true */ -private ["_modName"]; -_modName = [_this, 0, "",[""]] call BIS_fnc_Param; +#include "script_component.hpp" -(isClass (configFile >> "cfgPatches" >> _modName)) \ No newline at end of file +(isClass (configFile >> "cfgPatches" >> (_this select 0))) \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_isUnconscious.sqf b/addons/common/functions/fnc_isUnconscious.sqf similarity index 71% rename from TO_MERGE/cse/f_states/unconscious/functions/fn_isUnconscious.sqf rename to addons/common/functions/fnc_isUnconscious.sqf index 2d410d7ba5..a4293cf13b 100644 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_isUnconscious.sqf +++ b/addons/common/functions/fnc_isUnconscious.sqf @@ -8,4 +8,6 @@ * @PublicAPI: true */ - ((_this select 0) getvariable ["cse_state_unconscious",false]); \ No newline at end of file +#include "script_component.hpp" + +((_this select 0) getvariable ["ACE_isUnconscious",false]); \ No newline at end of file diff --git a/addons/common/functions/fnc_limitMovementSpeed.sqf b/addons/common/functions/fnc_limitMovementSpeed.sqf new file mode 100644 index 0000000000..ad3d08c66c --- /dev/null +++ b/addons/common/functions/fnc_limitMovementSpeed.sqf @@ -0,0 +1,53 @@ +/** + * fn_limitMovementSpeed.sqf + * @Descr: Limits the movement speed of a unit + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, fallDown BOOL (Optional)] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_carriedObj"]; +_unit = _this select 0; +_fallDown = false; +if (count _this > 1) then { + _fallDown = _this select 1; +}; + +if ((_unit getvariable [QGVAR(limitMovementSpeed),false])) exitwith { + _unit setvariable [QGVAR(limitMovementSpeed),nil,true]; +}; + +[{ + private["_unit","_fallDown","_carriedObj"]; + _unit = (_this select 0) select 0; + _fallDown = (_this select 0) select 1; + + _carriedObj = [_unit] call FUNC(getCarriedObj); + + if !(_unit getvariable [QGVAR(limitMovementSpeed),false]) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + if !((!isNull _carriedObj) && (alive _unit)) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + if (speed _unit > 12 && vehicle _unit == _unit && isTouchingGround _unit) then { + + _unit setVelocity [0,0,0]; + + if (_fallDown) then { + _unit playMove "amovppnemstpsraswrfldnon"; + }; + + if (_carriedObj isKindOf "Man") then { + hint "You can not move this fast while transporting this person."; + } else { + hint "You can not move this fast while carrying this object"; + }; + [_unit,ObjNull] call FUNC(carryObj); + }; +}, 0.5, [_unit,_fallDown] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_loadPersonLocal_f.sqf b/addons/common/functions/fnc_loadPersonLocal_f.sqf new file mode 100644 index 0000000000..dbba09111a --- /dev/null +++ b/addons/common/functions/fnc_loadPersonLocal_f.sqf @@ -0,0 +1,39 @@ +/** + * fn_loadPersonLocal_f.sqf + * @Descr: Load a person, local + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, vehicle OBJECT, caller OBJECT] + * @Return: void + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_vehicle","_caller","_handle","_loaded"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_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 moveInCargo _vehicle; +_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; +_loaded pushback _unit; +_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; +if (!([_unit] call FUNC(isAwake))) then { + _handle = [_unit,_vehicle] spawn { + private ["_unit","_vehicle"]; + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit == _vehicle}; + sleep 0.5; + [_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation); + }; +} else { + if ([_unit] call FUNC(isArrested)) then { + + }; +}; \ No newline at end of file diff --git a/addons/common/functions/fnc_loadPerson_f.sqf b/addons/common/functions/fnc_loadPerson_f.sqf new file mode 100644 index 0000000000..5944879c62 --- /dev/null +++ b/addons/common/functions/fnc_loadPerson_f.sqf @@ -0,0 +1,42 @@ +/** + * fn_loadPerson_f.sqf + * @Descr: Loads a specified unit into any nearby vehicle + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, unitToBeLoaded OBJECT] + * @Return: OBJECT Returns the vehicle that the unitToBeloaded has been loaded in. Returns ObjNull if function failed + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) + +private ["_caller", "_unit","_vehicle", "_loadcar", "_loadhelicopter", "_loadtank"]; +_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; +_vehicle = ObjNull; + +if (!([_caller] call FUNC(canInteract)) || {_caller == _unit}) exitwith {_vehicle}; + +_loadcar = nearestObject [_unit, "car"]; +if (_unit distance _loadcar <= 10) then { + _vehicle = _loadcar; +} else { + _loadhelicopter = nearestObject [_unit, "air"]; + if (_unit distance _loadhelicopter <= 10) then { + _vehicle = _loadhelicopter; + } else { + _loadtank = nearestObject [_unit, "tank"]; + if (_unit distance _loadtank <= 10) then { + _vehicle = _loadtank; + }; + }; +}; +if (!isNull _vehicle) then { + [_unit, true, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); + [_caller,objNull] call FUNC(carryObj); + [_unit,objNull] call FUNC(carryObj); + [[_unit, _vehicle,_caller], QUOTE(FUNC(loadPersonLocal_F)), _unit, false] call EFUNC(common,execRemoteFnc); +}; +_vehicle \ No newline at end of file diff --git a/addons/common/functions/fnc_makeCopyOfBody_f.sqf b/addons/common/functions/fnc_makeCopyOfBody_f.sqf new file mode 100644 index 0000000000..498e8a2168 --- /dev/null +++ b/addons/common/functions/fnc_makeCopyOfBody_f.sqf @@ -0,0 +1,75 @@ +/** + * fn_makeCopyOfBody_f.sqf + * @Descr: Makes a copy of a dead body. For handling dead bodies for actions such as load and carry. + * @Author: Glowbal + * + * @Arguments: [oldBody OBJECT, caller OBJECT] + * @Return: newUnit OBJECT Returns the copy of the unit. If no copy could be made, returns the oldBody + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariables"]; +_oldBody = _this select 0; +_caller = _this select 1; + + if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies + _name = _oldBody getvariable [QGVAR(name),"unknown"]; + _class = typeof _oldBody; + _side = side _caller; + _group = createGroup _side; + _position = getPos _oldBody; + + _newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; + + _allVariables = [_oldBody] call FUNC(getAllDefinedSetVariables); + // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] + { + [_newUnit,_x select 0, _x select 2] call FUNC(setDefinedVariable); + }foreach _allVariables; + _newUnit setVariable [QGVAR(name),_name,true]; + + _newUnit disableAI "TARGET"; + _newUnit disableAI "AUTOTARGET"; + _newUnit disableAI "MOVE"; + _newUnit disableAI "ANIM"; + _newUnit disableAI "FSM"; + _newUnit setvariable [QGVAR(isDead),true,true]; + + removeallweapons _newUnit; + removeallassigneditems _newUnit; + removeUniform _newUnit; + removeHeadgear _newUnit; + removeBackpack _newUnit; + removeVest _newUnit; + + _newUnit addHeadgear (headgear _oldBody); + _newUnit addBackpack (backpack _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); + + _newUnit addVest (vest _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); + + _newUnit addUniform (uniform _oldBody); + clearItemCargoGlobal (backpackContainer _newUnit); + clearMagazineCargoGlobal (backpackContainer _newUnit); + clearWeaponCargoGlobal (backpackContainer _newUnit); + + {_newUnit addMagazine _x} count (magazines _oldBody); + {_newUnit addWeapon _x} count (weapons _oldBody); + {_newUnit addItem _x} count (items _oldBody); + + _newUnit selectWeapon (primaryWeapon _newUnit); + //_newUnit playMoveNow ([_newUnit] call FUNC(getDeathAnim)); + + deleteVehicle _oldBody; + + // TODO sometimes the old body does not get cleaned up properly. Look into garbage collection. + + _newUnit setDamage 0.9; +_newUnit \ No newline at end of file diff --git a/addons/common/functions/fnc_moduleBasicRevive.sqf b/addons/common/functions/fnc_moduleBasicRevive.sqf new file mode 100644 index 0000000000..6d8bfa2e6c --- /dev/null +++ b/addons/common/functions/fnc_moduleBasicRevive.sqf @@ -0,0 +1,24 @@ +/** + * fn_moduleEnableBasicRevive.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_logic"]; +_logic = _this select 0; + +GVAR(Module) = true; + +[_logic, QGVAR(ENABLE_REVIVE_F), "enableFor" ] call EFUNC(common,readNumericParameterFromModule); +[_logic, QGVAR(REVIVE_TIMER_MAX_F), "timer" ] call EFUNC(common,readNumericParameterFromModule); +[_logic, QGVAR(REVIVE_NUMBER_MAX_F), "amountOf" ] call EFUNC(common,readNumericParameterFromModule); + +[ + {(((_this select 0) getvariable[QGVAR(ENABLE_REVIVE_SETDEAD_F),0]) > 0)} +] call FUNC(registerUnconsciousCondition); diff --git a/addons/common/functions/fnc_moveToTempGroup.sqf b/addons/common/functions/fnc_moveToTempGroup.sqf new file mode 100644 index 0000000000..b146e67ef3 --- /dev/null +++ b/addons/common/functions/fnc_moveToTempGroup.sqf @@ -0,0 +1,32 @@ +/** + * fn_moveToTempGroup_f.sqf + * Moves a unit into a temporarly group and stores its original group to allow rejoining. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, moveToTempGroup BOOL] + * @Return: void + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_moveTo","_previousGroup","_newGroup", "_currentGroup", "_switchToGroup"]; +_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_moveTo = [_this, 1,false,[false]] call BIS_fnc_Param; + +if (_moveTo) then { + _previousGroup = group _unit; + _newGroup = createGroup (side _previousGroup); + [_unit] joinSilent _newGroup; + _unit setvariable [QGVAR(previousGroup_F),_previousGroup]; +} else { + _previousGroup = _unit getvariable QGVAR(previousGroup_F); + if (!isnil "_previousGroup") then { + _currentGroup = group _unit; + _unit setvariable [QGVAR(previousGroup_F),nil]; + [_unit] joinSilent _previousGroup; + if (count units _currentGroup == 0) then { + deleteGroup _currentGroup; + }; + }; +}; \ No newline at end of file diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf new file mode 100644 index 0000000000..aa3ae8fb45 --- /dev/null +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -0,0 +1,38 @@ +/** + * fn_onAnswerRequest.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; +_unit = _this select 0; +_id = _this select 1; +_accepted = _this select 2; + +_info = _unit getvariable _id; +if (!isnil "_info") then { + _caller = _info select 0; + _target = _info select 1; + _requestID = _info select 2; + _requestMessage = _info select 3; + _callBack = _info select 4; + _replyParams = [_info, _accepted]; + [_replyParams, QUOTE(FUNC(requestCallback)), _caller, false] call FUNC(execRemoteFnc); + _unit setvariable [_id, nil]; +}; + +GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; + +if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { + _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; +}; +if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; +}; diff --git a/addons/common/functions/fnc_raiseScriptedEvent_f.sqf b/addons/common/functions/fnc_raiseScriptedEvent_f.sqf new file mode 100644 index 0000000000..a4ea604f28 --- /dev/null +++ b/addons/common/functions/fnc_raiseScriptedEvent_f.sqf @@ -0,0 +1,64 @@ +/** + * fn_raiseScriptedEvent_f.sqf + * @Descr: Execute a custom defined eventhandler. + * @Author: Glowbal + * + * @Arguments: [arguments ANY, handle STRING (The name of the eventhandler)] + * @Return: ARRAY Array containing the results of the called eventhandlers. + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"]; +_arguments = _this select 0; +_handle = _this select 1; + +// TODO figure out how we want to handle custom eventhandlers + +_eventHandlerName = (QGVAR(f_custom_eventhandlers_) + _handle); +_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; +if (isnil "_eventHandlerCollection") then { + _eventHandlerCollection = []; + [format["caching Custom Eventhandler: %1",_handle]] call FUNC(debug); + _cfg = (ConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); + if (isClass _cfg) then { + _numberOfEH = count _cfg; + + for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { + //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; + }; + }; + }; + + _cfg = (MissionConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); + if (isClass _cfg) then { + _numberOfEH = count _cfg; + for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { + //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]; + [format["Custom Eventhandler: %1 cache: %2",_handle, _eventHandlerCollection]] call FUNC(debug); +}; + +_return = []; +{ + _return pushback (_arguments call (_x select 1)); +}foreach _eventHandlerCollection; + +_return \ No newline at end of file diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf new file mode 100644 index 0000000000..c74a69013d --- /dev/null +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -0,0 +1,69 @@ +/** + * fn_recieveRequest.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +_caller = _this select 0; +_target = _this select 1; +_requestID = _this select 2; +_requestMessage = _this select 3; +_callBack = _this select 4; + +_requestID = ("ace_recieveRequest_f_id_"+_requestID); + +_target setvariable [_requestID, _this]; + +if (isLocalized _requestMessage) then { + _requestMessage = format[localize _requestMessage,[_caller] call FUNC(getName)]; +} else { + _requestMessage = format[_requestMessage,[_caller] call FUNC(getName)]; +}; + +hint format["%1",_requestMessage]; +if !(isnil QGVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT)) then { + terminate GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT); +}; + +if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; +}; +if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; +}; + +GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = _target addAction ["Accept", compile format["[player,'%1', true] call FUNC(onAnswerRequest);", _requestID]]; +GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile format["[player,'%1', false] call FUNC(onAnswerRequest);", _requestID]]; + +GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID; + +GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { + _t = (_this select 0) + 40; + _target = _this select 1; + _requestID = _this select 2; + _id = _target getvariable _requestID; + waituntil { + _id = _target getvariable _requestID; + + (time > _t || isnil "_id")}; + _target setvariable [_requestID, nil]; + GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; + if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); + GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; + }; + if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { + _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); + GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_registerUnconsciousCondition.sqf b/addons/common/functions/fnc_registerUnconsciousCondition.sqf similarity index 55% rename from TO_MERGE/cse/f_states/unconscious/functions/fn_registerUnconsciousCondition.sqf rename to addons/common/functions/fnc_registerUnconsciousCondition.sqf index 25742589ba..f34d05b57d 100644 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_registerUnconsciousCondition.sqf +++ b/addons/common/functions/fnc_registerUnconsciousCondition.sqf @@ -8,15 +8,15 @@ * @PublicAPI: true */ +#include "script_component.hpp" -if (isnil "CSE_UNCONSCIOUS_CONDITIONS_F") then { - CSE_UNCONSCIOUS_CONDITIONS_F = []; +if (isnil QGVAR(unconsciousConditions_F)) then { + GVAR(unconsciousConditions_F) = []; }; if (typeName _this == typeName []) then { - { - if (typeName _x == typeName {}) then { - CSE_UNCONSCIOUS_CONDITIONS_F pushback _x; - }; - }foreach _this; -} else { + { + if (typeName _x == typeName {}) then { + GVAR(unconsciousConditions_F) pushback _x; + }; + }foreach _this; }; \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf b/addons/common/functions/fnc_requestCallback.sqf similarity index 83% rename from TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf rename to addons/common/functions/fnc_requestCallback.sqf index 1896f8b3dc..b5c9312d3d 100644 --- a/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf +++ b/addons/common/functions/fnc_requestCallback.sqf @@ -8,6 +8,8 @@ * @PublicAPI: false */ +#include "script_component.hpp" + private ["_info", "_accepted", "_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; _info = _this select 0; _accepted = _this select 1; diff --git a/addons/common/functions/fnc_resetAllDefaults_f.sqf b/addons/common/functions/fnc_resetAllDefaults_f.sqf new file mode 100644 index 0000000000..571526dbf6 --- /dev/null +++ b/addons/common/functions/fnc_resetAllDefaults_f.sqf @@ -0,0 +1,38 @@ +/** + * fn_resetAllDefaults_f.sqf + * @Descr: reset all variables that have been defined + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_oldUnit","_sets"]; +_unit = _this select 0; + +_unit setvariable [QGVAR(isDead),nil,true]; +_unit setvariable ["ACE_isUnconscious", nil, true]; + +if (isPlayer _unit) then { + [true] call FUNC(setVolume_f); + [false] call FUNC(disableKeyInput_f); + [false] call EFUNC(GUI,effectBlackOut); + + if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { + // clear all disable user input + { + [_X, false] call FUNC(setDisableUserInputStatus); + }foreach GVAR(DISABLE_USER_INPUT_COLLECTION_F); + }; +}; + +{ + if (!(_x select 4)) then { + _unit setvariable [(_x select 0),nil,_x select 3]; + }; +}foreach ([_unit] call FUNC(getAllDefinedSetVariables)); + +[[_unit],"resetToDefaults"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_revealObject_f.sqf b/addons/common/functions/fnc_revealObject_f.sqf new file mode 100644 index 0000000000..9c5a34f59a --- /dev/null +++ b/addons/common/functions/fnc_revealObject_f.sqf @@ -0,0 +1,15 @@ +/** + * 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/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf b/addons/common/functions/fnc_sendRequest_f.sqf similarity index 61% rename from TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf rename to addons/common/functions/fnc_sendRequest_f.sqf index 2ba9cbc9f1..fdd88716e9 100644 --- a/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf +++ b/addons/common/functions/fnc_sendRequest_f.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_caller", "_target", "_requestMessage", "_requestID", "_callBack"]; _caller = _this select 0; _target = _this select 1; @@ -16,11 +18,9 @@ _requestMessage = _this select 3; _callBack = _this select 4; if (isPlayer _target) then { - // Pass request on to target locality for player accept/decline. - [[_caller, _target, _requestID, _requestMessage, _callBack], "cse_fnc_receiveRequest", _target, false] spawn BIS_fnc_MP; + // Pass request on to target locality for player accept/decline. + [[_caller, _target, _requestID, _requestMessage, _callBack], QUOTE(FUNC(receiveRequest)), _target, false] call EFUNC(common,execRemoteFnc); } else { - // accept it, since it's an AI. - [_caller, _target, true] spawn compile _callBack; + // accept it, since it's an AI. + [_caller, _target, true] call compile _callBack; }; - -// [player, player, "myRequestTest", "Hello %1, how are you?", "hint 'it worked!';"] call cse_fnc_sendRequest_f; \ No newline at end of file diff --git a/addons/common/functions/fnc_setArrestState.sqf b/addons/common/functions/fnc_setArrestState.sqf new file mode 100644 index 0000000000..d32ccc5098 --- /dev/null +++ b/addons/common/functions/fnc_setArrestState.sqf @@ -0,0 +1,45 @@ +/** + * fn_setArrestState.sqf + * @Descr: Set a unit in arrest state + * @Author: Glowbal + * + * @Arguments: [unitToBeArrested OBJECT, setArrested BOOL] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_setArrest"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_setArrest = [_this, 1, false, [false]] call BIS_fnc_Param; + +if (_setArrest) then { + [_unit, QGVAR(StateArrested), true] call FUNC(setDefinedVariable); + + if ([_unit] call FUNC(isAwake)) then { + if (vehicle _unit == _unit) then { + [_unit,"UnaErcPoslechVelitele2",1] call FUNC(doAnimation); + }; + }; + if (IsPlayer _unit) then { + [["arrested", true],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); + }; + _unit disableAI "Move"; + _unit disableAI "ANIM"; +} else { + [_unit, QGVAR(StateArrested), false] call FUNC(setDefinedVariable); + + if ([_unit] call FUNC(isAwake)) then { + if (vehicle _unit == _unit) then { + [_unit,"",1] call FUNC(doAnimation); + }; + _unit enableAI "Move"; + _unit enableAI "ANIM"; + }; + if (IsPlayer _unit) then { + [["arrested", false],QUOTE(FUNC(setDisableUserInputStatus)),_unit,false] call EFUNC(common,execRemoteFnc); + }; +}; + +[[_unit, _setArrest],"setArrestState"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf b/addons/common/functions/fnc_setCanInteract.sqf similarity index 52% rename from TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf rename to addons/common/functions/fnc_setCanInteract.sqf index 2d7ca320b5..091bbf8cc6 100644 --- a/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf +++ b/addons/common/functions/fnc_setCanInteract.sqf @@ -8,19 +8,21 @@ * @PublicAPI: false */ +#include "script_component.hpp" + private ["_unit","_to","_return"]; _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _to = _this select 1; _return = false; if (((typeName _to) == "SCALAR")) then { - if (_to <-1) then { - _to = -1; - } else { - if (_to > 1) then { - _to = 1; - }; - }; - _unit setvariable ["cse_canInteract", ([_unit] call cse_fnc_getCanInteract) + _to,false]; - _return = true; + if (_to <-1) then { + _to = -1; + } else { + if (_to > 1) then { + _to = 1; + }; + }; + _unit setvariable [QGVAR(canInteract), ([_unit] call FUNC(getCanInteract)) + _to,false]; + _return = true; }; _return \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf b/addons/common/functions/fnc_setCaptiveSwitch.sqf similarity index 50% rename from TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf rename to addons/common/functions/fnc_setCaptiveSwitch.sqf index e99f6f18c3..378f42e5d4 100644 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf +++ b/addons/common/functions/fnc_setCaptiveSwitch.sqf @@ -8,6 +8,8 @@ * @PublicAPI: false */ +#include "script_component.hpp" + private ["_unit", "_captiveSwitch", "_setCaptive"]; _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; _setCaptive = [_this, 1, false, [false]] call BIS_fnc_Param; @@ -15,24 +17,17 @@ _setCaptive = [_this, 1, false, [false]] call BIS_fnc_Param; _captiveSwitch = true; if (_setCaptive) then { - if (captive _unit) then { - _captiveSwitch = false; - } else { - if (player == _unit) then { - missionNamespace setvariable["cse_unconscious_non_captive_f",true]; - }; - _unit setCaptive true; - [format["USED SETCAPTIVE",_unit]] call cse_fnc_debug; - }; + if (captive _unit) then { + _captiveSwitch = false; + } else { + _unit setCaptive true; + }; } else { - if (alive _unit) then { - _unit setCaptive false; - if (!isnil "cse_unconscious_non_captive_f") then { - missionNamespace setvariable["cse_unconscious_non_captive_f",nil]; - }; - } else { - _unit setCaptive false; - }; + if (captive _unit) then { + _unit setCaptive false; + } else { + _captiveSwitch = false; + }; }; _captiveSwitch \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf b/addons/common/functions/fnc_setCarriedBy.sqf similarity index 61% rename from TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf rename to addons/common/functions/fnc_setCarriedBy.sqf index 26d773a738..2ea5f3f469 100644 --- a/TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf +++ b/addons/common/functions/fnc_setCarriedBy.sqf @@ -4,17 +4,18 @@ * @Author: Glowbal * * @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT] - * @Return: BOOL True if succesfully registered + * @Return: BOOL True if succesfully registered * @PublicAPI: false */ +#include "script_component.hpp" private ["_unit","_to","_return"]; _unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _to = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; _return = false; -if ((isNull ([_unit] call cse_fnc_getCarriedBy)) || isNull _to) then { - _return = true; - _unit setvariable ["cse_carriedBy",_to,true]; +if ((isNull ([_unit] call FUNC(getCarriedBy))) || isNull _to) then { + _return = true; + _unit setvariable [QGVAR(carriedBy),_to,true]; }; _return \ No newline at end of file diff --git a/addons/common/functions/fnc_setDead.sqf b/addons/common/functions/fnc_setDead.sqf new file mode 100644 index 0000000000..1b24a0552e --- /dev/null +++ b/addons/common/functions/fnc_setDead.sqf @@ -0,0 +1,88 @@ +/** + * fn_setDead.sqf + * @Descr: Kills a unit + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#define TIME_BETWEEN_REVIVE_RUNS 0.5 + +private ["_unit"]; +_unit = _this select 0; +_force = false; +if (count _this >= 2) then { + _force = _this select 1; +}; + +if (!alive _unit) exitwith{}; +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 (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == 2)) && !_force && (alive (vehicle _unit))) exitwith { + // enter revive state + _unit setvariable [QGVAR(inReviveState), true, true]; + + // Remain unconscious while in revive state + [_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_NUMBER_MAX_F)) then { + GVAR(REVIVE_NUMBER_MAX_F) = -1; + }; + + [{ + private ["_unit","_playerDead","_counter"]; + _unit = (_this select 0) select 0; + _playerDead = (_this select 0) select 1; + + // Check if a unit woke up or was already killed + if (!([_unit] call FUNC(isUnconscious)) || !alive _unit) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + + // Cleaning up the variables, as we no longer need them. + _unit setvariable [QGVAR(reviveCounter_f), nil]; + _unit setvariable [QGVAR(inReviveState), nil, true]; + }; + + _counter = _unit getvariable [QGVAR(reviveCounter_f), 0]; + if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ + if (isPlayer _unit) then { + titleText ["You died..","PLAIN DOWN"]; + }; + [_unit,QGVAR(isDead), true, true] call FUNC(setDefinedVariable); + if (_playerDead) then { + [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); + }; + + _unit setdamage 1; // killing a unit will automatically clean up all variables. + + [[_unit, true],"killed"] call FUNC(raiseScriptedEvent_f); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + _unit setvariable [QGVAR(reviveCounter_f),_counter + TIME_BETWEEN_REVIVE_RUNS]; + + }, TIME_BETWEEN_REVIVE_RUNS, [_unit, isPlayer _unit] ] call CBA_fnc_addPerFrameHandler; + +}; + +[_unit,QGVAR(isDead),true,true] call FUNC(setDefinedVariable); +if (isPLayer _unit) then { + [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); +}; + +_unit setdamage 1; + +[[_unit, false],"killed"] call FUNC(raiseScriptedEvent_f); diff --git a/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf similarity index 58% rename from TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf rename to addons/common/functions/fnc_setDefinedVariable.sqf index e2119fcb37..b2eece4424 100644 --- a/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; _unit = _this select 0; _variable = _this select 1; @@ -15,15 +17,15 @@ _value = _this select 2; _global = false; if (count _this > 3) then { - _global = _this select 3; + _global = _this select 3; } else { - _definedVariable = ([_variable] call cse_fnc_getVariableInfo); - if (count _definedVariable > 2) then { - _global = _definedVariable select 2; - }; + _definedVariable = ([_variable] call FUNC(getDefinedVariableInfo)); + if (count _definedVariable > 2) then { + _global = _definedVariable select 2; + }; }; if (!isNil "_value") exitwith { - _unit setvariable [_variable, _value, _global]; + _unit setvariable [_variable, _value, _global]; }; _unit setvariable [_variable, nil, _global]; \ No newline at end of file diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf new file mode 100644 index 0000000000..2451cbe90f --- /dev/null +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -0,0 +1,28 @@ +/** + * fn_setDisableUserInputStatus.sqf + * @Descr: Disables the user input. Works stacked. + * @Author: Glowbal + * + * @Arguments: [id STRING, disable BOOL] + * @Return: void + * @PublicAPI: true + */ +#include "script_component.hpp" +private ["_id","_disable"]; +_id = _this select 0; +_disable = _this select 1; + + +if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { + GVAR(DISABLE_USER_INPUT_COLLECTION_F) = []; +}; + +if (_disable) then { + GVAR(DISABLE_USER_INPUT_COLLECTION_F) 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 { + [false] call FUNC(disableUserInput); + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf similarity index 62% rename from TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf rename to addons/common/functions/fnc_setHearingCapability.sqf index b1e29dc68f..26d8ca98ac 100644 --- a/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -8,39 +8,41 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_id", "_settings", "_add", "_exists", "_map", "_lowestVolume"]; _id = _this select 0; _settings = _this select 1; _add = true; if (count _this > 2) then { - _add = _this select 2; + _add = _this select 2; }; -_map = missionNamespace getVariable ["cse_setHearingCapabilityMap",[]]; +_map = missionNamespace getVariable [QGVAR(setHearingCapabilityMap),[]]; _exists = false; { - if (_id == _x select 0) exitWith { - _exists = true; - if (_add) then { - _x set [1, _settings]; - } else { - _map set [_forEachIndex, 0]; - _map = _map - [0]; - }; - }; + if (_id == _x select 0) exitWith { + _exists = true; + if (_add) then { + _x set [1, _settings]; + } else { + _map set [_forEachIndex, 0]; + _map = _map - [0]; + }; + }; } forEach _map; if (!_exists && _add) then { - _map pushBack [_id, _settings]; + _map pushBack [_id, _settings]; }; -missionNamespace setVariable ["cse_setHearingCapabilityMap", _map]; +missionNamespace setVariable [QGVAR(setHearingCapabilityMap), _map]; // find lowest volume _lowestVolume = 1; { - _lowestVolume = (_x select 1) min _lowestVolume; + _lowestVolume = (_x select 1) min _lowestVolume; } forEach _map; // in game sounds diff --git a/addons/common/functions/fnc_setProne.sqf b/addons/common/functions/fnc_setProne.sqf new file mode 100644 index 0000000000..b456c5094a --- /dev/null +++ b/addons/common/functions/fnc_setProne.sqf @@ -0,0 +1,28 @@ +/** + * fn_setProne.sqf + * @Descr: Force a unit to go prone + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit"]; +_unit = [_this,0, ObjNull,[ObjNull]] call BIS_fnc_Param; +switch (currentWeapon _unit) do { + case (primaryWeapon _unit): { + [_unit,"amovppnemstpsraswrfldnon"] call FUNC(localAnim); + }; + case (secondaryWeapon _unit): { + [_unit,"amovppnemstpsraswlnrdnon"] call FUNC(localAnim); + }; + case (handgunWeapon _unit): { + [_unit,"AmovPpneMstpSrasWpstDnon"] call FUNC(localAnim); + }; + default { + [_unit,"amovppnemstpsnonwnondnon"] call FUNC(localAnim); + }; +}; \ No newline at end of file diff --git a/addons/common/functions/fnc_setUnconsciousState.sqf b/addons/common/functions/fnc_setUnconsciousState.sqf new file mode 100644 index 0000000000..bae01b291c --- /dev/null +++ b/addons/common/functions/fnc_setUnconsciousState.sqf @@ -0,0 +1,142 @@ +/** + * fn_setUnconsciousState.sqf + * @Descr: Sets a unit in the unconscious state + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit", "_animState", "_dAnim"]; +_unit = _this select 0; + +if !([_unit] call FUNC(canGoUnconsciousState)) exitwith{ + [format["Exit setUnconscious: %1", _this]] call FUNC(debug); +}; + +// We only want this function to work on local machines +if (!local _unit) exitwith { + [[_unit], QUOTE(FUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); + [format["Exit setUnconscious: %1", _this]] call FUNC(debug); +}; + +// get rid of the object we are carrying, before we go unconscious. +[_unit, ObjNull, [0,0,0]] call FUNC(carryObj); + +// Set the unit in the unconscious state. +_unit setvariable ["ACE_isUnconscious",true,true]; +_unit setUnconscious true; + +// If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious, +// therefor we force it to select the primairy weapon before going unconscious +[_unit] call FUNC(setWeaponsCorrectUnconscious); + + +// We are storing the current animation, so we can use it later on when waking the unit up inside a vehicle +_animState = animationState _unit; +_originalPos = unitPos _unit; + +// Handle the on screen effects +if (isPlayer _unit) then { + [] call FUNC(closeAllDialogs_f); + [true] call EFUNC(GUI,effectBlackOut); + ["unconscious", true] call FUNC(setDisableUserInputStatus); + [false] call FUNC(setVolume_f); +} else { + _unit setUnitPos "DOWN"; + [_unit, true] call FUNC(disableAI_F); +}; + +// 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 FUNC(switchToGroupSide_f); + +_captiveSwitch = [_unit, true] call FUNC(setCaptiveSwitch); +[_unit, [_unit] call FUNC(getDeathAnim), 1, true] call FUNC(doAnimation); + + +[format["Unit moving into unconscious: %1", _this]] call FUNC(debug); + + +_startingTime = time; +_minWaitingTime = (round(random(10)+5)); + +[{ + private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch"]; + _args = _this select 0; + _unit = _args select 0; + _oldAnimation = _args select 1; + _captiveSwitch = _args select 2; + _originalPos = _args select 3; + _startingTime = _args select 4; + _minWaitingTime = _args select 5; + + // Since the unit is no longer alive, get rid of this PFH. + if (!alive _unit) exitwith { + [format["%1 Unit no longer alive, exiting"], _unit] call FUNC(debug); + // EXIT PFH + [(_this select 1)] call cba_fnc_removePerFrameHandler; + [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); + }; + + // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation + if !([_unit] call FUNC(isUnconscious)) exitwith { + [format["%1 Unit no longer unconscious, handling exit and animation"], _unit] call FUNC(debug); + // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations + if !([_unit] call FUNC(beingCarried)) then { + if (vehicle _unit == _unit) then { + [_unit,"amovppnemstpsnonwnondnon", 1] call FUNC(doAnimation); + } else { + // Switch to the units original animation, assuming + // TODO: what if the unit switched vehicle? + [_unit, _oldAnimation, 1] call FUNC(doAnimation); + }; + + // EXIT PFH + [(_this select 1)] call cba_fnc_removePerFrameHandler; + [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); + }; + }; + // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs + if ((time - _startingTime) >= _minWaitingTime) exitwith { + + // Wait until the unit is no longer unconscious + if (!([_unit] call FUNC(getUnconsciousCondition))) then { + [format["%1 No unconscious condition valid anymore, moving uit out of unconsciousState"], _unit] call FUNC(debug); + // Reset the unit back to the previous captive state. + if (_captiveSwitch) then { + [_unit, false] call FUNC(setCaptiveSwitch); + }; + _unit setUnconscious false; + + // Swhich the unit back to its original group + [_unit, false, "ACE_isUnconscious", side group _unit] call FUNC(switchToGroupSide_f); + + // Reset any visual and audio effects for players, or enable everything again for AI. + if (isPlayer _unit) then { + [false] call EFUNC(GUI,effectBlackOut); + [true] call FUNC(setVolume_f); + ["unconscious", false] call FUNC(setDisableUserInputStatus); + } else { + [_unit, false] call FUNC(disableAI_F); + _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) + }; + + // Move unit out of unconscious state + _unit setvariable ["ACE_isUnconscious", false, true]; + [format["%1 Unit no longer unconsicous"], _unit] call FUNC(debug); + }; + }; + + // A check to ensure that the animation is being played properly. + // TODO: Might no longer be necessary: Have to test this in MP. + if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call FUNC(getCarriedBy)))} && (time - _startingTime >= 0.5)) then { + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); // Reset animations if unit starts doing wierd things. + [format["%1 Had to reset an animation for unconscious"], _unit] call FUNC(debug); + }; + +}, 0.1, [_unit,_animState, _captiveSwitch, _originalPos, _startingTime, _minWaitingTime] ] call CBA_fnc_addPerFrameHandler; + +[[_unit, true],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); diff --git a/addons/common/functions/fnc_setVolume_f.sqf b/addons/common/functions/fnc_setVolume_f.sqf new file mode 100644 index 0000000000..2eacb98ab0 --- /dev/null +++ b/addons/common/functions/fnc_setVolume_f.sqf @@ -0,0 +1,48 @@ +/** + * fn_setVolume_f.sqf + * @Descr: Sets the volume of the game, including third party radio modifications such as TFAR and ACRE. + * @Author: Glowbal + * + * @Arguments: [setVolume BOOL] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#define MUTED_LEVEL 0.2 +#define NORMAL_LEVEL 1 +#define NO_SOUND 0 + +private ["_setVolume"]; +_setVolume = [_this, 0, false, [false]] call BIS_fnc_Param; + +if (_setVolume) then { + // Vanilla Game + 2 fadeSound NORMAL_LEVEL; + + // TFAR + player setVariable ["tf_voiceVolume", NORMAL_LEVEL, true]; + player setVariable ["tf_globalVolume", NORMAL_LEVEL]; + player setVariable ["tf_unable_to_use_radio", false]; + + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", NORMAL_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", false, true]; + +} else { + // Vanilla Game + 2 fadeSound MUTED_LEVEL; + + // TFAR + player setVariable ["tf_voiceVolume", NO_SOUND, true]; + player setVariable ["tf_globalVolume", MUTED_LEVEL]; + player setVariable ["tf_unable_to_use_radio", true]; + + // ACRE2 + player setVariable ["acre_sys_core_globalVolume", MUTED_LEVEL]; + player setVariable ["acre_sys_core_isDisabled", true, true]; + +}; + +[[_setVolume],"setVolume"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf b/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf similarity index 52% rename from TO_MERGE/cse/f_states/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf rename to addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf index 6853156aeb..bdd4fde460 100644 --- a/TO_MERGE/cse/f_states/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf +++ b/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf @@ -8,29 +8,31 @@ * @PublicAPI: false */ +#include "script_component.hpp" + private ["_unit"]; _unit = _this select 0; if ((vehicle _unit) isKindOf "StaticWeapon") then { - moveOut _unit; - unassignVehicle _unit; - //unassignVehicle _unit; - //_unit action ["eject", vehicle _unit]; + moveOut _unit; + unassignVehicle _unit; + //unassignVehicle _unit; + //_unit action ["eject", vehicle _unit]; }; if (vehicle _unit == _unit) then { - if (currentWeapon _unit == secondaryWeapon _unit) then { - reload _unit; - }; + if (currentWeapon _unit == secondaryWeapon _unit) then { + reload _unit; + }; }; if (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) then { - _unit action ["ladderOff", (nearestBuilding _unit)]; + _unit action ["ladderOff", (nearestBuilding _unit)]; }; if (vehicle _unit == _unit) then { - if (currentWeapon _unit == secondaryWeapon _unit) then { - _unit selectWeapon (primaryWeapon _unit); - _unit switchMove ""; - _unit playmoveNow ""; - }; + if (currentWeapon _unit == secondaryWeapon _unit) then { + _unit selectWeapon (primaryWeapon _unit); + _unit switchMove ""; + _unit playmoveNow ""; + }; }; diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf new file mode 100644 index 0000000000..1d2a2af1bf --- /dev/null +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -0,0 +1,44 @@ +/** + * fn_sortAlphabeticallyBy.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_array", "_elements", "_elementN", "_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; +_array = _this select 0; +_elementN = _this select 1; + +_indexes = []; +_elements = []; + +{ + _theElement = toArray (_x select _elementN); + _indexes pushback _foreachIndex; + _elements pushback _theElement; +}foreach _array; + +for "_i" from 1 to (count _elements) - 1 do { + _tmp = _elements select _i; + _tempIndex = _indexes select _i; + _j = _i; + while {_j >= 1 && {_tmp < _elements select (_j - 1)}} do { + _elements set [_j, _elements select (_j - 1)]; + _indexes set [_j, _indexes select (_j - 1)]; + _j = _j - 1; + }; + _elements set[_j, _tmp]; + _indexes set [_j, _tempIndex]; +}; + +_returnArray = []; +{ + _returnArray pushback (_array select _x); +}foreach _indexes; + +_returnArray; \ No newline at end of file diff --git a/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf b/addons/common/functions/fnc_stringCompare.sqf similarity index 89% rename from TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf rename to addons/common/functions/fnc_stringCompare.sqf index 75ae1ff3b7..2162f71fd0 100644 --- a/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf +++ b/addons/common/functions/fnc_stringCompare.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_searchTerm", "_string", "_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; _string = toLower (_this select 0); // removes case sensitivity _searchTerm = toLower (_this select 1); @@ -24,8 +26,8 @@ _targetIterator = 0; _searchIterator = 0; while {(_searchIterator < _sizeSearchTerm) && (_targetIterator < _sizeString)} do { // Prevents us from going out of bounds if ((_arraySearchTerm select _searchIterator) == (_arrayString select _targetIterator)) then { // If we have a match, start looking for the next character in the search term - _matchingCharacters = _matchingCharacters + 1; - _searchIterator = _searchIterator + 1 + _matchingCharacters = _matchingCharacters + 1; + _searchIterator = _searchIterator + 1 }; _targetIterator = _targetIterator + 1; // Look at the next character in the string }; diff --git a/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf b/addons/common/functions/fnc_string_removeWhiteSpace.sqf similarity index 90% rename from TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf rename to addons/common/functions/fnc_string_removeWhiteSpace.sqf index b17a582697..19ca13de3b 100644 --- a/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf +++ b/addons/common/functions/fnc_string_removeWhiteSpace.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + #define WHITE_SPACE [20] private ["_string", "_charArray", "_returnString"]; diff --git a/addons/common/functions/fnc_switchToGroupSide_f.sqf b/addons/common/functions/fnc_switchToGroupSide_f.sqf new file mode 100644 index 0000000000..b13da8e3ea --- /dev/null +++ b/addons/common/functions/fnc_switchToGroupSide_f.sqf @@ -0,0 +1,66 @@ +/** + * fn_switchToGroupSide_f.sqf + * @Descr: Stack group switches. Will always trace back to original group. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, switch BOOL, id STRING, side SIDE] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_side","_previousGroup","_newGroup", "_currentGroup", "_switch", "_originalSide", "_previousGroupsList", "_id"]; +_unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; +_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),[]]; +if (_switch) then { + // go forward + _previousGroup = group _unit; + _originalSide = side group _unit; + + if (count units _previousGroup == 1 && _originalSide == _side) exitwith { + [format["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); + }; + + _newGroup = createGroup _side; + [_unit] joinSilent _newGroup; + + _previousGroupsList pushback [_previousGroup, _originalSide, _id, true]; + _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; +} else { + // go one back + { + if (_id == (_x select 2)) exitwith { + _x set [ 3, false]; + _previousGroupsList set [_foreachIndex, _x]; + [format["found group with ID: %1", _id]] call FUNC(debug); + }; + }foreach _previousGroupsList; + reverse _previousGroupsList; + + { + if (_x select 3) exitwith {}; // stop at first id set to true + if !(_x select 3) then { + _currentGroup = group _unit; + if (!isNull (_x select 0)) then { + [_unit] joinSilent (_x select 0); + } else { + _newGroup = createGroup (_x select 1); + [_unit] joinSilent _newGroup; + }; + if (count units _currentGroup == 0) then { + deleteGroup _currentGroup; + }; + _previousGroupsList set [_foreachIndex, ObjNull]; + }; + }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, _switch, _id, _side],"switchToGroupSide"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf similarity index 67% rename from TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf rename to addons/common/functions/fnc_uniqueElementsOnly.sqf index 3bf40595e6..21d42072da 100644 --- a/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -8,15 +8,17 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_array", "_result", "_value"]; _array = _this select 0; _result = []; { - _value = _x; - if ({_x isEqualTo _value} count _result == 0) then { - _result pushback _x; - }; + _value = _x; + if ({_x isEqualTo _value} count _result == 0) then { + _result pushback _x; + }; }foreach _array; _result; \ No newline at end of file diff --git a/addons/common/functions/fnc_unloadPerson_f.sqf b/addons/common/functions/fnc_unloadPerson_f.sqf new file mode 100644 index 0000000000..1aaaee84a1 --- /dev/null +++ b/addons/common/functions/fnc_unloadPerson_f.sqf @@ -0,0 +1,59 @@ +/** + * fn_unloadPerson_f.sqf + * @Descr: Unload a person from a vehicle + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, unit OBJECT] + * @Return: BOOL Returns true if succesfully unloaded person + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson_F)) + +private ["_caller", "_unit","_vehicle", "_loaded"]; +_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; +_vehicle = vehicle _unit; + +if (_vehicle == _unit) exitwith {false;}; +if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;}; +if (!([_caller] call FUNC(isAwake))) exitwith{false;}; + +moveOut _unit; +unassignVehicle _unit; +if (!alive _unit) then { + _unit action ["Eject", vehicle _unit]; +}; + +[_unit, false, GROUP_SWITCH_ID, side group _caller] call FUNC(switchToGroupSide_f); + +_loaded = _vehicle getvariable [QGVAR(loaded_persons_F),[]]; +_loaded = _loaded - [_unit]; +_vehicle setvariable [QGVAR(loaded_persons_F),_loaded,true]; + +if (!([_unit] call FUNC(isAwake))) then { + _handle = [_unit,_vehicle] spawn { + private ["_unit","_vehicle"]; + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit != _vehicle}; + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); + [format["Unit should move into death anim: %1", _unit]] call FUNC(debug); + }; +} else { + if ([_unit] call FUNC(isArrested)) then { + _handle = [_unit,_vehicle] spawn { + _unit = _this select 0; + _vehicle = _this select 1; + waituntil {vehicle _unit != _vehicle}; + [_unit,"UnaErcPoslechVelitele2", 1] call FUNC(doAnimation); + [format["Unit should move into arrested anim: %1", _unit]] call FUNC(debug); + }; + } else { + [format["Unit should move into normal anim: %1", _unit]] call FUNC(debug); + }; +}; + +true; \ No newline at end of file diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf new file mode 100644 index 0000000000..d03ec4d156 --- /dev/null +++ b/addons/common/functions/fnc_useItem.sqf @@ -0,0 +1,35 @@ +/** + * fn_useItem.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_item","_return"]; +_unit = _this select 0; +_item = _this select 1; +_vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; + +_return = false; +if (!_vehicleUsage) then { + if (_item != "") then { + if (_item in (items _unit)) then { + _unit removeItem _item; + _return = true; + } else { + if (_item in (assignedItems _unit)) then { + _unit unassignItem _item; + _unit removeItem _item; + _return = true; + }; + }; + }; +}; +// TODO implement shared item functionality for with vehicles. + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf similarity index 56% rename from TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf rename to addons/common/functions/fnc_useMagazine.sqf index 0a356aabc5..726e169383 100644 --- a/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -8,21 +8,23 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_unit","_magazine","_return"]; _unit = _this select 0; _magazine = _this select 1; _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; if (!_vehicleUsage) then { - if (_magazine != "") then { - _unit removeMagazine _magazine; - _return = true; - } else { - _return = false; - }; - [format["fnc_useMagazine: %1 | %2",_this,_return]] call cse_fnc_debug; + if (_magazine != "") then { + _unit removeMagazine _magazine; + _return = true; + } else { + _return = false; + }; + [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); _return } else { - // TODO implement shared magazine functionality + // TODO implement shared magazine functionality }; \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index cf4638c569..dfb200dff8 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -463,5 +463,26 @@ Без голоса Nincs hang + + Accept Requests + Akceptuj prośby + Aceptar Peticiones + + + Decline Requests + Ignoruj prośby + Rechazar Peticiones + + + Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. + Akceptuj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności. + Acepta Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones. + + + Decline Requests send by other players. These can be requests to use / share equipment, perform certain actions. + 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. + + \ No newline at end of file diff --git a/addons/disposable/config.cpp b/addons/disposable/config.cpp index 49ae873674..be2b52735a 100644 --- a/addons/disposable/config.cpp +++ b/addons/disposable/config.cpp @@ -4,11 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; authorUrl = "https://github.com/commy2/"; - // VERSION_CONFIG @todo + VERSION_CONFIG; }; }; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index 48697d913d..8bf463c9f4 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"}; - requiredVersion = 0.60; - requiredAddons[] = {ace_common, ace_interaction}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; author[] = {"Garth 'L-H' de Wet"}; authorUrl = "http://garth.snakebiteink.co.za/"; + VERSION_CONFIG; }; }; diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 527e5a9d36..61b30f65ae 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -3,3 +3,76 @@ GVAR(enabled) = True; GVAR(time) = 0; GVAR(position) = [0,0,0]; + +// Add keybinds +["ACE3", + localize "STR_ACE_FCS_LaseTarget", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!GVAR(enabled) && {call FUNC(canUseRangefinder) || FUNC(canUseFCS)}) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(keyDown); + true + }, + [15, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_LaseTarget", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(keyUp); + true + }, + [15, [false, false, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_AdjustRangeUp", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player, 50] call FUNC(adjustRange); + true + }, + [201, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_AdjustRangeDown", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player, -50] call FUNC(adjustRange); + true + }, + [209, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index e1ebaa2888..e1e8ac8901 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -4,47 +4,16 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {ace_common, ace_interaction}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; author[] = {"KoffeinFlummi","BadGuy (simon84)"}; authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class laseTarget { - displayName = $STR_ACE_FCS_LaseTarget; - condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); - statement = QUOTE([_vehicle] call FUNC(keyDown)); - conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS)); - statementUp = QUOTE([_vehicle] call FUNC(keyUp)); - key = 15; - shift = 0; - control = 0; - alt = 0; - }; - class adjustRangeUp { - displayName = $STR_ACE_FCS_AdjustRangeUp; - condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); - statement = QUOTE([_vehicle, 50] call FUNC(adjustRange)); - key = 201; - shift = 0; - control = 0; - alt = 0; - allowHolding = 1; - }; - class adjustRangeDown: adjustRangeUp { - displayName = $STR_ACE_FCS_AdjustRangeDown; - statement = QUOTE([_vehicle, -50] call FUNC(adjustRange)); - key = 209; - }; -}; - class CfgVehicles { class All { class Turrets; diff --git a/addons/fcs/functions/fnc_canResetFCS.sqf b/addons/fcs/functions/fnc_canResetFCS.sqf index 0aa281bd85..8760503cdb 100644 --- a/addons/fcs/functions/fnc_canResetFCS.sqf +++ b/addons/fcs/functions/fnc_canResetFCS.sqf @@ -12,5 +12,5 @@ #include "script_component.hpp" -_player == gunner _vehicle -&& (count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) +ACE_player == gunner vehicle ACE_player +&& (count ((vehicle ACE_player) getVariable [QGVAR(Magazines), []]) > 1) diff --git a/addons/fcs/functions/fnc_canUseFCS.sqf b/addons/fcs/functions/fnc_canUseFCS.sqf index e75efd44cf..ef4a3f2814 100644 --- a/addons/fcs/functions/fnc_canUseFCS.sqf +++ b/addons/fcs/functions/fnc_canUseFCS.sqf @@ -12,6 +12,6 @@ #include "script_component.hpp" -_player == gunner _vehicle -&& {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(Enabled)) == 1} +ACE_player == gunner vehicle ACE_player +&& {getNumber (configFile >> "CfgVehicles" >> typeOf (vehicle ACE_player) >> QGVAR(Enabled)) == 1} && {cameraView == "GUNNER"} diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index fc76ff2639..c95460e65b 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -17,8 +17,6 @@ private ["_ammoType", "_viewDiff", "_posArrival", "_airFriction", "_timeToLive", _vehicle = _this select 0; _distance = call FUNC(getRange); -if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; - _magazines = magazines _vehicle; if (_distance == 0) then { @@ -105,59 +103,28 @@ if (_viewDiff != 0) then { _FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth; }; -// CALCULATE OFFSET FOR CURRENT WEAPON +// CALCULATE OFFSET _FCSMagazines = []; _FCSElevation = []; -_magazineType = currentMagazine _vehicle; -_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo"); -if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then { - _maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev"); - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed"); - _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); - _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); +{ + _ammoType = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then { + _maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev"); + _initSpeed = getNumber (configFile >> "CfgMagazines" >> _x >> "initSpeed"); + _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle); + _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; + _offset = parseNumber _offset; - _FCSMagazines = _FCSMagazines + [_magazineType]; - _FCSElevation = _FCSElevation + [_offset]; -}; + _FCSMagazines = _FCSMagazines + [_x]; + _FCSElevation = _FCSElevation + [_offset]; + }; +} forEach _magazines; _vehicle setVariable [QGVAR(Distance), _distance, true]; _vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true]; _vehicle setVariable [QGVAR(Elevation), _FCSElevation, true]; _vehicle setVariable [QGVAR(Azimuth), _FCSAzimuth, true]; -// CALCULATE OFFSETS FOR OTHER WEAPONS IN THE BACKGROUND -GVAR(backgroundCalculation) = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn { - _vehicle = _this select 0; - _magazines = _this select 1; - _distance = _this select 2; - _angleTarget = _this select 3; - _FCSMagazines = _this select 4; - _FCSElevation = _this select 5; - - { - if !(_x in _FCSMagazines) then { - _ammoType = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); - if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then { - _maxElev = getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "Turrets" >> "MainTurret" >> "maxElev"); - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _x >> "initSpeed"); - _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); - _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); - - _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle); - - _FCSMagazines = _FCSMagazines + [_x]; - _FCSElevation = _FCSElevation + [_offset]; - }; - }; - } forEach _magazines; - - _vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true]; - _vehicle setVariable [QGVAR(Elevation), _FCSElevation, true]; -}; - [format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured); diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index acde4575b2..98a159a78e 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; - version = VERSION; author[] = {"Nou"}; + VERSION_CONFIG; }; }; diff --git a/addons/gui/CfgEventHandlers.hpp b/addons/gui/CfgEventHandlers.hpp new file mode 100644 index 0000000000..c9142e676b --- /dev/null +++ b/addons/gui/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000000..71e8dc0090 --- /dev/null +++ b/addons/gui/GUI.hpp @@ -0,0 +1,2 @@ +#include "UI\define.hpp" +#include "UI\RscTitles.hpp" diff --git a/addons/gui/UI/RscTitles.hpp b/addons/gui/UI/RscTitles.hpp new file mode 100644 index 0000000000..93f422bc9f --- /dev/null +++ b/addons/gui/UI/RscTitles.hpp @@ -0,0 +1,251 @@ + +#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"; + }; + }; + }; + + class GVAR(ScreenEffectsBlack) { + duration = 10e10; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBlack))), _this select 0)]); + + class controlsBackground { + class blackScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\black_out.paa)); + colorText[] = {0.0, 0.0, 0.0, 0.0}; + idc = 11112; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsBleeding) { + duration = 1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBleeding))), _this select 0)]); + + class controlsBackground { + class bleedingScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\bleeding.paa)); + colorText[] = {0.9, 0.2, 0.2, 0.6}; + idc = 11113; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsHit) { + duration = 1.1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsHit))), _this select 0)]); + + class controlsBackground { + class effectHit: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\hit.paa)); + colorText[] = {0.7, 0.2, 0.2, 0.4}; + idc = 11113; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsPain) { + duration = 1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsPain))), _this select 0)]); + + class controlsBackground { + class painScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\painScreen.paa)); + colorText[] = {1, 1, 1, 0.5}; + idc = 11115; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/define.hpp b/addons/gui/UI/define.hpp similarity index 90% rename from TO_MERGE/cse/f_states/define.hpp rename to addons/gui/UI/define.hpp index c521de470f..13ce7d8a3e 100644 --- a/TO_MERGE/cse/f_states/define.hpp +++ b/addons/gui/UI/define.hpp @@ -1,6 +1,6 @@ -#ifndef CSE_DEFINE_H -#define CSE_DEFINE_H +#ifndef ACE_DEFINE_H +#define ACE_DEFINE_H // define.hpp #define true 1 @@ -82,7 +82,7 @@ #define LB_MULTI 0x20 #define FontCSE "PuristaMedium" -class cse_gui_backgroundBase { +class ACE_gui_backgroundBase { type = CT_STATIC; idc = -1; style = ST_PICTURE; @@ -92,7 +92,7 @@ class cse_gui_backgroundBase { text = ""; sizeEx = 0.032; }; -class cse_gui_editBase +class ACE_gui_editBase { access = 0; type = 2; @@ -139,7 +139,7 @@ class cse_gui_editBase -class cse_gui_buttonBase { +class ACE_gui_buttonBase { idc = -1; type = 16; style = ST_LEFT; @@ -153,18 +153,11 @@ class cse_gui_buttonBase { sizeEx = 0.03921; color[] = {1.0, 1.0, 1.0, 1}; color2[] = {1.0, 1.0, 1.0, 1}; - /*colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.5])"}; - colorbackground2[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.4}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - colorFocused[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])", 0.8}; - colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.8}; - */ - - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {1,1,1,1}; - colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,0.95}; + colorbackground2[] = {1,1,1,0.95}; + colorDisabled[] = {1,1,1,0.6}; + colorFocused[] = {1,1,1,1}; + colorBackgroundFocused[] = {1,1,1,1}; periodFocus = 1.2; periodOver = 0.8; default = false; @@ -189,12 +182,12 @@ class cse_gui_buttonBase { bottom = 0.00; }; textureNoShortcut = ""; - animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa"; - animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; + 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)); period = 0.5; font = FontCSE; soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; @@ -215,7 +208,7 @@ class cse_gui_buttonBase { }; }; -class cse_gui_RscProgress { +class ACE_gui_RscProgress { type = 8; style = 0; colorFrame[] = {1,1,1,0.7}; @@ -228,7 +221,7 @@ class cse_gui_RscProgress { }; -class cse_gui_staticBase { +class ACE_gui_staticBase { idc = -1; type = CT_STATIC; x = 0.0; @@ -244,7 +237,7 @@ class cse_gui_staticBase { }; class RscListBox; -class cse_gui_listBoxBase : RscListBox{ +class ACE_gui_listBoxBase : RscListBox{ type = CT_LISTBOX; style = ST_MULTI; font = FontCSE; @@ -296,7 +289,7 @@ class cse_gui_listBoxBase : RscListBox{ }; -class cse_gui_listNBox { +class ACE_gui_listNBox { access = 0; type = CT_LISTNBOX;// 102; style =ST_MULTI; @@ -362,7 +355,7 @@ class cse_gui_listNBox { class RscCombo; -class cse_gui_comboBoxBase: RscCombo { +class ACE_gui_comboBoxBase: RscCombo { idc = -1; type = 4; style = "0x10 + 0x200"; @@ -419,7 +412,7 @@ class cse_gui_comboBoxBase: RscCombo { -class cse_gui_mapBase { +class ACE_gui_mapBase { moveOnEdges = 1; x = "SafeZoneXAbs"; y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; diff --git a/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf b/addons/gui/XEH_postInit.sqf similarity index 65% rename from TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf rename to addons/gui/XEH_postInit.sqf index 2e2710509b..4172145202 100644 --- a/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf +++ b/addons/gui/XEH_postInit.sqf @@ -1,5 +1,5 @@ /** - * fn_ragdoll_f.sqf + * XEH_postInit.sqf * @Descr: N/A * @Author: Glowbal * @@ -8,4 +8,4 @@ * @PublicAPI: false */ -// Deleted. \ No newline at end of file +#include "script_component.hpp" diff --git a/addons/gui/XEH_preInit.sqf b/addons/gui/XEH_preInit.sqf new file mode 100644 index 0000000000..b3de51cd9b --- /dev/null +++ b/addons/gui/XEH_preInit.sqf @@ -0,0 +1,28 @@ +/** + * 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(effectPain); +PREP(effectBleeding); +PREP(effectBlackOut); +PREP(sendHintTo); +PREP(sendMessageTo); +PREP(sendDisplayInformationTo); +PREP(sendDisplayMessageTo); + +ADDON = true; \ No newline at end of file diff --git a/addons/gui/config.cpp b/addons/gui/config.cpp new file mode 100644 index 0000000000..2f7666be13 --- /dev/null +++ b/addons/gui/config.cpp @@ -0,0 +1,27 @@ + +#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/TO_MERGE/cse/f_states/data/black_out1.paa b/addons/gui/data/black_out.paa similarity index 100% rename from TO_MERGE/cse/f_states/data/black_out1.paa rename to addons/gui/data/black_out.paa diff --git a/TO_MERGE/cse/f_states/data/cse_bleedingscreen_v5.paa b/addons/gui/data/bleeding.paa similarity index 100% rename from TO_MERGE/cse/f_states/data/cse_bleedingscreen_v5.paa rename to addons/gui/data/bleeding.paa diff --git a/TO_MERGE/cse/gui/data/buttonDisabled.paa b/addons/gui/data/buttonDisabled.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonDisabled.paa rename to addons/gui/data/buttonDisabled.paa diff --git a/TO_MERGE/cse/gui/data/buttonDisabled_gradient.paa b/addons/gui/data/buttonDisabled_gradient.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonDisabled_gradient.paa rename to addons/gui/data/buttonDisabled_gradient.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal.paa b/addons/gui/data/buttonNormal.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal.paa rename to addons/gui/data/buttonNormal.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient.paa b/addons/gui/data/buttonNormal_gradient.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal_gradient.paa rename to addons/gui/data/buttonNormal_gradient.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient2.paa b/addons/gui/data/buttonNormal_gradient2.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal_gradient2.paa rename to addons/gui/data/buttonNormal_gradient2.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient3.paa b/addons/gui/data/buttonNormal_gradient3.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal_gradient3.paa rename to addons/gui/data/buttonNormal_gradient3.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient_top.paa b/addons/gui/data/buttonNormal_gradient_top.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal_gradient_top.paa rename to addons/gui/data/buttonNormal_gradient_top.paa diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient_top_w.paa b/addons/gui/data/buttonNormal_gradient_top_w.paa similarity index 100% rename from TO_MERGE/cse/gui/data/buttonNormal_gradient_top_w.paa rename to addons/gui/data/buttonNormal_gradient_top_w.paa diff --git a/TO_MERGE/cse/f_states/data/hit_screen1.paa b/addons/gui/data/hit.paa similarity index 100% rename from TO_MERGE/cse/f_states/data/hit_screen1.paa rename to addons/gui/data/hit.paa diff --git a/TO_MERGE/cse/f_states/data/pain_screen3.paa b/addons/gui/data/painScreen.paa similarity index 100% rename from TO_MERGE/cse/f_states/data/pain_screen3.paa rename to addons/gui/data/painScreen.paa diff --git a/addons/gui/empty.hpp b/addons/gui/empty.hpp new file mode 100644 index 0000000000..698784e2c6 --- /dev/null +++ b/addons/gui/empty.hpp @@ -0,0 +1,21 @@ +#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_blurScreen.sqf b/addons/gui/functions/fnc_blurScreen.sqf new file mode 100644 index 0000000000..1cde214587 --- /dev/null +++ b/addons/gui/functions/fnc_blurScreen.sqf @@ -0,0 +1,42 @@ +/** + * fn_gui_blurScreen.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_id", "_show"]; +_id = _this select 0; +_show = if (count _this > 1) then {_this select 1} else {false}; + +if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; +}; +if (typeName _show == typeName 0) then { + _show = (_show == 1); +}; + +if (_show) then { + GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushback _id; + // show blur + if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectCommit 0; + }; +} else { + GVAR(SHOW_BLUR_SCREEN_COLLECTION) = GVAR(SHOW_BLUR_SCREEN_COLLECTION) - [_id]; + if (GVAR(SHOW_BLUR_SCREEN_COLLECTION) isEqualTo []) then { + // hide blur + if (!isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { + ppEffectDestroy GVAR(MENU_ppHandle_GUI_BLUR_SCREEN); + GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayIcon.sqf b/addons/gui/functions/fnc_displayIcon.sqf similarity index 71% rename from TO_MERGE/cse/gui/functions/fn_gui_displayIcon.sqf rename to addons/gui/functions/fnc_displayIcon.sqf index 1634228f9c..98895c6346 100644 --- a/TO_MERGE/cse/gui/functions/fn_gui_displayIcon.sqf +++ b/addons/gui/functions/fnc_displayIcon.sqf @@ -7,9 +7,11 @@ * @Return: * @PublicAPI: true * - * @Example ["myID", true, CSE_ICON_PATH + "icon_group.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + * @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"]; @@ -19,8 +21,15 @@ _icon = _this select 2; _color = _this select 3; disableSerialization; -_list = missionNamespace getvariable ["cse_gui_displayIconList",[]]; -_display = uiNamespace getvariable "cse_gui_iconsDisplay"; +_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]; @@ -32,7 +41,7 @@ if (_show) then { }foreach _list; }; - missionNamespace setvariable ["cse_gui_displayIconList", _list]; + missionNamespace setvariable [QGVAR(displayIconList), _list]; { if (_x select 0 == _iconId) exitwith { @@ -51,7 +60,7 @@ if (_show) then { }; }foreach _list; - missionNamespace setvariable ["cse_gui_displayIconList", _newList]; + missionNamespace setvariable [QGVAR(displayIconList), _newList]; for "_i" from 0 to (MAX_N_ICONS - 1) /* step +1 */ do { _idc = 10501 + _i; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf b/addons/gui/functions/fnc_displayInformation.sqf similarity index 90% rename from TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf rename to addons/gui/functions/fnc_displayInformation.sqf index 44f675769f..c4eb96984b 100644 --- a/TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf +++ b/addons/gui/functions/fnc_displayInformation.sqf @@ -8,6 +8,8 @@ * @PublicAPI: false */ +#include "script_component.hpp" + #define DISPLAY_LAYER 32547 private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos","_icon","_iconCtrl"]; @@ -17,10 +19,10 @@ _type = [_this, 2, 0, [0]] call BIS_fnc_Param; _icon = [_this, 3, "",[""]] call BIS_fnc_Param; if (_title != "") then { - DISPLAY_LAYER cutRsc ["CSE_DISPLAY_INFORMATION","PLAIN"]; + DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_INFORMATION),"PLAIN"]; disableSerialization; - _display = uiNamespace getvariable "CSE_DISPLAY_INFORMATION"; + _display = uiNamespace getvariable QGVAR(RSC_DISPLAY_INFORMATION); if (!isnil "_display") then { _headerCtrl = _display displayCtrl 1; _headerCtrl ctrlSetText _title; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf b/addons/gui/functions/fnc_displayMessage.sqf similarity index 87% rename from TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf rename to addons/gui/functions/fnc_displayMessage.sqf index 1816bdfad5..3dceab2638 100644 --- a/TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf +++ b/addons/gui/functions/fnc_displayMessage.sqf @@ -8,6 +8,8 @@ * @PublicAPI: false */ +#include "script_component.hpp" + #define DISPLAY_LAYER 546 private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos"]; @@ -16,10 +18,10 @@ _content = [_this, 1, "",[""]] call BIS_fnc_Param; _type = [_this, 2, 0, [0]] call BIS_fnc_Param; if (_title != "" && _content != "") then { - DISPLAY_LAYER cutRsc ["CSE_DISPLAY_MESSAGE","PLAIN"]; + DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_MESSAGE),"PLAIN"]; disableSerialization; - _display = uiNamespace getvariable "CSE_DISPLAY_MESSAGE"; + _display = uiNamespace getvariable QGVAR(RSC_DISPLAY_MESSAGE); if (!isnil "_display") then { _headerCtrl = _display displayCtrl 1; _contentCtrl = _display displayCtrl 2; diff --git a/addons/gui/functions/fnc_effectBlackOut.sqf b/addons/gui/functions/fnc_effectBlackOut.sqf new file mode 100644 index 0000000000..1ffa75fff9 --- /dev/null +++ b/addons/gui/functions/fnc_effectBlackOut.sqf @@ -0,0 +1,29 @@ +/** + * fn_effectBlackOut.sqf + * @Descr: Displays the blacked out effect for clients. + * @Author: Glowbal + * + * @Arguments: [displayEffect BOOL] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_displayEffect","_effect"]; +_displayEffect = [_this, 0, false,[false]] call bis_fnc_param; + +if (!hasInterface) exitwith {}; + +disableSerialization; +_effect = uiNamespace getVariable QGVAR(ScreenEffectsBlack); +if (isNil "_effect") then { + 45 cutRsc [QGVAR(ScreenEffectsBlack),"PLAIN"]; + _effect = uiNamespace getVariable QGVAR(ScreenEffectsBlack); +}; + +if (_displayEffect) then { + (_effect displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.9]; +} else { + (_effect displayCtrl 11112) ctrlSetTextColor [0.0,0.0,0.0,0.0]; +}; \ No newline at end of file diff --git a/addons/gui/functions/fnc_effectBleeding.sqf b/addons/gui/functions/fnc_effectBleeding.sqf new file mode 100644 index 0000000000..0882267df1 --- /dev/null +++ b/addons/gui/functions/fnc_effectBleeding.sqf @@ -0,0 +1,36 @@ +/** + * fn_effectBleeding.sqf + * @Descr: Displays the ACE Bleeding effect + * @Author: Glowbal + * + * @Arguments: [bloodLoss NUMBER] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +if (isnil QGVAR(DisplayingBleedingEffect)) then { + GVAR(DisplayingBleedingEffect) = false; +}; +if (GVAR(DisplayingBleedingEffect)) exitwith {}; +private ["_bloodLoss","_time"]; +_bloodLoss = _this select 0; +if (!(_bloodLoss > 0)) exitwith{}; + +_time = 10 - _bloodLoss; +if (_time < 1.5) then { + _time = 1.5; +}; +GVAR(DisplayingBleedingEffect) = true; +47 cutRsc [QGVAR(ScreenEffectsBleeding),"PLAIN"]; + +[{ + if !(isnil QGVAR(DisplayingBleedingEffect_ran)) then { + GVAR(DisplayingBleedingEffect_ran) = nil; + GVAR(DisplayingBleedingEffect) = false; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + } else { + GVAR(DisplayingBleedingEffect_ran) = true; + }; +}, _time, [] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gui/functions/fnc_effectPain.sqf b/addons/gui/functions/fnc_effectPain.sqf new file mode 100644 index 0000000000..595d4ea6a0 --- /dev/null +++ b/addons/gui/functions/fnc_effectPain.sqf @@ -0,0 +1,32 @@ +/** + * fn_effectPain.sqf + * @Descr: Displays the ACE Pain effect + * @Author: Glowbal + * + * @Arguments: [painRatio NUMBER] + * @Return: void + * @PublicAPI: true + */ + +#include "script_component.hpp" + +if (isnil QGVAR(DisplayingPainEffect)) then { + GVAR(DisplayingPainEffect) = false; +}; + +if (GVAR(DisplayingPainEffect)) exitwith {}; + +private ["_ratio","_time"]; +_ratio = _this select 0; +if (!(_ratio > 0)) exitwith{}; + _time = 6 - _ratio; +if (_time <1.5) then { + _time = 1.5; +}; +GVAR(DisplayingPainEffect) = true; +46 cutRsc [QGVAR(ScreenEffectsPain),"PLAIN"]; + +[{ + GVAR(DisplayingPainEffect) = false; + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}, _time, [] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gui/functions/fnc_loadingbar.sqf b/addons/gui/functions/fnc_loadingbar.sqf new file mode 100644 index 0000000000..4aba751235 --- /dev/null +++ b/addons/gui/functions/fnc_loadingbar.sqf @@ -0,0 +1,64 @@ +/** + * 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/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf b/addons/gui/functions/fnc_sendDisplayInformationTo.sqf similarity index 85% rename from TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf rename to addons/gui/functions/fnc_sendDisplayInformationTo.sqf index b8a47455ce..ae4012b5fe 100644 --- a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf +++ b/addons/gui/functions/fnc_sendDisplayInformationTo.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; _reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _title = [_this, 1, "",[""]] call BIS_fnc_Param; @@ -17,9 +19,8 @@ _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, "cse_fnc_sendDisplayInformationTo", _reciever, false] spawn BIS_fnc_MP; + [_this, QUOTE(FUNC(sendDisplayInformationTo)), _reciever, false] call EFUNC(common,execRemoteFnc); } else { - if (isLocalized _title) then { _title = localize _title; }; @@ -41,6 +42,6 @@ if (isPlayer _reciever) then { }foreach _content; - [_title,_content,_type] call cse_fnc_gui_displayInformation; + [_title,_content,_type] call EFUNC(gui,displayInformation); }; }; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf b/addons/gui/functions/fnc_sendDisplayMessageTo.sqf similarity index 85% rename from TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf rename to addons/gui/functions/fnc_sendDisplayMessageTo.sqf index da02f48dbc..c66af97266 100644 --- a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf +++ b/addons/gui/functions/fnc_sendDisplayMessageTo.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; _reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; _title = [_this, 1, "",[""]] call BIS_fnc_Param; @@ -15,11 +17,9 @@ _content = [_this, 2, "",[""]] call BIS_fnc_Param; _type = [_this, 3, 0,[0]] call BIS_fnc_Param; _parameters = [_this, 4, [], [[]]] call BIS_fnc_Param; -[_this] call cse_fnc_debug; - if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, "cse_fnc_sendDisplayMessageTo", _reciever, false] spawn BIS_fnc_MP; + [_this, QUOTE(FUNC(sendDisplayMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); } else { if (isLocalized _title) then { @@ -41,6 +41,6 @@ if (isPlayer _reciever) then { }foreach _parameters; _content = format _localizationArray; - [_title,_content,_type] call cse_fnc_gui_displayMessage; + [_title,_content,_type] call EFUNC(gui,displayMessage); }; }; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf b/addons/gui/functions/fnc_sendHintTo.sqf similarity index 60% rename from TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf rename to addons/gui/functions/fnc_sendHintTo.sqf index a86bc0bc2d..0454cc5691 100644 --- a/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf +++ b/addons/gui/functions/fnc_sendHintTo.sqf @@ -8,16 +8,19 @@ * @PublicAPI: true */ +#include "script_component.hpp" private ["_reciever","_message"]; _reciever = _this select 0; _message = _this select 1; -//[_reciever,_message] call cms_fnc_sendChatMessageTo; if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, "cse_fnc_sendHintTo", _reciever, false] spawn BIS_fnc_MP; + [_this, QUOTE(FUNC(sendHintTo)), _reciever, false] call EFUNC(common,execRemoteFnc); } else { - hintsilent format ["%1",_message]; + if (isLocalized _message) then { + _message = localize _message; + }; + hintsilent format ["%1",_message]; }; }; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf b/addons/gui/functions/fnc_sendMessageTo.sqf similarity index 52% rename from TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf rename to addons/gui/functions/fnc_sendMessageTo.sqf index f54d49d6d5..a4e0e4ccd5 100644 --- a/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf +++ b/addons/gui/functions/fnc_sendMessageTo.sqf @@ -8,6 +8,8 @@ * @PublicAPI: true */ +#include "script_component.hpp" + private ["_reciever","_message"]; _reciever = _this select 0; _message = _this select 1; @@ -15,8 +17,15 @@ _message = _this select 1; if (isPlayer _reciever) then { if (!local _reciever) then { - [_this, "cse_fnc_sendMessageTo", _reciever, false] spawn BIS_fnc_MP; + [_this, QUOTE(FUNC(sendMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc); } else { - CSE_LOGIC_OBJECT globalChat format ["%1",_message]; + 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 new file mode 100644 index 0000000000..e9276928ad --- /dev/null +++ b/addons/gui/functions/script_component.hpp @@ -0,0 +1,12 @@ +#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 new file mode 100644 index 0000000000..e9276928ad --- /dev/null +++ b/addons/gui/script_component.hpp @@ -0,0 +1,12 @@ +#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/TO_MERGE/cse/gui/stringtable.xml b/addons/gui/stringtable.xml similarity index 54% rename from TO_MERGE/cse/gui/stringtable.xml rename to addons/gui/stringtable.xml index 9a22f46ff3..6a7807c925 100644 --- a/TO_MERGE/cse/gui/stringtable.xml +++ b/addons/gui/stringtable.xml @@ -1,6 +1,6 @@  - - + + diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index d1956936df..3b82fc60f4 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = {"commy2", "KoffeinFlummi", "CAA-Picard", "bux578"}; authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; }; }; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 8b6d33b71f..e933cc40a4 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.6; - requiredAddons[] = {ace_common}; - version = VERSION; - versionStr = VERSION; - versionAr[] = {VERSIONAR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; author[] = {"Pabst Mirror"}; authorUrl = "https://github.com/PabstMirror/"; + VERSION_CONFIG; }; }; diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 6fec248637..711bd743b6 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 34d9acd675..58c47e3de2 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -1,12 +1,14 @@ // by commy2 #include "script_component.hpp" +if !(hasInterface) exitWith {}; + GVAR(nearUnits) = []; // @todo. Maybe move to common? [{ private "_nearUnits"; - _nearUnits = nearestObjects [ACE_player, ["CAManBase"], 50]; + _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; if (count _nearUnits > 10) then { _nearUnits resize 10; diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 24cd14de79..626e0e3abc 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,46 +1,55 @@ -// by commy2 +// by commy2 and CAA-Picard #include "script_component.hpp" -private ["_unit", "_range", "_isGreen"]; +EXPLODE_3_PVT(_this,_unit,_range,_isGreen); -_unit = _this select 0; -_range = _this select 1; -_isGreen = _this select 2; +_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand"); -_p0 = _unit modelToWorld (_unit selectionPosition "righthand"); -_d = _unit weaponDirection currentWeapon _unit; +// Convert _p0Pos to ASL +_p0 = + _p0Pos; +if (!surfaceIsWater _p0) then { + _p0 = ATLtoASL _p0; +}; -_p1 = _p0 vectorAdd (_d vectorMultiply _range); -_pA = _p0 vectorAdd (_d vectorMultiply 0.5); +// Find a system of orthogonal reference vectors +// _v1 points in the direction of the weapon +// _v2 points to the right of the weapon +// _v3 points to the top side of the weapon +_v1 = _unit weaponDirection currentWeapon _unit; +_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); +_v3 = _v2 vectorCrossProduct _v1; -_offset0 = getTerrainHeightASL _p0; -_offset1 = getTerrainHeightASL _p1; -_offsetA = getTerrainHeightASL _pA; +// Offset over the 3 reference axis +// This offset could eventually be configured by weapon in the config +_offV1 = 0.31; +_offV2 = 0; +_offV3 = 0.08; -_p1 = _p1 vectorAdd [0, 0, _offset0 - _offset1]; -_p0 = _pA vectorAdd [0, 0, _offset0 - _offsetA]; +// Offset _p0, the start of the laser +_p0 = _p0 vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +_p0Pos = _p0Pos vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +// Calculate _p1, the potential end of the laser +_p1 = _p0 vectorAdd (_v1 vectorMultiply _range); -_fnc_getDistance = { +//Debugaaa = lineIntersectsObjs [_p0, _p1, objNull, _unit, false, 2]; + +_fnc_getDistanceToTerrain = { private "_distance"; _pX = + _p0; - _line = [ATLToASL _p0, ATLToASL _pX]; + _line = [_p0, _pX]; _distance = _this; _iteration = _distance; while { - _iteration > 0.01 / 2 + _iteration > 0.05 / 2 } do { _iteration = _iteration / 2; - _pX = _p0 vectorAdd (_d vectorMultiply _distance); + _pX = _p0 vectorAdd (_v1 vectorMultiply _distance); - _offsetX = getTerrainHeightASL _pX; - - _pX = _pX vectorAdd [0, 0, _offset0 - _offsetX]; - - _line set [1, ATLToASL _pX]; + _line set [1, _pX]; _distance = _distance + (([1, -1] select (lineIntersects (_line + [_unit]) || {terrainIntersectASL _line})) * _iteration); @@ -50,53 +59,60 @@ _fnc_getDistance = { _distance }; -_distance = _range call _fnc_getDistance; +// Get distance to nearest object or terrain (excluding men) +_distance = _range call _fnc_getDistanceToTerrain; + +// Find all men potentially intercepted by the ray +_intermediatePos = _p0 vectorAdd (_v1 vectorMultiply _distance/2); +if (!surfaceIsWater _intermediatePos) then { + _intermediatePos = ASLtoATL _intermediatePos; +}; +_units = nearestObjects [_intermediatePos, ["Man"], _distance/2]; -_units = nearestObjects [_unit, ["Man"], _distance]; _units deleteAt (_units find _unit); -_fnc_doesIntersect = { - _pX = _p0 vectorAdd (_d vectorMultiply (_this select 1)); - - _offsetX = getTerrainHeightASL _pX; - - _pX = _pX vectorAdd [0, 0, _offset0 - _o1]; - - count ([_this select 0, "FIRE"] intersect [_p0, _pX]) > 0 +_fnc_doesIntersectWithMan = { + _pX = _p0 vectorAdd (_v1 vectorMultiply (_this select 1)); + if (!surfaceIsWater _pX) then { + _pX = ASLtoATL _pX; + }; + count ([_this select 0, "FIRE"] intersect [_p0Pos, _pX]) > 0 }; +// Test intersection with nearby men { - if ([_x, _distance] call _fnc_doesIntersect) then { - _distance = _distance min (_unit distance _x); + if ([_x, _distance] call _fnc_doesIntersectWithMan) then { + _distance = _distance min ((_unit distance _x) - _offV1); }; } forEach _units; //systemChat str _distance; if (_distance < 0.5) exitWith {}; -_pL = _p0 vectorAdd (_d vectorMultiply _distance); -_pL2 = _p0 vectorAdd (_d vectorMultiply (_distance - 0.5)); +_pL = _p0 vectorAdd (_v1 vectorMultiply _distance); +_pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); -_offsetL = getTerrainHeightASL _pL; -_offsetL2 = getTerrainHeightASL _pL2; - -_pL = _pL vectorAdd [0, 0, _offset0 - _offsetL]; -_pL2 = _pL2 vectorAdd [0, 0, _offset0 - _offsetL2]; +// Convert _pL to pos +if (!surfaceIsWater _pL) then { + _pL = ASLtoATL _pL; +}; drawLine3D [ - _p0, + _p0Pos, _pL, [[1,0,0,1], [0,1,0,1]] select _isGreen ]; -_spL = worldToScreen _pL; //systemChat str _spL; _size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; _camPos = positionCameraToWorld [0,0,0.2]; if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; if (count ([ACE_player, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; -if ( terrainIntersect [_camPos, _pL2]) exitWith {}; -if (lineIntersects [ATLToASL _camPos, ATLToASL _pL2]) exitWith {}; + +// Convert _camPos to ASL +if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; +if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; +if ( lineIntersects [_camPos, _pL2]) exitWith {}; drawIcon3D [ format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index be4ccc5a22..6720559ccc 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common", "ace_laser" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index c9c34195f1..04d083dc01 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common", "ace_interaction" }; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = { "commy2", "CAA-Picard" }; authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; }; }; diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index d5a2274b55..32c563bfb6 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2", "KoffeinFlummi", "PabstMirror"}; authorUrl = "https://github.com/commy2/"; diff --git a/addons/overheating/CfgEventHandlers.hpp b/addons/overheating/CfgEventHandlers.hpp index f5c0105711..f06e95788e 100644 --- a/addons/overheating/CfgEventHandlers.hpp +++ b/addons/overheating/CfgEventHandlers.hpp @@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + class Extended_FiredBIS_EventHandlers { class CAManBase { class GVAR(Overheat) { diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf new file mode 100644 index 0000000000..6d0014c2a2 --- /dev/null +++ b/addons/overheating/XEH_postInit.sqf @@ -0,0 +1,25 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Overheating_UnjamWeapon", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} + ) exitWith {false}; + + // Statement + [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); + true + }, + [19, [true, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index 2c7047718a..c3778862e6 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -14,18 +14,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class clearJam { - displayName = "$STR_ACE_Overheating_UnjamWeapon"; - condition = QUOTE( [_player] call EFUNC(common,canUseWeapon) && {currentWeapon _player in (_player getVariable [ARR_2(QUOTE(QGVAR(jammedWeapons)), [])])} ); - statement = QUOTE( [ARR_3(_player, currentMuzzle _player, false)] call FUNC(clearJam); ); - key = 19; - shift = 1; - control = 0; - alt = 0; - }; -}; - #include "CfgSounds.hpp" #include "CfgVehicles.hpp" diff --git a/addons/recoil/config.cpp b/addons/recoil/config.cpp index 40defea1fb..db08a49143 100644 --- a/addons/recoil/config.cpp +++ b/addons/recoil/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {ace_common}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; author[] = {"KoffeinFlummi", "TaoSensai", "commy2"}; authorUrl = "https://github.com/Taosenai/tmr"; + VERSION_CONFIG; }; }; diff --git a/addons/reload/CfgEventHandlers.hpp b/addons/reload/CfgEventHandlers.hpp index 051db27dda..8de6a01f06 100644 --- a/addons/reload/CfgEventHandlers.hpp +++ b/addons/reload/CfgEventHandlers.hpp @@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + class Extended_Take_EventHandlers { class CAManBase { class ACE_AmmoIndicatorReload { diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf new file mode 100644 index 0000000000..d40e5e0442 --- /dev/null +++ b/addons/reload/XEH_postInit.sqf @@ -0,0 +1,24 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Reload_checkAmmo", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) || + {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); + true + }, + [19, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 2d6c933742..6e0c14049d 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -13,18 +13,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + #include "CfgActions.hpp" -class ACE_Default_Keys { - class checkAmmo { - displayName = "$STR_ACE_Reload_checkAmmo"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon) || {_vehicle isKindOf 'StaticWeapon'}); - statement = QUOTE([ARR_3(_player, _vehicle, false)] call FUNC(checkAmmo);); - key = 19; - shift = 0; - control = 1; - alt = 0; - }; -}; - #include "RscInGameUI.hpp" diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 2391af350f..0d914df949 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" }; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = { "bux578", "commy2" }; authorUrl = "https://github.com/bux578/"; + VERSION_CONFIG; }; }; diff --git a/addons/resting/CfgEventHandlers.hpp b/addons/resting/CfgEventHandlers.hpp index f0a9f14d91..beb3c4d419 100644 --- a/addons/resting/CfgEventHandlers.hpp +++ b/addons/resting/CfgEventHandlers.hpp @@ -4,3 +4,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf new file mode 100644 index 0000000000..b593bebbf6 --- /dev/null +++ b/addons/resting/XEH_postInit.sqf @@ -0,0 +1,26 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Resting_RestWeapon", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {inputAction 'reloadMagazine' == 0} && + {!weaponLowered ACE_player} && + {speed ACE_player < 1}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); + true + }, + [15, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/resting/config.cpp b/addons/resting/config.cpp index dafa7e5b87..ac710c82a8 100644 --- a/addons/resting/config.cpp +++ b/addons/resting/config.cpp @@ -14,18 +14,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class restWeapon { - displayName = "$STR_ACE_Resting_RestWeapon"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon) && {inputAction 'reloadMagazine' == 0} && {!weaponLowered _player} && {speed _player < 1}); - statement = QUOTE([ARR_3(_player, _vehicle, currentWeapon _player)] call FUNC(restWeapon)); - key = 15; - shift = 0; - control = 0; - alt = 0; - }; -}; - #include "CfgWeapons.hpp" #include "CfgMoves.hpp" diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 94e6b789bd..8ae1155d53 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -1,5 +1,25 @@ - -// by commy2 +// by CAA-Picard +#include "script_component.hpp" //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" + + +// Add keybinds +["ACE3", + localize "STR_ACE_SafeMode_SafeMode", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + true + }, + [41, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/safemode/config.cpp b/addons/safemode/config.cpp index d61a386e20..8371e7f35f 100644 --- a/addons/safemode/config.cpp +++ b/addons/safemode/config.cpp @@ -13,16 +13,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Default_Keys { - class safeWeapon { - displayName = "$STR_ACE_SafeMode_SafeMode"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_3(_player, currentWeapon _player, currentMuzzle _player)] call FUNC(lockSafety)); - exceptions[] = {"ACE_interaction_isNotEscorting"}; - key = 41; - shift = 0; - control = 1; - alt = 0; - }; -}; diff --git a/addons/scopes/$PBOPREFIX$ b/addons/scopes/$PBOPREFIX$ new file mode 100644 index 0000000000..48434ed1b1 --- /dev/null +++ b/addons/scopes/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\scopes \ No newline at end of file diff --git a/addons/scopes/CfgEventHandlers.hpp b/addons/scopes/CfgEventHandlers.hpp new file mode 100644 index 0000000000..204f2e267e --- /dev/null +++ b/addons/scopes/CfgEventHandlers.hpp @@ -0,0 +1,51 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Fired_EventHandlers { + class CAManBase { + class ADDON { + clientFired = QUOTE(if (_this select 0 == ACE_player) then { _this call FUNC(firedEH);};); + }; + }; +}; + +class Extended_Take_EventHandlers { + class CAManBase { + class ADDON { + clientTake = QUOTE(if (_this select 0 == ACE_player) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_Put_EventHandlers { + class CAManBase { + class ADDON { + clientPut = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_InitPost_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; diff --git a/addons/scopes/CfgSounds.hpp b/addons/scopes/CfgSounds.hpp new file mode 100644 index 0000000000..9063c7f730 --- /dev/null +++ b/addons/scopes/CfgSounds.hpp @@ -0,0 +1,12 @@ +class CfgSounds { + class ACE_Sound_Click; + class ACE_Scopes_Click_1: ACE_Sound_Click { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)),3, 2, 200}; + }; + class ACE_Scopes_Click_2: ACE_Scopes_Click_1 { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)), 3.3, 1.8, 200}; + }; + class ACE_Scopes_Click_3: ACE_Scopes_Click_1 { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)), 2.8, 2.3, 200}; + }; +}; diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp new file mode 100644 index 0000000000..67898fb449 --- /dev/null +++ b/addons/scopes/CfgWeapons.hpp @@ -0,0 +1,43 @@ +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class optic_LRPS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -50, 50 }; + ACE_ScopeAdjust_Vertical[] = { -70, 70 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_SOS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -50, 50 }; + ACE_ScopeAdjust_Vertical[] = { -60, 60 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_DMS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -40, 40 }; + ACE_ScopeAdjust_Vertical[] = { -40, 40 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp new file mode 100644 index 0000000000..79de7e8214 --- /dev/null +++ b/addons/scopes/RscTitles.hpp @@ -0,0 +1,76 @@ +class RscTitles { + class ACE_Scopes_Zeroing { + idd = -1; + movingEnable = 0; + enableSimulation = 1; + enableDisplay = 1; + onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(scripts\zeroingOnLoad.sqf))); uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); + duration = 1e+011; + fadein = 0; + fadeout = 0; + name = QGVAR(Zeroing); + class RscPicture; + class RscText; + class controls { + class ACE_Scopes_Zeroing_BG : RscPicture { + idc = 925001; + type = 0; + text = PATHTOF(UI\scopes_bg.paa); + style = 48 + 0x800; + scale = 1; + sizeEx = 1; + font = "PuristaMedium"; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = { 1, 1, 1, 1 }; + shadow = 1; + + x = (0.5 - 0.4 / 2) * safezoneW + safezoneX; + y = 0 * safezoneH + safezoneY; + w = 0.4 * safezoneW; + h = 0.3 * safezoneH; + }; + class ACE_Scopes_Zeroing_Vertical : RscText { + idc = 925002; + type = 0; + style = 2; + sizeEx = 0.04; + lineSpacing = 1; + font = "PuristaMedium"; + text = ""; + colorText[] = { 1, 1, 1, 0.9 }; + colorBackground[] = { 1, 0, 0, 0 }; + shadow = 0; + + x = (0.5 - 0.4 / 2 + 0.45*0.4) * safezoneW + safezoneX; + y = (0 + 0.19*0.3) * safezoneH + safezoneY; + w = 0.04 * safezoneW; + h = 0.025 * safezoneH; + }; + class ACE_Scopes_Zeroing_Horizontal : RscText { + idc = 925003; + type = 0; + style = 0; + sizeEx = 0.04; + lineSpacing = 1; + font = "PuristaMedium"; + text = ""; + colorText[] = { 1, 1, 1, 0.9 }; + colorBackground[] = { 1, 0, 0, 0 }; + shadow = 0; + + x = (0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX; + y = (0 + 0.47*0.3) * safezoneH + safezoneY; + w = 0.04 * safezoneW; + h = 0.025 * safezoneH; + }; + }; + }; +}; + +class RscInGameUI { + class RscUnitInfo; + class RscWeaponZeroing : RscUnitInfo { + onLoad = QUOTE([ARR_4('onLoad',_this,'RscUnitInfo','IGUI')] call compile preprocessfilelinenumbers 'A3\ui_f\scripts\initDisplay.sqf'; uiNamespace setVariable [ARR_2('ACE_dlgWeaponZeroing', _this select 0)]; ); + //onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgWeaponZeroing', _this select 0];"; + }; +}; diff --git a/TO_MERGE/agm/Scopes/UI/scopes_bg.paa b/addons/scopes/UI/scopes_bg.paa similarity index 100% rename from TO_MERGE/agm/Scopes/UI/scopes_bg.paa rename to addons/scopes/UI/scopes_bg.paa diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf new file mode 100644 index 0000000000..b7fd4bfc3a --- /dev/null +++ b/addons/scopes/XEH_postInit.sqf @@ -0,0 +1,115 @@ +/* + * Author: KoffeinFlummi and CAA-Picard + * + * Watches for scope changes. + * Defines key bindings + * + */ +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// show overlay after changing weapon/optic +0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { + waitUntil {[ACE_player, 0,0] call FUNC(canAdjustScope)}; + _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; + sleep 3; + _layer cutFadeOut 2; + + _weapon = currentWeapon ACE_player; + _optics = [ACE_player] call FUNC(getOptics); + waitUntil {sleep 0.05; !(_optics isEqualTo ([ACE_player] call FUNC(getOptics))) or (currentWeapon ACE_player != _weapon)}; + }; +}; + +// instantly hide when scoping in +0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { + waitUntil {sleep 0.05; cameraView == "GUNNER"}; + if !(isNull GVAR(fadeScript)) then { + terminate GVAR(fadeScript); + }; + _layer cutText ["", "PLAIN", 0]; + }; +}; + + +// Add keybinds +["ACE3", + localize "STR_ACE_Scopes_AdjustUp", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0, 0.1] call FUNC(adjustScope); + true + }, + [201, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustDown", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0, -0.1] call FUNC(adjustScope); + true + }, + [209, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustLeft", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, -0.1, 0] call FUNC(adjustScope); + true + }, + [209, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustRight", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0.1, 0] call FUNC(adjustScope); + true + }, + [201, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/scopes/XEH_preInit.sqf b/addons/scopes/XEH_preInit.sqf new file mode 100644 index 0000000000..cc83dd6332 --- /dev/null +++ b/addons/scopes/XEH_preInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +PREP(adjustScope); +PREP(canAdjustScope); +PREP(firedEH); +PREP(getOptics); +PREP(hideZeroing); +PREP(inventoryCheck); + +GVAR(fadeScript) = scriptNull; diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp new file mode 100644 index 0000000000..9d2ddbeacb --- /dev/null +++ b/addons/scopes/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_main", "ace_common" }; + author[] = {"KoffeinFlummi"}; + authorUrl = "https://github.com/KoffeinFlummi"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#include "CfgSounds.hpp" + +#include "CfgWeapons.hpp" + +#include "RscTitles.hpp" diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf new file mode 100644 index 0000000000..7db640590a --- /dev/null +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -0,0 +1,69 @@ +/* + * Author: KoffeinFlummi + * + * Changes the adjustment for the current scope + * + * Arguments: + * 0: Horizontal adjustment + * 1: Vertical adjustment + * + * Return Value: + * True + */ + +#include "script_component.hpp" + +private ["_unit", "_weapons", "_zeroing", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_hint"]; + +_unit = _this select 0; + +_weapons = [ + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit +]; + +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; +}; + +_zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon _unit)); +_zeroing set [0, (round (((_zeroing select 0) + (_this select 1)) * 10)) / 10]; +_zeroing set [1, (round (((_zeroing select 1) + (_this select 2)) * 10)) / 10]; + +GVAR(Adjustment) set [_weapons find (currentWeapon _unit), _zeroing]; + +playSound (["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"] select floor random 3); + +// slightly rotate the player if looking through optic +if (cameraView == "GUNNER") then { + _pitchbankyaw = [_unit] call EFUNC(common,getPitchBankYaw); + // these are not exact mil-to-degree conversions, but instead chosen + // to minimize the effect of rounding errors + _pitch = (_pitchbankyaw select 0) + ((_this select 2) * -0.04); + _bank = _pitchbankyaw select 1; + _yaw = (_pitchbankyaw select 2) + ((_this select 1) * -0.04); + [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw) +}; + +_display = uiNamespace getVariable [QGVAR(ZeroingDisplay), displayNull]; +if !(isNull _display) then { + _vertical = _display displayCtrl 925002; + _horizontal = _display displayCtrl 925003; + _vertical ctrlSetText (str (_zeroing select 1)); + _horizontal ctrlSetText (str (_zeroing select 0)); +}; + +if (!isNull (missionNamespace getVariable [QGVAR(fadeScript), scriptNull])) then { + terminate GVAR(fadeScript); +}; +if (cameraView != "GUNNER") then { + GVAR(fadeScript) = 0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; + sleep 3; + _layer cutFadeOut 2; + }; +}; + +true diff --git a/TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf b/addons/scopes/functions/fnc_canAdjustScope.sqf similarity index 68% rename from TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf rename to addons/scopes/functions/fnc_canAdjustScope.sqf index 0096bd150f..8aea2ff9e4 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf +++ b/addons/scopes/functions/fnc_canAdjustScope.sqf @@ -11,33 +11,35 @@ * Can adjustment be done? (Bool) */ +#include "script_component.hpp" + private ["_unit", "_weapons", "_zeroing", "_optic", "_maxHorizontal", "_maxVertical"]; _unit = _this select 0; _weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit ]; if !(currentWeapon _unit in _weapons) exitWith {false}; -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; }; -if (isNil "AGM_Scopes_Optics") then { - AGM_Scopes_Optics = ["", "", ""]; +if (isNil QGVAR(Optics)) then { + GVAR(Optics) = ["", "", ""]; }; -_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon _unit)); +_zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon _unit)); _zeroX = (_zeroing select 0) + (_this select 1); _zeroY = (_zeroing select 1) + (_this select 2); -_optic = AGM_Scopes_Optics select (_weapons find (currentWeapon _unit)); -_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "AGM_ScopeAdjust_Horizontal"); -_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "AGM_ScopeAdjust_Vertical"); +_optic = GVAR(Optics) select (_weapons find (currentWeapon _unit)); +_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Horizontal"); +_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Vertical"); if ((count _maxHorizontal < 2) or (count _maxVertical < 2)) exitWith {false}; if ((_maxHorizontal isEqualTo [0,0]) or (_maxVertical isEqualTo [0,0])) exitWith {false}; diff --git a/TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf similarity index 62% rename from TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf rename to addons/scopes/functions/fnc_firedEH.sqf index 925679ef98..4414f617d6 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -10,6 +10,8 @@ * None */ +#include "script_component.hpp" + private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_weapons", "_zeroing", "_direction", "_azimuth", "_altitude", "_velocity"]; _unit = _this select 0; @@ -19,15 +21,15 @@ _round = _this select 5; _magazineType = _this select 6; _weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit ]; if !(_weaponType in _weapons) exitWith {}; -_zeroing = AGM_Scopes_Adjustment select (_weapons find _weaponType); +_zeroing = GVAR(Adjustment) select (_weapons find _weaponType); // convert zeroing from mils to degrees -_zeroing = [_zeroing, {_this * 0.05625}] call AGM_Core_fnc_map; +_zeroing = [_zeroing, {_this * 0.05625}] call EFUNC(common,map); -[_round, _zeroing select 0, _zeroing select 1, 0] call AGM_Core_fnc_changeProjectileDirection; +[_round, _zeroing select 0, _zeroing select 1, 0] call EFUNC(common,changeProjectileDirection); diff --git a/TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf similarity index 78% rename from TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf rename to addons/scopes/functions/fnc_getOptics.sqf index 997b1dc442..7ff2c7ea1d 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -10,6 +10,8 @@ * [optic of primary, optic of secondary, optic of handgun] (Array) */ +#include "script_component.hpp" + private ["_unit", "_array"]; _unit = _this select 0; @@ -19,9 +21,9 @@ _array = ["", "", ""]; if !(_unit isKindOf "CAManBase") exitWith {_array}; { - if (count _x >= 2) then { - _array set [_forEachIndex, _x select 2]; - }; + if (count _x >= 2) then { + _array set [_forEachIndex, _x select 2]; + }; } forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; _array diff --git a/addons/scopes/functions/fnc_hideZeroing.sqf b/addons/scopes/functions/fnc_hideZeroing.sqf new file mode 100644 index 0000000000..b41fd1dab6 --- /dev/null +++ b/addons/scopes/functions/fnc_hideZeroing.sqf @@ -0,0 +1,27 @@ +// by commy2 + +#include "script_component.hpp" + +private ["_state", "_ctrl"]; + +_state = _this select 0; + +disableSerialization; +_ctrl = (uiNamespace getVariable ['ACE_dlgWeaponZeroing', displayNull]) displayCtrl 168; + +if (_state) then { + _ctrl ctrlSetPosition [0,0,0,0]; +} else { + private "_config"; + + _config = configFile >> "RscInGameUI" >> "RscWeaponZeroing" >> "CA_Zeroing"; + + _ctrl ctrlSetPosition [ + getNumber (_config >> "x"), + getNumber (_config >> "y"), + getNumber (_config >> "w"), + getNumber (_config >> "h") + ]; +}; + +_ctrl ctrlCommit 0; diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf new file mode 100644 index 0000000000..23971098d6 --- /dev/null +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -0,0 +1,23 @@ +// by KoffeinFlummi / commy2 + +#include "script_component.hpp" + +private "_new"; + +_new = _this call FUNC(getOptics); + +if (isNil QGVAR(Optics)) then { + GVAR(Optics) = ["", "", ""]; +}; + +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; +}; + +{ + if (_new select _forEachIndex != _x) then { + GVAR(Adjustment) set [_forEachIndex, [0,0]]; + }; +} forEach GVAR(Optics); + +GVAR(Optics) = _new; diff --git a/addons/scopes/functions/script_component.hpp b/addons/scopes/functions/script_component.hpp new file mode 100644 index 0000000000..acca51b4b5 --- /dev/null +++ b/addons/scopes/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\scopes\script_component.hpp" diff --git a/addons/scopes/script_component.hpp b/addons/scopes/script_component.hpp new file mode 100644 index 0000000000..8c4a2cb1cd --- /dev/null +++ b/addons/scopes/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT scopes +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SCOPES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SCOPES + #define DEBUG_SETTINGS DEBUG_SETTINGS_SCOPES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/scopes/scripts/script_component.hpp b/addons/scopes/scripts/script_component.hpp new file mode 100644 index 0000000000..acca51b4b5 --- /dev/null +++ b/addons/scopes/scripts/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\scopes\script_component.hpp" diff --git a/addons/scopes/scripts/zeroingOnLoad.sqf b/addons/scopes/scripts/zeroingOnLoad.sqf new file mode 100644 index 0000000000..591b5fc07b --- /dev/null +++ b/addons/scopes/scripts/zeroingOnLoad.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +disableSerialization; + +_display = _this select 0; +uiNamespace setVariable [QGVAR(ZeroingDisplay, _display]; +_vertical = _display displayCtrl 925002; +_horizontal = _display displayCtrl 925003; + +_weapons = [ + primaryWeapon player, + secondaryWeapon player, + handgunWeapon player +]; + +if ((currentWeapon ACE_player) in _weapons) then { + _zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon ACE_player)); + _horizontal ctrlSetText (str (_zeroing select 0)); + _vertical ctrlSetText (str (_zeroing select 1)); +}; diff --git a/TO_MERGE/agm/Scopes/sounds/agm_scopes_click.wav b/addons/scopes/sounds/ace_scopes_click.wav similarity index 100% rename from TO_MERGE/agm/Scopes/sounds/agm_scopes_click.wav rename to addons/scopes/sounds/ace_scopes_click.wav diff --git a/TO_MERGE/agm/Scopes/stringtable.xml b/addons/scopes/stringtable.xml similarity index 90% rename from TO_MERGE/agm/Scopes/stringtable.xml rename to addons/scopes/stringtable.xml index 85d4b40994..04f777241a 100644 --- a/TO_MERGE/agm/Scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -1,8 +1,8 @@  - + - + Adjust Elevation Up Magasság Állítása Felfelé Optik-Elevation erhöhen @@ -13,7 +13,7 @@ Ajustar elevación arriba Вверх по вертикали - + Adjust Elevation Down Magasság Állítása Lefelé Optik-Elevation verringern @@ -24,7 +24,7 @@ Ajustar elevación abajo Вниз по вертикали - + Adjust Windage Right Oldalirány Állítása Jobbra Optik-Azimuth erhöhen @@ -35,7 +35,7 @@ Ajustar deriva a la derecha Вправо на уровне - + Adjust Windage Left Oldalirány Állítása Balra Optik-Azimuth verringern diff --git a/addons/switchunits/config.cpp b/addons/switchunits/config.cpp index 1f60ca83ac..b89adb3a7a 100644 --- a/addons/switchunits/config.cpp +++ b/addons/switchunits/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_main", "ace_common"}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; author[] = {"bux578"}; authorUrl = "https://github.com/bux578/"; + VERSION_CONFIG; }; }; diff --git a/addons/vector/CfgWeapons.hpp b/addons/vector/CfgWeapons.hpp index eea552a94b..6b8757d143 100644 --- a/addons/vector/CfgWeapons.hpp +++ b/addons/vector/CfgWeapons.hpp @@ -9,8 +9,8 @@ class CfgWeapons { modelOptics = PATHTOF(ace_vector_optics.p3d); picture = PATHTOF(UI\ace_vector_x_ca.paa); visionMode[] = {"Normal","NVG"}; - opticsZoomMax = 0.03; - opticsZoomMin = 0.03; + opticsZoomMax = 0.06621; + opticsZoomMin = 0.06621; weaponInfoType = "ACE_RscOptics_vector"; }; }; diff --git a/addons/vehicles/CfgEventHandlers.hpp b/addons/vehicles/CfgEventHandlers.hpp index ccc1e1b7ce..049b154088 100644 --- a/addons/vehicles/CfgEventHandlers.hpp +++ b/addons/vehicles/CfgEventHandlers.hpp @@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + class Extended_Engine_EventHandlers { class Car { class ACE_EngineStartDelay { diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf new file mode 100644 index 0000000000..efff70306f --- /dev/null +++ b/addons/vehicles/XEH_postInit.sqf @@ -0,0 +1,25 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_SpeedLimiter", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player == driver vehicle ACE_player && + {vehicle ACE_player isKindOf 'Car' || + {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); + true + }, + [211, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/vehicles/config.cpp b/addons/vehicles/config.cpp index e9543e9b94..a3641a7b5b 100644 --- a/addons/vehicles/config.cpp +++ b/addons/vehicles/config.cpp @@ -16,15 +16,3 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - -class ACE_Default_Keys { - class speedLimiter { - displayName = "$STR_ACE_SpeedLimiter"; - condition = QUOTE(_player == driver _vehicle && {_vehicle isKindOf 'Car' || {_vehicle isKindOf 'Tank'}}); - statement = QUOTE([ARR_2(_player, _vehicle)] call FUNC(speedLimiter)); - key = 211; - shift = 0; - control = 0; - alt = 0; - }; -}; diff --git a/addons/weaponselect/CfgEventHandlers.hpp b/addons/weaponselect/CfgEventHandlers.hpp index 4599224a24..f409a36e5a 100644 --- a/addons/weaponselect/CfgEventHandlers.hpp +++ b/addons/weaponselect/CfgEventHandlers.hpp @@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + class Extended_FiredBIS_EventHandlers { class CAManBase { class GVAR(ThrowGrenade) { diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf new file mode 100644 index 0000000000..3414f64c52 --- /dev/null +++ b/addons/weaponselect/XEH_postInit.sqf @@ -0,0 +1,257 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_WeaponSelect_SelectPistol", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [2, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectRifle", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [3, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectLauncher", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [5, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); + true + }, + [4, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectBinocular", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); + true + }, + [6, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(selectGrenadeFrag); + true + }, + [7, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectGrenadeOther", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(selectGrenadeOther); + true + }, + [8, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_HolsterWeapon", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(putWeaponAway); + true + }, + [11, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_EngineOn", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; + + // Statement + (vehicle ACE_player) engineOn true; + true + }, + [3, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_EngineOff", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; + + // Statement + (vehicle ACE_player) engineOn false; + true + }, + [2, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMainGun", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); + true + }, + [4, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMachineGun", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); + true + }, + [5, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMissiles", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); + true + }, + [6, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_FireSmokeLauncher", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(fireSmokeLauncher); + true + }, + [10, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp index 98630a4b79..adebcd322c 100644 --- a/addons/weaponselect/config.cpp +++ b/addons/weaponselect/config.cpp @@ -13,165 +13,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Default_Keys { - class selectPistol { - displayName = "$STR_ACE_WeaponSelect_SelectPistol"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_2(_player, handgunWeapon _player)] call FUNC(selectWeaponMode);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 2; - shift = 0; - control = 0; - alt = 0; - }; - class selectRifle { - displayName = "$STR_ACE_WeaponSelect_SelectRifle"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_2(_player, primaryWeapon _player)] call FUNC(selectWeaponMode);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 3; - shift = 0; - control = 0; - alt = 0; - }; - class selectLauncher { - displayName = "$STR_ACE_WeaponSelect_SelectLauncher"; - condition = QUOTE(_player == _vehicle); - statement = QUOTE([ARR_2(_player, secondaryWeapon _player)] call FUNC(selectWeaponMode);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 5; - shift = 0; - control = 0; - alt = 0; - }; - /*class selectPistolMuzzle { - displayName = "Select Pistol Muzzle"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_2(_player, handgunWeapon _player)] call FUNC(selectWeaponMuzzle);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - disabled = 1; - key = 7; - shift = 0; - control = 0; - alt = 0; - };*/ - class selectRifleMuzzle { - displayName = "$STR_ACE_WeaponSelect_SelectRifleMuzzle"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_2(_player, primaryWeapon _player)] call FUNC(selectWeaponMuzzle);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 4; - shift = 0; - control = 0; - alt = 0; - }; - /*class selectLauncherMuzzle { - displayName = "Select Launcher Muzzle"; - condition = QUOTE(_player == _vehicle); - statement = QUOTE([ARR_2(_player, secondaryWeapon _player)] call FUNC(selectWeaponMuzzle);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - disabled = 1; - key = 8; - shift = 0; - control = 0; - alt = 0; - };*/ - class selectBinocular { - displayName = "$STR_ACE_WeaponSelect_SelectBinocular"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_2(_player, binocular _player)] call FUNC(selectWeaponMode);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 6; - shift = 0; - control = 0; - alt = 0; - }; - class selectGrenadeFrag { - displayName = "$STR_ACE_WeaponSelect_SelectGrenadeFrag"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([_player] call FUNC(selectGrenadeFrag);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 7; - shift = 0; - control = 0; - alt = 0; - }; - class selectGrenadeOther { - displayName = "$STR_ACE_WeaponSelect_SelectGrenadeOther"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([_player] call FUNC(selectGrenadeOther);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 8; - shift = 0; - control = 0; - alt = 0; - }; - class holsterWeapon { - displayName = "$STR_ACE_WeaponSelect_HolsterWeapon"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([_player] call FUNC(putWeaponAway);); - exceptions[] = {QEGVAR(interaction,isNotEscorting)}; - key = 11; - shift = 0; - control = 0; - alt = 0; - }; - - class engineOn { - displayName = "$STR_ACE_WeaponSelect_EngineOn"; - condition = QUOTE(_player != _vehicle && {_player == driver _vehicle} && {!isEngineOn _vehicle}); - statement = QUOTE(_vehicle engineOn true;); - key = 3; - shift = 0; - control = 0; - alt = 0; - }; - class engineOff { - displayName = "$STR_ACE_WeaponSelect_EngineOff"; - condition = QUOTE(_player != _vehicle && {_player == driver _vehicle} && {isEngineOn _vehicle}); - statement = QUOTE(_vehicle engineOn false;); - key = 2; - shift = 0; - control = 0; - alt = 0; - }; - - class selectMaingun { - displayName = "$STR_ACE_WeaponSelect_SelectMainGun"; - condition = QUOTE(_player != _vehicle); - statement = QUOTE([ARR_3(_player, _vehicle, 0)] call FUNC(selectWeaponVehicle);); - key = 4; - shift = 0; - control = 0; - alt = 0; - }; - class selectMachineGun { - displayName = "$STR_ACE_WeaponSelect_SelectMachineGun"; - condition = QUOTE(_player != _vehicle); - statement = QUOTE([ARR_3(_player, _vehicle, 1)] call FUNC(selectWeaponVehicle);); - key = 5; - shift = 0; - control = 0; - alt = 0; - }; - class selectMissile { - displayName = "$STR_ACE_WeaponSelect_SelectMissiles"; - condition = QUOTE(_player != _vehicle); - statement = QUOTE([ARR_3(_player, _vehicle, 2)] call FUNC(selectWeaponVehicle);); - key = 6; - shift = 0; - control = 0; - alt = 0; - }; - - class fireSmokeLauncher { - displayName = "$STR_ACE_WeaponSelect_FireSmokeLauncher"; - condition = QUOTE(_player != _vehicle && {_player == commander _vehicle}); - statement = QUOTE([_vehicle] call FUNC(fireSmokeLauncher);); - key = 10; - shift = 0; - control = 0; - alt = 0; - }; -}; diff --git a/addons/wep_dragon/config.cpp b/addons/wep_dragon/config.cpp index 235e643b18..f654e815c9 100644 --- a/addons/wep_dragon/config.cpp +++ b/addons/wep_dragon/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = { "ACE_M47StaticLauncher", "M47Launcher_EP1", "ACE_M47_Daysight" }; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index 07a1e33d41..0c8fae6154 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/extensions/ace_fcs.cpp b/extensions/ace_fcs.cpp new file mode 100644 index 0000000000..0b6788e7d1 --- /dev/null +++ b/extensions/ace_fcs.cpp @@ -0,0 +1,117 @@ +/* + * ace_fcs.cpp + * + * Calculates firing solution. + * + * Takes: + * initSpeed,airFriction,angle,distance as string + * Example: "900,-0.0004,2,1050" + * + * Returns: + * Correction to angle + */ + +#include "stdafx.h" + +#define _USE_MATH_DEFINES + +#include +#include +#include +#include + +#define MAXELEVATION 20 +#define SIMULATIONSTEP 0.05 +#define MAXITERATIONS 120 +#define PRECISION 0.1 +#define RADIANS(X) (X / (180 / M_PI)) + +static char version[] = "1.0"; + +extern "C" { + __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); +}; + +std::vector splitString(std::string input) { + std::istringstream ss(input); + std::string token; + + std::vector output; + while (std::getline(ss, token, ',')) { + output.push_back(token); + } + + return output; +} + +double traceBullet(double initSpeed, double airFriction, double angle, double angleTarget, double distance) { + double velX, velY, posX, posY, posTargetX, posTargetY, velMag; + velX = cos(RADIANS(angle)) * initSpeed; + velY = sin(RADIANS(angle)) * initSpeed; + posX = 0; + posY = 0; + posTargetX = cos(RADIANS(angleTarget)) * distance; + posTargetY = sin(RADIANS(angleTarget)) * distance; + + int i = 0; + while (i < MAXITERATIONS) { + velMag = sqrt(pow(velX, 2) + pow(velY, 2)); + velX += SIMULATIONSTEP * (velX * velMag * airFriction); + velY += SIMULATIONSTEP * (velY * velMag * airFriction - 9.81); + posX += velX * SIMULATIONSTEP; + posY += velY * SIMULATIONSTEP; + if (posX >= posTargetX) { break; } + i++; + } + + return posY - posTargetY; +} + +double getSolution(double initSpeed, double airFriction, double angleTarget, double distance) { + double posTargetX, posTargetY; + posTargetX = cos(RADIANS(angleTarget)) * distance; + posTargetY = sin(RADIANS(angleTarget)) * distance; + + if (traceBullet(initSpeed, airFriction, MAXELEVATION, angleTarget, distance) < 0) { + return MAXELEVATION - angleTarget; + } + + double a1 = angleTarget; + double a2 = MAXELEVATION; + double f1, f2, tmp; + f1 = traceBullet(initSpeed, airFriction, a1, angleTarget, distance); + if (fabs(f1) <= PRECISION) { return 0; } + while (fabs(f1) > PRECISION) { + f2 = traceBullet(initSpeed, airFriction, a2, angleTarget, distance); + tmp = a2 - f2 * (a2 - a1) / (f2 - f1); + a1 = a2; + a2 = tmp; + f1 = f2; + } + + return a2 - angleTarget; +} + +// i like to live dangerously. jk, fix strncpy sometime pls. +#pragma warning( push ) +#pragma warning( disable : 4996 ) + +void __stdcall RVExtension(char *output, int outputSize, const char *function) { + if (!strcmp(function, "version")) { + strncpy(output, version, outputSize); + } else { + std::vector argStrings = splitString(function); + double initSpeed = std::stod(argStrings[0]); + double airFriction = std::stod(argStrings[1]); + double angleTarget = std::stod(argStrings[2]); + double distance = std::stod(argStrings[3]); + + double result = getSolution(initSpeed, airFriction, angleTarget, distance); + std::string resultString = std::to_string(result); + + strcpy(output, resultString.c_str()); + output[outputSize - 1] = '\0'; + } +} + +#pragma warning( pop ) diff --git a/extensions/stdafx.cpp b/extensions/stdafx.cpp new file mode 100644 index 0000000000..e1e622b65d --- /dev/null +++ b/extensions/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// ace_fcs.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/extensions/stdafx.h b/extensions/stdafx.h new file mode 100644 index 0000000000..f3a07375c7 --- /dev/null +++ b/extensions/stdafx.h @@ -0,0 +1,16 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#include "targetver.h" + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + + + +// TODO: reference additional headers your program requires here