diff --git a/.gitignore b/.gitignore index a067f29817..70f252396b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.pbo - +texHeaders.bin +*.swp +*.swo diff --git a/TO_MERGE/agm/SwitchUnits/clientInit.sqf b/TO_MERGE/agm/SwitchUnits/clientInit.sqf deleted file mode 100644 index 6c769a5903..0000000000 --- a/TO_MERGE/agm/SwitchUnits/clientInit.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - Author(s): - bux578 -*/ - -0 spawn { - private ["_side"]; - - waitUntil {sleep 0.5; AGM_SwitchUnits_EnableSwitchUnits}; - - //_side = [west, east, independent, civilian] select AGM_SwitchUnits_SwitchUnitsAllowedForSide; - - _sides = []; - - if(AGM_SwitchUnits_SwitchToWest) then {_sides pushBack west}; - if(AGM_SwitchUnits_SwitchToEast) then {_sides pushBack east}; - if(AGM_SwitchUnits_SwitchToIndependent) then {_sides pushBack independent}; - if(AGM_SwitchUnits_SwitchToCivilian) then {_sides pushBack civilian}; - - if (player getVariable ["AGM_CanSwitchUnits", false]) then { - [player, _sides] call AGM_SwitchUnits_fnc_initPlayer; - }; -}; diff --git a/TO_MERGE/agm/SwitchUnits/config.cpp b/TO_MERGE/agm/SwitchUnits/config.cpp deleted file mode 100644 index 254a92be3a..0000000000 --- a/TO_MERGE/agm/SwitchUnits/config.cpp +++ /dev/null @@ -1,140 +0,0 @@ -class CfgPatches { - class AGM_SwitchUnits { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"bux578"}; - authorUrl = "https://github.com/bux578/"; - }; -}; - -class CfgFunctions { - class AGM_SwitchUnits { - class AGM_SwitchUnits { - file = "AGM_SwitchUnits\functions"; - class addMapFunction; - class handleMapClick; - class initPlayer; - class isValidAi; - class markAiOnMap; - class module; - class nearestPlayers; - class switchBack; - class switchUnit; - }; - }; -}; - - -class Extended_PostInit_EventHandlers { - class AGM_SwitchUnits { - clientInit = "call compile preprocessFileLineNumbers '\AGM_SwitchUnits\clientInit.sqf'"; - }; -}; - - -class CfgVehicles { - class Module_F; - class AGM_ModuleSwitchUnits: Module_F { - author = "AGM Team"; - category = "AGM"; - displayName = "SwitchUnits System"; - function = "AGM_SwitchUnits_fnc_module"; - scope = 2; - isGlobal = 1; - icon = "\AGM_SwitchUnits\UI\IconSwitchUnits_ca.paa"; - class Arguments { - class SwitchToWest { - displayName = "Switch to West?"; - description = "Allow switching to west units?"; - typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; - }; - class SwitchToEast { - displayName = "Switch to East?"; - description = "Allow switching to east units?"; - typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; - }; - class SwitchToIndependent { - displayName = "Switch to Independent?"; - description = "Allow switching to independent units?"; - typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; - }; - class SwitchToCivilian { - displayName = "Switch to Civilian?"; - description = "Allow switching to civilian units?"; - typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; - }; - class EnableSafeZone { - displayName = "Enable Safe Zone?"; - description = "Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone."; - typeName = "BOOL"; - class values { - class Yes {default = 1; name = "Yes"; value = 1;}; - class No {name = "No"; value = 0;}; - }; - }; - class SafeZoneRadius { - displayName = "Safe Zone Radius"; - description = "The safe zone around players from a different team. Default: 200"; - typeName = "NUMBER"; - defaultValue = 100; - }; - - /* - - class EnableSwitchUnits { - displayName = "Enable SwitchUnits?"; - description = "Enable to switch to AI units? Default: No"; - typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; - }; - - class SwitchUnitsAllowedForSide { - displayName = "Allow for which side?"; - description = "Which side should be allowed to switch to AI units?"; - typeName = "NUMBER"; - class values { - class West {name = "West"; value = 0;}; - class East {default = 1; name = "East"; value = 1;}; - class Independent {name = "Independent"; value = 2;}; - class Civilian {name = "Civilian"; value = 3;}; - }; - };*/ - }; - }; -}; - -class AGM_Parameters_Numeric { - AGM_SwitchUnits_SafeZoneRadius = 100; -}; -class AGM_Parameters_Boolean { - AGM_SwitchUnits_EnableSwitchUnits = 0; - AGM_SwitchUnits_SwitchToWest = 0; - AGM_SwitchUnits_SwitchToEast = 0; - AGM_SwitchUnits_SwitchToIndependent = 0; - AGM_SwitchUnits_SwitchToCivilian = 0; - AGM_SwitchUnits_EnableSafeZone = 1; -}; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_addMapFunction.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_addMapFunction.sqf deleted file mode 100644 index f65725aacf..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_addMapFunction.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_addMapFunction - - Author(s): - bux578 - - Description: - Adds a mapClick Eventhandler - - Parameters: - 0: OBJECT - unit - 1: ARRAY - sided - - Returns: - VOID -*/ - -private ["_unit"]; -_unit = _this select 0; - -["theMapClick", "onMapSingleClick", { - [_this, _pos, _shift, _alt] call AGM_SwitchUnits_fnc_handleMapClick; -}, [_unit, _sides]] call BIS_fnc_addStackedEventHandler; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_handleMapClick.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_handleMapClick.sqf deleted file mode 100644 index 642baed1bd..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_handleMapClick.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_handleMapClick - - Author(s): - bux578 - - Description: - Finds the clicked unit - - Parameters: - 0: OBJECT - MapClickEventHandlerArgs - 0: OBJECT - unit to switch to - 1: ARRAY - sides - - Returns: - VOID -*/ - -private ["_args", "_currentPlayerUnit", "_sides", "_pos", "_sideNearest"]; - -_currentPlayerUnit = (_this select 0) select 0; -_sides = (_this select 0) select 1; -_pos = _this select 1; - -_sideNearest = []; - -{ - if ([_x] call AGM_SwitchUnits_fnc_isValidAi && (side group _x in _sides)) then { - _sideNearest pushBack _x; - }; -} forEach (nearestObjects [_pos, ["Man"], 20]); - - -if (count _sideNearest > 0) then { - private ["_switchUnit"]; - - _switchUnit = _sideNearest select 0; - [_currentPlayerUnit, _switchUnit] call AGM_SwitchUnits_fnc_switchUnit; - - openMap false; -}; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_initPlayer.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_initPlayer.sqf deleted file mode 100644 index c3ee6ce7b2..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_initPlayer.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_initPlayer - - Author(s): - bux578 - - Description: - Initializes the player - - Parameters: - 0: OBJECT - player - 1: ARRAY - Array containing selected sides - - Returns: - VOID -*/ - -private ["_playerUnit", "_sides"]; - -_playerUnit = _this select 0; -_sides = _this select 1; - -if (vehicle _playerUnit == _playerUnit) then { - - [_sides] call AGM_SwitchUnits_fnc_markAiOnMap; - - _playerUnit setVariable ["AGM_SwitchUnits_IsPlayerUnit", true]; - _playerUnit allowDamage false; - - AGM_SwitchUnits_OriginalUnit = _playerUnit; - AGM_SwitchUnits_OriginalName = [_playerUnit] call AGM_Core_fnc_getName; - AGM_SwitchUnits_OriginalGroup = group _playerUnit; - - // remove all starting gear of a player - removeAllWeapons _playerUnit; - removeGoggles _playerUnit; - removeHeadgear _playerUnit; - removeVest _playerUnit; - removeAllAssignedItems _playerUnit; - clearAllItemsFromBackpack _playerUnit; - removeBackpack _playerUnit; - _playerUnit linkItem "ItemMap"; - removeUniform _playerUnit; - - [_playerUnit, "AGM_SwitchUnits", true] call AGM_Core_fnc_setForceWalkStatus; - - [_playerUnit, _sides] call AGM_SwitchUnits_fnc_addMapFunction; -}; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_isValidAi.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_isValidAi.sqf deleted file mode 100644 index f91b27ffbe..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_isValidAi.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_isValidAi - - Author(s): - bux578 - - Description: - Checks if AI is a valid target for switching - - Parameters: - 0: OBJECT - unit - - Returns: - VOID -*/ - -private ["_unit"]; - -_unit = _this select 0; - -!([_unit] call AGM_Core_fnc_isPlayer -|| {_unit in playableUnits} -|| {vehicle _unit != _unit} -|| {_unit getVariable ["AGM_SwitchUnits_IsPlayerUnit", false]} -|| {_unit getVariable ["AGM_SwitchUnits_IsPlayerControlled", false]}) diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_markAiOnMap.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_markAiOnMap.sqf deleted file mode 100644 index 05865bc060..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_markAiOnMap.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_markAiOnMap - - Author(s): - bux578 - - Description: - Creates markers for AI units for given sides - Marks players in a different color - - Parameters: - 0: OBJECT - side - - Returns: - VOID -*/ - -private ["_sidesToShow"]; -_sidesToShow = _this select 0; - -_sidesToShow spawn { - - private ["_sides", "_allMarkerNames"]; - _sides = _this; - _allMarkerNames = []; - - while { true } do { - sleep 1.5; - - // delete markers - { - deleteMarkerLocal _x; - } forEach _allMarkerNames; - - // create markers - { - if (([_x] call AGM_SwitchUnits_fnc_isValidAi && (side group _x in _sides)) || (_x getVariable ["AGM_SwitchUnits_IsPlayerControlled", false])) then { - private ["_markerName", "_marker", "_markerColor"]; - - //_markerName = format ["%1", [_x] call AGM_Core_fnc_getName]; - _markerName = str _x; - - _marker = createMarkerLocal [_markerName, position _x]; - _markerName setMarkerTypeLocal "mil_triangle"; - _markerName setMarkerShapeLocal "ICON"; - _markerName setMarkerSizeLocal [0.5,0.7]; - _markerName setMarkerDirLocal getDir _x; - - // commy's one liner magic - _markerColor = format ["Color%1", side group _x]; - - if ((_x getVariable ["AGM_SwitchUnits_IsPlayerControlled", false])) then { - _markerName setMarkerColorLocal "ColorOrange"; - _markerName setMarkerTextLocal (_x getVariable ["AGM_SwitchUnits_PlayerControlledName",""]); - } else { - _markerName setMarkerColorLocal _markerColor; - _markerName setMarkerTextLocal (getText (configFile >> "CfgVehicles" >> typeOf _x >> "displayName")); - }; - - _allMarkerNames pushBack _markerName; - }; - } forEach allUnits; - }; -}; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_module.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_module.sqf deleted file mode 100644 index 43ec26199a..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_module.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_module - - Author(s): - bux578 - - Description: - Initializes the SwitchUnits module - - Parameters: - 0: OBJECT - module logic - 1: ARRAY - list of affected units - 2: BOOLEAN - isActivated - - Returns: - BOOLEAN (Good practice to include one) -*/ - -if !(isServer) exitWith {}; - -_logic = _this select 0; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -AGM_SwitchUnits_Module = true; - -["AGM_SwitchUnits_EnableSwitchUnits", true] call AGM_Core_fnc_setParameter; - -[_logic, "AGM_SwitchUnits_SwitchToWest", "SwitchToWest"] call AGM_Core_fnc_readBooleanParameterFromModule; -[_logic, "AGM_SwitchUnits_SwitchToEast", "SwitchToEast"] call AGM_Core_fnc_readBooleanParameterFromModule; -[_logic, "AGM_SwitchUnits_SwitchToIndependent", "SwitchToIndependent"] call AGM_Core_fnc_readBooleanParameterFromModule; -[_logic, "AGM_SwitchUnits_SwitchToCivilian", "SwitchToCivilian"] call AGM_Core_fnc_readBooleanParameterFromModule; - -[_logic, "AGM_SwitchUnits_EnableSafeZone", "EnableSafeZone"] call AGM_Core_fnc_readBooleanParameterFromModule; -[_logic, "AGM_SwitchUnits_SafeZoneRadius", "SafeZoneRadius"] call AGM_Core_fnc_readNumericParameterFromModule; - -diag_log text "[AGM]: SwitchUnits Module Initialized."; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_nearestPlayers.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_nearestPlayers.sqf deleted file mode 100644 index 04b185c455..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_nearestPlayers.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_nearestPlayers - - Author(s): - bux578 - - Description: - Returns an array of alive players in a given radius around a given location - - Parameters: - 0: POSTION - Center position - 1: NUMBER - Radius - - Returns: - ARRAY - Player units -*/ - -private ["_position", "_radius", "_nearestPlayers"]; - -_position = _this select 0; -_radius = _this select 1; - -_nearestPlayers = []; - -{ - if ([_x] call AGM_Core_fnc_isPlayer && {alive _x}) then { - _nearestPlayers pushBack _x; - }; -} forEach (nearestObjects [_position, ["Man"], _radius]); - - _nearestPlayers diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_switchBack.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_switchBack.sqf deleted file mode 100644 index eba84d57f6..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_switchBack.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_switchBack - - Author(s): - bux578 - - Description: - Switches back to the original player unit - This method needs to be "spawn"ed - - Parameters: - 0: OBJECT - original player unit - 1: OBJECT - respawned unit - - Returns: - VOID -*/ - -private ["_originalPlayerUnit", "_currentUnit"]; -_originalPlayerUnit = _this select 0; -_currentUnit = _this select 1; - -[_originalPlayerUnit] joinSilent AGM_SwitchUnits_OriginalGroup; - -waitUntil {local _originalPlayerUnit}; - -selectPlayer _originalPlayerUnit; - -deleteVehicle _currentUnit; diff --git a/TO_MERGE/agm/SwitchUnits/functions/fn_switchUnit.sqf b/TO_MERGE/agm/SwitchUnits/functions/fn_switchUnit.sqf deleted file mode 100644 index ddb2a1d523..0000000000 --- a/TO_MERGE/agm/SwitchUnits/functions/fn_switchUnit.sqf +++ /dev/null @@ -1,79 +0,0 @@ -/* - Name: AGM_SwitchUnits_fnc_switchUnit - - Author(s): - bux578 - - Description: - Selects the new given player unit - - Parameters: - 0: OBJECT - the unit to switch to - - Returns: - VOID -*/ - -private ["_newUnit"]; - -_newUnit = _this select 1; - -// don't switch to original player units -if (!([_newUnit] call AGM_SwitchUnits_fnc_isValidAi)) exitWith {}; - -_newUnit spawn { - private ["_unit", "_allNearestPlayers", "_oldUnit", "_respawnEhId", "_oldOwner", "_leave"]; - - _unit = _this; - - _leave = false; - - if (AGM_SwitchUnits_EnableSafeZone) then { - - _allNearestPlayers = [position _unit, AGM_SwitchUnits_SafeZoneRadius] call AGM_SwitchUnits_fnc_nearestPlayers; - _nearestEnemyPlayers = [_allNearestPlayers, {((side AGM_SwitchUnits_OriginalGroup) getFriend (side _this) < 0.6) && !(_this getVariable ["AGM_SwitchUnits_IsPlayerControlled", false])}] call AGM_Core_fnc_filter; - - if (count _nearestEnemyPlayers > 0) exitWith { - _leave = true; - }; - }; - - // exitWith doesn't exit past the "if(EnableSafeZone)" block - if (_leave) exitWith { - [localize "STR_AGM_SwitchUnits_TooCloseToEnemy"] call AGM_Core_fnc_displayTextStructured; - }; - - // should switch locality - // This doesn't work anymore, because one's now able to switch to units from a different side - //[_unit] joinSilent group player; - [[_unit, player], "{(_this select 0) setVariable ['AGM_SwitchUnits_OriginalOwner', owner (_this select 0), true]; (_this select 0) setOwner owner (_this select 1)}", 1] call AGM_Core_fnc_execRemoteFnc; - - _oldUnit = player; - waitUntil {sleep 0.2; local _unit}; - - _oldUnit setVariable ["AGM_SwitchUnits_IsPlayerControlled", false, true]; - _oldUnit setVariable ["AGM_SwitchUnits_PlayerControlledName", "", true]; - - _respawnEhId = _unit getVariable ["AGM_SwitchUnits_RespawnEhId", -1]; - if (_respawnEhId != -1) then { - _oldUnit removeEventHandler ["Respawn", _respawnEhId]; - }; - - selectPlayer _unit; - - _unit setVariable ["AGM_SwitchUnits_IsPlayerControlled", true, true]; - _unit setVariable ["AGM_SwitchUnits_PlayerControlledName", AGM_SwitchUnits_OriginalName, true]; - - _respawnEhId = _unit addEventHandler ["Respawn", { - [AGM_SwitchUnits_OriginalUnit, _this select 0] spawn AGM_SwitchUnits_fnc_switchBack; - }]; - _unit setVariable ["AGM_SwitchUnits_RespawnEhId", _respawnEhId, true]; - - // set owner back to original owner - _oldOwner = _oldUnit getVariable["AGM_SwitchUnits_OriginalOwner", -1]; - if (_oldOwner > -1) then { - [[_oldUnit, _oldOwner], "{(_this select 0) setOwner (_this select 1)}", 1] call AGM_Core_fnc_execRemoteFnc; - }; - - [localize "STR_AGM_SwitchUnits_SwitchedUnit"] call AGM_Core_fnc_displayTextStructured; -}; diff --git a/TO_MERGE/cse/f_configuration/CfgFunctions.h b/TO_MERGE/cse/f_configuration/CfgFunctions.h new file mode 100644 index 0000000000..bd875b8a58 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/CfgFunctions.h @@ -0,0 +1,31 @@ +class CfgFunctions { + class CSE { + class Configuration { + file = "cse\cse_f_configuration\functions"; + class addKeyBindingForMenu_f { recompile = 1; }; + class addKeyBindingForAction_f { recompile = 1; }; + class onKeyPressed_f { recompile = 1; }; + class onKeyReleased_f { recompile = 1; }; + class getKeyBindingFromProfile_f { recompile = 1; }; + class saveKeyBindingToProfile_f { recompile = 1; }; + class updateActionKeyBinding_f { recompile = 1; }; + class updateMenuKeyBinding_f { recompile = 1; }; + class updateAllKeyBindings_f { recompile = 1; }; + class settingsMenuUpdateKeyBinding_f { recompile = 1; }; + class onSettingsMenuOpen { recompile = 1; }; + class settingsMenuUpdateList { recompile = 1; }; + class onListBoxShowSelectionChanged { recompile = 1; }; + class settingsMenuUpdateKeyView { recompile = 1; }; + class settingsDefineDetails_f { recompile = 1; }; + class getSettingDetails_f { recompile = 1; }; + class onListBoxKeyBindingChanged { recompile = 1; }; + class onListBoxSettingsChanged { recompile = 1; }; + class getClientSideOptionFromProfile_f { recompile = 1; }; + class addClientSideOptions_f { recompile = 1; }; + class saveClientSideOptionToProfile_f { recompile = 1; }; + class updateClientSideOption_f { recompile = 1; }; + class parseConfigForConfigurations { recompile = 1; }; + class parseModuleForConfigurations { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/CfgHints.h b/TO_MERGE/cse/f_configuration/CfgHints.h new file mode 100644 index 0000000000..924e7d3d1e --- /dev/null +++ b/TO_MERGE/cse/f_configuration/CfgHints.h @@ -0,0 +1,51 @@ +class CfgHints +{ + class Combat_Space_Enhancement + { + displayName = "Combat Space Enhancement"; + class Cse_configure { + displayName = "Configuration"; + displayNameShort = "Configuration"; + description = "You can configure CSE keybindings and settings through the configuration menu."; + tip = "Keybindings and settings are stored in your profile."; + arguments[] = {}; + image = ""; + noImage = true; + }; + class menuKeyBindings_subHint + { + displayName = "Menu Keybindings"; + displayNameShort = "Menu Keybindings"; + description = "Menu %11 will when their key is pressed open a menu."; + tip = "You can hold down the key for a longer period and when released, the menu will close."; + arguments[] = { + {"Keybindings"} + }; + image = ""; + noImage = true; + }; + class actionKeyBindings_subHint + { + displayName = "Action Keybindings"; + displayNameShort = "Action Keybindings"; + description = "Action %11 are used for specific actions performed by the player character."; + tip = "Use Ctrl, Alt or Shift combinations to increase the amount of actions you can bind."; + arguments[] = { + {"Keybindings"} + }; + image = ""; + noImage = true; + }; + class clientSettings + { + displayName = "Client Settings"; + displayNameShort = "Client Settings"; + description = "Client settings do not affect MP gameplay but allows players to customize their gameplay to their likings."; + tip = "If you are having low frames, try turning off some client settings.."; + arguments[] = {}; + image = ""; + noImage = true; + }; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/Combat_Space_Enhancement.h b/TO_MERGE/cse/f_configuration/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..0a763dadf4 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/Combat_Space_Enhancement.h @@ -0,0 +1,9 @@ +class Combat_Space_Enhancement { + class EventHandlers { + class PostInit_EventHandlers { + class cse_f_configuration_handleKeys { + init = " call compile preprocessFile 'cse\cse_f_configuration\displayEventHandler_keys.sqf';"; // [configFile] call cse_fnc_parseConfigForConfigurations; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/GUI.h b/TO_MERGE/cse/f_configuration/GUI.h new file mode 100644 index 0000000000..63cf9a14b3 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/GUI.h @@ -0,0 +1,3 @@ +#include "gui\define.h" +#include "gui\settingsMenu.h" +#include "gui\pauseMenu.h" \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/config.cpp b/TO_MERGE/cse/f_configuration/config.cpp new file mode 100644 index 0000000000..f7a525961a --- /dev/null +++ b/TO_MERGE/cse/f_configuration/config.cpp @@ -0,0 +1,26 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_f_configuration + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"a3_ui_f", "cse_gui"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_f_configuration { + list[] = {"cse_f_configuration"}; + }; + }; +}; + +#include "CfgFunctions.h" +#include "CfgHints.h" +#include "Combat_Space_Enhancement.h" +#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/displayEventHandler_keys.sqf b/TO_MERGE/cse/f_configuration/displayEventHandler_keys.sqf new file mode 100644 index 0000000000..87c4411f4e --- /dev/null +++ b/TO_MERGE/cse/f_configuration/displayEventHandler_keys.sqf @@ -0,0 +1,23 @@ +if (isnil "CSE_F_KEYBINDINGS_MENUS") then { + CSE_F_KEYBINDINGS_MENUS = []; +}; +if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then { + CSE_F_KEYBINDINGS_ACTIONS = []; +}; +if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then { + CSE_F_CLIENT_SIDE_SETTINGS = []; +}; + +CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; +CSE_DISPLAY_MENU = false; +CSE_KEY_RELEASED = false; +CSE_DISABLE_KEY_INPUT_F = false; +CSE_KEY_COMBINATION_PRESSED = [0,0,0,0]; +if (hasInterface) then { + [] spawn { + waitUntil {!isNull player && (player == player) && !(isNull (findDisplay 46))}; + sleep 3; + cse_displayEventHandler_config_keyPressed_f = findDisplay 46 displayAddEventHandler ["keyDown", cse_fnc_onKeyPressed_f ]; + cse_displayEventHandler_config_keyReleaded_f = findDisplay 46 displayAddEventHandler ["keyUp", cse_fnc_onKeyReleased_f]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_addClientSideOptions_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_addClientSideOptions_f.sqf new file mode 100644 index 0000000000..1a4d0a6ce2 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_addClientSideOptions_f.sqf @@ -0,0 +1,25 @@ +/** + * fn_addClientSideOptions_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name", "_possibleValues", "_defaultValue"]; +_name = _this select 0; +_possibleValues = _this select 1; +_defaultValue = _this select 2; +_onChange = _this select 3; + +if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then { + CSE_F_CLIENT_SIDE_SETTINGS = []; +}; + +// missionNamespace setvariable[_name, _defaultValue]; + +CSE_F_CLIENT_SIDE_SETTINGS pushBack [ _name, _possibleValues, _defaultValue, _onChange]; + +[_name, _defaultValue] call _onChange; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForAction_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForAction_f.sqf new file mode 100644 index 0000000000..2ca8011ed6 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForAction_f.sqf @@ -0,0 +1,25 @@ +/** + * fn_addKeyBindingForAction_f.sqf + * @Descr: Add a new action keybinding + * @Author: Glowbal + * + * @Arguments: [name STRING, keybinding ARRAY, action CODE] + * @Return: void + * @PublicAPI: true + */ + +private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"]; +_name = _this select 0; +_keyBinding = _this select 1; +_action = _this select 2; + +_keyCodePressed = _keyBinding select 0; +_shiftPressed = _keyBinding select 1; +_ctrlPressed = _keyBinding select 2; +_altPressed = _keyBinding select 3; + +if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then { + CSE_F_KEYBINDINGS_ACTIONS = []; +}; +CSE_F_KEYBINDINGS_ACTIONS pushBack [ _name, _keyBinding, _action ]; +[_name, "action"] call cse_fnc_saveKeyBindingToProfile_f; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForMenu_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForMenu_f.sqf new file mode 100644 index 0000000000..9cc0a7f20b --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForMenu_f.sqf @@ -0,0 +1,26 @@ +/** + * fn_addKeyBindingForMenu_f.sqf + * @Descr: Add a new menu keybinding + * @Author: Glowbal + * + * @Arguments: [name STRING, keybinding ARRAY, action CODE] + * @Return: void + * @PublicAPI: true + */ + +private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"]; +_name = _this select 0; +_keyBinding = _this select 1; +_action = _this select 2; +_idd = _this select 3; + +_keyCodePressed = _keyBinding select 0; +_shiftPressed = _keyBinding select 1; +_ctrlPressed = _keyBinding select 2; +_altPressed = _keyBinding select 3; + +if (isnil "CSE_F_KEYBINDINGS_MENUS") then { + CSE_F_KEYBINDINGS_MENUS = []; +}; +CSE_F_KEYBINDINGS_MENUS pushBack [_name, _keyBinding, _action, _idd, [false, false] ]; +[_name, "menu"] call cse_fnc_saveKeyBindingToProfile_f; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_getClientSideOptionFromProfile_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_getClientSideOptionFromProfile_f.sqf new file mode 100644 index 0000000000..8584d1e0cf --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_getClientSideOptionFromProfile_f.sqf @@ -0,0 +1,17 @@ +/** + * fn_getClientSideOptionFromProfile_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_default","_settingValue"]; +_name = _this select 0; +_default = _this select 1; + +_settingValue = profileNamespace getvariable ["cse_f_clientSideSetting_"+_name, _default]; + +_settingValue \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_getKeyBindingFromProfile_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_getKeyBindingFromProfile_f.sqf new file mode 100644 index 0000000000..78a1659906 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_getKeyBindingFromProfile_f.sqf @@ -0,0 +1,18 @@ +/** + * fn_getKeyBindingFromProfile_f.sqf + * @Descr: Grab a keybinding settings saved in the profile. + * @Author: Glowbal + * + * @Arguments: [name STRING, type STRING (Can be: Action or Menu), defaultValue ARRAY (Format: [keyCode, shift, ctrl], alt)] + * @Return: ARRAY Format: [keyCode, shift, ctrl, alt] + * @PublicAPI: true + */ + +private ["_name","_default","_keyBinding"]; +_name = _this select 0; +_type = _this select 1; +_default = _this select 2; + +_keyBinding = profileNamespace getvariable ["cse_f_keybinding_"+_type+"_"+_name, _default]; + +_keyBinding \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_getSettingDetails_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_getSettingDetails_f.sqf new file mode 100644 index 0000000000..fedcbfd211 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_getSettingDetails_f.sqf @@ -0,0 +1,44 @@ +/** + * fn_getSettingDetails_f.sqf + * @Descr: Returns the details of current setting + * @Author: Glowbal + * + * @Arguments: [name STRING, type STRING] + * @Return: ARRAY Array with the current settings + * @PublicAPI: false + */ + +private ["_name","_type", "_title","_desc", "_return"]; +_name = _this select 0; +_type = _this select 1; + +_return = [_name,""]; +if (isnil "CSE_SETTINGS_MENUS_DETAILS_F") then { + CSE_SETTINGS_MENUS_DETAILS_F = []; + CSE_SETTINGS_ACTIONS_DETAILS_F = []; + CSE_SETTINGS_CLIENTSIDE_DETAILS_F = []; +}; + +if (_type == "menu") then { + { + if (_name == (_x select 0)) exitwith { + _return = [_x select 1, _x select 2]; + }; + }foreach CSE_SETTINGS_MENUS_DETAILS_F; +} else { + if (_type == "action") then { + { + if (_name == (_x select 0)) exitwith { + _return = [_x select 1, _x select 2]; + }; + }foreach CSE_SETTINGS_ACTIONS_DETAILS_F; + } else { + { + if (_name == (_x select 0)) exitwith { + _return = [_x select 1, _x select 2, _x select 3]; + }; + }foreach CSE_SETTINGS_CLIENTSIDE_DETAILS_F; + }; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onKeyPressed_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onKeyPressed_f.sqf new file mode 100644 index 0000000000..5a77824fc7 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onKeyPressed_f.sqf @@ -0,0 +1,105 @@ +/** + * fn_onKeyPressed_f.sqf + * @Descr: Executed on a key pressed. Handles all CSE keybindings + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +// Returns the control, the keyboard code and the state of Shift, Ctrl and Alt. +private ["_control","_var","_keyBinding","_keyCodePressed","_shiftPressed","_ctrlPressed","_altPressed","_name","_onPressed","_idd", "_state","_STARTINGTIME","_handle", "_returnOnPressed"]; +_control = _this select 0; +_keyCodePressed = _this select 1; +_shiftPressed = _this select 2; +_ctrlPressed = _this select 3; +_altPressed = _this select 4; + +if (missionNamespace getVariable ['CSE_SETTINGS_MENU_OPEN', false]) exitwith { + false; +}; +_returnOnPressed = false; +if ((findDisplay 46) == _control && _keyCodePressed != 0) then { + if ([player] call cse_fnc_canInteract) then { + { + _name = _x select 0; + _keyBinding = _x select 1; + _onPressed = _x select 2; + _idd = _x select 3; + _state = _x select 4; + + _shiftBinding = _keyBinding select 1; + _ctrlBinding = _keyBinding select 2; + _altBinding = _keyBinding select 3; + + if ((_keyBinding select 0) == _keyCodePressed) then { + + if ((_shiftBinding == 0) && _shiftPressed) exitwith {}; + if ((_shiftBinding == 1) && !_shiftPressed) exitwith {}; + + if ((_ctrlBinding == 0) && _ctrlPressed) exitwith {}; + if ((_ctrlBinding == 1) && !_ctrlPressed) exitwith {}; + + if ((_altBinding == 0) && _altPressed) exitwith {}; + if ((_altBinding == 1) && !_altPressed) exitwith {}; + + if (CSE_DISPLAY_MENU && !CSE_KEY_RELEASED) exitwith {}; + if (CSE_DISPLAY_MENU && CSE_KEY_RELEASED) exitwith { closeDialog _idd;}; + + if (dialog) exitwith { closeDialog 0; }; + _state set [ 0, true]; // activated/open , not released + _state set [ 1, false]; + CSE_KEY_COMBINATION_PRESSED = _keyBinding; + CSE_DISPLAY_MENU = true; + CSE_KEY_RELEASED = false; + + _handle = [_forEachIndex, time] spawn { + _menu = CSE_F_KEYBINDINGS_MENUS select (_this select 0); + _state = _menu select 4; + waituntil{CSE_KEY_RELEASED || (time - ((_this select 1) ) > (0.25 * accTime))}; + if (!CSE_KEY_RELEASED) then { + waituntil {CSE_KEY_RELEASED}; + closeDialog (_menu select 3); + } else { + CSE_KEY_RELEASED = true; + }; + waituntil {!dialog}; + _state set [ 0, false]; + CSE_DISPLAY_MENU = false; + }; + _returnOnPressed = _this call _onPressed; + }; + }foreach CSE_F_KEYBINDINGS_MENUS; + + if (isNil "_returnOnPressed") then { + { + _name = _x select 0; + _keyBinding = _x select 1; + _onPressed = _x select 2; + + _shiftBinding = _keyBinding select 1; + _ctrlBinding = _keyBinding select 2; + _altBinding = _keyBinding select 3; + + if ((_keyBinding select 0) == _keyCodePressed) then { + if ((_shiftBinding == 0) && _shiftPressed) exitwith {}; + if ((_shiftBinding == 1) && !_shiftPressed) exitwith {}; + + if ((_ctrlBinding == 0) && _ctrlPressed) exitwith {}; + if ((_ctrlBinding == 1) && !_ctrlPressed) exitwith {}; + + if ((_altBinding == 0) && _altPressed) exitwith {}; + if ((_altBinding == 1) && !_altPressed) exitwith {}; + + CSE_KEY_COMBINATION_PRESSED = _keyBinding; + _returnOnPressed = _this call _onPressed; + }; + }foreach CSE_F_KEYBINDINGS_ACTIONS; + }; + }; +}; +if (isnil "_returnOnPressed") exitwith {false}; +//_returnOnPressed +false; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onKeyReleased_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onKeyReleased_f.sqf new file mode 100644 index 0000000000..21010e4beb --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onKeyReleased_f.sqf @@ -0,0 +1,33 @@ +/** + * fn_onKeyReleased_f.sqf + * @Descr: Handles all keyreleased from CSE + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +// _this = the control, the keyboard code and the state of Shift, Ctrl and Alt. + + +if (CSE_DISABLE_KEY_INPUT_F) exitwith { + (( _this select 1) > 0); +}; + +if ((findDisplay 46) == (_this select 0)) then { + _keyCodePressed = _this select 1; + { + _keyBinding = _x select 1; + _state = _x select 4; + if ((_keyBinding select 0) == _keyCodePressed) then { + if (!(_state select 0) ) exitwith {}; + _state set [ 0, false]; + CSE_KEY_RELEASED = true; + }; + }foreach CSE_F_KEYBINDINGS_MENUS; +} else { + false; +}; +false; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxKeyBindingChanged.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxKeyBindingChanged.sqf new file mode 100644 index 0000000000..a0bd859d1e --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxKeyBindingChanged.sqf @@ -0,0 +1,54 @@ +/** + * fn_onListBoxKeyBindingChanged.sqf + * @Descr: called when the listbox keybinding has changed. Updates the configuration menu with new information. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_settingsMenu","_ctrlSelected","_ctrlPressed","_ctrlTextLabel","_keyCodePressed","_shiftSelected","_shiftPressed","_altSelected","_altPressed","_possibleOptions",'_keyBinding',"_fnc","_collection"]; +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; + +_shiftSelected = lbCurSel 400; +_ctrlSelected = lbCurSel 401; +_altSelected = lbCurSel 402; + +_possibleOptions = [0,1,2]; + +if (_shiftSelected < 0) then { + _shiftSelected = 0; +}; +if (_ctrlSelected < 0) then { + _ctrlSelected = 0; +}; +if (_altSelected < 0) then { + _altSelected = 0; +}; + +_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {cse_fnc_updateMenuKeyBinding_F}; + case "action": {cse_fnc_updateActionKeyBinding_F}; + default {{}}; +}; +_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {CSE_F_KEYBINDINGS_MENUS}; + case "action": {CSE_F_KEYBINDINGS_ACTIONS}; + default {[]}; +}; +if (count _collection > 0) then { + _selectedSetting = (lbCurSel (_settingsMenu displayCtrl 200)); + if (_selectedSetting > (count _collection)) then { + _selectedSetting = count _collection - 1; + }; + if (_selectedSetting < 0) then { + _selectedSetting = 0; + }; + _nameOfSetting = (_collection select _selectedSetting) select 0; + _keyBinding = [_nameOfSetting,CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F,[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F; + _keyBinding = [_keyBinding select 0, _possibleOptions select _shiftSelected, _possibleOptions select _ctrlSelected, _possibleOptions select _altSelected]; + [_nameOfSetting,_keyBinding] call _func; + + [false] call cse_fnc_settingsMenuUpdateList; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxSettingsChanged.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxSettingsChanged.sqf new file mode 100644 index 0000000000..dc95a8fb89 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxSettingsChanged.sqf @@ -0,0 +1,40 @@ +/** + * fn_onListBoxSettingsChanged.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_settingsMenu", "_ctrlTextLabel", "_optionSelected", "_func", "_collection", "_selectedSetting", "_nameOfSetting"]; +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; + +_optionSelected = lbCurSel 400; + +if (_optionSelected < 0) then { + _optionSelected = 0; +}; + +_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "option": {cse_fnc_updateClientSideOption_F}; + default {{}}; +}; +_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "option": {CSE_F_CLIENT_SIDE_SETTINGS}; + default {[]}; +}; +if !(_collection isEqualTo []) then { + _selectedSetting = (lbCurSel (_settingsMenu displayCtrl 200)); + if (_selectedSetting > (count _collection)) then { + _selectedSetting = count _collection - 1; + }; + if (_selectedSetting < 0) then { + _selectedSetting = 0; + }; + _nameOfSetting = (_collection select _selectedSetting) select 0; + [_nameOfSetting, _optionSelected] call _func; + [_nameOfSetting, _optionSelected] call ((_collection select _selectedSetting) select 3); + [false] call cse_fnc_settingsMenuUpdateList; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxShowSelectionChanged.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxShowSelectionChanged.sqf new file mode 100644 index 0000000000..60ce5c91e1 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onListBoxShowSelectionChanged.sqf @@ -0,0 +1,55 @@ +/** + * fn_onListBoxShowSelectionChanged.sqf + * @Descr: called when the listbox selection has changed. Updates configuration menu information + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + private ["_first", "_settingsMenu", "_ctrlLb", "_ctrlLbShow"]; +_first = (_this select 0); + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; +_ctrlLbShow = _settingsMenu displayCtrl 100; +if (isnil "_first") then { + _ctrlLbShow lbSetCurSel (_this select 1); +}; + +if ((_this select 1) > -1) then { + private ["_options"]; + _options = ["menu","action", "option", "color"]; + CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F = _options select (_this select 1); + [true] call cse_fnc_settingsMenuUpdateList; + _textOptions = ["Menu Keybindings", "Action Keybindings", "Client Settings"]; + ctrlSetText [13, ("Current selected settings list: " + (_textOptions select (_this select 1)))]; + if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F == "color") exitwith {}; + + if ((_this select 1) > 1) then { + (_settingsMenu displayCtrl 400) ctrlShow true; + lbClear 400; + (_settingsMenu displayCtrl 401) ctrlShow false; + (_settingsMenu displayCtrl 402) ctrlShow false; + + (_settingsMenu displayCtrl 301) ctrlSetText "Value:"; + (_settingsMenu displayCtrl 302) ctrlSetText ""; + (_settingsMenu displayCtrl 303) ctrlSetText ""; + + } else { + (_settingsMenu displayCtrl 400) ctrlShow true; + LbClear 400; + _ctrlLb = _settingsMenu displayCtrl 400; + _ctrlLb lbadd "No"; + _ctrlLb lbadd "Yes"; + _ctrlLb lbadd "Ignore"; + + (_settingsMenu displayCtrl 401) ctrlShow true; + (_settingsMenu displayCtrl 402) ctrlShow true; + + (_settingsMenu displayCtrl 301) ctrlSetText "Shift:"; + (_settingsMenu displayCtrl 302) ctrlSetText "Ctrl:"; + (_settingsMenu displayCtrl 303) ctrlSetText "Alt:"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_onSettingsMenuOpen.sqf b/TO_MERGE/cse/f_configuration/functions/fn_onSettingsMenuOpen.sqf new file mode 100644 index 0000000000..8dc2352e25 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_onSettingsMenuOpen.sqf @@ -0,0 +1,104 @@ +/** + * fn_onSettingsMenuOpen.sqf + * @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + + +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; +_ctrlLbShow = _settingsMenu displayCtrl 100; +_ctrlLbShow lbadd "Menu Keybindings"; +_ctrlLbShow lbadd "Action Keybindings"; +_ctrlLbShow lbadd "Client Settings"; +_ctrlLbShow lbadd "Colors"; +_ctrlLbShow lbSetCurSel 0; + + +(_settingsMenu displayCtrl 1003) ctrlEnable false; +//lbadd[100,"Other settings"]; +CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; +_settingsMenu displayAddEventHandler ["KeyDown", { + _keyCodePressed = _this select 1; + _shiftPressed = _this select 2; + _ctrlPressed = _this select 3; + _altPressed = _this select 4; + _var = uiNamespace getVariable 'cse_settingsMenu'; + if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then { + if !(isnil "_var") then { + if (CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then { + if (_keyCodePressed > 1) then { + [_keyCodePressed,_shiftPressed, _ctrlPressed, _altPressed] call cse_fnc_settingsMenuUpdateKeyBinding_F; + true; + } else { + false; + }; + } else { + false; + }; + } else { + false; + }; + } else { + false; + }; + }]; + +_settingsMenu displayAddEventHandler ["KeyUp", { + _keyCodePressed = _this select 1; + _shiftPressed = _this select 2; + _ctrlPressed = _this select 3; + _altPressed = _this select 4; + _var = uiNamespace getVariable 'cse_settingsMenu'; + if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then { + if !(isnil "_var") then { + if (CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then { + if (_keyCodePressed > 1) then { + CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; + true; + } else { + false; + }; + } else { + false; + }; + } else { + false; + }; + } else { + false; + }; + }]; + +(_settingsMenu displayCtrl 200) ctrlSetEventHandler ["LBSelChanged", "_this call cse_fnc_settingsMenuUpdateKeyView;"]; + +_textOptions = ["Menu Keybindings", "Action Keybindings"]; +(_settingsMenu displayCtrl 13) ctrlSetText ("Current selected settings list: " + (_textOptions select 0)); + +_ctrlLb = _settingsMenu displayCtrl 400; +_ctrlLb lbadd "No"; +_ctrlLb lbadd "Yes"; +_ctrlLb lbadd "Ignore"; +_ctrlLb ctrlSetEventHandler ["LBSelChanged", "if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != 'option') then { _this call cse_fnc_onListBoxKeyBindingChanged; } else { _this call cse_fnc_onListBoxSettingsChanged; };"]; + +_ctrlLb = _settingsMenu displayCtrl 401; +_ctrlLb lbadd "No"; +_ctrlLb lbadd "Yes"; +_ctrlLb lbadd "Ignore"; +_ctrlLb ctrlSetEventHandler ["LBSelChanged", " _this call cse_fnc_onListBoxKeyBindingChanged;"]; + +_ctrlLb = _settingsMenu displayCtrl 402; +_ctrlLb lbadd "No"; +_ctrlLb lbadd "Yes"; +_ctrlLb lbadd "Ignore"; +_ctrlLb ctrlSetEventHandler ["LBSelChanged", " _this call cse_fnc_onListBoxKeyBindingChanged;"]; + +CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; +CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F = "menu"; +[true] call cse_fnc_settingsMenuUpdateList; + +(_settingsMenu displayCtrl 200) lbSetCurSel 0; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_parseConfigForConfigurations.sqf b/TO_MERGE/cse/f_configuration/functions/fn_parseConfigForConfigurations.sqf new file mode 100644 index 0000000000..2ea37d1935 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_parseConfigForConfigurations.sqf @@ -0,0 +1,22 @@ +/** + * fn_parseConfigForConfigurations.sqf + * @Descr: Collect all configurations defined in CfgModules + * @Author: Glowbal + * + * @Arguments: [config CONFIG] + * @Return: nil + * @PublicAPI: false + */ + +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +private ["_config","_cfgRoot","_amountOfClasses","_i","_moduleName","_configurationClass","_nOfConfgClasses","_j","_configuration","_configurationName","_title","_desc","_defaultValue","_code","_idd","_availableSettings","_valuesCfg","_nOfValues","_k"]; +_config = _this select 0; + +_cfgRoot = (_config >> "Combat_Space_Enhancement" >> "CfgModules"); +_amountOfClasses = count _cfgRoot; +for [{_i=0}, {_i < _amountOfClasses}, {_i=_i+1}] do { + [ConfigName (_cfgRoot select _i)] call cse_fnc_parseModuleForConfigurations; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_parseModuleForConfigurations.sqf b/TO_MERGE/cse/f_configuration/functions/fn_parseModuleForConfigurations.sqf new file mode 100644 index 0000000000..5271e73173 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_parseModuleForConfigurations.sqf @@ -0,0 +1,63 @@ +/** + * fn_parseModuleForConfigurations.sqf + * @Descr: Collects all configurations defined in the CfgModules entry + * @Author: Glowbal + * + * @Arguments: [cfgModulesName STRING (Name of the module defined in CfgModules)] + * @Return: nil + * @PublicAPI: false + */ + +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +private ["_config","_cfgRoot","_amountOfClasses","_i","_moduleName","_configurationClass","_nOfConfgClasses","_j","_configuration","_configurationName","_title","_desc","_defaultValue","_code","_idd","_availableSettings","_valuesCfg","_nOfValues","_k"]; +_moduleName = _this select 0; +_cfgRoot = (configFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName); + +if (isClass (_cfgRoot >> "Configurations")) then { + _configurationClass = (_cfgRoot >> "Configurations"); + _nOfConfgClasses = count _configurationClass; + for [{_j=0}, {_j < _nOfConfgClasses}, {_j=_j+1}] do { + _configuration = _configurationClass select _j; + _configurationName = ConfigName _configuration; + + _title = [_configuration, "title", ""] call BIS_fnc_returnConfigEntry; + _desc = [_configuration, "description", ""] call BIS_fnc_returnConfigEntry; + + switch (getNumber(_configuration >> "type")) do { + case MENU_KEYBINDING: { + _defaultValue = [_configuration, "value", [0,0,0,0]] call BIS_fnc_returnConfigEntry; + _code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onPressed", ""] call BIS_fnc_returnConfigEntry) + "};"); + _idd = [_configuration, "idd", 0] call BIS_fnc_returnConfigEntry; + [format["name: %1, default %2, code %3, idd %4, title %5, desc %6",_configurationName, _defaultValue, _code, _idd, _title, _desc]] call cse_fnc_debug; + [_configurationName, ([_configurationName,"menu",_defaultValue] call cse_fnc_getKeyBindingFromProfile_F), _code, _idd] call cse_fnc_addKeyBindingForMenu_F; + [_configurationName,"menu", _title, _desc] call cse_fnc_settingsDefineDetails_F; + }; + case ACTION_KEYBINDING: { + _defaultValue = [_configuration, "value", [0,0,0,0]] call BIS_fnc_returnConfigEntry; + _code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onPressed", ""] call BIS_fnc_returnConfigEntry) + "};"); + [format["name: %1, default %2, code %3, title %4, desc %5",_configurationName, _defaultValue, _code, _title, _desc]] call cse_fnc_debug; + [_configurationName, ([_configurationName,"action",_defaultValue] call cse_fnc_getKeyBindingFromProfile_F), _code] call cse_fnc_addKeyBindingForAction_F; + [_configurationName,"action", _title, _desc] call cse_fnc_settingsDefineDetails_F; + + }; + case CLIENT_SETTING: { + _defaultValue = [_configuration, "value", 0] call BIS_fnc_returnConfigEntry; + _code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onChanged", ""] call BIS_fnc_returnConfigEntry) + "};"); + _availableSettings = []; + _valuesCfg = (_configuration >> "Values"); + if (isClass _valuesCfg) then { + _nOfValues = count _valuesCfg; + for [{_k=0}, {_k < _amountOfClasses}, {_k=_k+1}] do { + if (isClass (_valuesCfg select _k)) then { + _availableSettings pushback (configName (_valuesCfg select _k)); + }; + }; + }; + }; + default {}; // invalid, do nothing + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_saveClientSideOptionToProfile_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_saveClientSideOptionToProfile_f.sqf new file mode 100644 index 0000000000..04fb6ebde3 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_saveClientSideOptionToProfile_f.sqf @@ -0,0 +1,25 @@ +/** + * fn_saveClientSideOptionToProfile_f.sqf + * @Descr: Save the clientside option to the profile. + * @Author: Glowbal + * + * @Arguments: [name STRING (Name of setting)] + * @Return: BOOL True if saved. + * @PublicAPI: false + */ + +private ["_name","_nameSelected", "_saved"]; +_name = _this select 0; +if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then { + CSE_F_CLIENT_SIDE_SETTINGS = []; +}; +_saved = false; +{ + _nameSelected = _x select 0; + if (_nameSelected == _name) exitwith { + profileNamespace setvariable ["cse_f_clientSideSetting_"+_name, _x select 2]; + _saved = true; + }; +}foreach CSE_F_CLIENT_SIDE_SETTINGS; + +_saved \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_saveKeyBindingToProfile_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_saveKeyBindingToProfile_f.sqf new file mode 100644 index 0000000000..fbc7f2a593 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_saveKeyBindingToProfile_f.sqf @@ -0,0 +1,41 @@ +/** + * fn_saveKeyBindingToProfile_f.sqf + * @Descr: Saves a keybinding to the profile + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_nameSelected", "_saved", "_type"]; +_name = _this select 0; +_type = _this select 1; +if (isnil "CSE_F_KEYBINDINGS_MENUS") then { + CSE_F_KEYBINDINGS_MENUS = []; +}; +if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then { + CSE_F_KEYBINDINGS_ACTIONS = []; +}; +_saved = false; +if (_type == "menu") then { + { + _nameSelected = _x select 0; + if (_nameSelected == _name) exitwith { + profileNamespace setvariable ["cse_f_keybinding_menu_"+_name, _x select 1]; + _saved = true; + }; + }foreach CSE_F_KEYBINDINGS_MENUS; +} else { + if (_type == "action") then { + { + _nameSelected = _x select 0; + if (_nameSelected == _name) exitwith { + profileNamespace setvariable ["cse_f_keybinding_action_"+_name, _x select 1]; + _saved = true; + }; + }foreach CSE_F_KEYBINDINGS_ACTIONS; + }; +}; + +_saved \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_settingsDefineDetails_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_settingsDefineDetails_f.sqf new file mode 100644 index 0000000000..de6762d30c --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_settingsDefineDetails_f.sqf @@ -0,0 +1,33 @@ +/** + * fn_settingsDefineDetails_f.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_type", "_title","_descr"]; +_name = _this select 0; +_type = _this select 1; +_title = _this select 2; +_descr = _this select 3; + +if (isnil "CSE_SETTINGS_MENUS_DETAILS_F") then { + CSE_SETTINGS_MENUS_DETAILS_F = []; + CSE_SETTINGS_ACTIONS_DETAILS_F = []; + CSE_SETTINGS_CLIENTSIDE_DETAILS_F = []; +}; + +if (_type == "menu") then { + CSE_SETTINGS_MENUS_DETAILS_F pushback [_name, _title, _descr]; +} else { + if (_type == "action") then { + CSE_SETTINGS_ACTIONS_DETAILS_F pushback [_name, _title, _descr]; + } else { + if (_type == "option") then { + CSE_SETTINGS_CLIENTSIDE_DETAILS_F pushback [_name, _title, _descr]; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyBinding_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyBinding_f.sqf new file mode 100644 index 0000000000..2df8a134a8 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyBinding_f.sqf @@ -0,0 +1,65 @@ +/** + * fn_settingsMenuUpdateKeyBinding_f.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_settingsMenu","_ctrlSelected","_ctrlPressed","_ctrlTextLabel","_keyCodePressed","_shiftSelected","_shiftPressed","_altSelected","_altPressed","_possibleOptions",'_keyBinding',"_fnc","_collection"]; +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; + _ctrlTextLabel = (_settingsMenu displayCtrl 300); + +_keyCodePressed = _this select 0; +_shiftPressed = _this select 1; +_ctrlPressed = _this select 2; +_altPressed = _this select 3; + + ctrlSetText [252, '']; +//(_settingsMenu displayCtrl 300) ctrlSetText ("Key: " + (keyName _keyCodePressed)); + +_shiftSelected = lbCurSel 400; +_ctrlSelected = lbCurSel 401; +_altSelected = lbCurSel 402; + +_possibleOptions = [0,1,2]; + +if (_shiftSelected < 0) then { + _shiftSelected = 0; +}; +if (_ctrlSelected < 0) then { + _ctrlSelected = 0; +}; +if (_altSelected < 0) then { + _altSelected = 0; +}; + +_keyBinding = [_keyCodePressed, _possibleOptions select _shiftSelected, _possibleOptions select _ctrlSelected, _possibleOptions select _altSelected]; +//CSE_CURRENT_KEYBINDING_SETTING_NAME_F = ["cse_sys_weaponRestAction","action"]; + +_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {cse_fnc_updateMenuKeyBinding_F}; + case "action": {cse_fnc_updateActionKeyBinding_F}; + case "option": {{}}; + default {{}}; +}; +_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {CSE_F_KEYBINDINGS_MENUS}; + case "action": {CSE_F_KEYBINDINGS_ACTIONS}; + case "option": {CSE_F_CLIENT_SIDE_SETTINGS}; + default {[]}; +}; +if (count _collection > 0) then { + _selectedSetting = (lbCurSel 200); + if (_selectedSetting > (count _collection)) then { + _selectedSetting = count _collection - 1; + }; + if (_selectedSetting < 0) then { + _selectedSetting = 0; + }; + _nameOfSetting = (_collection select _selectedSetting) select 0; + [_nameOfSetting,_keyBinding] call _func; + [true] call cse_fnc_settingsMenuUpdateList; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyView.sqf b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyView.sqf new file mode 100644 index 0000000000..a355f8f92e --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyView.sqf @@ -0,0 +1,74 @@ +/** + * fn_settingsMenuUpdateKeyView.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_setting","_ctrlList","_collection","_settingsMenu", "_keybinding","_keyCode","_shiftPressed","_altPressed","_ctrlPressed"]; +disableSerialization; +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; +_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {CSE_F_KEYBINDINGS_MENUS}; + case "action": {CSE_F_KEYBINDINGS_ACTIONS}; + case "option": {CSE_F_CLIENT_SIDE_SETTINGS}; + default {[]}; +}; + + +if (count _collection > 0) then { + _selectedSetting = (lbCurSel _ctrlList); + if (_selectedSetting > (count _collection)) then { + _selectedSetting = count _collection - 1; + }; + + if (_selectedSetting < 0) exitwith { + _selectedSetting = 0; + }; + _setting = _collection select _selectedSetting; + + _details = [_setting select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F; + (_settingsMenu displayCtrl 250) ctrlSetText (_details select 0); + (_settingsMenu displayCtrl 251) ctrlSetText (_details select 1); + + if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then { + _keybinding = _setting select 1; + + _keyCode = _keybinding select 0; + _shiftPressed = _keybinding select 1; + _ctrlPressed = _keybinding select 2; + _altPressed = _keybinding select 3; + + _keyBindingText = keyName _keyCode; + if (_keyBindingText == '""') then { + _keyBindingText = "No key assigned"; + }; + (_settingsMenu displayCtrl 300) ctrlSetText ("Key: " + _keyBindingText); + + lbClear 400; + lbadd [400, "No"]; + lbadd [400, "Yes"]; + lbadd [400, "Ignore"]; + (_settingsMenu displayCtrl 400) lbSetCurSel _shiftPressed; + (_settingsMenu displayCtrl 401) lbSetCurSel _ctrlPressed; + (_settingsMenu displayCtrl 402) lbSetCurSel _altPressed; + } else { + _possibleValues = _setting select 1; + _settingsValue = _setting select 2; + + lbClear 400; + + _settingsText = (_possibleValues select _settingsValue); // expecting: value [[any, TEXT (DESCRIPTION)]] + (_settingsMenu displayCtrl 300) ctrlSetText ("Setting: " + _settingsText); + { + lbAdd [400, _x]; + }foreach _possibleValues; + + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateList.sqf b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateList.sqf new file mode 100644 index 0000000000..b6d950e240 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateList.sqf @@ -0,0 +1,56 @@ +/** + * fn_settingsMenuUpdateList.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_settingsMenu","_ctrlList","_collection","_keyBindingText","_keybinding", "_updateKeyView"]; +disableSerialization; + +_updateKeyView = [_this, 0, true, [true]] call BIS_fnc_Param; + +_settingsMenu = uiNamespace getVariable 'cse_settingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; +_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do { + case "menu": {CSE_F_KEYBINDINGS_MENUS}; + case "action": {CSE_F_KEYBINDINGS_ACTIONS}; + case "option": {CSE_F_CLIENT_SIDE_SETTINGS}; + default {[]}; +}; + +lbclear _ctrlList; +if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then { + { + _keybinding = (_x select 1); + _keyBindingText = keyName (_keybinding select 0); + if (_keyBindingText == '""') then { + _keyBindingText = ""; + } else { + if ((_keybinding select 1) == 1) then { + _keyBindingText = _keyBindingText + " + shift"; + }; + if ((_keybinding select 2) == 1) then { + _keyBindingText = _keyBindingText + " + ctrl"; + }; + if ((_keybinding select 3) == 1) then { + _keyBindingText = _keyBindingText + " + alt"; + }; + }; + _ctrlList lbadd (([_x select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F) select 0); + _ctrlList lbadd (_keyBindingText); + }foreach _collection; +} else { + { + _settingsText = ((_x select 1) select (_x select 2)); + _ctrlList lbadd (([_x select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F) select 0); + _ctrlList lbadd (_settingsText); + }foreach _collection; + +}; +if (_updateKeyView) then { + [] call cse_fnc_settingsMenuUpdateKeyView; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_updateActionKeybinding_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_updateActionKeybinding_f.sqf new file mode 100644 index 0000000000..f73ebd71be --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_updateActionKeybinding_f.sqf @@ -0,0 +1,24 @@ +/** + * fn_updateActionKeybinding_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"]; +_name = _this select 0; +_keyBinding = _this select 1; + +if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then { + CSE_F_KEYBINDINGS_ACTIONS = []; +}; +{ + if ((_x select 0) == _name) exitwith { + _x set [ 1, _keyBinding]; + }; +}foreach CSE_F_KEYBINDINGS_ACTIONS; + +[_name,"action"] call cse_fnc_saveKeyBindingToProfile_F; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_updateAllKeyBindings_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_updateAllKeyBindings_f.sqf new file mode 100644 index 0000000000..9a5efedf6f --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_updateAllKeyBindings_f.sqf @@ -0,0 +1,23 @@ +/** + * fn_updateAllKeyBindings_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_name","_currentKeyBinding"]; +{ + _name = _x select 0; + _currentKeyBinding = _x select 1; + _x set [1,([_name, _currentKeyBinding, "menu"] call cse_fnc_getKeyBindingFromProfile_F)]; +}foreach CSE_F_KEYBINDINGS_MENUS; + +{ + _name = _x select 0; + _currentKeyBinding = _x select 1; + _x set [1,([_name, _currentKeyBinding, "action"] call cse_fnc_getKeyBindingFromProfile_F)]; +}foreach CSE_F_KEYBINDINGS_ACTIONS; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_updateClientSideOption_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_updateClientSideOption_f.sqf new file mode 100644 index 0000000000..84a3e771cf --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_updateClientSideOption_f.sqf @@ -0,0 +1,24 @@ +/** + * fn_updateClientSideOption_f.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"]; +_name = _this select 0; +_keyBinding = _this select 1; + +if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then { + CSE_F_CLIENT_SIDE_SETTINGS = []; +}; +{ + if ((_x select 0) == _name) exitwith { + _x set [ 2, _keyBinding]; + }; +}foreach CSE_F_CLIENT_SIDE_SETTINGS; + +[_name] spawn cse_fnc_saveClientSideOptionToProfile_F; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/functions/fn_updateMenuKeyBinding_f.sqf b/TO_MERGE/cse/f_configuration/functions/fn_updateMenuKeyBinding_f.sqf new file mode 100644 index 0000000000..e6137e1444 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/functions/fn_updateMenuKeyBinding_f.sqf @@ -0,0 +1,24 @@ +/** + * fn_updateMenuKeyBinding_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"]; +_name = _this select 0; +_keyBinding = _this select 1; + +if (isnil "CSE_F_KEYBINDINGS_MENUS") then { + CSE_F_KEYBINDINGS_MENUS = []; +}; +{ + if ((_x select 0) == _name) exitwith { + _x set [ 1, _keyBinding]; + }; +}foreach CSE_F_KEYBINDINGS_MENUS; + +[_name,"menu"] call cse_fnc_saveKeyBindingToProfile_F; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/gui/define.h b/TO_MERGE/cse/f_configuration/gui/define.h new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/f_configuration/gui/define.h @@ -0,0 +1,797 @@ + +#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/f_configuration/gui/pauseMenu.h b/TO_MERGE/cse/f_configuration/gui/pauseMenu.h new file mode 100644 index 0000000000..c7ff74ef59 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/gui/pauseMenu.h @@ -0,0 +1,46 @@ +class CSE_Open_SettingsMenu_BtnBase : cse_gui_buttonBase { + idc = -1; + text = "Configure [CSE]"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; + w = "14 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "(findDisplay 49) closeDisplay 0; createDialog 'cse_settingsMenu';"; +}; + +class RscStandardDisplay; +class RscDisplayMPInterrupt: RscStandardDisplay { + class controls { + class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {}; + }; +}; +class RscDisplayInterruptEditorPreview: RscStandardDisplay { + class controls { + class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {}; + }; +}; +class RscDisplayInterrupt: RscStandardDisplay { + class controls { + class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {}; + }; +}; +class RscDisplayInterruptEditor3D: RscStandardDisplay { + class controls { + class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/gui/settingsMenu.h b/TO_MERGE/cse/f_configuration/gui/settingsMenu.h new file mode 100644 index 0000000000..66d5532389 --- /dev/null +++ b/TO_MERGE/cse/f_configuration/gui/settingsMenu.h @@ -0,0 +1,259 @@ +class cse_settingsMenu { + idd = 145246; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_settingsMenu', _this select 0]; [] call cse_fnc_onSettingsMenuOpen; ['cse_settingsMenu', true] call cse_fnc_gui_blurScreen;missionNamespace setVariable ['CSE_SETTINGS_MENU_OPEN', true];"; + onUnload = "uiNamespace setVariable ['cse_settingsMenu', nil]; saveProfileNamespace; ['cse_settingsMenu', false] call cse_fnc_gui_blurScreen; missionNamespace setVariable ['CSE_SETTINGS_MENU_OPEN', nil];"; + class controlsBackground { + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class LeftBackground: CenterBackground { + y = "4.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "12.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "25 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class RightBackground: LeftBackground { + x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + w = "12.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "Configure [CSE]"; + }; + + class actionClose : cse_gui_buttonBase { + idc = 10; + text = "Close"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((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)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "closedialog 0;"; + }; + class actionUnassign: actionClose { + idc = 11; + text = "Unassign"; + x = "33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + action = "[0, 0, 0, 0] call cse_fnc_settingsMenuUpdateKeyBinding_F;"; + }; + + class labelShow : cse_gui_staticBase { + idc = 12; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.3 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Show:"; + }; + class labelShow2: cse_gui_staticBase { + idc = 13; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.4 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + }; + + class selectionAction_1 : cse_gui_buttonBase { + idc = 1000; + text = "Menus"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "9.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + 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 = "[nil, 0] call cse_fnc_onListBoxShowSelectionChanged;"; + }; + class selectionAction_2 : selectionAction_1 { + idc = 1001; + text = "Actions"; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "[nil, 1] call cse_fnc_onListBoxShowSelectionChanged;"; + }; + class selectionAction_3 : selectionAction_1 { + idc = 1002; + text = "Settings"; + x = "20 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "[nil, 2] call cse_fnc_onListBoxShowSelectionChanged;"; + }; + class selectionAction_4 : selectionAction_1 { + idc = 1003; + text = "Colors"; + x = "29.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "[nil, 3] call cse_fnc_onListBoxShowSelectionChanged;"; + }; + + class listBoxSettingsList: cse_gui_listNBox { + idc = 200; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.5}; + }; + + class labelTitle: cse_gui_staticBase { + idc = 250; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + + class labelKey: cse_gui_staticBase { + idc = 300; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "6.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Key:"; + }; + + class Label2: labelKey { + idc = 301; + y = "7.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = "Shift:"; + }; + + class Label3: labelKey { + idc = 302; + y = "8.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = "Ctrl:"; + }; + class Label4: labelKey { + idc = 303; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = "Alt:"; + }; + class comboBox1: cse_gui_comboBoxBase { + idc = 400; + x = "32.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "7.3 * ((((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)"; + }; + class comboBox2: comboBox1 { + idc = 401; + y = "8.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + }; + class comboBox3: comboBox1 { + idc = 402; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + }; + + class labelDesc: cse_gui_staticBase { + idc = 251; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + sizeEx = 0.03; + }; + + class actionEdit: actionClose { + idc = 150; + text = "Edit"; + x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + action = "if (!CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then{ ctrlSetText [252, 'Press the key you want to assign to this action..']; CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = true; };"; + }; + class actionCancel: actionClose { + idc = 151; + text = "Cancel"; + x = "20 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + action = "ctrlSetText [252, '']; CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; "; + }; + + + class notificationDesc: cse_gui_staticBase { + idc = 252; + x = "1 * (((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 = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + style = ST_CENTER + ST_SHADOW; + sizeEx = 0.05; + }; + + class selectionAction_5 : selectionAction_1 { + idc = 1100; + text = "Fix Animation"; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((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)"; + action = "if ([player] call cse_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call cse_fnc_broadcastAnim; };"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_eh/CfgFunctions.h b/TO_MERGE/cse/f_eh/CfgFunctions.h new file mode 100644 index 0000000000..36054c411f --- /dev/null +++ b/TO_MERGE/cse/f_eh/CfgFunctions.h @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000..15511631e1 --- /dev/null +++ b/TO_MERGE/cse/f_eh/CfgVehicles.h @@ -0,0 +1,180 @@ +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 new file mode 100644 index 0000000000..f44a5fac89 --- /dev/null +++ b/TO_MERGE/cse/f_eh/Combat_Space_Enhancement.h @@ -0,0 +1,13 @@ + +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 new file mode 100644 index 0000000000..953aa28c44 --- /dev/null +++ b/TO_MERGE/cse/f_eh/Extended_Init_EventHandlers.h @@ -0,0 +1,103 @@ +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 new file mode 100644 index 0000000000..129c8d9c4e --- /dev/null +++ b/TO_MERGE/cse/f_eh/cba_compat_init.sqf @@ -0,0 +1,19 @@ +/** + * 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 new file mode 100644 index 0000000000..eab6a20d7d --- /dev/null +++ b/TO_MERGE/cse/f_eh/config.cpp @@ -0,0 +1,31 @@ +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 new file mode 100644 index 0000000000..c59c985771 --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_HandleHeal_eh_f.sqf @@ -0,0 +1,54 @@ +/** + * 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 new file mode 100644 index 0000000000..3830605364 --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_addModuleEventhandlers_f.sqf @@ -0,0 +1,64 @@ +/** + * 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 new file mode 100644 index 0000000000..00f7fa50dc --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_customEventHandler_f.sqf @@ -0,0 +1,61 @@ +/** + * 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 new file mode 100644 index 0000000000..beada7ec82 --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_eventHandler_f.sqf @@ -0,0 +1,65 @@ +/** + * 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 new file mode 100644 index 0000000000..0609a3229e --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_getCustomResults_f.sqf @@ -0,0 +1,42 @@ +/** + * 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 new file mode 100644 index 0000000000..6eb1017b77 --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_handleDamage_eh_f.sqf @@ -0,0 +1,79 @@ +/** + * 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 new file mode 100644 index 0000000000..9433d8295d --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_initialization_f.sqf @@ -0,0 +1,55 @@ +/** + * 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 new file mode 100644 index 0000000000..38b13bfaba --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_removeEventhandler_f.sqf @@ -0,0 +1,33 @@ +/** + * 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 new file mode 100644 index 0000000000..1eaf62bde4 --- /dev/null +++ b/TO_MERGE/cse/f_eh/functions/fn_setEventhandler_f.sqf @@ -0,0 +1,35 @@ +/** + * 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 new file mode 100644 index 0000000000..6927a1bdce --- /dev/null +++ b/TO_MERGE/cse/f_eh/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/f_modules/CfgFunctions.h b/TO_MERGE/cse/f_modules/CfgFunctions.h new file mode 100644 index 0000000000..25e2f6cfaf --- /dev/null +++ b/TO_MERGE/cse/f_modules/CfgFunctions.h @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000..1b7d525b36 --- /dev/null +++ b/TO_MERGE/cse/f_modules/Combat_Space_Enhancement.h @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000000..0e5d5d7802 --- /dev/null +++ b/TO_MERGE/cse/f_modules/config.cpp @@ -0,0 +1,23 @@ +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 new file mode 100644 index 0000000000..6461eed738 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_enableModule_f.sqf @@ -0,0 +1,36 @@ +/** + * 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 new file mode 100644 index 0000000000..095dbf8a39 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleArguments_f.sqf @@ -0,0 +1,98 @@ +/** + * 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 new file mode 100644 index 0000000000..e25bd089e6 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_getCfgModuleInits_f.sqf @@ -0,0 +1,28 @@ +/** + * 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 new file mode 100644 index 0000000000..8bfb2cadca --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_getModuleCondition_f.sqf @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 0000000000..74f2762e99 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_getModule_f.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..84fec9d862 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_getModules_f.sqf @@ -0,0 +1,15 @@ +/** + * 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 new file mode 100644 index 0000000000..02769a31cf --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_initalizeModuleObjEH.sqf @@ -0,0 +1,59 @@ +/** + * 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 new file mode 100644 index 0000000000..fd9e659450 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_initalizeModule_F.sqf @@ -0,0 +1,59 @@ +/** + * 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 new file mode 100644 index 0000000000..8e3f86c295 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_isModuleEnabled_F.sqf @@ -0,0 +1,14 @@ +/** + * 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 new file mode 100644 index 0000000000..55e2205876 --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_moduleIsActive_f.sqf @@ -0,0 +1,19 @@ +/** + * 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 new file mode 100644 index 0000000000..bd37d9ecda --- /dev/null +++ b/TO_MERGE/cse/f_modules/functions/fn_remoteModuleInit.sqf @@ -0,0 +1,17 @@ +/** + * 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 new file mode 100644 index 0000000000..8524b1f20c --- /dev/null +++ b/TO_MERGE/cse/f_modules/init.sqf @@ -0,0 +1,3 @@ + + +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 new file mode 100644 index 0000000000..bbc3015f39 --- /dev/null +++ b/TO_MERGE/cse/f_modules/post-init.sqf @@ -0,0 +1,21 @@ +// 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 new file mode 100644 index 0000000000..735441ee0b --- /dev/null +++ b/TO_MERGE/cse/f_modules/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/CfgFunctions.h b/TO_MERGE/cse/f_states/CfgFunctions.h new file mode 100644 index 0000000000..b52b213890 --- /dev/null +++ b/TO_MERGE/cse/f_states/CfgFunctions.h @@ -0,0 +1,49 @@ +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 new file mode 100644 index 0000000000..d729a8bb80 --- /dev/null +++ b/TO_MERGE/cse/f_states/Combat_Space_Enhancement.h @@ -0,0 +1,26 @@ +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_isArrested.sqf b/TO_MERGE/cse/f_states/arrest/functions/fn_isArrested.sqf new file mode 100644 index 0000000000..555a77a408 --- /dev/null +++ b/TO_MERGE/cse/f_states/arrest/functions/fn_isArrested.sqf @@ -0,0 +1,11 @@ +/** + * fn_isArrested.sqf + * @Descr: Check if unit is in arrested state + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL Returns true if unit or object is in arrest state + * @PublicAPI: true + */ + +((_this select 0) getvariable ["cse_state_arrested",false]) \ 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 new file mode 100644 index 0000000000..306d2d4a2c --- /dev/null +++ b/TO_MERGE/cse/f_states/arrest/functions/fn_setArrestState.sqf @@ -0,0 +1,43 @@ +/** + * 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_beingCarried.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_beingCarried.sqf new file mode 100644 index 0000000000..ae3dd0f6d7 --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_beingCarried.sqf @@ -0,0 +1,13 @@ +/** + * fn_beingCarried.sqf + * @Descr: Check if object is being carried + * @Author: Glowbal + * + * @Arguments: [object OBJECT] + * @Return: BOOL True if object is being carried + * @PublicAPI: true + */ + +private["_object"]; +_object = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_Param; +!(isNull ([_object] call cse_fnc_getCarriedObj)); \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf new file mode 100644 index 0000000000..afc76bc7d8 --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_carriedByObj.sqf @@ -0,0 +1,15 @@ +/** + * fn_carriedByObj.sqf + * @Descr: Check if object A is being carried by object B. + * @Author: Glowbal + * + * @Arguments: [object OBJECT, unit OBJECT] + * @Return: BOOL True if B is carrying A. + * @PublicAPI: true + */ + +private ["_unit","_to"]; +_to = _this select 0; +_unit = _this select 1; + +([_to] call cse_fnc_getCarriedBy == [_unit] call cse_fnc_getCarriedBy); \ 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 new file mode 100644 index 0000000000..06a4e3620c --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_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 + */ + +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/carry/functions/fn_getCarriedBy.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedBy.sqf new file mode 100644 index 0000000000..de2effafbf --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedBy.sqf @@ -0,0 +1,14 @@ +/** + * fn_getCarriedBy.sqf + * @Descr: Get the object that is carrying given unit or object + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: OBJECT Returns the object that is carrying the unit. Otherwise returns ObjNull + * @PublicAPI: true + */ + + private ["_unit","_return"]; + _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; + _return = _unit getvariable ["cse_carriedBy",objNull]; +_return diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf new file mode 100644 index 0000000000..5da37a0099 --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_getCarriedObj.sqf @@ -0,0 +1,14 @@ +/** + * fn_getCarriedObj.sqf + * @Descr: Grab the registered carried object + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: OBJECT Returns the object that the unit is currently carrying. If not carrying, returns ObjNull + * @PublicAPI: true + */ + + private ["_unit","_return"]; + _unit = _this select 0; + _return = _unit getvariable ["cse_carriedObj",objNull]; +_return diff --git a/TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf b/TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf new file mode 100644 index 0000000000..26d773a738 --- /dev/null +++ b/TO_MERGE/cse/f_states/carry/functions/fn_setCarriedBy.sqf @@ -0,0 +1,20 @@ +/** + * fn_setCarriedBy.sqf + * @Descr: Registers an object being carried by another object + * @Author: Glowbal + * + * @Arguments: [unitToBeCarried OBJECT, objectCarrying OBJECT] + * @Return: BOOL True if succesfully registered + * @PublicAPI: false + */ + + +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]; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/config.cpp b/TO_MERGE/cse/f_states/config.cpp new file mode 100644 index 0000000000..8a0a71a719 --- /dev/null +++ b/TO_MERGE/cse/f_states/config.cpp @@ -0,0 +1,26 @@ +#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/black_out1.paa b/TO_MERGE/cse/f_states/data/black_out1.paa new file mode 100644 index 0000000000..c50a106954 Binary files /dev/null and b/TO_MERGE/cse/f_states/data/black_out1.paa differ diff --git a/TO_MERGE/cse/f_states/data/cse_bleedingscreen_v5.paa b/TO_MERGE/cse/f_states/data/cse_bleedingscreen_v5.paa new file mode 100644 index 0000000000..2e88e1cf3d Binary files /dev/null and b/TO_MERGE/cse/f_states/data/cse_bleedingscreen_v5.paa differ diff --git a/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa b/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa new file mode 100644 index 0000000000..ff12bd993e Binary files /dev/null and b/TO_MERGE/cse/f_states/data/cse_blurryScreen.paa differ diff --git a/TO_MERGE/cse/f_states/data/cse_fadingblack.paa b/TO_MERGE/cse/f_states/data/cse_fadingblack.paa new file mode 100644 index 0000000000..9ed471597c Binary files /dev/null and b/TO_MERGE/cse/f_states/data/cse_fadingblack.paa differ diff --git a/TO_MERGE/cse/f_states/data/cse_painscreen.paa b/TO_MERGE/cse/f_states/data/cse_painscreen.paa new file mode 100644 index 0000000000..026f994fa9 Binary files /dev/null and b/TO_MERGE/cse/f_states/data/cse_painscreen.paa differ diff --git a/TO_MERGE/cse/f_states/data/hit_screen1.paa b/TO_MERGE/cse/f_states/data/hit_screen1.paa new file mode 100644 index 0000000000..e878efff0b Binary files /dev/null and b/TO_MERGE/cse/f_states/data/hit_screen1.paa differ diff --git a/TO_MERGE/cse/f_states/data/pain_screen3.paa b/TO_MERGE/cse/f_states/data/pain_screen3.paa new file mode 100644 index 0000000000..f629d66280 Binary files /dev/null and b/TO_MERGE/cse/f_states/data/pain_screen3.paa differ diff --git a/TO_MERGE/cse/f_states/define.hpp b/TO_MERGE/cse/f_states/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/f_states/define.hpp @@ -0,0 +1,797 @@ + +#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/f_states/functions.sqf b/TO_MERGE/cse/f_states/functions.sqf new file mode 100644 index 0000000000..53534edef1 --- /dev/null +++ b/TO_MERGE/cse/f_states/functions.sqf @@ -0,0 +1,104 @@ +/* + +*/ + + + 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 new file mode 100644 index 0000000000..881e02b95d --- /dev/null +++ b/TO_MERGE/cse/f_states/init.sqf @@ -0,0 +1,37 @@ +/* + +*/ + + 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_cleanUpCopyOfBody_f.sqf b/TO_MERGE/cse/f_states/loadPerson/functions/fn_cleanUpCopyOfBody_f.sqf new file mode 100644 index 0000000000..ad9f200b8a --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_cleanUpCopyOfBody_f.sqf @@ -0,0 +1,24 @@ +/** + * fn_cleanUpCopyOfBody_f.sqf + * @Descr: Called from a custom eventhandler to ensure that any copies of bodies are cleaned up. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_unit", "_copy"]; +_unit = _this select 0; + +_copy = _unit getvariable "cse_copyOfBody_f"; +if (isnil "_copy") exitwith {false}; +[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call cse_fnc_debug; +// lets clean it up +_unit setvariable ["cse_originalCopy_f", nil, true]; +_unit setvariable ["cse_copyOfBody_f", nil, true]; +if (!isNull _copy) then { + deleteVehicle _copy; +}; + +true; \ 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 new file mode 100644 index 0000000000..7a6cee7202 --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPersonLocal_f.sqf @@ -0,0 +1,37 @@ +/** + * 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 new file mode 100644 index 0000000000..5181d74372 --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_loadPerson_f.sqf @@ -0,0 +1,40 @@ +/** + * 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 new file mode 100644 index 0000000000..8e00653978 --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBodyLocal_f.sqf @@ -0,0 +1,62 @@ +/** + * 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 new file mode 100644 index 0000000000..77b3147a2d --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_makeCopyOfBody_f.sqf @@ -0,0 +1,88 @@ +/** + * 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 new file mode 100644 index 0000000000..bbfcf52b3f --- /dev/null +++ b/TO_MERGE/cse/f_states/loadPerson/functions/fn_unloadPerson_f.sqf @@ -0,0 +1,57 @@ +/** + * 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 new file mode 100644 index 0000000000..9a807abfd9 --- /dev/null +++ b/TO_MERGE/cse/f_states/movement/functions/fn_limitMovementSpeed.sqf @@ -0,0 +1,34 @@ +/** + * 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 new file mode 100644 index 0000000000..24af4ff1af --- /dev/null +++ b/TO_MERGE/cse/f_states/movement/functions/fn_limitSpeed.sqf @@ -0,0 +1,38 @@ +/** + * 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 new file mode 100644 index 0000000000..db81cc6d02 --- /dev/null +++ b/TO_MERGE/cse/f_states/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf new file mode 100644 index 0000000000..d716df49de --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_canGoUnconsciousState.sqf @@ -0,0 +1,14 @@ +/** + * fn_canGoUnconsciousState.sqf + * @Descr: Checks if an object can move into unconscious state + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL true if object can move into unconscious state + * @PublicAPI: true + */ + +private ["_unit"]; +_unit = _this select 0; + +(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call cse_fnc_isAwake)}) \ 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 new file mode 100644 index 0000000000..6e3018baba --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_getUnconsciousCondition.sqf @@ -0,0 +1,32 @@ +/** + * 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_isUnconscious.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_isUnconscious.sqf new file mode 100644 index 0000000000..2d410d7ba5 --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_isUnconscious.sqf @@ -0,0 +1,11 @@ +/** + * fn_isUnconscious.sqf + * @Descr: Checks whatever given object is in the unconscious state + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True when object is in unconscious state + * @PublicAPI: true + */ + + ((_this select 0) getvariable ["cse_state_unconscious",false]); \ 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 new file mode 100644 index 0000000000..48df97777e --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_moveToTempGroup.sqf @@ -0,0 +1,30 @@ +/** + * 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_registerUnconsciousCondition.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_registerUnconsciousCondition.sqf new file mode 100644 index 0000000000..25742589ba --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_registerUnconsciousCondition.sqf @@ -0,0 +1,22 @@ +/** + * fn_registerUnconsciousCondition.sqf + * @Descr: Register new condition for the unconscious state. Conditions are not actively checked for units unless unit is in unconscious state. + * @Author: Glowbal + * + * @Arguments: [code CODE] + * @Return: void + * @PublicAPI: true + */ + + +if (isnil "CSE_UNCONSCIOUS_CONDITIONS_F") then { + CSE_UNCONSCIOUS_CONDITIONS_F = []; +}; +if (typeName _this == typeName []) then { + { + if (typeName _x == typeName {}) then { + CSE_UNCONSCIOUS_CONDITIONS_F pushback _x; + }; + }foreach _this; +} else { +}; \ No newline at end of file diff --git a/TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf new file mode 100644 index 0000000000..e99f6f18c3 --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_setCaptiveSwitch.sqf @@ -0,0 +1,38 @@ +/** + * fn_setCaptiveSwitch.sqf + * @Descr: Register a unit as captive for the unconscious state + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, setCaptive BOOL] + * @Return: BOOL True if unit is put as set captive, otherwise false + * @PublicAPI: false + */ + +private ["_unit", "_captiveSwitch", "_setCaptive"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_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; + }; +} 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; + }; +}; + +_captiveSwitch \ 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 new file mode 100644 index 0000000000..8ae7c75172 --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_setUnconsciousState.sqf @@ -0,0 +1,95 @@ +/** + * 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/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf b/TO_MERGE/cse/f_states/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf new file mode 100644 index 0000000000..6853156aeb --- /dev/null +++ b/TO_MERGE/cse/f_states/unconscious/functions/fn_setWeaponsCorrectUnconscious.sqf @@ -0,0 +1,36 @@ +/** + * fn_setWeaponsCorrectUnconscious.sqf + * @Descr: Ensures the weapon of a unit is selected correctly for the unconscious state. Prefents wierd animation behaviour + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: false + */ + +private ["_unit"]; +_unit = _this select 0; + +if ((vehicle _unit) isKindOf "StaticWeapon") then { + 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 (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) then { + _unit action ["ladderOff", (nearestBuilding _unit)]; +}; + +if (vehicle _unit == _unit) then { + if (currentWeapon _unit == secondaryWeapon _unit) then { + _unit selectWeapon (primaryWeapon _unit); + _unit switchMove ""; + _unit playmoveNow ""; + }; +}; diff --git a/TO_MERGE/cse/f_states/visual/effects.hpp b/TO_MERGE/cse/f_states/visual/effects.hpp new file mode 100644 index 0000000000..17301fe662 --- /dev/null +++ b/TO_MERGE/cse/f_states/visual/effects.hpp @@ -0,0 +1,312 @@ +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 new file mode 100644 index 0000000000..5489ad8565 --- /dev/null +++ b/TO_MERGE/cse/f_states/visual/empty.hpp @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000000..61a3951517 --- /dev/null +++ b/TO_MERGE/cse/f_states/visual/functions/fn_effectBlackOut.sqf @@ -0,0 +1,19 @@ +/** + * 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 new file mode 100644 index 0000000000..97f17c259f --- /dev/null +++ b/TO_MERGE/cse/f_states/visual/functions/fn_effectBleeding.sqf @@ -0,0 +1,30 @@ +/** + * 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 new file mode 100644 index 0000000000..8f3cdb3d35 --- /dev/null +++ b/TO_MERGE/cse/f_states/visual/functions/fn_effectPain.sqf @@ -0,0 +1,27 @@ +/** + * 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 new file mode 100644 index 0000000000..ef4e5c25b2 --- /dev/null +++ b/TO_MERGE/cse/gui/CfgFunctions.h @@ -0,0 +1,61 @@ +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 new file mode 100644 index 0000000000..62d1708f5c --- /dev/null +++ b/TO_MERGE/cse/gui/Combat_Space_Enhancement.h @@ -0,0 +1,13 @@ +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 new file mode 100644 index 0000000000..4e22d8ae32 --- /dev/null +++ b/TO_MERGE/cse/gui/GUI.h @@ -0,0 +1,10 @@ +#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 new file mode 100644 index 0000000000..918a9208b3 --- /dev/null +++ b/TO_MERGE/cse/gui/config.cpp @@ -0,0 +1,25 @@ +#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 new file mode 100644 index 0000000000..0a56125f7a Binary files /dev/null and b/TO_MERGE/cse/gui/data/background_gradient.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonDisabled.paa b/TO_MERGE/cse/gui/data/buttonDisabled.paa new file mode 100644 index 0000000000..2c2a10856b Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonDisabled.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonDisabled_gradient.paa b/TO_MERGE/cse/gui/data/buttonDisabled_gradient.paa new file mode 100644 index 0000000000..43b1b8d100 Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonDisabled_gradient.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal.paa b/TO_MERGE/cse/gui/data/buttonNormal.paa new file mode 100644 index 0000000000..84936d8356 Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient.paa b/TO_MERGE/cse/gui/data/buttonNormal_gradient.paa new file mode 100644 index 0000000000..2210f98741 Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal_gradient.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient2.paa b/TO_MERGE/cse/gui/data/buttonNormal_gradient2.paa new file mode 100644 index 0000000000..cabe6c7fed Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal_gradient2.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient3.paa b/TO_MERGE/cse/gui/data/buttonNormal_gradient3.paa new file mode 100644 index 0000000000..7da9fbcf8a Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal_gradient3.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient_top.paa b/TO_MERGE/cse/gui/data/buttonNormal_gradient_top.paa new file mode 100644 index 0000000000..904e1a62f7 Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal_gradient_top.paa differ diff --git a/TO_MERGE/cse/gui/data/buttonNormal_gradient_top_w.paa b/TO_MERGE/cse/gui/data/buttonNormal_gradient_top_w.paa new file mode 100644 index 0000000000..23dd190afc Binary files /dev/null and b/TO_MERGE/cse/gui/data/buttonNormal_gradient_top_w.paa differ diff --git a/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf b/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf new file mode 100644 index 0000000000..5c45c5f466 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_addCatagoryEntry.sqf @@ -0,0 +1,54 @@ +/** + * 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 new file mode 100644 index 0000000000..0d4e91bc19 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_addCatagory.sqf @@ -0,0 +1,76 @@ +/** + * 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/addons/core/script_macros.hpp b/TO_MERGE/cse/gui/functions/fn_gui_addCatagoryEntry.sqf similarity index 100% rename from addons/core/script_macros.hpp rename to TO_MERGE/cse/gui/functions/fn_gui_addCatagoryEntry.sqf diff --git a/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf b/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf new file mode 100644 index 0000000000..6cd4b22d01 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_addMenuEntry.sqf @@ -0,0 +1,47 @@ +/** + * 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 new file mode 100644 index 0000000000..9c9a901dd4 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_blurScreen.sqf @@ -0,0 +1,37 @@ +/** + * 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 new file mode 100644 index 0000000000..859aaf04c8 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_createInteractionMenu.sqf @@ -0,0 +1,19 @@ +/** + * 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 new file mode 100644 index 0000000000..083a12ed26 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_displayEventHandler.sqf @@ -0,0 +1,74 @@ +/** + * 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_displayIcon.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displayIcon.sqf new file mode 100644 index 0000000000..1634228f9c --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_displayIcon.sqf @@ -0,0 +1,70 @@ +/** + * fn_gui_displayIcon.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + * + * @Example ["myID", true, CSE_ICON_PATH + "icon_group.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + */ + +#define MAX_N_ICONS 6 + +private ["_iconId", "_show", "_icon", "_spot", "_idc", "_display","_next_IDC", "_nextText"]; +_iconId = _this select 0; +_show = _this select 1; +_icon = _this select 2; +_color = _this select 3; + +disableSerialization; +_list = missionNamespace getvariable ["cse_gui_displayIconList",[]]; +_display = uiNamespace getvariable "cse_gui_iconsDisplay"; +if (_show) then { + if ({(_x select 0 == _iconId)} count _list == 0) then { + _list pushback [_iconId, _icon, _color]; + } else { + { + if (_x select 0 == _iconId) exitwith { + _list set [_foreachIndex, [_iconId, _icon, _color]]; + }; + }foreach _list; + }; + + missionNamespace setvariable ["cse_gui_displayIconList", _list]; + + { + if (_x select 0 == _iconId) exitwith { + _idc = 10501 + _foreachIndex; + _ctrl = _display displayCtrl _idc; + _ctrl ctrlsetText _icon; + _ctrl ctrlSetTextColor _color; + }; + }foreach _list; +} else { + if ({(_x select 0 == _iconId)} count _list == 1) then { + _newList = []; + { + if (_x select 0 != _iconId) then { + _newList pushback _x; + }; + }foreach _list; + + missionNamespace setvariable ["cse_gui_displayIconList", _newList]; + + for "_i" from 0 to (MAX_N_ICONS - 1) /* step +1 */ do { + _idc = 10501 + _i; + _ctrl = _display displayCtrl _idc; + _ctrl ctrlsetText ""; + _ctrl ctrlSetTextColor [1,1,1,1]; + }; + + { + _idc = 10501 + _foreachIndex; + _ctrl = _display displayCtrl _idc; + _ctrl ctrlsetText (_x select 1); + _ctrl ctrlSetTextColor (_x select 2); + }foreach _newList; + }; +}; diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf new file mode 100644 index 0000000000..44f675769f --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_displayInformation.sqf @@ -0,0 +1,65 @@ +/** + * fn_gui_displayInformation.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define DISPLAY_LAYER 32547 + +private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos","_icon","_iconCtrl"]; +_title = [_this, 0, "",[""]] call BIS_fnc_Param; +_content = [_this, 1, [""],[[""]]] call BIS_fnc_Param; +_type = [_this, 2, 0, [0]] call BIS_fnc_Param; +_icon = [_this, 3, "",[""]] call BIS_fnc_Param; + +if (_title != "") then { + DISPLAY_LAYER cutRsc ["CSE_DISPLAY_INFORMATION","PLAIN"]; + + disableSerialization; + _display = uiNamespace getvariable "CSE_DISPLAY_INFORMATION"; + if (!isnil "_display") then { + _headerCtrl = _display displayCtrl 1; + _headerCtrl ctrlSetText _title; + _iconCtrl = _display displayCtrl 10; + _iconCtrl ctrlSetText _icon; + + _idc = 2; + { + _text = _x; + if (_text != "") then { + _contentCtrl = _display displayCtrl _idc; + _contentCtrl ctrlSetText _text; + + _contentAmountOfChars = count (toArray _text); + _pos = ctrlPosition _contentCtrl; + _pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)]; + _contentCtrl ctrlSetPosition _pos; + _contentCtrl ctrlCommit 0; + + + if (_type >0) then { + if (_type == 1) then { + _contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8]; + _contentCtrl ctrlSetTextColor [1,1,1,0.9]; + }; + }; + _idc = _idc + 1; + }; + }foreach _content; + + while {(_idc < 7)} do { + _contentCtrl = _display displayCtrl _idc; + _contentCtrl ctrlSetPosition [0,0,0,0]; + _contentCtrl ctrlCommit 0; + + _idc = _idc + 1; + }; + }; +} else { + + DISPLAY_LAYER cutText ["","PLAIN"]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf new file mode 100644 index 0000000000..1816bdfad5 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_displayMessage.sqf @@ -0,0 +1,43 @@ +/** + * fn_gui_displayMessage.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define DISPLAY_LAYER 546 + +private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos"]; +_title = [_this, 0, "",[""]] call BIS_fnc_Param; +_content = [_this, 1, "",[""]] call BIS_fnc_Param; +_type = [_this, 2, 0, [0]] call BIS_fnc_Param; + +if (_title != "" && _content != "") then { + DISPLAY_LAYER cutRsc ["CSE_DISPLAY_MESSAGE","PLAIN"]; + + disableSerialization; + _display = uiNamespace getvariable "CSE_DISPLAY_MESSAGE"; + if (!isnil "_display") then { + _headerCtrl = _display displayCtrl 1; + _contentCtrl = _display displayCtrl 2; + + _headerCtrl ctrlSetText _title; + _contentCtrl ctrlSetText _content; + + _contentAmountOfChars = count (toArray _content); + _pos = ctrlPosition _contentCtrl; + _pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)]; + _contentCtrl ctrlSetPosition _pos; + _contentCtrl ctrlCommit 0; + + if (_type >0) then { + if (_type == 1) then { + _contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8]; + _contentCtrl ctrlSetTextColor [1,1,1,0.9]; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf b/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf new file mode 100644 index 0000000000..51b31d8873 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_displaySubMenuButtons.sqf @@ -0,0 +1,104 @@ +/** + * 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 new file mode 100644 index 0000000000..655dcf91e2 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_getMenuEntries.sqf @@ -0,0 +1,45 @@ +/** + * 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 new file mode 100644 index 0000000000..898a377fcc --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_hasOptionAvailable.sqf @@ -0,0 +1,48 @@ +/** + * 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 new file mode 100644 index 0000000000..afce751b5a --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_hideSubMenuButtons.sqf @@ -0,0 +1,32 @@ +/** + * 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 new file mode 100644 index 0000000000..b73f70e5c5 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_hideSubSubMenuButtons.sqf @@ -0,0 +1,32 @@ +/** + * 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 new file mode 100644 index 0000000000..324a504485 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_keyPressed.sqf @@ -0,0 +1,180 @@ +/** + * 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 new file mode 100644 index 0000000000..d17321ba94 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_loadingbar.sqf @@ -0,0 +1,46 @@ +/** + * 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 new file mode 100644 index 0000000000..9c1db43f91 --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_refreshLastSubMenu.sqf @@ -0,0 +1,19 @@ +/** + * 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 new file mode 100644 index 0000000000..373cd980bf --- /dev/null +++ b/TO_MERGE/cse/gui/functions/fn_gui_sortMenuEntries.sqf @@ -0,0 +1,23 @@ +/** + * 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 new file mode 100644 index 0000000000..f4e8b8a5cf --- /dev/null +++ b/TO_MERGE/cse/gui/gui/RscTitles.h @@ -0,0 +1,50 @@ + +#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 new file mode 100644 index 0000000000..248556fedc --- /dev/null +++ b/TO_MERGE/cse/gui/gui/cseLogoPlain.hpp @@ -0,0 +1,31 @@ + +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 new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/gui/gui/define.hpp @@ -0,0 +1,797 @@ + +#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 new file mode 100644 index 0000000000..1ae5206fe2 --- /dev/null +++ b/TO_MERGE/cse/gui/gui/dynamicMenu.h @@ -0,0 +1,12 @@ +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 new file mode 100644 index 0000000000..b93918c407 --- /dev/null +++ b/TO_MERGE/cse/gui/gui/interactionMenu.hpp @@ -0,0 +1,494 @@ +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 new file mode 100644 index 0000000000..d32752f42d --- /dev/null +++ b/TO_MERGE/cse/gui/gui/interactionMenu_white.hpp @@ -0,0 +1,417 @@ +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 new file mode 100644 index 0000000000..2b56b40a14 --- /dev/null +++ b/TO_MERGE/cse/gui/gui/radial.h @@ -0,0 +1,648 @@ + +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 new file mode 100644 index 0000000000..ec1e7c3451 --- /dev/null +++ b/TO_MERGE/cse/gui/gui/weapon_selector.h @@ -0,0 +1,195 @@ + +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 new file mode 100644 index 0000000000..96dfd03389 --- /dev/null +++ b/TO_MERGE/cse/gui/init.sqf @@ -0,0 +1,37 @@ +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 new file mode 100644 index 0000000000..f86d1ec9fc --- /dev/null +++ b/TO_MERGE/cse/gui/init_action_ui.sqf @@ -0,0 +1,63 @@ +#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 new file mode 100644 index 0000000000..b7354a0e24 --- /dev/null +++ b/TO_MERGE/cse/gui/init_interaction_ui.sqf @@ -0,0 +1,6 @@ + + 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 new file mode 100644 index 0000000000..5142a62573 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottom_w.paa 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 new file mode 100644 index 0000000000..bcc441512b Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomleft_w.paa 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 new file mode 100644 index 0000000000..bd7746a142 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_bottomright_w.paa 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 new file mode 100644 index 0000000000..ab4dea1e5f Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerleft_w.paa 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 new file mode 100644 index 0000000000..9f36be9c30 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_centerright_w.paa 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 new file mode 100644 index 0000000000..f1695ce4da Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_top_w.paa 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 new file mode 100644 index 0000000000..ac8e507323 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_topleft_w.paa 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 new file mode 100644 index 0000000000..57204f2116 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_background_topright_w.paa 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 new file mode 100644 index 0000000000..9f468feee7 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background.paa 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 new file mode 100644 index 0000000000..de28c44dad Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_512.paa 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 new file mode 100644 index 0000000000..af1c2f97cc Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_center_background_full_512.paa 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 new file mode 100644 index 0000000000..51e5ea0e18 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_center_info_background.paa differ diff --git a/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa new file mode 100644 index 0000000000..1fe76a1086 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu.paa 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 new file mode 100644 index 0000000000..b1dcf36875 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomleft.paa 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 new file mode 100644 index 0000000000..de5763a4bf Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_bottomright.paa 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 new file mode 100644 index 0000000000..a888959e5a Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topleft.paa 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 new file mode 100644 index 0000000000..b612277b25 Binary files /dev/null and b/TO_MERGE/cse/gui/radialmenu/data/radial_submenu_topright.paa differ diff --git a/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf b/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf new file mode 100644 index 0000000000..38f901cb8d --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_addCategoryEntryRadialMenu_F.sqf @@ -0,0 +1,26 @@ +/** + * 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 new file mode 100644 index 0000000000..8ab6e03f9a --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_addEntryToMenuSorter_f.sqf @@ -0,0 +1,26 @@ +/** + * 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 new file mode 100644 index 0000000000..5f98b2664a --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_addEntryToRadialInteraction_f.sqf @@ -0,0 +1,30 @@ +/** + * 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 new file mode 100644 index 0000000000..4dadd9e205 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_addMultipleEntriesToRadialCategory_f.sqf @@ -0,0 +1,25 @@ +/** + * 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 new file mode 100644 index 0000000000..acf99521d1 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_categoryHasActionsAvailable_f.sqf @@ -0,0 +1,34 @@ +/** + * 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 new file mode 100644 index 0000000000..e17517788d --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_closeRadialSecondRing_gui.sqf @@ -0,0 +1,30 @@ +/** + * 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 new file mode 100644 index 0000000000..501839ca07 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_createCategoryRadialMenu_f.sqf @@ -0,0 +1,40 @@ +/** + * 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 new file mode 100644 index 0000000000..0ec48b353b --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_createRadialInteraction_f.sqf @@ -0,0 +1,30 @@ +/** + * 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 new file mode 100644 index 0000000000..dc5386a09e --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_findTargetName_gui.sqf @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 0000000000..9a5ca534ef --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_findTargetOfMenu_gui.sqf @@ -0,0 +1,46 @@ +/** + * 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 new file mode 100644 index 0000000000..d9cb1763d7 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_getAllCategoryEntriesRadialMenu_f.sqf @@ -0,0 +1,15 @@ +/** + * 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 new file mode 100644 index 0000000000..47e8e6fb60 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_getCurrentRadialTarget_gui.sqf @@ -0,0 +1,23 @@ +/** + * 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 new file mode 100644 index 0000000000..175520ffd5 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_getEntryToMenuSorter_f.sqf @@ -0,0 +1,31 @@ +/** + * 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 new file mode 100644 index 0000000000..03236d36b8 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_getIcon_f.sqf @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 0000000000..02d295621b --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_getRadialInteractionEntries_f.sqf @@ -0,0 +1,16 @@ +/** + * 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 new file mode 100644 index 0000000000..7813a497d1 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_hasEntriesRadialInteraction_f.sqf @@ -0,0 +1,37 @@ +/** + * 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 new file mode 100644 index 0000000000..9907647f16 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_isOpenSecondRing_gui.sqf @@ -0,0 +1,35 @@ +/** + * 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 new file mode 100644 index 0000000000..b8dcc39bc1 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_isRadialOptionSelected_gui.sqf @@ -0,0 +1,18 @@ +/** + * 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 new file mode 100644 index 0000000000..3536bc929f --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_openRadialInteractionMenu_f.sqf @@ -0,0 +1,37 @@ +/** + * 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 new file mode 100644 index 0000000000..b62bf87e68 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_openRadialMenu_gui.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..c5f1577a57 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_openRadialSecondRing_gui.sqf @@ -0,0 +1,41 @@ +/** + * 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 new file mode 100644 index 0000000000..245cdf00a5 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_openRadialSubMenu_gui.sqf @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 0000000000..8ae3b84e7b --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_radialUsesSorter_f.sqf @@ -0,0 +1,17 @@ +/** + * 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 new file mode 100644 index 0000000000..b7166aff2f --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_returnToPreviousSubMenu_gui.sqf @@ -0,0 +1,29 @@ +/** + * 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 new file mode 100644 index 0000000000..7ac2cf648b --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuName_gui.sqf @@ -0,0 +1,24 @@ +/** + * 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 new file mode 100644 index 0000000000..dc151cc954 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuOptions_gui.sqf @@ -0,0 +1,86 @@ +/** + * 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 new file mode 100644 index 0000000000..9eb7cc903e --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_setRadialMenuTargetName_gui.sqf @@ -0,0 +1,13 @@ +/** + * 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 new file mode 100644 index 0000000000..5cf550a48b --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_setRadialOptionSelected_gui.sqf @@ -0,0 +1,34 @@ +/** + * 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 new file mode 100644 index 0000000000..64694cde61 --- /dev/null +++ b/TO_MERGE/cse/gui/radialmenu/fn_setRadialSecondRing_gui.sqf @@ -0,0 +1,180 @@ +/** + * 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/stringtable.xml b/TO_MERGE/cse/gui/stringtable.xml new file mode 100644 index 0000000000..9a22f46ff3 --- /dev/null +++ b/TO_MERGE/cse/gui/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf b/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf new file mode 100644 index 0000000000..e7ad59a6ee --- /dev/null +++ b/TO_MERGE/cse/gui/weaponSelector/fn_onWeaponSelectorOpened_GUI.sqf @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000000..6dce67e747 --- /dev/null +++ b/TO_MERGE/cse/main/CfgFactionClasses.h @@ -0,0 +1,22 @@ +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 new file mode 100644 index 0000000000..29cb3d875e --- /dev/null +++ b/TO_MERGE/cse/main/CfgFunctions.h @@ -0,0 +1,154 @@ +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 new file mode 100644 index 0000000000..23611db6cc --- /dev/null +++ b/TO_MERGE/cse/main/CfgHints.h @@ -0,0 +1,27 @@ +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 new file mode 100644 index 0000000000..e717a10d4f --- /dev/null +++ b/TO_MERGE/cse/main/CfgVehicles.h @@ -0,0 +1,115 @@ +#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 new file mode 100644 index 0000000000..9046550f26 --- /dev/null +++ b/TO_MERGE/cse/main/Combat_Space_Enhancement.h @@ -0,0 +1,60 @@ +#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 new file mode 100644 index 0000000000..82a9535799 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_broadcastAnim.sqf @@ -0,0 +1,21 @@ +/** + * 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 new file mode 100644 index 0000000000..2722e16ffb --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_getDeathAnim.sqf @@ -0,0 +1,33 @@ +/** + * 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 new file mode 100644 index 0000000000..919a7176c6 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_localAnim.sqf @@ -0,0 +1,24 @@ +/** + * 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 new file mode 100644 index 0000000000..03ffda17fb --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_playMoveNow.sqf @@ -0,0 +1,14 @@ +/** + * 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 new file mode 100644 index 0000000000..73a0260ef6 --- /dev/null +++ b/TO_MERGE/cse/main/anim/functions/fn_switchAnim.sqf @@ -0,0 +1,15 @@ +/** + * 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 new file mode 100644 index 0000000000..9a2255f45b --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findAll.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..9fe7c57869 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findIf.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..d8001d03c2 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_findIn.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..1c18a746eb --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_foreachDo.sqf @@ -0,0 +1,21 @@ +/** + * 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_insertionSort.sqf b/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf new file mode 100644 index 0000000000..5653256621 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_insertionSort.sqf @@ -0,0 +1,32 @@ +/** + * fn_insertionSort.sqf + * @Descr: Sorts an array of numbers + * @Author: Ruthberg + * + * @Arguments: [array ARRAY, (optional) ascending BOOL] + * @Return: sortedArray ARRAY + * @PublicAPI: true + */ + +private ["_list", "_ascending", "_tmp", "_i", "_j"]; +_list = +(_this select 0); +_ascending = true; +if (count _this > 1) then { + _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]; +}; + +if (!_ascending) then { + reverse _list; +}; + +_list \ 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 new file mode 100644 index 0000000000..91f4c837e5 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_sortAlphabeticallyBy.sqf @@ -0,0 +1,42 @@ +/** + * 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/arrays/functions/fn_uniqueElementsOnly.sqf b/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf new file mode 100644 index 0000000000..3bf40595e6 --- /dev/null +++ b/TO_MERGE/cse/main/arrays/functions/fn_uniqueElementsOnly.sqf @@ -0,0 +1,22 @@ +/** + * fn_uniqueElementsOnly.sqf + * @Descr: Make a copy of an array with only the unique elements. + * @Author: Glowbal + * + * @Arguments: [array ARRAY] + * @Return: ARRAY Copy of original array + * @PublicAPI: true + */ + +private ["_array", "_result", "_value"]; +_array = _this select 0; + +_result = []; +{ + _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/TO_MERGE/cse/main/config.cpp b/TO_MERGE/cse/main/config.cpp new file mode 100644 index 0000000000..3620b37e7a --- /dev/null +++ b/TO_MERGE/cse/main/config.cpp @@ -0,0 +1,33 @@ +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/config/functions/fn_inheritsFrom.sqf b/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf new file mode 100644 index 0000000000..e0c942c40d --- /dev/null +++ b/TO_MERGE/cse/main/config/functions/fn_inheritsFrom.sqf @@ -0,0 +1,24 @@ +/** + * fn_inheritsFrom.sqf + * @Descr: Checks whether a given configuration name appears in the inheritance tree of a specific configuration entry. + * @Author: Ruthberg + * + * @Arguments: [configEntry CONFIG, configname STRING] + * @Return: BOOL + * @PublicAPI: true + */ + + private ["_configEntry","_configMatch", "_match"]; +_configEntry = _this select 0; +_configMatch = _this select 1; + +if (configName _configEntry == _configMatch) exitWith { true }; +if (configName _configEntry == ",") exitWith { false }; + +_match = false; +while {configName _configEntry != ""} do { + if (configName _configEntry == _configMatch) exitWith { _match = true }; + _configEntry = inheritsFrom(_configEntry); +}; + +_match \ 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 new file mode 100644 index 0000000000..0bd682d3d2 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_aim_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_backblast_module.paa b/TO_MERGE/cse/main/data/cse_backblast_module.paa new file mode 100644 index 0000000000..527c516c22 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_backblast_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_ballistics_module.paa b/TO_MERGE/cse/main/data/cse_ballistics_module.paa new file mode 100644 index 0000000000..4be1f5869f Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_ballistics_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_basic_module.paa b/TO_MERGE/cse/main/data/cse_basic_module.paa new file mode 100644 index 0000000000..8ef2af6867 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_basic_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_cc_module.paa b/TO_MERGE/cse/main/data/cse_cc_module.paa new file mode 100644 index 0000000000..4833873c60 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_cc_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_debug_icon.paa b/TO_MERGE/cse/main/data/cse_debug_icon.paa new file mode 100644 index 0000000000..e5cbceeebb Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_debug_icon.paa differ diff --git a/TO_MERGE/cse/main/data/cse_earmuffs_module.paa b/TO_MERGE/cse/main/data/cse_earmuffs_module.paa new file mode 100644 index 0000000000..d0d571112c Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_earmuffs_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_explosive_module.paa b/TO_MERGE/cse/main/data/cse_explosive_module.paa new file mode 100644 index 0000000000..5837932776 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_explosive_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_groups_module.paa b/TO_MERGE/cse/main/data/cse_groups_module.paa new file mode 100644 index 0000000000..067eb7ef0c Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_groups_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_logging_icon.paa b/TO_MERGE/cse/main/data/cse_logging_icon.paa new file mode 100644 index 0000000000..7339a44899 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_logging_icon.paa differ diff --git a/TO_MERGE/cse/main/data/cse_medical_module.paa b/TO_MERGE/cse/main/data/cse_medical_module.paa new file mode 100644 index 0000000000..9cb6c4782d Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_medical_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_nvg_module.paa b/TO_MERGE/cse/main/data/cse_nvg_module.paa new file mode 100644 index 0000000000..3d0a8bc050 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_nvg_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_rifle_module.paa b/TO_MERGE/cse/main/data/cse_rifle_module.paa new file mode 100644 index 0000000000..f386713736 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_rifle_module.paa differ diff --git a/TO_MERGE/cse/main/data/cse_tags_module.paa b/TO_MERGE/cse/main/data/cse_tags_module.paa new file mode 100644 index 0000000000..1710ef74c9 Binary files /dev/null and b/TO_MERGE/cse/main/data/cse_tags_module.paa differ diff --git a/TO_MERGE/cse/main/debug/Debug.h b/TO_MERGE/cse/main/debug/Debug.h new file mode 100644 index 0000000000..16095b6db1 --- /dev/null +++ b/TO_MERGE/cse/main/debug/Debug.h @@ -0,0 +1,9 @@ +// 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 new file mode 100644 index 0000000000..3c87285e10 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_debug.sqf @@ -0,0 +1,66 @@ +/** + * 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 new file mode 100644 index 0000000000..f0a9902ef8 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_debugModule.sqf @@ -0,0 +1,15 @@ +/** + * 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 new file mode 100644 index 0000000000..ef64fa09f8 --- /dev/null +++ b/TO_MERGE/cse/main/debug/functions/fn_traceModule.sqf @@ -0,0 +1,23 @@ +/** + * 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_findItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf new file mode 100644 index 0000000000..b53adb3315 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_findItem.sqf @@ -0,0 +1,25 @@ +/** + * fn_findItem.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_magazine","_return"]; +_unit = _this select 0; +_item = _this select 1; + +if (_item in (uniformItems _unit)) exitwith {1}; +if (_item in (vestItems _unit)) exitwith {2}; +if (_item in (backpackItems _unit)) exitwith {3}; +if (_item in (assignedItems _unit)) exitwith {4}; +if (_item in (primaryWeaponItems _unit)) exitwith {5}; +if (_item in (secondaryWeaponItems _unit)) exitwith {6}; +if (_item in (handgunItems _unit)) exitwith {7}; +if (_item in (items _unit)) exitwith {8}; // in case it is in items but cannot be found in any other container (should never reach this) + +// If we cannot find the item, return 0. +0; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf b/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf new file mode 100644 index 0000000000..14d6a455ec --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_findMagazine.sqf @@ -0,0 +1,21 @@ +/** + * fn_findMagazine.sqf + * @Descr: Find where the current magazines are. Order: uniform, vest, backpack, any. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, magazine STRING (Classname of magazine)] + * @Return: NUMBER 0 = none, 1 = in uniform, 2 = in vest, 3 = in backpack, 4 = found outside container + * @PublicAPI: true + */ + +private ["_unit","_magazine"]; +_unit = _this select 0; +_magazine = _this select 1; + +if (_magazine in (getMagazineCargo uniformContainer _unit)) exitwith {1}; +if (_magazine in (getMagazineCargo vestContainer _unit)) exitwith {2}; +if (_magazine in (getMagazineCargo backpackContainer _unit)) exitwith {3}; +if (_magazine in (magazines _unit)) exitwith {4}; // in case it cannot be found in any other container. Most likely loaded in a weapon. + +// If we cannot find the item, return 0. +0; \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf b/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf new file mode 100644 index 0000000000..0b470c1a20 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_getNumberMagazinesIn.sqf @@ -0,0 +1,26 @@ +/** + * fn_getNumberMagazinesIn.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_magazine"]; +_unit = _this select 0; +_magazine = _this select 1; + +_return = 0; +if (_unit isKindOf "CAManBase") then { + _return = {_x == _magazine} count magazines _unit; +} else { + { + _return = _return + {_x == _magazine} count magazines _x; + }foreach (crew _unit); + + _return = _return + ({_x == _magazine} count getMagazineCargo _unit); +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf new file mode 100644 index 0000000000..a0b07f1852 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_hasItem.sqf @@ -0,0 +1,11 @@ +/** + * fn_hasItem.sqf + * @Descr: Check if unit has item + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, item STRING (Classname of item)] + * @Return: BOOL + * @PublicAPI: true + */ +// 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/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf new file mode 100644 index 0000000000..468c955290 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_hasMagazine.sqf @@ -0,0 +1,21 @@ +/** + * fn_hasMagazine.sqf + * @Descr: Check if given unit has a magazine of given classname + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, magazine STRING] + * @Return: BOOL True if unith as given magazine + * @PublicAPI: true + */ + +private ["_unit","_magazine","_return"]; +_unit = _this select 0; +_magazine = _this select 1; + +if (_magazine != "") then { + _return = (_magazine in magazines _unit); +} else { + _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/equipment/functions/fn_useItem.sqf b/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf new file mode 100644 index 0000000000..fd07398aad --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_useItem.sqf @@ -0,0 +1,36 @@ +/** + * 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/equipment/functions/fn_useMagazine.sqf b/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf new file mode 100644 index 0000000000..0a356aabc5 --- /dev/null +++ b/TO_MERGE/cse/main/equipment/functions/fn_useMagazine.sqf @@ -0,0 +1,28 @@ +/** + * fn_useMagazine.sqf + * @Descr: Use magazine + * @Author: Glowbal + * + * @Arguments: [unit OBJECt, magazine STRING] + * @Return: BOOL True if magazine has been used. + * @PublicAPI: true + */ + +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; +_return +} else +{ + // TODO implement shared magazine functionality +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf b/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf new file mode 100644 index 0000000000..443e6d48f2 --- /dev/null +++ b/TO_MERGE/cse/main/hc/functions/fn_isHC.sqf @@ -0,0 +1,22 @@ +/** + * fn_isHC.sqf + * @Descr: Check if current locality is a headless client + * @Author: Glowbal + * + * @Arguments: [] + * @Return: BOOL True if locality is headless client OR is not in multiplayer + * @PublicAPI: true + */ + +private ["_return"]; + +if (!isMultiplayer) then { + _return = true; +} else { + if (isServer && !isDedicated) then { + _return = true; + } else { + _return = !(hasInterface || isDedicated); + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/main/init.sqf b/TO_MERGE/cse/main/init.sqf new file mode 100644 index 0000000000..3ab0f5f3c4 --- /dev/null +++ b/TO_MERGE/cse/main/init.sqf @@ -0,0 +1,81 @@ +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 new file mode 100644 index 0000000000..51804eec13 --- /dev/null +++ b/TO_MERGE/cse/main/integration/alive/alive_flexiMenu_integration.sqf @@ -0,0 +1,182 @@ + +#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 new file mode 100644 index 0000000000..1ecbbe1767 --- /dev/null +++ b/TO_MERGE/cse/main/integration/alive/alive_gui_integration.sqf @@ -0,0 +1,72 @@ +/** + * 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 new file mode 100644 index 0000000000..4ddb76b131 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_broadcastMonitoredVariable.sqf @@ -0,0 +1,23 @@ +/** + * 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_canInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf new file mode 100644 index 0000000000..496c0a43e5 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_canInteract.sqf @@ -0,0 +1,13 @@ +/** + * fn_canInteract.sqf + * @Descr: Check if unit can interact with enviroment. Unit has to be awake and not be in arrested state. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit can interact with enviroment. + * @PublicAPI: true + */ + +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 diff --git a/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf b/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf new file mode 100644 index 0000000000..62d3e2a989 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getAllMonitoredVariables.sqf @@ -0,0 +1,14 @@ +/** + * 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 new file mode 100644 index 0000000000..f90af6758c --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getCanInteract.sqf @@ -0,0 +1,13 @@ +/** + * 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 new file mode 100644 index 0000000000..d81bfdc24a --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getInteractionTarget.sqf @@ -0,0 +1,14 @@ +/** + * 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 new file mode 100644 index 0000000000..7a721e4c54 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableName.sqf @@ -0,0 +1,20 @@ +/** + * 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 new file mode 100644 index 0000000000..7f2658afec --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getMonitoredVariableValue.sqf @@ -0,0 +1,39 @@ +/** + * 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 new file mode 100644 index 0000000000..8ecae2ba6a --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getOnUpdateVariableEH.sqf @@ -0,0 +1,23 @@ +/** + * 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 new file mode 100644 index 0000000000..90eeed1aa1 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_getRegisteredMonitorVariablesOwners.sqf @@ -0,0 +1,25 @@ +/** + * 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 new file mode 100644 index 0000000000..436979399f --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_isRegisteredInteractingWith.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..bb48949687 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_registerInteractingWith.sqf @@ -0,0 +1,30 @@ +/** + * 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 new file mode 100644 index 0000000000..51f273faa6 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_registerVariableMonitor.sqf @@ -0,0 +1,34 @@ +/** + * 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_setCanInteract.sqf b/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf new file mode 100644 index 0000000000..2d7ca320b5 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setCanInteract.sqf @@ -0,0 +1,26 @@ +/** + * fn_setCanInteract.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +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; +}; +_return \ 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 new file mode 100644 index 0000000000..c0da8c58f6 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setMonitoredVariableValue.sqf @@ -0,0 +1,35 @@ +/** + * 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 new file mode 100644 index 0000000000..63021c0287 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_setOnUpdateVariableEH.sqf @@ -0,0 +1,17 @@ +/** + * 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 new file mode 100644 index 0000000000..d3621d1462 --- /dev/null +++ b/TO_MERGE/cse/main/interaction/functions/fn_unregisterInteractingWith.sqf @@ -0,0 +1,38 @@ +/** + * 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/messages/functions/fn_sendDisplayInformationTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf new file mode 100644 index 0000000000..b8a47455ce --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayInformationTo.sqf @@ -0,0 +1,46 @@ +/** + * fn_sendDisplayInformationTo.sqf + * @Descr: Sends a display information hint to a receiver + * @Author: Glowbal + * + * @Arguments: [receiver OBJECT, title STRING, content ARRAY (An array with strings), type NUMBER (Optional)] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; +_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_title = [_this, 1, "",[""]] call BIS_fnc_Param; +_content = [_this, 2, [""],[[""]]] call BIS_fnc_Param; +_type = [_this, 3, 0,[0]] call BIS_fnc_Param; +_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; + } else { + + if (isLocalized _title) then { + _title = localize _title; + }; + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; + + { + if (isLocalized _x) then { + _localizationArray = [localize _x]; + { + _localizationArray pushback _x; + }foreach _parameters; + + _content set [_foreachIndex, format _localizationArray]; + }; + + }foreach _content; + + [_title,_content,_type] call cse_fnc_gui_displayInformation; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf new file mode 100644 index 0000000000..da02f48dbc --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendDisplayMessageTo.sqf @@ -0,0 +1,46 @@ +/** + * fn_sendDisplayMessageTo.sqf + * @Descr: Displays a message on locality of receiver + * @Author: Glowbal + * + * @Arguments: [receiver OBJECT, title STRING, content STRING, type NUMBER (Optional)] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_title","_content","_type", "_parameters", "_localizationArray"]; +_reciever = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_title = [_this, 1, "",[""]] call BIS_fnc_Param; +_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; + } else { + + if (isLocalized _title) then { + _title = localize _title; + }; + if (isLocalized _content) then { + _content = localize _content; + }; + + _localizationArray = [_title]; + { + _localizationArray pushback _x; + }foreach _parameters; + _title = format _localizationArray; + + _localizationArray = [_content]; + { + _localizationArray pushback _x; + }foreach _parameters; + _content = format _localizationArray; + + [_title,_content,_type] call cse_fnc_gui_displayMessage; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf new file mode 100644 index 0000000000..a86bc0bc2d --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendHintTo.sqf @@ -0,0 +1,23 @@ +/** + * fn_sendHintTo.sqf + * @Descr: Sends a hint to player unit across network + * @Author: Glowbal + * + * @Arguments: [reciever OBJECT, message STRING] + * @Return: void + * @PublicAPI: true + */ + + +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; + } else { + hintsilent format ["%1",_message]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf b/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf new file mode 100644 index 0000000000..f54d49d6d5 --- /dev/null +++ b/TO_MERGE/cse/main/messages/functions/fn_sendMessageTo.sqf @@ -0,0 +1,22 @@ +/** + * fn_sendMessageTo.sqf + * @Descr: Sends a chat message to player unit across the network + * @Author: Glowbal + * + * @Arguments: [reciever OBJECT, message STRING] + * @Return: void + * @PublicAPI: true + */ + +private ["_reciever","_message"]; +_reciever = _this select 0; +_message = _this select 1; + + +if (isPlayer _reciever) then { + if (!local _reciever) then { + [_this, "cse_fnc_sendMessageTo", _reciever, false] spawn BIS_fnc_MP; + } else { + CSE_LOGIC_OBJECT globalChat format ["%1",_message]; + }; +}; diff --git a/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf new file mode 100644 index 0000000000..b44904ae10 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_broadcastSound3D_f.sqf @@ -0,0 +1,16 @@ +/** + * fn_broadcastSound3D_f.sqf + * @Descr: Plays a sound in 3D + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, sound STRING] + * @Return: void + * @PublicAPI: true + */ + + + +if (isDedicated) exitwith{}; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_sound = [_this, 1, "",[""]] call BIS_fnc_Param; +_unit say3D _sound; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf new file mode 100644 index 0000000000..4d9cb33837 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_closeAllDialogs_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_closeAllDialogs_f.sqf + * @Descr: Close all dialogs + * @Author: Glowbal + * + * @Arguments: [] + * @Return: void + * @PublicAPI: true + */ + + +while {dialog} do { + closeDialog 0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf new file mode 100644 index 0000000000..d2ad392559 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableAI_f.sqf @@ -0,0 +1,23 @@ +/** + * fn_disableAI_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +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"; + }; +}; \ 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 new file mode 100644 index 0000000000..679ca870a1 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableKeyInput_f.sqf @@ -0,0 +1,77 @@ +/** + * 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 new file mode 100644 index 0000000000..a2832cfebc --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_disableUserInput_f.sqf @@ -0,0 +1,28 @@ +/** + * 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_dropWeapon_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf new file mode 100644 index 0000000000..4a23b214b5 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_dropWeapon_f.sqf @@ -0,0 +1,39 @@ +/** + * fn_dropWeapon_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_currentWeapon","_currentAnimation", "_WeaponHolder"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; + +_currentWeapon = currentWeapon _unit; +_currentAnimation = animationState _unit; +_WeaponHolder = "GroundWeaponHolder" createVehicle position _unit; + +_unit removeWeapon _currentWeapon; +_weaponHolder addWeaponCargoGlobal [_currentWeapon, 1]; +//_unit action [ "DropWeapon", _WeaponHolder, _currentWeapon ]; +_WeaponHolder setPos (getPos _unit); +//_unit switchMove _currentAnimation; + +_primairyWeapon = primaryWeapon _unit; +_secondairyWeapon = secondaryWeapon _unit; +_handGunWeapon = handgunWeapon _unit; + +switch (_currentWeapon) do { + case _primairyWeapon: { + + }; + case _secondairyWeapon: { + + }; + case _handGunWeapon: { + + }; + default {}; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf new file mode 100644 index 0000000000..86457e708c --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_endRadioTransmission_f.sqf @@ -0,0 +1,29 @@ +/** + * 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_getFirstObjectIntersection.sqf b/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf new file mode 100644 index 0000000000..9d57ea57a1 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getFirstObjectIntersection.sqf @@ -0,0 +1,44 @@ +/** + * fn_getFirstIntersection.sqf + * @Descr: Returns the the first intersection with an object between two positions + * @Author: Ruthberg + * + * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] + * @Return: [intersects BOOL, intersection PositionASL] + * @PublicAPI: true + */ + + +private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; +_source = _this select 0; +_destination = _this select 1; +_accuracy = _this select 2; + +_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))]; +}; + +_result diff --git a/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf b/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf new file mode 100644 index 0000000000..57ff80fa60 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getFirstTerrainIntersection.sqf @@ -0,0 +1,44 @@ +/** + * fn_getFirstIntersection.sqf + * @Descr: Returns the the first intersection with an object between two positions + * @Author: Ruthberg + * + * @Arguments: [position PositionASL, position PositionASL, accuracy FLOAT] + * @Return: [intersects BOOL, intersection PositionASL] + * @PublicAPI: true + */ + + +private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; +_source = _this select 0; +_destination = _this select 1; +_accuracy = _this select 2; + +_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))]; +}; + +_result diff --git a/TO_MERGE/cse/main/misc/functions/fn_getName.sqf b/TO_MERGE/cse/main/misc/functions/fn_getName.sqf new file mode 100644 index 0000000000..b7b4c9bda8 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getName.sqf @@ -0,0 +1,26 @@ +/** + * 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_getWeaponItems_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf new file mode 100644 index 0000000000..7128ceb09c --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_getWeaponItems_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_getWeaponItems_f.sqf + * @Descr: Get the weapon items from the unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: + * @PublicAPI: false + */ + +private "_unit"; +_unit = _this select 0; + +[primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; \ 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 new file mode 100644 index 0000000000..6091895503 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_hasItem_f.sqf @@ -0,0 +1,16 @@ +/** + * 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_inWater_f.sqf b/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf new file mode 100644 index 0000000000..93027ffe7d --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_inWater_f.sqf @@ -0,0 +1,20 @@ +/** + * fn_inWater_f.sqf + * @Descr: Check if unit is underwater + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit is in the water + * @PublicAPI: true + */ + +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; + }; +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf b/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf new file mode 100644 index 0000000000..a8afe16aa6 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_isAwake.sqf @@ -0,0 +1,13 @@ +/** + * fn_isAwake.sqf + * @Descr: Check if unit is awake. Will be false when death or unit is unconscious. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if unit is awake + * @PublicAPI: true + */ + +private ["_unit","_return"]; +_unit = _this select 0; +(!([_unit] call cse_fnc_isUnconscious)) && alive _unit && !(_unit getvariable ["cse_isDead",false]); diff --git a/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf b/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf new file mode 100644 index 0000000000..6b08e969f0 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_isInBuilding.sqf @@ -0,0 +1,23 @@ +/** + * 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 new file mode 100644 index 0000000000..adf55eed55 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_lockVehicleOfUnitUntil.sqf @@ -0,0 +1,38 @@ +/** + * 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 new file mode 100644 index 0000000000..f7541e4d58 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_moduleEnableBasicRevive.sqf @@ -0,0 +1,36 @@ +/** + * 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 new file mode 100644 index 0000000000..7937c359a2 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_resetAllDefaults_f.sqf @@ -0,0 +1,51 @@ +/** + * 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 new file mode 100644 index 0000000000..e711fe6c91 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_revealObject_f.sqf @@ -0,0 +1,4 @@ + +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 new file mode 100644 index 0000000000..dd85ecea06 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setDead.sqf @@ -0,0 +1,101 @@ +/** + * 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_setHearingCapability.sqf b/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf new file mode 100644 index 0000000000..b1e29dc68f --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setHearingCapability.sqf @@ -0,0 +1,53 @@ +/** + * fn_setHearingCapability.sqf + * @Descr: Handle set volume calls. Will use the lowest available volume setting. + * @Author: Glowbal + * + * @Arguments: [id STRING, settings NUMBER, add BOOL (Optional. True will add, false will remove. Default value is true)] + * @Return: nil + * @PublicAPI: true + */ + +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; +}; + +_map = missionNamespace getVariable ["cse_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]; + }; + }; +} forEach _map; + +if (!_exists && _add) then { + _map pushBack [_id, _settings]; +}; + +missionNamespace setVariable ["cse_setHearingCapabilityMap", _map]; + +// find lowest volume +_lowestVolume = 1; +{ + _lowestVolume = (_x select 1) min _lowestVolume; +} forEach _map; + +// in game sounds +0 fadeSound _lowestVolume; +0 fadeRadio _lowestVolume; +0 fadeMusic _lowestVolume; + +// Set Radio mod variables. +player setVariable ["tf_globalVolume", _lowestVolume]; +player setVariable ["acre_sys_core_globalVolume", _lowestVolume]; diff --git a/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf b/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf new file mode 100644 index 0000000000..0ad2a231eb --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setProne.sqf @@ -0,0 +1,26 @@ +/** + * 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 new file mode 100644 index 0000000000..44d4179091 --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_setVolume_f.sqf @@ -0,0 +1,45 @@ +/** + * 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 new file mode 100644 index 0000000000..6a28fa473a --- /dev/null +++ b/TO_MERGE/cse/main/misc/functions/fn_switchToGroupSide_f.sqf @@ -0,0 +1,65 @@ +/** + * 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 new file mode 100644 index 0000000000..7ccf6c5d27 --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_ALiVE_BUS_Mod.sqf @@ -0,0 +1,16 @@ +/** + * 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 new file mode 100644 index 0000000000..12a37391ae --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_isLoaded_ALiVE_Mod.sqf @@ -0,0 +1,12 @@ +/** + * 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/mods/functions/fn_isModLoaded_f.sqf b/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf new file mode 100644 index 0000000000..3be56bff11 --- /dev/null +++ b/TO_MERGE/cse/main/mods/functions/fn_isModLoaded_f.sqf @@ -0,0 +1,14 @@ +/** + * fn_isModLoaded_f.sqf + * Descr: Check in cfgPatches if modification is loaded + * Author: Glowbal + * + * Arguments: [modName STRING (Classname of the mod in cfgPatches)] + * Return: BOOL true if modification is loaded + * PublicAPI: true + */ + +private ["_modName"]; +_modName = [_this, 0, "",[""]] call BIS_fnc_Param; + +(isClass (configFile >> "cfgPatches" >> _modName)) \ 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 new file mode 100644 index 0000000000..895687082f --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_createMutex.sqf @@ -0,0 +1,24 @@ +/** + * 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 new file mode 100644 index 0000000000..536176bcba --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_lockMutex.sqf @@ -0,0 +1,24 @@ +/** + * 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 new file mode 100644 index 0000000000..8e29633dc5 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_releaseMutex.sqf @@ -0,0 +1,24 @@ +/** + * 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 new file mode 100644 index 0000000000..4e626cc6c1 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_waitForMultipleMutex.sqf @@ -0,0 +1,18 @@ +/** + * 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 new file mode 100644 index 0000000000..5d04a60968 --- /dev/null +++ b/TO_MERGE/cse/main/mutex/functions/fn_waitForSingleMutex.sqf @@ -0,0 +1,28 @@ +/** + * 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/ragdoll/functions/fn_ragdoll_f.sqf b/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf new file mode 100644 index 0000000000..2e2710509b --- /dev/null +++ b/TO_MERGE/cse/main/ragdoll/functions/fn_ragdoll_f.sqf @@ -0,0 +1,11 @@ +/** + * fn_ragdoll_f.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +// Deleted. \ 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 new file mode 100644 index 0000000000..8f2420f7ba --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_onAnswerRequest.sqf @@ -0,0 +1,37 @@ +/** + * 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 new file mode 100644 index 0000000000..8e1502edc1 --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_receiveRequest.sqf @@ -0,0 +1,67 @@ +/** + * 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/requests/functions/fn_requestCallback.sqf b/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf new file mode 100644 index 0000000000..1896f8b3dc --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_requestCallback.sqf @@ -0,0 +1,21 @@ +/** + * fn_requestCallback.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_info", "_accepted", "_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +_info = _this select 0; +_accepted = _this select 1; + +_caller = _info select 0; +_target = _info select 1; +_requestID = _info select 2; +_requestMessage = _info select 3; +_callBack = _info select 4; + +[_caller, _target, _accepted] call compile _callBack; \ No newline at end of file diff --git a/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf b/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf new file mode 100644 index 0000000000..2ba9cbc9f1 --- /dev/null +++ b/TO_MERGE/cse/main/requests/functions/fn_sendRequest_f.sqf @@ -0,0 +1,26 @@ +/** + * fn_sendRequest_f.sqf + * @Descr: Send a request to an unit and execute code based upon results. + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, target OBJECT, requestID STRING, requestMessage STRING (Will be localized for other target object), callback CODE (Code called upon accept or decline.)] + * @Return: void + * @PublicAPI: true + */ + +private ["_caller", "_target", "_requestMessage", "_requestID", "_callBack"]; +_caller = _this select 0; +_target = _this select 1; +_requestID = _this select 2; +_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; +} else { + // accept it, since it's an AI. + [_caller, _target, true] spawn 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/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf b/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf new file mode 100644 index 0000000000..75ae1ff3b7 --- /dev/null +++ b/TO_MERGE/cse/main/strings/functions/fn_stringCompare.sqf @@ -0,0 +1,33 @@ +/** + * fn_stringCompare.sqf + * @Descr: Determines whether one string matches another and how many characters match. Case insensitive. + * @Author: bovine3dom + * + * @Arguments: [stringA STRING, stringB STRING] + * @Return: NUMBER Number of matching characters + * @PublicAPI: true + */ + +private ["_searchTerm", "_string", "_arraySearchTerm", "_arrayString", "_sizeSearchTerm", "_sizeString", "_matchingCharacters", "_searchIterator", "_targetIterator"]; +_string = toLower (_this select 0); // removes case sensitivity +_searchTerm = toLower (_this select 1); + + +_arraySearchTerm = toArray _searchTerm; // splits string into array of unicode decimals +_arrayString = toArray _string; +_sizeSearchTerm = count _arraySearchTerm; // We only measure the array once +_sizeString = count _arrayString; + + +_matchingCharacters = 0; +_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 + }; + _targetIterator = _targetIterator + 1; // Look at the next character in the string +}; + +_matchingCharacters \ No newline at end of file diff --git a/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf b/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf new file mode 100644 index 0000000000..b17a582697 --- /dev/null +++ b/TO_MERGE/cse/main/strings/functions/fn_string_removeWhiteSpace.sqf @@ -0,0 +1,19 @@ +/** + * fn_stringTrim.sqf + * @Descr: Removes white spaces from string + * @Author: Glowbal + * + * @Arguments: [string STRING] + * @Return: STRING copy of string + * @PublicAPI: true + */ + +#define WHITE_SPACE [20] + +private ["_string", "_charArray", "_returnString"]; +_string = [_this, 0, "",[""]] call bis_fnc_param; +_charArray = toArray _string; +_charArray = _charArray - [((toArray " ") select 0)]; +_returnString = toString _charArray; + +_returnString; \ No newline at end of file diff --git a/TO_MERGE/cse/main/stringtable.xml b/TO_MERGE/cse/main/stringtable.xml new file mode 100644 index 0000000000..a0493c1ae5 --- /dev/null +++ b/TO_MERGE/cse/main/stringtable.xml @@ -0,0 +1,27 @@ + + + + + + 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 new file mode 100644 index 0000000000..d9d9776bed --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_addTaskToPool_f.sqf @@ -0,0 +1,22 @@ +/** + * 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 new file mode 100644 index 0000000000..5a44c14bdb --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_loopThroughPool_f.sqf @@ -0,0 +1,17 @@ +/** + * 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 new file mode 100644 index 0000000000..0699208043 --- /dev/null +++ b/TO_MERGE/cse/main/tasks/functions/fn_removeTaskFromPool_f.sqf @@ -0,0 +1,25 @@ +/** + * 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 new file mode 100644 index 0000000000..da83e326fc --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_defineVariable.sqf @@ -0,0 +1,39 @@ +/** + * 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_getAllSetVariables.sqf b/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf new file mode 100644 index 0000000000..52ffe02a36 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getAllSetVariables.sqf @@ -0,0 +1,27 @@ +/** + * fn_getAllSetVariables.sqf + * @Descr: Returns an 2d array of all variables that have been set on the object + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, category STRING (Optional. Only get the variables from the specified category. Default is "" == all)] + * @Return: ARRAY REturns an array with the format [ [name STRING, typeName STRING, value ANY, publicFlag BOOL, peristentFlag BOOL] ] + * @PublicAPI: true + */ + +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 = []; +}; +_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; +_return \ 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 new file mode 100644 index 0000000000..84f37c9387 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getVariable.sqf @@ -0,0 +1,31 @@ +/** + * 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 new file mode 100644 index 0000000000..f187f3b05a --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getvariableDefault.sqf @@ -0,0 +1,18 @@ +/** + * 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/variables/functions/fn_getvariableInfo.sqf b/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf new file mode 100644 index 0000000000..0909925f17 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_getvariableInfo.sqf @@ -0,0 +1,11 @@ +/** + * fn_getvariableInfo.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + ++(missionNamespace getvariable ["cse_object_variables_storage_" + (_this select 0),[]]) \ No newline at end of file diff --git a/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf b/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf new file mode 100644 index 0000000000..e2119fcb37 --- /dev/null +++ b/TO_MERGE/cse/main/variables/functions/fn_setVariable.sqf @@ -0,0 +1,29 @@ +/** + * fn_setVariable.sqf + * @Descr: Setvariable value + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, variableName STRING, value ANY] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; +_unit = _this select 0; +_variable = _this select 1; +_value = _this select 2; +_global = false; + +if (count _this > 3) then { + _global = _this select 3; +} else { + _definedVariable = ([_variable] call cse_fnc_getVariableInfo); + if (count _definedVariable > 2) then { + _global = _definedVariable select 2; + }; +}; + +if (!isNil "_value") exitwith { + _unit setvariable [_variable, _value, _global]; +}; +_unit setvariable [_variable, nil, _global]; \ 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 new file mode 100644 index 0000000000..c3953426f0 --- /dev/null +++ b/TO_MERGE/cse/main/version/functions/fn_getVersion.sqf @@ -0,0 +1,11 @@ +/** + * 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/TO_MERGE/cse/nametags/CfgEventHandlers.hpp b/TO_MERGE/cse/nametags/CfgEventHandlers.hpp new file mode 100644 index 0000000000..ab75a246bb --- /dev/null +++ b/TO_MERGE/cse/nametags/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_postInit.sqf) ); + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/CfgVehicles.hpp b/TO_MERGE/cse/nametags/CfgVehicles.hpp new file mode 100644 index 0000000000..a0d8133e8a --- /dev/null +++ b/TO_MERGE/cse/nametags/CfgVehicles.hpp @@ -0,0 +1,64 @@ +// TODO Check what faction classes are available within ACE and move this to a core pbo +class CfgFactionClasses +{ + class NO_CATEGORY; + class ACEMisc: NO_CATEGORY { + displayName = "ACE Misc Modules"; + }; +}; + + +class CfgVehicles +{ + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class GVAR(Module): Module_F { + scope = 2; + displayName = $STR_ACE_NameTags_Title; + icon = QUOTE(PATHOF(data\module_icon.paa)); + category = "ACEMisc"; + function = QUOTE(FUNC(initalizeModule)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class enableModule { + displayName = $STR_ACE_NameTags_Arg_enable; + description = $STR_ACE_NameTags_Arg_enable_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + class indirectDistance { + displayName = $STR_ACE_NameTags_Arg_indirectDistance; + description = $STR_ACE_NameTags_Arg_indirectDistance_Desc; + typeName = "NUMBER"; + defaultValue = 7.5; + }; + class cursorTargetDistance { + displayName = $STR_ACE_NameTags_Arg_directDistance; + description = $STR_ACE_NameTags_Arg_directDistance_Desc; + typeName = "NUMBER"; + defaultValue = 20; + }; + class allowDifferentSides { + displayName = $STR_ACE_NameTags_Arg_differentSides; + description = $STR_ACE_NameTags_Arg_differentSides_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableSoundWaves { + displayName = $STR_ACE_NameTags_Arg_soundWaves; + description = $STR_ACE_NameTags_Arg_soundWaves_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = $STR_ACE_NameTags_ModuleDesc; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/XEH_postInit.sqf b/TO_MERGE/cse/nametags/XEH_postInit.sqf new file mode 100644 index 0000000000..97b6926c5b --- /dev/null +++ b/TO_MERGE/cse/nametags/XEH_postInit.sqf @@ -0,0 +1,66 @@ +/** + * XEH_postInit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated server. + +#include "script_component.hpp" + +// Settings +if (isNil QUOTE(ACE_NameTagsModule)) then { + GVAR(INDIRECT_TAGS_DISTANCE) = 7.5; + GVAR(DIRECT_TAG_DISTANCE) = 20; + GVAR(ENABLE_SOUNDWAVES) = false; + GVAR(ALLOW_OWN_SIDE_ONLY) = true; + GVAR(ENABLE_MODULE) = true; +}; + +// In case the module has been placed and the enable setting has been put to false +if (!GVAR(ENABLE_MODULE)) exitwith {}; + +// Client side options +// TODO Implement a framework for adjusting client side settings. +GVAR(DRAW_TAG_ICONS) = true; +GVAR(ENABLE_INDIRECT) = false; +GVAR(TAG_DISPLAY_COLOR) = [1,1,1,1]; +GVAR(SHOW_SOUNDWAVES) = false; +GVAR(DISPLAY_RANK) = false; + +// If the distance values are set incorrectly, ensure we handle this +if (GVAR(DIRECT_TAG_DISTANCE) < GVAR(INDIRECT_TAGS_DISTANCE)) then { + GVAR(DIRECT_TAG_DISTANCE) = GVAR(INDIRECT_TAGS_DISTANCE); +}; + +// If both are below 1m, exit because they will not show up. +if (GVAR(DIRECT_TAG_DISTANCE) < 1) exitwith {}; + +// Draw the icons for each nametag +// TODO Look into replacement with cutRsc instead of icon3d +addMissionEventHandler ["Draw3D", FUNC(drawNameTags)]; + +if (GVAR(ENABLE_SOUNDWAVES)) then { + + GVAR(SOUNDWAVE_ICONS) = [QUOTE(PATHTOF(data\soundwaves\soundwave1.paa)),QUOTE(PATHTOF(data\soundwaves\soundwave2.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave3.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave4.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave5.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave6.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave7.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave8.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave9.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave_silent.paa))]; + + // TODO Implement function for checking if an addon is loaded + //if (["task_force_radio"] call ace_fnc_isModLoaded_F) then { + if (isnil "TFAR_fnc_isSpeaking") then { + TFAR_fnc_isSpeaking = { if (!isnil "TF_tangent_lr_pressed") then {(TF_tangent_lr_pressed || TF_tangent_sw_pressed || TF_tangent_dd_pressed)} else { false }; }; + }; + //}; + + // TODO Move to unscheduled environment with PFH + [] spawn { + waituntil{ + waituntil {alive player}; + /*ACE_player*/ player call FUNC(handleSpeaking); + !GVAR(ENABLE_SOUNDWAVES); // exit when the soundwaves have been disabled + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/XEH_preInit.sqf b/TO_MERGE/cse/nametags/XEH_preInit.sqf new file mode 100644 index 0000000000..702a785859 --- /dev/null +++ b/TO_MERGE/cse/nametags/XEH_preInit.sqf @@ -0,0 +1,17 @@ +/** + * XEH_preInit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +PREP(drawNameTags); +PREP(findNearbyUnits); +PREP(handleSpeaking); +PREP(allowSide); +PREP(initalizeModule); diff --git a/TO_MERGE/cse/nametags/config.cpp b/TO_MERGE/cse/nametags/config.cpp new file mode 100644 index 0000000000..8a90482389 --- /dev/null +++ b/TO_MERGE/cse/nametags/config.cpp @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ACE_gui","ACE_main"}; + version = VERSION; + author[] = {$STR_ACE_Core_ACETeam}; + authorUrl = "http://ACEmod.com"; // TODO website link? + }; +}; + +class CfgAddons { + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgEventHandlers.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/data/empty.paa b/TO_MERGE/cse/nametags/data/empty.paa new file mode 100644 index 0000000000..a354c7eb38 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/empty.paa differ diff --git a/TO_MERGE/cse/nametags/data/module_icon.paa b/TO_MERGE/cse/nametags/data/module_icon.paa new file mode 100644 index 0000000000..1710ef74c9 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/module_icon.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave1.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave1.paa new file mode 100644 index 0000000000..ce4f85eb69 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave1.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave2.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave2.paa new file mode 100644 index 0000000000..0bc59cde24 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave2.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave3.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave3.paa new file mode 100644 index 0000000000..39f3e8e95b Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave3.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave4.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave4.paa new file mode 100644 index 0000000000..7ab8b6d944 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave4.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave5.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave5.paa new file mode 100644 index 0000000000..f3e98d47aa Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave5.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave6.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave6.paa new file mode 100644 index 0000000000..3f29976c9f Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave6.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave7.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave7.paa new file mode 100644 index 0000000000..e705c70b42 Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave7.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave8.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave8.paa new file mode 100644 index 0000000000..e6027d878a Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave8.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave9.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave9.paa new file mode 100644 index 0000000000..91ddfd02df Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave9.paa differ diff --git a/TO_MERGE/cse/nametags/data/soundwaves/soundwave_silent.paa b/TO_MERGE/cse/nametags/data/soundwaves/soundwave_silent.paa new file mode 100644 index 0000000000..27f34b38ab Binary files /dev/null and b/TO_MERGE/cse/nametags/data/soundwaves/soundwave_silent.paa differ diff --git a/TO_MERGE/cse/nametags/functions/fnc_allowSide.sqf b/TO_MERGE/cse/nametags/functions/fnc_allowSide.sqf new file mode 100644 index 0000000000..d28c9a336d --- /dev/null +++ b/TO_MERGE/cse/nametags/functions/fnc_allowSide.sqf @@ -0,0 +1,15 @@ +/** + * fn_allowSide_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: side + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +if (GVAR(ALLOW_OWN_SIDE_ONLY)) exitwith { + _this == playerSide; /* side ACE_player */ +}; +((_this getFriend playerSide /* side ACE_player */ ) >= 0.6); \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/functions/fnc_drawNameTags.sqf b/TO_MERGE/cse/nametags/functions/fnc_drawNameTags.sqf new file mode 100644 index 0000000000..da05c477e4 --- /dev/null +++ b/TO_MERGE/cse/nametags/functions/fnc_drawNameTags.sqf @@ -0,0 +1,71 @@ +/** + * fn_drawNameTags_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" +#define FONT "EtelkaMonospacePro" + +private ["_cursor","_soundWaves", "_nameOfUnit","_pos","_color", "_nearbyUnits", "_iconOptions", "_iconSets", "_unit", "_colorOfIcon", "_nearObj"]; +if (visibleMap || !GVAR(DRAW_TAG_ICONS)) exitwith {}; + +_nearObj = if (isNull curatorCamera) then {/* ACE_player */ if (isNull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) then { player} else {(missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull]) }; } else { curatorCamera }; + +if (GVAR(ENABLE_INDIRECT)) then { + { + _nameOfUnit = _x select 0; + _pos = _x select 1; + _color = _x select 2; + _unit = _x select 3; + _iconDrawn = QUOTE(PATHTOF(data\empty.paa)); + if (_unit getvariable [QGVAR(isSpeaking),false] && GVAR(SHOW_SOUNDWAVES)) then { + _iconDrawn = (GVAR(SOUNDWAVE_ICONS) select ((round(random (count GVAR(SOUNDWAVE_ICONS) - 1))))); + }; + drawIcon3D [_iconDrawn,_color, _pos, 2, 2, 1 ,toUpper _nameOfUnit, 1, 0.03, FONT]; + false; + }count (_nearObj call FUNC(findNearbyUnits)); +}; + +_cursor = cursortarget; +if (_cursor == _cursor && isTouchingGround _cursor) then { + if (_cursor isKindOf "CAManBase" && ((_cursor distance _nearObj) < GVAR(DIRECT_TAG_DISTANCE)) && ((side _cursor) call FUNC(allowSide))) then { + + // TODO Improve this switch statement + _pos = visiblePositionASL _cursor; + switch (stance _cursor) do { + case "STAND": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+2]; + }; + case "CROUCH": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+1.5]; + }; + case "PRONE": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+0.5]; + }; + default { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2) + 1.5]; + }; + }; + _color = +GVAR(TAG_DISPLAY_COLOR); + + _nameOfUnit = name _cursor; //[_cursor] call FUNC(getName); // TODO Implement a getName function + // TODO implement module checking + /*if (ACE_NameTags_SYS_MEDICAL_SYSTEM_ENABLED_TAGS) then { + _status = [_cursor] call FUNC(getTriageStatus_CMS); + if ((_status select 1) >0) then { + _nameOfUnit = _nameOfUnit + " ["+ (_status select 0) + "]"; + _color = _status select 2; + }; + };*/ + _iconDrawn = QUOTE(PATHTOF(data\empty.paa)); + if (_unit getvariable [QGVAR(isSpeaking),false] && GVAR(SHOW_SOUNDWAVES)) then { + _iconDrawn = (GVAR(SOUNDWAVE_ICONS) select ((round(random (count GVAR(SOUNDWAVE_ICONS) - 1))))); + }; + drawIcon3D [_iconDrawn,_color, _pos, 2, 2, 1 ,toUpper _nameOfUnit, 1, 0.03, FONT]; + + }; +}; diff --git a/TO_MERGE/cse/nametags/functions/fnc_findNearbyUnits.sqf b/TO_MERGE/cse/nametags/functions/fnc_findNearbyUnits.sqf new file mode 100644 index 0000000000..122823c46c --- /dev/null +++ b/TO_MERGE/cse/nametags/functions/fnc_findNearbyUnits.sqf @@ -0,0 +1,65 @@ +/** + * fn_findNearbyUnits_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_info", "_nameOfUnit", "_color", "_isTalking", "_pos", "_nearest"]; +_info = []; +if (alive player) then { + _nearest = (_this nearEntities [["CAManBase"], GVAR(INDIRECT_TAGS_DISTANCE)]); + { + if (_x != _this && (vehicle _x == _x) && isTouchingGround _X) then { + if (lineIntersects [eyePos _this, eyePos _x, _x, _this]) exitwith{}; + if ((side _x) call FUNC(allowSide) && !(_x == cursortarget)) then { + _nameOfUnit = name _x; + if (_x getvariable ["ACE_isDead",false]) then { // TODO, how do we check for dead units? + _nameOfUnit = _unit getvariable ["ACE_name","Unknown"]; // TODO is there are function to get the name of a unit? + }; + _pos = visiblePositionASL _x; + + // TODO This can be done better + switch (stance _x) do { + case "STAND": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2)+2]; + }; + case "CROUCH": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2)+1.5]; + }; + case "PRONE": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2) + 0.5]; + }; + default { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2) + 1.5]; + }; + }; + + _color = +GVAR(TAG_DISPLAY_COLOR); + _color set [3, 0]; + _isTalking = (_x getvariable [QGVAR(isSpeaking),false]); + + // TODO implement module checking + /*if (ACE_NameTags_SYS_MEDICAL_SYSTEM_ENABLED_TAGS) then { + _status = [_x] call FUNC(getTriageStatus_CMS; + if ((_status select 1) >0) then { + _nameOfUnit = _nameOfUnit + " ["+ (_status select 0) + "]"; + _color = _status select 2; + }; + };*/ + if (GVAR(DISPLAY_RANK)) then { + _nameOfUnit = (rank _x) + " " + _nameOfUnit; + }; + _color set [3,(1-((_x distance _this) / GVAR(INDIRECT_TAGS_DISTANCE))) + 0.05]; + _info pushback [_nameOfUnit, _pos, _color, _x]; + }; + }; + }foreach _nearest; +}; + +_info; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/functions/fnc_handleSpeaking.sqf b/TO_MERGE/cse/nametags/functions/fnc_handleSpeaking.sqf new file mode 100644 index 0000000000..a61f810969 --- /dev/null +++ b/TO_MERGE/cse/nametags/functions/fnc_handleSpeaking.sqf @@ -0,0 +1,40 @@ +/** + * fn_handleSpeaking_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +// TODO Implement a check mod loaded function +#define ACTION_PUSH_TO_TALK_PRESSED (inputAction "PushToTalk" > 0) +#define ACTION_TFAR_RADIO_ACTIVE false // [] call {if (["task_force_radio"] call FUNC(isModLoaded_F)) then {player call TFAR_fnc_isSpeaking} else { false };} +#define ACTION_ACRE_RADIO_ACTIVE false // [] call {if (["acre_api"] call FUNC(isModLoaded_F)) then {[player] call ACRE_api_fnc_isBroadcasting} else { false };} + +private ["_unit"]; +_unit = _this select 0; + +if (_unit != player /* _unit != ACE_Player */) exitwith {}; + +// TODO check mod loaded function +/*if (["task_force_radio"] call FUNC(isModLoaded_F)) then { + waituntil {!isnil "TF_tangent_lr_pressed"}; +};*/ + +waituntil { + if (ACTION_TFAR_RADIO_ACTIVE || ACTION_PUSH_TO_TALK_PRESSED || ACTION_ACRE_RADIO_ACTIVE) then { + if !(_unit getvariable [QGVAR(isSpeaking), false]) then { + _unit setvariable [QGVAR(isSpeaking), true, true]; + }; + } else { + if (_unit getvariable [QGVAR(isSpeaking), false]) then { + _unit setvariable [QGVAR(isSpeaking), false, true]; + }; + }; + !(alive _unit) /* _unit != ACE_Player */ +}; + +_unit setvariable [QGVAR(isSpeaking),nil,true]; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/functions/fnc_initalizeModule.sqf b/TO_MERGE/cse/nametags/functions/fnc_initalizeModule.sqf new file mode 100644 index 0000000000..7db37789db --- /dev/null +++ b/TO_MERGE/cse/nametags/functions/fnc_initalizeModule.sqf @@ -0,0 +1,24 @@ +/** + * fnc_initalizeModule.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated server. + +private ["_logic"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + // TODO default values should be defined somewhere through an include, so they are the same in CfgVehicles and here. + GVAR(ENABLE_MODULE) = _logic getvariable ["enableModule", false]; + GVAR(INDIRECT_TAGS_DISTANCE) = _logic getvariable ["indirectDistance", 7.5]; + GVAR(DIRECT_TAG_DISTANCE) = _logic getvariable ["cursorTargetDistance", 20]; + GVAR(ALLOW_OWN_SIDE_ONLY) = !(_logic getvariable ["allowDifferentSides", false]); + GVAR(ENABLE_SOUNDWAVES) = _logic getvariable ["enableSoundWaves", false]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/script_component.hpp b/TO_MERGE/cse/nametags/script_component.hpp new file mode 100644 index 0000000000..4637f8de75 --- /dev/null +++ b/TO_MERGE/cse/nametags/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT nametags +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_NAMETAGS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_NAMETAGS + #define DEBUG_SETTINGS DEBUG_SETTINGS_NAMETAGS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/nametags/stringtable.xml b/TO_MERGE/cse/nametags/stringtable.xml new file mode 100644 index 0000000000..53100d4ceb --- /dev/null +++ b/TO_MERGE/cse/nametags/stringtable.xml @@ -0,0 +1,43 @@ + + + + + + Name Tags [ACE] + + + Enable Name Tags + + + Enable the name tags + + + Indirect Distance + + + Distance for indirect Tags + + + Target Distance + + + Distance for the direct Tag (Cursortarget) + + + Enable Soundwaves + + + Enable Soundwaves when a player is speaking + + + Allow Different sides + + + Allow name tags for all friendly sides, instead of only player side + + + Adjust the name tags settings. + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgAddons.h b/TO_MERGE/cse/sys_advanced_interaction/CfgAddons.h new file mode 100644 index 0000000000..8e5d5504f1 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgAddons.h @@ -0,0 +1,7 @@ +class CfgAddons { + class PreloadAddons { + class cse_sys_advanced_interaction { + list[] = {"cse_sys_advanced_interaction", "cse_moduleAmbientCivilians"}; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgFunctions.h b/TO_MERGE/cse/sys_advanced_interaction/CfgFunctions.h new file mode 100644 index 0000000000..cebd88dc5e --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgFunctions.h @@ -0,0 +1,45 @@ +class CfgFunctions { + class CSE { + class AdvancedInteraction { + file = "cse\cse_sys_advanced_Interaction\functions"; + class arrest_AIM { recompile = 1; }; + class displayArrestOptions_AIM { recompile = 1; }; + class load_AIM { recompile = 1; }; + class loadLocal_AIM { recompile = 1; }; + class move_AIM { recompile = 1; }; + class placedown_AIM { recompile = 1; }; + class release_AIM { recompile = 1; }; + class searchPerson_AIM { recompile = 1; }; + class searchPersonCondition_AIM { recompile = 1; }; + class unload_AIM { recompile = 1; }; + class onCivilianKilled_AIM { recompile = 1; }; + class getDialogLines_AIM { recompile = 1; }; + class getReactionTypeOfUnit_AIM { recompile = 1; }; + class playerStartConverationWith_AIM { recompile = 1; }; + class dialogMovementOrder_AIM { recompile = 1; }; + class fillDialogWithConversationLines_AIM { recompile = 1; }; + class personSpeaksLine_AIM { recompile = 1; }; + class getAvailableProfileSetsFor_AIM { recompile = 1; }; + class generateProfileInformation_AIM { recompile = 1; }; + class getPlayerSpokenLineType_AIM { recompile = 1; }; + class playerSpeaksLine_AIM { recompile = 1; }; + class personReactionToLine_AIM { recompile = 1; }; + class getProfileInformation_AIM { recompile = 1; }; + class getReactionLinesOfPerson_AIM { recompile = 1; }; + class addToConversationLog_AIM { recompile = 1; }; + class getALiVECivData_AIM { recompile = 1; }; + class isALIVECivlianSystemActive_AIM { recompile = 1; }; + class disarmPerson_AIM { recompile = 1; }; + class canDetain { recompile = 1; }; + class canPerformArrestActions_AIM { recompile = 1; }; + class canPerformAction_AIM { recompile = 1; }; + class callForSurrender_AIM { recompile = 1; }; + }; + + class AmbientCivilians { + file = "cse\cse_sys_advanced_Interaction\ambient\functions"; + class moduleAmbientcivilians { recompile = 1; }; + class getAvailableUnits_faction { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgMagazines.h b/TO_MERGE/cse/sys_advanced_interaction/CfgMagazines.h new file mode 100644 index 0000000000..746fdc6619 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgMagazines.h @@ -0,0 +1,104 @@ + +// keep present for sometime, to allow backwards compatibility. Note: We will not support this in the code! + +class CfgMagazines { + class Default; + class CA_magazine: Default{}; + class cse_Keycuffs: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Keycuffs"; + picture = "cse\cse_sys_advanced_interaction\img\keycuffs.paa"; + descriptionShort = "Keycuffs, used for detaining a suspect"; + }; + class cse_HIIDE: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 3; + descriptionUse = "Biometric Scanner"; + descriptionShort = ""; + displayName = "Biometric Scanner (HIIDE)"; + picture = "cse\cse_sys_advanced_interaction\img\HIIDE.paa"; + model = "cse\cse_sys_advanced_interaction\hiide.p3d"; + }; + class cse_oldphone: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Old Phone"; + picture = "cse\cse_sys_advanced_interaction\img\oldphone.paa"; + model = "cse\cse_sys_advanced_interaction\mobile.p3d"; + }; + class cse_oldphone_folded: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Old Phone (Folded)"; + picture = "cse\cse_sys_advanced_interaction\img\oldphone.paa"; + model = "cse\cse_sys_advanced_interaction\mobile_folded.p3d"; + }; + class cse_watch_expensive: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Watch"; + picture ="cse\cse_sys_advanced_interaction\img\watch_expensive.paa"; + }; + class cse_wallet: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Wallet"; + picture = "cse\cse_sys_advanced_interaction\img\wallet.paa"; + }; + class cse_9v_battery: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "9 volt battery"; + picture = "cse\cse_sys_advanced_interaction\img\9v_battery.paa"; + model = "\A3\Structures_F_EPA\Items\Electronics\Battery_F.p3d"; + }; + class cse_notebook: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Notebook"; + picture = "cse\cse_sys_advanced_interaction\img\notebook.paa"; + }; + class cse_scissors: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Scissors"; + picture = "cse\cse_sys_advanced_interaction\img\scissor.paa"; + } ; + class cse_wires: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Wires"; + picture = "cse\cse_sys_advanced_interaction\img\wires.paa"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgSounds.h b/TO_MERGE/cse/sys_advanced_interaction/CfgSounds.h new file mode 100644 index 0000000000..b21c8521f3 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgSounds.h @@ -0,0 +1,7 @@ +class CfgSounds { + class cse_cable_tie_zipping { + name = "cse_cable_tie_zipping"; + sound[] = {"cse\cse_sys_advanced_interaction\sounds\cse_cable_tie_zipping.ogg","db-1",1.0}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgVehicles.h b/TO_MERGE/cse/sys_advanced_interaction/CfgVehicles.h new file mode 100644 index 0000000000..e47f165a49 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgVehicles.h @@ -0,0 +1,355 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic + { + class ArgumentsBaseUnits + { + }; + }; + class cse_sys_advanced_interaction: Module_F { + scope = 2; + displayName = "Advanced Interaction [CSE]"; + icon = "\cse\cse_main\data\cse_aim_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments + { + + class enableDetain { + displayName = "Allow detaining"; + description = "Allow players to detain other units"; + typeName = "NUMBER"; + defaultValue = 2; + class values { + class all {name="Everyone"; value=3; }; + class onlyOtherSide {name="Opposite side"; value=2; default=1;}; + class onlyAI {name="AI Only"; value=1; }; + class onlyOtherSideAI {name="Opposite side AI only"; value=0; }; + class disable {name="Disable"; value=-1; }; + }; + }; + class enableSearch { + displayName = "Allow search"; + description = "Allow players to search other units and vehicles"; + typeName = "NUMBER"; + defaultValue = 2; + class values { + class all {name="Everyone"; value=3; }; + class onlyOtherSide {name="Opposite side"; value=2; default=1;}; + class onlyAI {name="AI Only"; value=1; }; + class onlyOtherSideAI {name="Opposite side (AI Only)"; value=0; }; + class disable {name="Disable"; value=-1; }; + }; + }; + class enableBiometric { + displayName = "Biometric Scanner"; + description = "Allow players to use the biometric scanner on other units"; + typeName = "NUMBER"; + defaultValue = 2; + class values { + class all {name="Everyone"; value=3; }; + class onlyOtherSide {name="Opposite side"; value=2; default=1;}; + class onlyAI {name="AI Only"; value=1; }; + class onlyOtherSideAI {name="Opposite side (AI Only)"; value=0; }; + class disable {name="Disable"; value=-1; }; + }; + }; + class enableConversation { + displayName = "Enable Conversation"; + description = "Allow Conversation with civilians"; + typeName = "BOOL"; + defaultValue = false; + }; + class useEquipment { + displayName = "Equipment Required"; + description = "Is AIM equipment required for performing actions?"; + typeName = "BOOL"; + defaultValue = true; + }; + }; + }; + class cse_moduleAmbientCivilians: Module_F { + scope = 2; + displayName = "Ambient civilians [CSE]"; + icon = "\cse\cse_main\data\cse_aim_module.paa"; + category = "cseMisc"; + function = "cse_fnc_moduleAmbientcivilians"; + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + class Arguments { + class maxCivilians { + displayName = "Max Civilians"; + description = "The maximum amount of civilians at any given time"; + typeName = "NUMBER"; + defaultValue = 50; + }; + class maxRadius { + displayName = "Max Radius"; + description = "The maximum radus around object"; + typeName = "NUMBER"; + defaultValue = 1000; + }; + class minPlayerDistance { + displayName = "Minimal Player distance"; + description = "The minimal distance players can be near spawn locations"; + typeName = "NUMBER"; + defaultValue = 250; + }; + class percentageOf { + displayName = "Percentage"; + description = "Chance of building occupied ( 1 = 100%, 0 = 0%)"; + typeName = "NUMBER"; + defaultValue = 0.3; + }; + + class factionOf { + displayName = "Faction"; + description = "Of what faction should the civilians be"; + typeName = "STRING"; + defaultValue = "CIV_F"; + }; + class weaponChance { + displayName = "Chance of Weapons"; + description = "What is the chance that spawned civilans have weapons"; + typeName = "NUMBER"; + defaultValue = 0; + }; + class hostilityToBlufor { + displayName = "Hostility to BLUFOR"; + description = "What is the initial stance towards BLUFOR"; + typeName = "NUMBER"; + defaultValue = 0; + }; + class hostilityToOPfor { + displayName = "Hostility to OPFOR"; + description = "What is the initial stance towards OPFOR"; + typeName = "NUMBER"; + defaultValue = 0; + }; + + }; + }; + class NATO_Box_Base; + class cse_advancedInteractionItems: NATO_Box_Base + { + scope = 2; + displayName = "Advanced Interaction Items [CSE]"; + author = "Combat Space Enhancement"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + class TransportWeapons + { + class _xx_cse_Keycuffs + { + weapon="cse_Keycuffs"; + count=5; + }; + class _xx_cse_HIIDE + { + weapon="cse_HIIDE"; + count=5; + }; + class _xx_cse_oldphone + { + weapon="cse_oldphone"; + count=5; + }; + class _xx_cse_oldphone_folded + { + weapon="cse_oldphone_folded"; + count=5; + }; + class _xx_cse_watch_expensive + { + weapon="cse_watch_expensive"; + count=5; + }; + class _xx_cse_wallet + { + weapon="cse_wallet"; + count=5; + }; + class _xx_cse_9v_battery + { + weapon="cse_9v_battery"; + count=5; + }; + class _xx_cse_notebook + { + weapon="cse_notebook"; + count=5; + }; + class _xx_cse_scissors + { + weapon="cse_scissors"; + count=5; + }; + class _xx_cse_wires + { + weapon="cse_wires"; + count=5; + }; + }; + }; + + class Item_Base_F; + class cse_KeycuffsItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Keycuffs"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_Keycuffs + { + name = "cse_Keycuffs"; + count = 1; + }; + }; + }; + class cse_HIIDEItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + descriptionUse = "Biometric Scanner"; + descriptionShort = ""; + displayName = "Biometric Scanner (HIIDE)"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_HIIDE + { + name = "cse_HIIDE"; + count = 1; + }; + }; + }; + class cse_oldphoneItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Old Phone"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_oldphone + { + name = "cse_oldphone"; + count = 1; + }; + }; + }; + class cse_oldphone_foldedItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Old Phone (Folded)"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_oldphone_folded + { + name = "cse_oldphone_folded"; + count = 1; + }; + }; + }; + class cse_watch_expensiveItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Watch"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_watch_expensive + { + name = "cse_watch_expensive"; + count = 1; + }; + }; + }; + class cse_walletItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Wallet"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_wallet + { + name = "cse_wallet"; + count = 1; + }; + }; + }; + class cse_9v_batteryItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "9 volt battery"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_9v_battery + { + name = "cse_9v_battery"; + count = 1; + }; + }; + }; + class cse_notebookItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Notebook"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_notebook + { + name = "cse_notebook"; + count = 1; + }; + }; + }; + class cse_scissorsItem: Item_Base_F { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Scissors"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_scissors + { + name = "cse_scissors"; + count = 1; + }; + }; + }; + class cse_wiresItem: Item_Base_F { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = "Wires"; + vehicleClass = "Items"; + scopeCurator = 2; + class TransportItems + { + class cse_wires + { + name = "cse_wires"; + count = 1; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/CfgWeapons.h b/TO_MERGE/cse/sys_advanced_interaction/CfgWeapons.h new file mode 100644 index 0000000000..220f8d5150 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/CfgWeapons.h @@ -0,0 +1,141 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + + class cse_Keycuffs: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_KEYCUFFS_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\keycuffs.paa"; + descriptionShort = $STR_CSE_ITEM_KEYCUFFS_DESC; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_HIIDE: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + descriptionUse = $STR_CSE_ITEM_HIIDE_DESC; + descriptionShort = $STR_CSE_ITEM_HIIDE_DESC; + displayName = $STR_CSE_ITEM_HIIDE_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\HIIDE.paa"; + model = "\cse\cse_sys_advanced_interaction\hiide.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_oldphone: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_PHONE_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\oldphone.paa"; + model = "\cse\cse_sys_advanced_interaction\mobile.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_oldphone_folded: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_PHONE_FOLDED_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\oldphone.paa"; + model = "\cse\cse_sys_advanced_interaction\mobile_folded.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_watch_expensive: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_WATCH_EXPENSIVE_DISPLAY; + picture ="cse\cse_sys_advanced_interaction\img\watch_expensive.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_wallet: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_WALLET_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\wallet.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_9v_battery: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_9v_BATTERY_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\9v_battery.paa"; + model = "\A3\Structures_F_EPA\Items\Electronics\Battery_F.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_notebook: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_NOTEBOOK_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\notebook.paa"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_scissors: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_CSE_ITEM_SCISSORS_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\scissor.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + class cse_wires: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + mass = 1; + displayName = $STR_CSE_ITEM_WIRES_DISPLAY; + picture = "\cse\cse_sys_advanced_interaction\img\wires.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + + mass=10; + type=201; + }; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_advanced_interaction/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..01a86078ec --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/Combat_Space_Enhancement.h @@ -0,0 +1,60 @@ + +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_advanced_interaction { + init = "call compile preprocessFile 'cse\cse_sys_advanced_interaction\fn_aim_init.sqf';"; + name = "Advanced Interaction Module"; + class EventHandlers { + class CAManBase { + //init = "waituntil{player==player}; hint 'AIM TEST';"; + killed = "_this call cse_fnc_onCivilianKilled_AIM;"; + }; + }; + + class dialog_module { + class lines { + class agressive_OutOfMyFace { + text = "I already told you to go away! Now get out of my face!"; + }; + class agressive_YouWontListen: agressive_OutOfMyFace { + text = "You just won't listen, won't you?"; + }; + class agressive_SlapInFace: agressive_OutOfMyFace { + text = "Someone should slap you in the face."; + }; + class agressive_LeaveAlone: agressive_OutOfMyFace { + text = "Leave me alone!"; + }; + class friendly_hello_friend { + text = "Hello my friend!"; + stance = "Friendly"; + }; + class friendly_haveNiceDay: friendly_hello_friend { + text = "Good Sir, I hope you have a nice day"; + }; + class friendly_welcome: friendly_hello_friend { + text = "Welcome"; + }; + class friendly_whatbringsyouhere: friendly_hello_friend { + text = "Hello, what brings you here?"; + }; + }; + }; + + class Configurations { + class open_biometric_scanner_aim { + type = MENU_KEYBINDING; + title = "Open Biometric Scanner"; + description = "Opens the biometric scanner if the action is available. The action will be available if you are looking at another Person."; + value[] = {0,0,0,0}; + onPressed = "if (CSE_ENABLED_BIOMETRIC_SCANNER_AIM) then {_target = cursorTarget;if (!iSNull _target) then {if ((_target isKindOf 'CAManBase') && ((player distance _target) < 10)) then {[player,_target] call cse_fnc_biometricScanner;};};};"; + idd = 432231; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/GUI.h b/TO_MERGE/cse/sys_advanced_interaction/GUI.h new file mode 100644 index 0000000000..6ebf7b736c --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/GUI.h @@ -0,0 +1,7 @@ + +#include "biometric_scanner\define.hpp" +#include "biometric_scanner\biometricScannerDialog.hpp" + +#include "gui\define.h" +#include "gui\dialog_menu.h" +#include "gui\search_menu.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_getAvailableUnits_faction.sqf b/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_getAvailableUnits_faction.sqf new file mode 100644 index 0000000000..9dbe7d817e --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_getAvailableUnits_faction.sqf @@ -0,0 +1,41 @@ +/** + * fn_getAvailableGroups_faction.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_factionOfEntry", "_faction", "_factionConfig", "_return", "_sideN", "_sideT", "_sideConfig", "_entry", "_scopeOfEntry"]; +_faction = _this select 0; +_baseclass = _this select 1; + +_factionConfig = (configFile >> "CfgFactionClasses" >> _faction); +_return = []; +_filtered_non_base = []; +if (isclass _factionConfig) then { + _configCivs = (configFile >> "CfgVehicles"); + _numberOfConfig = count _configCivs; + for [{_i=0}, {(_i< _numberOfConfig)}, {_i=_i+1}] do { + _entry = _configCivs select _i; + if (isClass _entry) then { + _factionOfEntry = getText(_entry >> "faction"); + _scopeOfEntry = getNumber (_entry >> "scope"); + if (_factionOfEntry == _faction && _scopeOfEntry >= 2) then { + if ([_entry, _baseclass] call cse_fnc_inheritsFrom) then { + _return pushback (configName _entry); + } else { + _filtered_non_base pushback (configName _entry); + }; + }; + }; + }; + //}; +} else { + [] +}; +[format["Filtered non base config entries: %1", _filtered_non_base]] call cse_fnc_debug; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_moduleAmbientCivilians.sqf b/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_moduleAmbientCivilians.sqf new file mode 100644 index 0000000000..3140bfea01 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/ambient/functions/fn_moduleAmbientCivilians.sqf @@ -0,0 +1,201 @@ +/** + * fn_moduleAmbientCivilians.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define BUILDING_SEARCH_RADIUS 1000 +#define PERCENTAGE_OF_BUILDINGS 0.3 +#define MINIMAL_DISTANCE_PLAYERS 10 +#define MAX_AMOUNT_CIVS_TOTAL 100 +#define MAX_UNITS_IN_GROUP 3 + +// only run this on the server +if !(isServer) exitwith {}; + +_this spawn { + waitUntil {time > 1}; + + _logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + if (!isNull _logic) then { + _MAX_CIVS_TOTAL = _logic getvariable ["maxCivilians", MAX_AMOUNT_CIVS_TOTAL]; + _MAX_RADIUS = _logic getvariable ["maxRadius", BUILDING_SEARCH_RADIUS]; + _MIN_DISTANCE_PLAYERS = _logic getvariable ["minPlayerDistance", MINIMAL_DISTANCE_PLAYERS]; + _PERCENTAGE = _logic getvariable ["percentageOf", PERCENTAGE_OF_BUILDINGS]; + _FACTION_OF = _logic getVariable ["factionOf", "CIV_F"]; + + _availableUnitClasses = [_FACTION_OF, "CaManBase"] call cse_fnc_getAvailableUnits_faction; + [format["Found available classes: %1", _availableUnitClasses]] call cse_fnc_debug; + if (_availableUnitClasses isEqualTo []) exitwith { [format["AvailableClasses for %1 is empty", _FACTION_OF]] call cse_fnc_debug; }; + _allSpawnedUnits = []; + _allSpawnedGroups = []; + _playerUnits = []; + _allCheckedBuildings = []; + + while {alive _logic} do { + sleep 1; + if (isMultiplayer) then { + waituntil {count playableUnits > 0}; + _playerUnits = playableUnits; + } else { + _playerUnits = [player]; + }; + _spawnLocatationObjects = [_logic]; + + { + _playableUnit = _x; + if (count _allSpawnedUnits < _MAX_CIVS_TOTAL && {_playableUnit distance _logic < _MAX_RADIUS}) then { + _availableBuildings = []; + _buildingsWithInArea = nearestObjects [_playableUnit, ["house"], _MAX_RADIUS]; + { + _building = _x; + if !(_building in _allCheckedBuildings) then { + _buildingPos = [_x] call BIS_fnc_buildingPositions; + _invalid = false; + { + if (_building distance _x <= _MIN_DISTANCE_PLAYERS) exitwith { + _invalid = true; + }; + }foreach _playerUnits; + if !(_invalid) then { + _availableBuildings pushback [_building, _buildingPos]; + _allCheckedBuildings pushback _building; + }; + }; + }foreach _buildingsWithInArea; + + { + _building = _x select 0; + _buildingPos = _x select 1; + + if (({_x getvariable ["cse_ambientcivilianModule_Building", objNull] == _building}count _allSpawnedGroups) == 0 && (count _allSpawnedUnits < _MAX_CIVS_TOTAL)) then { + if (random(1) >= (1 - _PERCENTAGE)) then { + _group = createGroup civilian; + + _group setvariable ["cse_ambientcivilianModule_Building", _building]; + if (isNull _group) exitwith { + ["Group was null - most likely hit the 144 limit!"] call cse_fnc_debug; + }; + { + if ((random(1) >= 0.7 && (count _allSpawnedUnits < _MAX_CIVS_TOTAL) && {(count units _group < MAX_UNITS_IN_GROUP)})|| (count units _group == 0)) then { + _className = _availableUnitClasses select (round(random((count _availableUnitClasses)-1))); + _unit = _group createUnit [_className, _x, [], 0, "NONE"]; + _unit setOwner (owner _logic); + _allSpawnedUnits pushback _unit; + }; + }foreach _buildingPos; + + if (count units _group == 0) then { + deleteGroup _group; + } else { + _allSpawnedGroups pushback _group; + _group addWaypoint [(getPos _building), 100, 1, "initial_waypoint_ambientCiv"]; + [_group, 1] setWaypointSpeed "LIMITED"; + }; + }; + }; + + // lets exit, since we ran into the limit. + if ((count _allSpawnedUnits >= _MAX_CIVS_TOTAL)) exitwith {}; + }foreach _availableBuildings; + }; + }foreach _playerUnits; + + sleep 0.5; + + _unitsRemoved = 0; + { + _unit = _x; + _cannotRemove = false; + { + if (_unit distance _x <= _MIN_DISTANCE_PLAYERS) exitwith { + _cannotRemove = true; + }; + }foreach _playerUnits; + if !(_cannotRemove) then { + if ({(_unit distance _x > _MAX_RADIUS)}count _playerUnits == count _playerUnits) then { + deleteVehicle _unit; + _allSpawnedUnits set [_foreachIndex, ObjNull]; + _unitsRemoved = _unitsRemoved + 1; + }; + }; + }foreach _allSpawnedUnits; + _allSpawnedUnits = _allSpawnedUnits - [objNull]; + { + if (count units _x == 0) then { + deleteGroup _x; + _allSpawnedGroups set [_foreachIndex, ObjNull]; + } else { + _group = _x; + // HANDLE WAYPOINTS FOR GROUPS + if (currentWaypoint _group == (count waypoints _group)) then { + _building = _group getvariable "cse_ambientcivilianModule_Building"; + _group addWaypoint [(getPos _building), 200, currentWaypoint _group]; + }; + }; + }foreach _allSpawnedGroups; + _allSpawnedGroups = _allSpawnedGroups - [objNull]; + + sleep 0.5; + { + _building = _x; + _cannotRemove = false; + { + if (_building distance _x <= _MIN_DISTANCE_PLAYERS) exitwith { + _cannotRemove = true; + }; + }foreach _playerUnits; + if !(_cannotRemove) then { + if ({(_building distance _x > _MAX_RADIUS)}count _playerUnits == count _playerUnits) then { + _allCheckedBuildings set [_foreachIndex, ObjNull]; + }; + }; + }foreach _allCheckedBuildings; + _allCheckedBuildings = _allCheckedBuildings - [objNull]; + + if (_unitsRemoved > 0) then { + [format["%1- %2 - Removed %3", count _allSpawnedUnits, _allSpawnedUnits, _unitsRemoved]] call cse_fnc_debug; + }; + }; + + [["Finished ambient Civilians module. Cleaning up all units"]] call cse_fnc_Debug; + // Finished this module. Cleaning up everything. + _cleanUpStartTime = time; + // CLEAN UP ALL UNITS, ENSURE PLAYERS ARE NOT NEARBY + while {(count _allSpawnedUnits > 0 && count _allSpawnedGroups > 0)} do { + { + _unit = _x; + _cannotRemove = false; + { + if (_unit distance _x <= _MIN_DISTANCE_PLAYERS) exitwith { + _cannotRemove = true; + }; + }foreach _playerUnits; + + // force clean up if this loop has been running for 60 seconds already + if (!(_cannotRemove) || (time - _cleanUpStartTime > 60)) then { + if ({(_unit distance _x > _MAX_RADIUS)}count _playerUnits == count _playerUnits) then { + deleteVehicle _unit; + _allSpawnedUnits set [_foreachIndex, ObjNull]; + _unitsRemoved = _unitsRemoved + 1; + }; + }; + }foreach _allSpawnedUnits; + _allSpawnedUnits = _allSpawnedUnits - [objNull]; + { + if (count units _x == 0) then { + deleteGroup _x; + _allSpawnedGroups set [_foreachIndex, ObjNull]; + } else { + // HANDLE WAYPOINTS FOR GROUPS + + }; + }foreach _allSpawnedGroups; + _allSpawnedGroups = _allSpawnedGroups - [objNull]; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/battery.p3d b/TO_MERGE/cse/sys_advanced_interaction/battery.p3d new file mode 100644 index 0000000000..1a0cf71a94 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/battery.p3d differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/Thumbs.db b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/Thumbs.db new file mode 100644 index 0000000000..b30616897b Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/Thumbs.db differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/biometricScannerDialog.hpp b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/biometricScannerDialog.hpp new file mode 100644 index 0000000000..630b7a7263 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/biometricScannerDialog.hpp @@ -0,0 +1,196 @@ +// GBL_BiometricDialog +// Displays a HIIDE inderface for a biometric scan. +// by gobbo + +class cse_biometricScanner { + idd = 432231; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_biometricScanner', _this select 0];"; + + class controlsBackground { + class cse_backgroundImageScanner : cse_backgroundBase { + text = "cse\cse_sys_advanced_interaction\biometric_scanner\data\biometricScanner_background.paa"; + idc = 21314; + x = -0.3; + y = 0.2; + w = 1.6; + h = 1; + }; + + }; + + class controls { + + class cse_title: cse_staticBase { + idc = 100; + x = 0.29; + y = 0.45; + w = 0.33825; + h = 0.104575; + sizeEx = 0.04; + text = "HIIDE - "; + }; + class cse_subtitle: cse_staticBase { + idc = 101; + x = 0.29; + y = 0.49; + w = 0.33825; + h = 0.104575; + sizeEx = 0.025; + text = ""; + }; + + class cse_infoText1: cse_title { + idc = 111; + x = 100.3025; + y = 110.64; + w = 0.2; + h = 0.104575; + sizeEx = 0.03021; + text = ""; + style = ST_STATIC + ST_CENTER; + }; + class cse_infoText2: cse_infoText1 { + idc = 112; + x = 100.3025; + y = 110.69; + w = 0.2; + h = 0.104575; + sizeEx = 0.03021; + text = ""; + }; + + class cse_text1: cse_title { + idc = 121; + x = 100.3025; + y = 110.64; + w = 0.183825; + h = 0.104575; + sizeEx = 0.03021; + text = "NAME: "; + }; + class cse_text2: cse_text1 { + idc = 122; + x = 100.3025; + y = 110.69; + w = 0.183825; + h = 0.104575; + sizeEx = 0.03021; + text = "AGE: "; + }; + class cse_text3: cse_text1 { + idc = 123; + x = 100.3025; + y = 110.74; + w = 0.183825; + h = 0.104575; + sizeEx = 0.03021; + text = "Known Info: "; + }; + class cse_text4: cse_text1 { + idc = 124; + x = 100.3025; + y = 110.79; + w = 0.183825; + h = 0.104575; + sizeEx = 0.03021; + text = "Additional 1: "; + }; + class cse_text5: cse_text1 { + idc = 125; + x = 100.3025; + y = 110.84; + w = 0.183825; + h = 0.104575; + sizeEx = 0.03021; + text = "Additional 2: "; + }; + class cse_editableBox1: cse_editBase + { + idc = 701; + x = 100.42; + y = 110.68; + h = 0.03; + w = 0.3; + sizeEx = 0.03021; + text = ""; + autocomplete = ""; + }; + class cse_editableBox2: cse_editBase + { + idc = 702; + x = 100.42; + y = 110.73; + h = 0.03; + w = 0.3; + sizeEx = 0.03021; + text = ""; + autocomplete = ""; + }; + class cse_editableBox3: cse_editBase + { + idc = 703; + x = 100.42; + y = 110.78; + h = 0.03; + w = 0.3; + sizeEx = 0.03021; + text = ""; + autocomplete = ""; + }; + class cse_editableBox4: cse_editBase + { + idc = 704; + x = 100.42; + y = 110.83; + h = 0.03; + w = 0.3; + sizeEx = 0.03021; + text = ""; + autocomplete = ""; + }; + class cse_editableBox5: cse_editBase + { + idc = 705; + x = 100.42; + y = 110.88; + h = 0.03; + w = 0.3; + sizeEx = 0.03021; + text = ""; + autocomplete = ""; + }; + + class cse_option1 : cse_buttonBase { + idc = 151; + text = ""; + onButtonClick = ""; + x = 0.27; + y = 0.87; + w = 0.14; + h = 0.04; + color[] = {0.0, 0.0, 0.0, 1}; + color2[] = {0.0, 0.0, 0.0, 1}; + colorBackground[] = {1, 1, 1, 1}; + colorbackground2[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.5}; + animTextureNormal = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + animTextureDisabled = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + animTextureOver = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + animTextureFocused = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + animTexturePressed = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + animTextureDefault = "cse\cse_sys_advanced_interaction\biometric_scanner\data\scanner_button.paa"; + }; + class cse_option2 : cse_option1 { + idc = 152; + text = ""; + x = 0.425; + }; + class cse_option3 : cse_option1 { + idc = 153; + text = ""; + x = 0.58; + }; + }; + objects[] = {}; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/biometricScanner_background.paa b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/biometricScanner_background.paa new file mode 100644 index 0000000000..8931e0c8d5 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/biometricScanner_background.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/icon_biometricscanner.paa b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/icon_biometricscanner.paa new file mode 100644 index 0000000000..424789eee8 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/icon_biometricscanner.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/scanner_button.paa b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/scanner_button.paa new file mode 100644 index 0000000000..277ba5ab87 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/data/scanner_button.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/define.hpp b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/define.hpp new file mode 100644 index 0000000000..49827e2dbd --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/define.hpp @@ -0,0 +1,271 @@ +// 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_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_editBase +{ + access = 0; + type = CT_EDIT; + style = ST_STATIC; + x = 0; + y = 0; + h = 1; + w = 1; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + colorSelection[] = {1,1,1,0}; + colorDisabled[] = {1, 1, 1, 0.25}; + font = FontCSE; + sizeEx = 0.03921; + autocomplete = ""; + text = ""; + size = 0.03921; + shadow = 0; +}; + + +class cse_buttonBase { + idc = -1; + type = 16; + style = 0; + text = ""; + action = ""; + x = 0.0; + y = 0.0; + w = 0.2; + 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[] = {1, 1, 1, 0.6}; + colorbackground2[] = {1, 1, 1, 0.4}; + colorDisabled[] = {1, 1, 1, 0.25}; + colorFocused[] = {1,1,1,1}; + colorBackgroundFocused[] = {1,1,1,0.6}; + + 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\cse_cms_button.paa"; + animTextureDisabled = "cse\cse_gui\data\cse_cms_button.paa"; + animTextureOver = "cse\cse_gui\data\cse_cms_button.paa"; + animTextureFocused = "cse\cse_gui\data\cse_cms_button.paa"; + animTexturePressed = "cse\cse_gui\data\cse_cms_button.paa"; + animTextureDefault = "cse\cse_gui\data\cse_cms_button.paa"; + period = 0.5; + font = FontCSE; + soundEnter[] = {"\A3\ui_f\data\sound\onover",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\new1",0.0,0}; + soundClick[] = {"\A3\ui_f\data\sound\onclick",0.07,1}; + soundEscape[] = {"\A3\ui_f\data\sound\onescape",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_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 cse_listBoxBase { + 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}; + 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 ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = ""; + arrowFull = ""; + arrowEmpty = ""; + border = ""; + }; +}; + +class cse_comboBoxBase { + idc = -1; + type = 4; + style = 1; + x = 0; + y = 0; + w = 0.3; + h = 0.035; + colorSelect[] = {0.023529,0,0.0313725,1}; + colorText[] = {0.023529,0,0.0313725,1}; + colorBackground[] = {0.95,0.95,0.95,1}; + colorSelectBackground[] = {0.543,0.5742,0.4102,1.0}; + colorScrollbar[] = {0.023529,0,0.0313725,1}; + arrowEmpty = ""; + arrowFull = ""; + wholeHeight = 0.45; + color[] = {0,0,0,0.6}; + colorActive[] = {0,0,0,1}; + colorDisabled[] = {0,0,0,0.3}; + font = FontCSE; + sizeEx = 0.031; + soundSelect[] = {"",0.09,1}; + soundExpand[] = {"",0.09,1}; + soundCollapse[] = {"",0.09,1}; + maxHistoryDelay = 1.0; + class ScrollBar + { + color[] = {1,1,1,0.6}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + thumb = ""; + arrowFull = ""; + arrowEmpty = ""; + border = ""; + }; +}; diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanStart.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanStart.sqf new file mode 100644 index 0000000000..e7982c595d --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanStart.sqf @@ -0,0 +1,54 @@ +/* + NAME: fnc_biometricScanner + USAGE: opens the biometric Scanner dialog and starts up all functionality needed + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller", "_cursor", "_interactionDialog", "_button1", "_button2", "_button3", "_textDisplays", "_infoDisplays", "_editableColums", "_positionCenter"]; + _caller = _this select 0; + _cursor = _this select 1; + CSE_biometricScannerTarget = _cursor; +ctrlSetText [100,"HIIDE - Scanning"]; + call cse_fnc_clearScreenBiometricScanner; + + disableSerialization; + _interactionDialog = uiNamespace getvariable "cse_biometricScanner"; + + _button1 = (_interactionDialog displayCtrl 151); + _button2 = (_interactionDialog displayCtrl 152); + _button3 = (_interactionDialog displayCtrl 153); + + // adjusting positions: + _textDisplays = [(_interactionDialog displayCtrl 111),(_interactionDialog displayCtrl 112)]; + _infoDisplays = [(_interactionDialog displayCtrl 121),(_interactionDialog displayCtrl 122),(_interactionDialog displayCtrl 123), + (_interactionDialog displayCtrl 124),(_interactionDialog displayCtrl 125)]; + _editableColums = [(_interactionDialog displayCtrl 701),(_interactionDialog displayCtrl 702),(_interactionDialog displayCtrl 703), + (_interactionDialog displayCtrl 704),(_interactionDialog displayCtrl 705)]; + + + + _button1 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_hiideMainMenu"]]; + + // LOGIN FUNCTIONALITY + _button1 ctrlSetText "Cancel"; + _button2 ctrlSetText ""; + _button3 ctrlSetText ""; + + _positionCenter = [0.35,0.54]; + { + _x ctrlSetPosition _positionCenter; + _positionCenter = [_positionCenter select 0, (_positionCenter select 1) + 0.05]; + }foreach _textDisplays; + (_interactionDialog displayCtrl 111) ctrlSetText "Scanning Database"; + (_interactionDialog displayCtrl 112) ctrlSetText "Please Wait"; + + (_interactionDialog displayCtrl 111) ctrlCommit 0.0001; + (_interactionDialog displayCtrl 112) ctrlCommit 0.0001; + + sleep 2 + random(10); + if (!dialog) exitwith{}; + + [player,CSE_biometricScannerTarget] call cse_fnc_biometricScannerInfo; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanner.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanner.sqf new file mode 100644 index 0000000000..54aa84a87d --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScanner.sqf @@ -0,0 +1,25 @@ +/* + NAME: fnc_biometricScanner + USAGE: opens the biometric Scanner dialog and starts up all functionality needed + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + +private ["_caller","_cursor"]; +_caller = _this select 0; +_cursor = _this select 1; +CSE_biometricScannerTarget = _cursor; +[] call cse_fnc_closeAllDialogs_f; +createDialog "cse_biometricScanner"; + +if (isnil ("cse_biometricScannerLogin")) then { + cse_biometricScannerLogin = false; +}; + +if (cse_biometricScannerLogin) then { + [player,CSE_biometricScannerTarget] call cse_fnc_hiideMainMenu; +} else { + call cse_fnc_biometricScannerLoginScreen; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerInfo.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerInfo.sqf new file mode 100644 index 0000000000..bc5fc90bdb --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerInfo.sqf @@ -0,0 +1,77 @@ +/* + NAME: fnc_biometricScanner + USAGE: opens the biometric Scanner dialog and starts up all functionality needed + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + + call cse_fnc_clearScreenBiometricScanner; + + ctrlSetText [100,"HIIDE - Details"]; + + + disableSerialization; + _interactionDialog = uiNamespace getvariable "cse_biometricScanner"; + + _button1 = (_interactionDialog displayCtrl 151); + _button2 = (_interactionDialog displayCtrl 152); + _button3 = (_interactionDialog displayCtrl 153); + + // adjusting positions: + _textDisplays = [(_interactionDialog displayCtrl 111),(_interactionDialog displayCtrl 112)]; + _infoDisplays = [(_interactionDialog displayCtrl 121),(_interactionDialog displayCtrl 122),(_interactionDialog displayCtrl 123), + (_interactionDialog displayCtrl 124),(_interactionDialog displayCtrl 125)]; + _editableColums = [(_interactionDialog displayCtrl 701),(_interactionDialog displayCtrl 702),(_interactionDialog displayCtrl 703), + (_interactionDialog displayCtrl 704),(_interactionDialog displayCtrl 705)]; + + + + _button1 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_hiideMainMenu"]]; // logout + _button3 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_saveSettingsBiometric"]]; // scan something + + // LOGIN FUNCTIONALITY + _button1 ctrlSetText "Cancel"; + _button2 ctrlSetText ""; + _button3 ctrlSetText "Save"; + + _counter = 0; + _leftText = ["Name","DOB","Known Info","Additional"]; + _positionCenter = [0.3,0.54]; + { + if (_counter < count _leftText) then { + _x ctrlSetPosition _positionCenter; + _positionCenter = [_positionCenter select 0, (_positionCenter select 1) + 0.05]; + _x ctrlCommit 0.0001; + _x ctrlSetText (_leftText select _counter); + }; + _counter = _counter + 1; + }foreach _infoDisplays; + + _text = _cursor getvariable "cse_biometricScannerInfo"; + if (!isnil ("_text")) then { + ctrlSetText [701, _text select 0]; + ctrlSetText [702,_text select 1]; + ctrlSetText [703,_text select 2]; + ctrlSetText [704,_text select 3]; + ctrlSetText [705,_text select 4]; + ctrlSetText [101,"Entry in database found"]; + } else { + ctrlSetText [101,"No Entry in database found - Please fill in details"]; + }; + + _counter = 0; + _positionCenter = [0.42,0.58]; + { + if (_counter < count _leftText) then { + _x ctrlSetPosition _positionCenter; + _positionCenter = [_positionCenter select 0, (_positionCenter select 1) + 0.05]; + _x ctrlCommit 0.0001; + }; + _counter = _counter + 1; + }foreach _editableColums; diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLogin.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLogin.sqf new file mode 100644 index 0000000000..f484462ab6 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLogin.sqf @@ -0,0 +1,53 @@ +/* + NAME: fnc_biometricScannerLogin + USAGE: checks if the username and password have been typed correctly + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + +private ["_caller","_cursor","_return","_foundName"]; +_caller = _this select 0; +_cursor = _this select 1; +_return = false; +cse_biometricScannerLogin = false; + +_inputName = ctrlText 701; +_inputPass = ctrlText 702; + +_foundName = ""; +_foundUnit = ""; +if (Ismultiplayer) then { + { + if (isPlayer _x) then { + if ([_x] call cse_fnc_getName == _inputName) then { + _foundName = [_x] call cse_fnc_getName; + _foundUnit = _x; + }; + }; + }foreach playableUnits; +} else { + _foundName = [player] call cse_fnc_getName; + _foundUnit = player; +}; + +if (_foundName != _inputName) exitwith { + hint "Username incorrect!"; +}; + +if (_inputPass == "Password") then { + hint "Password and Username correct!"; + _return = true; +} else { + hint "Wrong Password!"; +}; + +if (_return) then { + [player,CSE_biometricScannerTarget] call cse_fnc_hiideMainMenu; + cse_biometricScannerLogin = true; +}; +[] spawn { + sleep 5; + hintSilent ""; +}; diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLoginScreen.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLoginScreen.sqf new file mode 100644 index 0000000000..2796ef4b0d --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_biometricScannerLoginScreen.sqf @@ -0,0 +1,39 @@ +/* + NAME: fnc_biometricScannerLoginScreen + USAGE: checks if the username and password have been typed correctly + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + +call cse_fnc_clearScreenBiometricScanner; +ctrlSetText [100,"HIIDE - Login"]; +disableSerialization; +_interactionDialog = uiNamespace getvariable "cse_biometricScanner"; +_button1 = (_interactionDialog displayCtrl 151); +_button2 = (_interactionDialog displayCtrl 152); +_button3 = (_interactionDialog displayCtrl 153); + +_button1 ctrlSetEventHandler ["ButtonClick", "closedialog 21314"]; +_button2 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_hiideMainMenu"]]; +_button3 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_biometricScannerLogin"]]; + +// LOGIN FUNCTIONALITY +_button1 ctrlSetText "Cancel"; +_button2 ctrlSetText "Iris Login"; +_button3 ctrlSetText "Login"; + + +(_interactionDialog displayCtrl 121) ctrlSetPosition [0.3,0.54]; +(_interactionDialog displayCtrl 121) ctrlCommit 0.0001; +(_interactionDialog displayCtrl 121) ctrlSetText "Username"; + +(_interactionDialog displayCtrl 122) ctrlSetposition [0.3,0.59]; +(_interactionDialog displayCtrl 122) ctrlCommit 0.0001; +(_interactionDialog displayCtrl 122) ctrlSetText "Password"; + +(_interactionDialog displayCtrl 701) ctrlSetposition [0.42,0.58]; +(_interactionDialog displayCtrl 701) ctrlCommit 0.0001; + +(_interactionDialog displayCtrl 702) ctrlSetposition [0.42,0.63]; +(_interactionDialog displayCtrl 702) ctrlCommit 0.0001; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_cancelBiometric.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_cancelBiometric.sqf new file mode 100644 index 0000000000..7d84781973 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_cancelBiometric.sqf @@ -0,0 +1,14 @@ +/* + NAME: fnc_biometricScanner + USAGE: opens the biometric Scanner dialog and starts up all functionality needed + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + +hint "cancel biometric "; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_clearScreenBiometricScanner.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_clearScreenBiometricScanner.sqf new file mode 100644 index 0000000000..c83303add8 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_clearScreenBiometricScanner.sqf @@ -0,0 +1,52 @@ + +/** + * fnc_clearScreenBiometricScanner.sqf + * @Descr: Clears the screen on the biometric scanner of all ctrl objects + * @Author: Glowbal + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +private ["_interactionDialog","_button1","_button2","_button3","_textDisplays","_infoDisplays","_editableColums"]; + +disableSerialization; +_interactionDialog = uiNamespace getvariable "cse_biometricScanner"; +_button1 = (_interactionDialog displayCtrl 151); +_button2 = (_interactionDialog displayCtrl 152); +_button3 = (_interactionDialog displayCtrl 153); + +// adjusting positions: +_textDisplays = [(_interactionDialog displayCtrl 111),(_interactionDialog displayCtrl 112)]; +_infoDisplays = [(_interactionDialog displayCtrl 121),(_interactionDialog displayCtrl 122),(_interactionDialog displayCtrl 123), + (_interactionDialog displayCtrl 124),(_interactionDialog displayCtrl 125)]; +_editableColums = [(_interactionDialog displayCtrl 701),(_interactionDialog displayCtrl 702),(_interactionDialog displayCtrl 703), + (_interactionDialog displayCtrl 704),(_interactionDialog displayCtrl 705)]; + +_position = [100.0,100.0]; +{ + _x ctrlsetText ""; + _x ctrlSetPosition _position; + _x ctrlCommit 0; +}foreach _textDisplays; +{ + _x ctrlSetPosition _position; + _x ctrlsetText ""; + _x ctrlCommit 0; + +}foreach _infoDisplays; +{ + _x ctrlsetText ""; + _x ctrlSetPosition _position; + _x ctrlCommit 0; +}foreach _editableColums; + +_button1 ctrlRemoveAllEventHandlers "ButtonClick"; +_button2 ctrlRemoveAllEventHandlers "ButtonClick"; +_button3 ctrlRemoveAllEventHandlers "ButtonClick"; +_button1 ctrlSetText ""; +_button2 ctrlSetText ""; +_button3 ctrlSetText ""; +ctrlSetText [101,""]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_conditionBiometricScanner.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_conditionBiometricScanner.sqf new file mode 100644 index 0000000000..cf47702902 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_conditionBiometricScanner.sqf @@ -0,0 +1,18 @@ +/* + NAME: fnc_conditionBiometricScanner + USAGE: checks if unit can be checked with a biometric scanner + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: boolean +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + _return = false; + + if (_cursor iskindof "man" && group _cursor != group _caller) then { + _return = true; + }; + _return diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_hiideMainMenu.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_hiideMainMenu.sqf new file mode 100644 index 0000000000..bd86215877 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_hiideMainMenu.sqf @@ -0,0 +1,50 @@ +/* + NAME: fnc_biometricScanner + USAGE: opens the biometric Scanner dialog and starts up all functionality needed + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + CSE_biometricScannerTarget = _cursor; + + disableSerialization; + _interactionDialog = uiNamespace getvariable "cse_biometricScanner"; + call cse_fnc_clearScreenBiometricScanner; + ctrlSetText [100,"HIIDE - Menu"]; + _button1 = (_interactionDialog displayCtrl 151); + _button2 = (_interactionDialog displayCtrl 152); + _button3 = (_interactionDialog displayCtrl 153); + +// adjusting positions: +_textDisplays = [(_interactionDialog displayCtrl 111),(_interactionDialog displayCtrl 112)]; +_infoDisplays = [(_interactionDialog displayCtrl 121),(_interactionDialog displayCtrl 122),(_interactionDialog displayCtrl 123), + (_interactionDialog displayCtrl 124),(_interactionDialog displayCtrl 125)]; +_editableColums = [(_interactionDialog displayCtrl 701),(_interactionDialog displayCtrl 702),(_interactionDialog displayCtrl 703), + (_interactionDialog displayCtrl 704),(_interactionDialog displayCtrl 705)]; + + + + _button1 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_biometricScannerLoginScreen; cse_biometricScannerLogin = false;"]]; + _button2 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_biometricScanStart"]]; // scan something + _button3 ctrlSetEventHandler ["ButtonClick", format["[player,CSE_biometricScannerTarget] spawn cse_fnc_biometricScanStart"]]; // scan something + + _button1 ctrlSetText "Logout"; + _button2 ctrlSetText "Scan Hands"; + _button3 ctrlSetText "Scan Iris"; + + + _positionCenter = [0.35,0.54]; + { + _x ctrlSetPosition _positionCenter; + _positionCenter = [_positionCenter select 0, (_positionCenter select 1) + 0.05]; + }foreach _textDisplays; + + (_interactionDialog displayCtrl 111) ctrlSetText "You are now logged in"; + (_interactionDialog displayCtrl 112) ctrlSetText "Select any option below to begin"; + (_interactionDialog displayCtrl 111) ctrlCommit 0.0001; + (_interactionDialog displayCtrl 112) ctrlCommit 0.0001; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_saveSettingsBiometric.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_saveSettingsBiometric.sqf new file mode 100644 index 0000000000..48a303ccd5 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/fnc_saveSettingsBiometric.sqf @@ -0,0 +1,24 @@ +/* + NAME: fnc_biometricScanner + USAGE: Saves the information of the biometric scanner for _cursor UNIT + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + + +_text1 = ctrlText 701; +_text2 = ctrlText 702; +_text3 = ctrlText 703; +_text4 = ctrlText 704; +_text5 = ctrlText 705; + +_cursor setvariable ["cse_biometricScannerInfo",[_text1,_text2,_text3,_text4,_text5],true]; +hint "Saved biometric"; + +[format["AIM - Biometric Scanner Saving. Target: %1 Information: %2",_cursor,[_text1,_text2,_text3,_text4,_text5]],2] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/functions.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/functions.sqf new file mode 100644 index 0000000000..7eb977eda8 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/functions.sqf @@ -0,0 +1,12 @@ + +cse_fnc_biometricScanner = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_biometricScanner.sqf"; +cse_fnc_conditionBiometricScanner = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_conditionBiometricScanner.sqf"; +cse_fnc_saveSettingsBiometric = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_saveSettingsBiometric.sqf"; +cse_fnc_cancelBiometric = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_cancelBiometric.sqf"; +cse_fnc_hiideMainMenu = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_hiideMainMenu.sqf"; +cse_fnc_clearScreenBiometricScanner = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_clearScreenBiometricScanner.sqf"; +cse_fnc_biometricScanStart = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_biometricScanStart.sqf"; +cse_fnc_biometricScannerInfo = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_biometricScannerInfo.sqf"; +cse_fnc_biometricScannerLogin = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_biometricScannerLogin.sqf"; +cse_fnc_biometricScannerLoginScreen = compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\fnc_biometricScannerLoginScreen.sqf"; + diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/init.sqf b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/init.sqf new file mode 100644 index 0000000000..bfcf654d80 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/init.sqf @@ -0,0 +1,6 @@ + + +call compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\functions.sqf"; + + [format["AIM - Biometric Scanner Component initialisation completed"],3] call cse_fnc_debug; + diff --git a/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/scanner.png b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/scanner.png new file mode 100644 index 0000000000..d8d304b120 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/biometric_scanner/scanner.png differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/config.cpp b/TO_MERGE/cse/sys_advanced_interaction/config.cpp new file mode 100644 index 0000000000..adcc70ea9e --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/config.cpp @@ -0,0 +1,38 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_advanced_interaction + { + units[] = {"cse_advancedInteractionItems", "cse_KeycuffsItem", "cse_HIIDEItem", "cse_oldphoneItem", "cse_oldphone_foldedItem", "cse_watch_expensiveItem", "cse_walletItem", "cse_9v_batteryItem", "cse_notebookItem", "cse_scissorsItem", "cse_wiresItem"}; + weapons[] = {"cse_Keycuffs", "cse_HIIDE", "cse_oldphone", "cse_oldphone_folded", "cse_watch_expensive", "cse_wallet", "cse_9v_battery", "cse_notebook", "cse_scissors", "cse_wires"}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main"}; + version = "0.10.0"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; + class cse_moduleAmbientCivilians + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main"}; + version = "0.10.0"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +#include "CfgAddOns.h" +#include "CfgVehicles.h" +#include "Combat_Space_Enhancement.h" +#include "GUI.h" + +// Here for backwards compatability. To be removed at a later moment. +// #include "CfgMagazines.h" + +#include "CfgWeapons.h" +#include "CfgFunctions.h" +#include "CfgSounds.h" + +// EOF \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/battery_co.paa b/TO_MERGE/cse/sys_advanced_interaction/data/battery_co.paa new file mode 100644 index 0000000000..58a57b8333 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/battery_co.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/hiide_back.paa b/TO_MERGE/cse/sys_advanced_interaction/data/hiide_back.paa new file mode 100644 index 0000000000..980599cdfe Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/hiide_back.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/hiide_side.paa b/TO_MERGE/cse/sys_advanced_interaction/data/hiide_side.paa new file mode 100644 index 0000000000..fc6c3866b8 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/hiide_side.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/mobile-folded.paa b/TO_MERGE/cse/sys_advanced_interaction/data/mobile-folded.paa new file mode 100644 index 0000000000..2bf3e3c9cf Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/mobile-folded.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/mobile.paa b/TO_MERGE/cse/sys_advanced_interaction/data/mobile.paa new file mode 100644 index 0000000000..2752620925 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/mobile.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/data/mobile_folded_side.paa b/TO_MERGE/cse/sys_advanced_interaction/data/mobile_folded_side.paa new file mode 100644 index 0000000000..13cf71bdf3 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/data/mobile_folded_side.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/dialog_module/init.sqf b/TO_MERGE/cse/sys_advanced_interaction/dialog_module/init.sqf new file mode 100644 index 0000000000..d0acf782ad --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/dialog_module/init.sqf @@ -0,0 +1,20 @@ + + +if (Isnil ("cse_stance_systemBlufor")) then {cse_stance_systemBlufor = 10;}; +if (Isnil ("cse_stance_systemOpfor")) then {cse_stance_systemOpfor = 10;}; +if (Isnil ("cse_stance_systemRes")) then {cse_stance_systemRes = 10; }; + +[format["AIM - Conversation Component initialisation completed"],3] call cse_fnc_debug; + + +if (!isnil "CSE_SYS_AIM_DIALOG_MODULE_TALKTO_AIM") then { + player removeAction CSE_SYS_AIM_DIALOG_MODULE_TALKTO_AIM; + CSE_SYS_AIM_DIALOG_MODULE_TALKTO_AIM = nil; +}; +CSE_SYS_AIM_DIALOG_MODULE_TALKTO_AIM = player addAction ["Talk to", {[cursorTarget, _this select 1] call cse_fnc_playerStartConverationWith_AIM;}, [], 1, false, false, "", "((cursortarget isKindOf 'CAManBase') && [cursortarget] call cse_fnc_isAwake && !(IsPlayer cursorTarget))"]; + + +["cse_profile_information_aim", [], true, "aim"] call cse_fnc_defineVariable; +["cse_dialog_recorded_conversation_aim", [], false, "aim"] call cse_fnc_defineVariable; + +CSE_PERFORMING_TALKING_ACTION_AIM = false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/dialog_module/talking_lines_default.sqf b/TO_MERGE/cse/sys_advanced_interaction/dialog_module/talking_lines_default.sqf new file mode 100644 index 0000000000..6cfb9060da --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/dialog_module/talking_lines_default.sqf @@ -0,0 +1,5 @@ + +/** +* This file is here temporarly. It will be replaced by config entries in the near future. +* +*/ diff --git a/TO_MERGE/cse/sys_advanced_interaction/fn_aim_init.sqf b/TO_MERGE/cse/sys_advanced_interaction/fn_aim_init.sqf new file mode 100644 index 0000000000..ab9bdb70c5 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/fn_aim_init.sqf @@ -0,0 +1,142 @@ +private ["_args"]; +_args = _this; +CSE_ENABLED_DIALOG_INTERACTION_AIM = true; +CSE_USE_EQUIPMENT_AIM = false; +CSE_BIOMETRIC_SCANNER_SETTING_AIM = 0; +CSE_DETAIN_SETTING_AIM = 0; +CSE_SEARCH_SETTING_AIM = 0; + +{ + _value = _x select 1; + if (!isnil "_value") then { + if (_x select 0 == "enableDetain") exitwith { + CSE_DETAIN_SETTING_AIM = _value; + if ((_x select 1) > 0) then { + CSE_ENABLED_DETAIN_AIM = true; + } else { + CSE_ENABLED_DETAIN_AIM = false; + }; + }; + + if (_x select 0 == "enableSearch") exitwith { + CSE_SEARCH_SETTING_AIM = _value; + if ((_x select 1) > 0) then { + CSE_ENABLED_SEARCH_AIM = true; + } else { + CSE_ENABLED_SEARCH_AIM = false; + }; + }; + + if (_x select 0 == "enableBiometric") exitwith { + CSE_BIOMETRIC_SCANNER_SETTING_AIM = _x select 1; + if ((_x select 1) > 0) then { + CSE_ENABLED_BIOMETRIC_SCANNER_AIM = true; + } else { + CSE_ENABLED_BIOMETRIC_SCANNER_AIM = false; + }; + }; + if (_x select 0 == "enableConversation") exitwith { + CSE_ENABLED_DIALOG_INTERACTION_AIM = (_x select 1); + }; + + if (_x select 0 == "useEquipment") exitwith { + CSE_USE_EQUIPMENT_AIM = (_x select 1); + }; +} ; +}foreach _args; + +[format["AIM - Advanced Interaction initialisation started"],3] call cse_fnc_debug; +waituntil{!isnil "cse_gui"}; + +[format["AIM - Advanced Interaction initialisation completed"],3] call cse_fnc_debug; + + +cse_fnc_action_openBiometricScanner_AIM = { + private ["_target"]; + if (CSE_ENABLED_BIOMETRIC_SCANNER_AIM && (!CSE_USE_EQUIPMENT_AIM || [player, "cse_HIDDE"] call cse_fnc_hasItem)) then { + _target = cursorTarget; + if (!iSNull _target) then { + if ((_target isKindOf "CAManBase") && ((player distance _target) < 10)) then { + [player,_target] call cse_fnc_biometricScanner; + }; + }; + }; +}; + +if (CSE_ENABLED_BIOMETRIC_SCANNER_AIM) then { + + call compile preprocessFile "cse\cse_sys_advanced_interaction\biometric_scanner\init.sqf"; + _entries = [ + ["Biometric", + { + ([_this select 0, _this select 1, CSE_BIOMETRIC_SCANNER_SETTING_AIM, "cse_HIDDE"] call cse_fnc_canPerformAction_AIM) + }, "cse\cse_sys_advanced_interaction\biometric_scanner\data\icon_biometricscanner.paa", + { closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_biometricScanner; }, "Use Biometric Scanner"] + ]; + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; + +if (CSE_ENABLED_SEARCH_AIM) then { + _entries = [ + ["Search", + { ([_this select 0, _this select 1, CSE_SEARCH_SETTING_AIM, ""] call cse_fnc_canPerformAction_AIM) }, CSE_ICON_PATH + "icon_search.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_searchPerson_AIM; + },"Search Person"] + ]; + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; + +if (CSE_ENABLED_DIALOG_INTERACTION_AIM) then { + call compile preprocessFile "cse\cse_sys_advanced_interaction\dialog_module\init.sqf"; + _entries = [ + ["Speak",{(((_this select 1) iskindof "CaManBase") && {((player distance (_this select 1)) < 10)} && {((_this select 1) != (_this select 0))} && {!Isplayer (_this select 1)})}, CSE_ICON_PATH + "icon_speak.paa", + { + if ([_this select 1] call cse_fnc_isAwake) then { + closeDialog 0; [_this select 1, player] call cse_fnc_playerStartConverationWith_AIM; + }; + },"Speak with Person"] + ]; + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; + +if (CSE_ENABLED_DETAIN_AIM) then { + _entries = [ + ["Arrest",{[player, _this select 1] call cse_fnc_canDetain}, CSE_ICON_PATH + "icon_handcuffs.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_arrest_AIM; + },"Arrest Person"], + + ["Release",{[player, _this select 1] call cse_fnc_canPerformArrestActions_AIM}, CSE_ICON_PATH + "icon_handcuffs.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_release_AIM; + },"Release Person"], + + ["Move",{[player, _this select 1] call cse_fnc_canPerformArrestActions_AIM}, CSE_ICON_PATH + "icon_movement.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_move_AIM; + },"Move Person"], + ["Place",{[player, _this select 1] call cse_fnc_canPerformArrestActions_AIM}, CSE_ICON_PATH + "icon_placedown.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_placedown_AIM; + },"Place down"], + ["Load",{[player, _this select 1] call cse_fnc_canPerformArrestActions_AIM}, CSE_ICON_PATH + "icon_place_in.paa", + { + closeDialog 0; [(_this select 0),(_this select 1)] call cse_fnc_load_AIM; + },"Load in nearby vehicle"] + ]; + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + + _entries = [ + ["Unload (Pris)", {((_this call cse_fnc_interactWithVehicle_Crew_Condition) && (count ((_this select 1) getvariable ["cse_loaded_detainees_AIM",[]]) > 0))}, CSE_ICON_PATH + "icon_open_dialog.paa", + { + closeDialog 0; + _loaded = ((_this select 1) getvariable ["cse_loaded_detainees_AIM",[]]); + { + [player,_x,false] call cse_fnc_unload_AIM; + }foreach _loaded + }, "Unload Prisoners"] + ]; + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_addToConversationLog_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_addToConversationLog_AIM.sqf new file mode 100644 index 0000000000..ac404ff451 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_addToConversationLog_AIM.sqf @@ -0,0 +1,31 @@ +/** + * fn_addToConversationLog_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_caller","_type","_activity","_log"]; +_unit = _this select 0; +_nameOf = _this select 1; +_message = _this select 2; + +_log = [_unit,"cse_dialog_recorded_conversation_aim"] call cse_fnc_getVariable; +if (count _log >= 12) then { + _newLog = []; + _counter = 0; + { + if (_counter > 0) then { + _newLog pushback _x; + } else { + _counter = _counter + 1; + }; + }foreach _log; + _log = _newLog; +}; +_log set [count _log, [_nameOf,_message]]; + +[_unit,"cse_dialog_recorded_conversation_aim",_log] call cse_fnc_setVariable; diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_arrest_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_arrest_aim.sqf new file mode 100644 index 0000000000..60c6fdb953 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_arrest_aim.sqf @@ -0,0 +1,21 @@ +/* + NAME: fnc_setArrested + USAGE: switches state of unit to arrested + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + +private ["_caller","_cursor"]; +_caller = _this select 0; +_target = _this select 1; + +playSound "cse_cable_tie_zipping"; + +[_target, true] call cse_fnc_setArrestState; +hint format["You arrrest this person"]; + +if (CSE_USE_EQUIPMENT_AIM) then { + [_caller, "cse_Keycuffs", false] call cse_fnc_useItem; +}; diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_callForSurrender_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_callForSurrender_AIM.sqf new file mode 100644 index 0000000000..749de803c9 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_callForSurrender_AIM.sqf @@ -0,0 +1,61 @@ +/** + * fn_callForSurrender_AIM.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define DISTANCE_AWAY 50 + +// TODO add missing variables to private array +private ["_nearest"]; +_nearest = (player nearEntities [["CAManBase"], DISTANCE_AWAY]); + +_amountOpfor = {side _x == EAST} count _nearest; +_amountBlufor = {side _x == west} count _nearest; +_amountInd = {side _x == independent} count _nearest; + +_amountOfSideCaller = switch (playerSide) do { + case west: {_amountOpfor}; + case east: {_amountBlufor}; + case independent: {_amountInd}; + default {0}; +}; +if (_amountOfSideCaller == 0) exitwith {}; + +{ + if (side _x != playerSide && !(isPlayer _x)) then { + if (!(lineIntersects [eyePos player, eyePos _x, _x, player]) || (random(1)>=0.75)) then { + + _amountOfSideTarget = switch (side _x) do { + case west: {_amountOpfor}; + case east: {_amountBlufor}; + case independent: {_amountInd}; + default {0}; + }; + _magCount = count magazines _x; + _allWeapons = weapons _x; + _availableMags = 0; + { + if (isArray (configFile >> "CfgWeapons" >> _x >> "magazines")) then { + _magazineArray = getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); + _canFitInWeapon = {_x in _magazineArray} count _magCount; + _availableMags = _availableMags + _canFitInWeapon; + }; + }foreach _allWeapons; + + if (_amountOfSideTarget / _amountOfSideCaller <= (0.1) + random(0.1)) then { + if (_availableMags <= 1) then { + // unit is out as well, so surrender here. + [format["UNIT %1 is surrendering", _x]] call cse_fnc_debug; + + // TODO implement surrender functionality + }; + }; + + }; + }; +}count _nearest; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canDetain.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canDetain.sqf new file mode 100644 index 0000000000..974540cea5 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canDetain.sqf @@ -0,0 +1,16 @@ +/** + * fn_canDetain.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target", "_caller"]; +_caller = _this select 0; +_target = _this select 1; + + +([_caller, _target, CSE_DETAIN_SETTING_AIM, "cse_Keycuffs"] call cse_fnc_canPerformAction_AIM) && !([_target] call cse_fnc_isArrested); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformAction_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformAction_AIM.sqf new file mode 100644 index 0000000000..bd2fbfb892 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformAction_AIM.sqf @@ -0,0 +1,28 @@ +/** + * fn_canPerformAction_AIM.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private [ "_caller", "_target", "_return", "_settingNumber", "_item"]; +_caller = _this select 0; +_target = _this select 1; +_settingNumber = _this select 2; +_item = _this select 3; + +if ((_target iskindof "CaManBase") && {((_caller distance _target) < 10)} && (_caller != _target) && (!CSE_USE_EQUIPMENT_AIM || [_caller, _item] call cse_fnc_hasItem || _item == "")) exitwith { + + _return = switch (_settingNumber ) do { + case 3: {true}; + case 2: {side _caller != side _target}; + case 1: {!(isPlayer _target)}; + case 0: {side _caller != side _target && !(isPlayer _target)}; + default { false }; + }; + _return +}; +false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformArrestActions_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformArrestActions_AIM.sqf new file mode 100644 index 0000000000..62c1cd179c --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_canPerformArrestActions_AIM.sqf @@ -0,0 +1,17 @@ +/** + * fn_canPerformArrestActions_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_target", "_caller"]; +_caller = _this select 0; +_target = _this select 1; + + +([_caller, _target, CSE_DETAIN_SETTING_AIM, ""] call cse_fnc_canPerformAction_AIM) && ([_target] call cse_fnc_isArrested); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_dialogMovementOrder_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_dialogMovementOrder_AIM.sqf new file mode 100644 index 0000000000..45dd2406c4 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_dialogMovementOrder_AIM.sqf @@ -0,0 +1,25 @@ +/** + * fn_dialogMovementOrder_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target","_order"]; +_target = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_order = [_this, 1, "",[""]] call BIS_fnc_Param; + +switch (_order) do { + case "Stop": { + _target stop true; + }; + case "Move": { + _target stop false; + }; + default { + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_disarmPerson_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_disarmPerson_AIM.sqf new file mode 100644 index 0000000000..cf63b2d13f --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_disarmPerson_AIM.sqf @@ -0,0 +1,19 @@ +/** + * fn_disarmPerson_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_cursor", "_weaponHolder"]; +_caller = _this select 0; +_target = _this select 1; + +_weaponHolder = createVehicle ["GroundWeaponHolder" , getPos _target, [], 0, "NONE"]; + +{ + _target action ["DropWeapon", _weaponHolder, _X]; +}foreach weapons _target; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_displayArrestOptions_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_displayArrestOptions_aim.sqf new file mode 100644 index 0000000000..29943eace0 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_displayArrestOptions_aim.sqf @@ -0,0 +1,31 @@ +/** + * fn_displayArrestOptions_aim.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + _subMenus = [ + ["Arrest",{!(CSE_interactionTarget getvariable ["cse_unitArrested",false])}, + { + [(_this select 0),(_this select 1)] call cse_fnc_arrest_AIM; + + }], + + ["Release",{(CSE_interactionTarget getvariable ["cse_unitArrested",false])},{ + [(_this select 0),(_this select 1)] call cse_fnc_release_AIM; + }], + + ["Move",{(CSE_interactionTarget getvariable ["cse_unitArrested",false])},{ + [(_this select 0),(_this select 1)] call cse_fnc_move_AIM; + }], + + ["Place down",{(CSE_interactionTarget getvariable ["cse_unitArrested",false])},{ + [(_this select 0),(_this select 1)] call cse_fnc_placedown_AIM; + }] + ]; + ["Arresting",_this select 2,_subMenus] call cse_fnc_gui_displaySubMenuButtons; + diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_fillDialogWithConversationLines_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_fillDialogWithConversationLines_AIM.sqf new file mode 100644 index 0000000000..6a8b2e7786 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_fillDialogWithConversationLines_AIM.sqf @@ -0,0 +1,28 @@ +/** + * fn_fillDialogWithConversationLines_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display","_target","_list","_conversation"]; +_target = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; + +disableSerialization; +_display = uiNamespace getvariable "cse_dialog_menu_aim"; +_list = _display displayCtrl 200; + +while {dialog} do { + + lbClear 200; + _conversation = _target getvariable ["cse_dialog_recorded_conversation_aim",[]]; + { + _list lbAdd format["%1:",(_x select 0)]; + _list lbAdd (_x select 1); // should localize here! + }foreach _conversation; + + uisleep 0.1; // got to put this in a oneachframe EH instead! +}; diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_generateProfileInformation_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_generateProfileInformation_AIM.sqf new file mode 100644 index 0000000000..42d5aa7939 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_generateProfileInformation_AIM.sqf @@ -0,0 +1,41 @@ +/** + * fn_generateProfileInformation_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define SELECT_RANDOM_ITEM(ARRAY) ARRAY select (round(random(count ARRAY -1))); + +private ["_unit","_occupation","_dateOfBirth","_politicalViews","_culture","_homeTown", "_availableCultures","_availableOccupations", "_availablePoliticalStances", "_availableSidesToSupport", "_availableHomeTown", "_supportedSides", "_profile"]; +_unit = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; + +_occupation = "Soldier"; +_dateOfBirth = "0/0/0"; +_politicalViews = ["Unknown"]; +_culture = "Unknown"; +_homeTown = "Unknown"; + +_sideOfUnit = side _unit; +_factionOfUnit = faction _unit; + +_availableCultures = [_unit, _sideOfUnit, _factionOfUnit,"Cultures"] call cse_fnc_getAvailableProfileSetsFor_AIM; +_availableOccupations = [_unit, _sideOfUnit, _factionOfUnit,"Occupations"] call cse_fnc_getAvailableProfileSetsFor_AIM; +_availablePoliticalStances = [_unit, _sideOfUnit, _factionOfUnit,"PoliticalViews"] call cse_fnc_getAvailableProfileSetsFor_AIM; +_availableSidesToSupport = [_unit, _sideOfUnit, _factionOfUnit,"SupportedSides"] call cse_fnc_getAvailableProfileSetsFor_AIM; +_availableHomeTown = [_unit, _sideOfUnit, _factionOfUnit,"homeTown"] call cse_fnc_getAvailableProfileSetsFor_AIM; + + +_occupation = SELECT_RANDOM_ITEM(_availableOccupations); +_dateOfBirth = SELECT_RANDOM_ITEM(["Unknown"]); +_politicalViews = SELECT_RANDOM_ITEM(_availablePoliticalStances); +_culture = SELECT_RANDOM_ITEM(_availableCultures); +_supportedSides = SELECT_RANDOM_ITEM(_availableSidesToSupport); +_homeTown = SELECT_RANDOM_ITEM(_availableHomeTown); + +_profile = [_occupation, _dateOfBirth, _politicalViews, _culture, _supportedSides, _homeTown]; + +[_unit, "cse_profile_information_aim", _profile] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getALiVECivData_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getALiVECivData_AIM.sqf new file mode 100644 index 0000000000..348c9d9db6 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getALiVECivData_AIM.sqf @@ -0,0 +1,20 @@ +/** + * fn_getALiVECivData_AIM.sqf + * Descr: Get the ALiVE Civ data from a Civilian unit + * Author: Glowbal + * + * Arguments: [unit OBJECT (Civilian unit to pull the data from.)] + * Return: ARRAY Civlian Data if system is enabled. Otherwise returns empty array. + * PublicAPI: true + */ + + +private ["_unit","_civData"]; +_unit = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; +if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { + //_civData = ["server","CSE_GET_AGENT_DATA_ALIVE_AIM",[[_unit],{call ALIVE_fnc_getAgentData}]] call ALiVE_fnc_BUS_RetVal; + _civData = [_unit] call ALIVE_fnc_getAgentData; // format: [ int POSTURE, array POSITION (HOME Postion), array TOWN Position, int Home town Posture] +} else { + _civData = []; +}; +_civData \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getAvailableProfileSetsFor_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getAvailableProfileSetsFor_AIM.sqf new file mode 100644 index 0000000000..662c696b8b --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getAvailableProfileSetsFor_AIM.sqf @@ -0,0 +1,112 @@ +/** + * fn_getAvailableProfileSetsFor_AIM.sqf + * Descr: Get available options for a profile set. Profile sets can be any of the following: Cultures, Occupations, PoliticalViews, SupportedSides, homeTown. + * + * Author: Glowbal + * + * Arguments: [unit OBJECT, side SIDE, faction STRING (Faction classname), set STRING (What set should be returned) ] + * Return: ARRAY Returns an array with the available profile set options. Is an array of strings in all cases but homeTown, which returns a 2D array. + * PublicAPI: true + */ + + +#define ALL_LOCATIONS ["Strategic","StrongpointArea","FlatArea","FlatAreaCity","FlatAreaCitySmall","CityCenter","Airport","NameMarine","NameCityCapital","NameCity","NameVillage","NameLocal","Hill","ViewPoint","RockArea","BorderCrossing","VegetationBroadleaf","VegetationFir","VegetationPalm","VegetationVineyard"] +#define NEAREST_LOCATION_RADIUS 700 + + +private ["_side","_faction","_set","_return", "_result", "_locationClose", "_locationFar", "_locationsClose", "_locationsFar", "_htReturn"]; +_unit = _this select 0; +_side = _this select 1; +_faction = _this select 2; +_set = _this select 3; + +_return = switch (_set) do { + case "Cultures": { + switch (_side) do { + case civilian: { + ["Greek", "Other"] + }; + default {["Unknown"]}; + }; + }; + case "Occupations": { + switch (_side) do { + case civilian: { + ["Baker", "Butcher", "Mechanic", "Writer", "Law_Enforcement", "Retired", "None", "Unknown", "Farmer", "Software_Developer", "Hunter", "Artist", "Banker", "Fireman", "Cook", "Construction_Worker", "Fisher","Repair_man", "Cleaner", "Woods_man", "Painter"] + }; + default {["Soldier"]}; + }; + }; + case "PoliticalViews": { + switch (_side) do { + case civilian: { + ["Normal", "Radical", "Mild", "None"] + }; + default {["Unknown"]}; + }; + }; + case "SupportedSides": { + switch (_side) do { + case civilian: { + _stances = []; + if (cse_stance_systemBlufor > 10) then { + _stances pushback West; + }; + if (cse_stance_systemOpfor > 10) then { + _stances pushback east; + }; + if (cse_stance_systemRes > 10) then { + _stances pushback independent; + }; + if (count _stances == 0) then { + _stances set [ 0, Civilian ]; + }; + + _stances + }; + default {[_side]}; + }; + }; + case "homeTown": { + _htReturn = [["Unknown","Unknown"]]; + switch (_side) do { + case civilian: { + if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { + ["ALiVE is loaded. Returning result with AlIVE settings", 1] call cse_fnc_debug; + _result = [_unit] call cse_fnc_getALiVECivData_AIM; + if (isnil "_result") then { + _result = []; + }; + _locationClose = ""; + _locationFar = ""; + if (count _result > 0) then { + _locationsClose = (nearestLocations [_result select 1, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + _locationsFar = (nearestLocations [_result select 2, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if (count _locationsClose > 0) then { + _locationClose = text (_locationsClose select 0); + }; + if (count _locationsFar > 0) then { + if (count _locationsFar > 1) then { + _locationFar = text (_locationsClose select 1); + } else { + _locationFar = text (_locationsClose select 0); + }; + }; + _htReturn = [[_locationClose,_locationFar]]; + } else { + _htReturn = [["Unknown","Unknown"]]; + }; + } else { + _htReturn = [["Unknown","Unknown"]]; + }; + }; + default {_htReturn = [["Unknown","Unknown"]]}; + }; + _htReturn; + }; + default { + ["Unknown"] + }; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getDialogLines_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getDialogLines_AIM.sqf new file mode 100644 index 0000000000..d58ca2147e --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getDialogLines_AIM.sqf @@ -0,0 +1,46 @@ +// Made by Glowbal +// Input: unit, object (Civ AI) +// Returns String array, contains strings with possible sentences + +private ["_arrayWithStrings", "_behaviour"]; +_behaviour = _this select 0; +_arrayWithStrings = []; + +switch (_behaviour) do { + case "agressive": + { + _arrayWithStrings = CSE_AgressiveLines_AIM; + }; + + case "friendly": + { + _arrayWithStrings = CSE_FriendlyLines_AIM; + }; + + case "neutral": + { + _arrayWithStrings = CSE_NeutralLines_AIM; + }; + + case "careless": + { + _arrayWithStrings = CSE_CarelessLines_AIM; + }; + + case "hostile": + { + _arrayWithStrings = CSE_HostileLines_AIM; + }; + + case "lostchicken": + { + _arrayWithStrings = CSE_OtherLines_AIM; + }; + + case default + { + _arrayWithStrings = CSE_DefaultLines_AIM; + }; +}; + +_arrayWithStrings \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getPlayerSpokenLineType_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getPlayerSpokenLineType_AIM.sqf new file mode 100644 index 0000000000..e714408240 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getPlayerSpokenLineType_AIM.sqf @@ -0,0 +1,74 @@ +/** + * fn_getPlayerSpokenLineType_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define MEET_AND_GREET 0 +#define ASK_ABOUT_OCCUPATION 1 +#define ASK_ABOUT_STANCE 2 +#define ASK_ABOUT_HOME 3 +#define ASK_ABOUT_CULTURE 4 +#define ASK_ABOUT_DOB 5 +#define ASK_ABOUT_INTEL 6 +#define ASK_ABOUT_ENEMY 7 +#define GIVE_MONEY 8 +#define GIVE_AID_PACKAGE 9 +#define OFFER_MEDICAL_AID 10 + +private ["_target","_caller","_spokenLineType", "_spot", "_enemySide", "_allSides"]; +_target = _this select 0; +_caller = _this select 1; +_spokenLineType = _this select 2; + +_allSides = [west, independent, east, civilian]; +_spot = 0; +{ + if ((_x getFriend side _caller) < ((_allSides select _spot) getFriend side _caller)) then { + _spot = _foreachIndex; + }; +}foreach _allSides; +_enemySide = _allSides select _spot; + +switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Hello, how are you?",format["Hello, I am %1",[_caller] call cse_fnc_getName], "Hi", "Hello.."] + }; + case ASK_ABOUT_OCCUPATION: { + ["What do you do for a living?", "What is it that you do?", "What is your occupation?"] + }; + case ASK_ABOUT_STANCE: { + ["Who do you support?", "What do you think of our cause?"] + }; + case ASK_ABOUT_HOME: { + ["Where do you live?","Do you live nearby?","Where are you from?","What is your place?"] + }; + case ASK_ABOUT_CULTURE: { + ["From what area are you from?"] + }; + case ASK_ABOUT_DOB: { + ["How old are you?","From when are you?"] + }; + case ASK_ABOUT_INTEL: { + ["Do you know any information that could be of use for us?","Have you got any information for us?","Have you seen something suspicious?"] + }; + case ASK_ABOUT_ENEMY: { + [format["Have you seen %1 side?", _enemySide], format["Can you tell me anything about %1 side movements?", _enemySide]] + }; + case GIVE_MONEY: { + ["Sir, please accept this"] + }; + case GIVE_AID_PACKAGE: { + ["Sir, please accept this"] + }; + case OFFER_MEDICAL_AID: { + ["Do you need medical assistance?"] + }; + default { + ["Hello"] + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getProfileInformation_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getProfileInformation_AIM.sqf new file mode 100644 index 0000000000..276babad4e --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getProfileInformation_AIM.sqf @@ -0,0 +1,42 @@ +/** + * fn_getProfileInformation_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_set"]; +_unit = _this select 0; +_set = _this select 1; +if (count (_unit getvariable ["cse_profile_information_aim",[]]) == 0) then { + [_unit] call cse_fnc_generateProfileInformation_AIM; +}; +_profile = _unit getvariable ["cse_profile_information_aim",[]]; +// [_occupation, _dateOfBirth, _politicalViews, _culture, _supportedSides, _homeTown] + +switch (_set) do { + case "Culture": { + _profile select 3 + }; + case "Occupation": { + _profile select 0 + }; + case "PoliticalViews": { + _profile select 2 + }; + case "SupportedSides": { + _profile select 4 + }; + case "homeTown": { + _profile select 5 + }; + case "dateOfBirth": { + _profile select 6 + }; + default { + "Unknown" + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionLinesOfPerson_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionLinesOfPerson_AIM.sqf new file mode 100644 index 0000000000..19b60b9fd2 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionLinesOfPerson_AIM.sqf @@ -0,0 +1,362 @@ +/** + * fn_getReactionLinesOfPerson_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define MEET_AND_GREET 0 +#define ASK_ABOUT_OCCUPATION 1 +#define ASK_ABOUT_STANCE 2 +#define ASK_ABOUT_HOME 3 +#define ASK_ABOUT_CULTURE 4 +#define ASK_ABOUT_DOB 5 +#define ASK_ABOUT_INTEL 6 +#define ASK_ABOUT_ENEMY 7 +#define GIVE_MONEY 8 +#define GIVE_AID_PACKAGE 9 +#define OFFER_MEDICAL_AID 10 + +#define ALL_LOCATIONS ["Strategic","StrongpointArea","FlatArea","FlatAreaCity","FlatAreaCitySmall","CityCenter","Airport","NameMarine","NameCityCapital","NameCity","NameVillage","NameLocal","Hill","ViewPoint","RockArea","BorderCrossing","VegetationBroadleaf","VegetationFir","VegetationPalm","VegetationVineyard"] +#define NEAREST_LOCATION_RADIUS 700 + + +// TODO clean up this file. To massive, so split it up into multiple functions + +private ["_target", "_caller","_spokenLineType","_reactionType"]; +_target = _this select 0; // civilian +_caller = _this select 1; // usually the player +_spokenLineType = _this select 2; +_reactionType = _this select 3; + +switch (_reactionType) do { + case "agressive": { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Go away...","We don't need you here!", "I won't talk to you", "GO AWAY!"] + }; + case ASK_ABOUT_OCCUPATION: { + ["Non of your business!"] + }; + case ASK_ABOUT_STANCE: { + ["Non of your business!", "I am warning you!"] + }; + case ASK_ABOUT_HOME: { + ["So you can destroy that?","Pfft.. someone should do something about you.."] + }; + case ASK_ABOUT_CULTURE: { + ["HA! You should die", "What..."] + }; + case ASK_ABOUT_DOB: { + ["Non of your business!"] + }; + case ASK_ABOUT_INTEL: { + ["As if I will help you!"] + }; + case ASK_ABOUT_ENEMY: { + if !([_target] call cse_fnc_isArrested) then { + ["I will not tell you anything!"] + } else { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.8} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["Alright! Perhaps something can be found near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults = ["I will never tell you anything!", "You won't get anything from me..", "I do not know anything!", "hmmph!"]; + }; + _enemyResults; + }; + }; + case GIVE_MONEY: { + ["I DONT NEED YOUR MONEY","So you are going to buy my favour?"] + }; + case GIVE_AID_PACKAGE: { + ["Go away!","I dont want this!"] + }; + case OFFER_MEDICAL_AID: { + ["I dont need your help"] + }; + default { + ["Go","Leave me!","Someone should do something about you.."] + }; + }; + }; + case "friendly": { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Hello...",format["Hello, I am %1",[_target] call cse_fnc_getName], "Hi", "How are you, sir?"] + }; + case ASK_ABOUT_OCCUPATION: { + [format["My occupation is %1",[_target, "Occupation"] call cse_fnc_getProfileInformation_AIM]] + }; + case ASK_ABOUT_STANCE: { + [format["I support %1", str ([_target, "SupportedSides"] call cse_fnc_getProfileInformation_AIM)]] + }; + case ASK_ABOUT_HOME: { + ["Sorry, I won't answer that", format["I live near %1, that is nearby %2",str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 0), str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 1)]] + }; + case ASK_ABOUT_CULTURE: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_DOB: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_INTEL: { + ["Sorry, I don't know"] + }; + case ASK_ABOUT_ENEMY: { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.2} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["There might be some from side %1 near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults pushback "I'm afraid I cannot tell you anything"; + }; + _enemyResults; + }; + case GIVE_MONEY: { + ["Thank you"] + }; + case GIVE_AID_PACKAGE: { + ["Thank you"] + }; + case OFFER_MEDICAL_AID: { + ["Thank you"] + }; + default { + ["Hello"] + }; + }; + }; + case "neutral": { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Hello...",format["Hello, I am %1",[_target] call cse_fnc_getName], "Hi", "How are you, sir?"] + }; + case ASK_ABOUT_OCCUPATION: { + [format["My occupation is %1",[_target, "Occupation"] call cse_fnc_getProfileInformation_AIM]] + }; + case ASK_ABOUT_STANCE: { + [format["I support %1",str ([_target, "SupportedSides"] call cse_fnc_getProfileInformation_AIM)]] + }; + case ASK_ABOUT_HOME: { + ["Sorry, I won't answer that", format["I live near %1, that is nearby %2",str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 0), str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 1)]] + }; + case ASK_ABOUT_CULTURE: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_DOB: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_INTEL: { + ["Sorry, I don't know"] + }; + case ASK_ABOUT_ENEMY: { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.2} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["There might be some from side %1 near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults pushback "I'm afraid I cannot tell you anything"; + }; + _enemyResults; + }; + case GIVE_MONEY: { + ["Thank you"] + }; + case GIVE_AID_PACKAGE: { + ["Thank you"] + }; + case OFFER_MEDICAL_AID: { + ["Thank you"] + }; + default { + ["Hello"] + }; + }; + }; + case "careless": { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Hello...",format["Hello, I am %1",[_target] call cse_fnc_getName], "Hi", "How are you, sir?"] + }; + case ASK_ABOUT_OCCUPATION: { + [format["My occupation is %1",[_target, "Occupation"] call cse_fnc_getProfileInformation_AIM]] + }; + case ASK_ABOUT_STANCE: { + [format["I support %1",str ([_target, "SupportedSides"] call cse_fnc_getProfileInformation_AIM)]] + }; + case ASK_ABOUT_HOME: { + ["Sorry, I won't answer that", format["I live near %1, that is nearby %2",str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 0), str (([_target, "homeTown"] call cse_fnc_getProfileInformation_AIM) select 1)]] + }; + case ASK_ABOUT_CULTURE: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_DOB: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_INTEL: { + ["Sorry, I don't know"] + }; + case ASK_ABOUT_ENEMY: { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.2} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["There might be some from side %1 near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults pushback "I'm afraid I cannot tell you anything"; + }; + _enemyResults; + }; + case GIVE_MONEY: { + ["Thank you"] + }; + case GIVE_AID_PACKAGE: { + ["Thank you"] + }; + case OFFER_MEDICAL_AID: { + ["Thank you"] + }; + default { + ["Hello"] + }; + }; + }; + case "hostile": { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Go away...","We don't need you here!", "I won't talk to you", "GO AWAY!"] + }; + case ASK_ABOUT_OCCUPATION: { + ["Non of your business!", "What are you still doing here"] + }; + case ASK_ABOUT_STANCE: { + ["Non of your business!", "I am warning you!", "Should I push you in the face?"] + }; + case ASK_ABOUT_HOME: { + ["So you can destroy that?","Pfft.. someone should do something about you..", "Where do you live? Perhaps I should visit there.."] + }; + case ASK_ABOUT_CULTURE: { + ["HA! You should die", "What..."] + }; + case ASK_ABOUT_DOB: { + ["Non of your business!"] + }; + case ASK_ABOUT_INTEL: { + ["As if I will help you!"] + }; + case ASK_ABOUT_ENEMY: { + if !([_target] call cse_fnc_isArrested) then { + ["I will not tell you anything!"] + } else { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.8} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["Alright! Perhaps something can be found near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults = ["I will never tell you anything!", "You won't get anything from me..", "I do not know anything!", "hmmph!"]; + }; + _enemyResults; + }; + }; + case GIVE_MONEY: { + ["I DONT NEED YOUR MONEY","So you are going to buy my favour?"] + }; + case GIVE_AID_PACKAGE: { + ["Go away!","I dont want this!"] + }; + case OFFER_MEDICAL_AID: { + ["I dont need your help"] + }; + default { + ["Go","Leave me!","Someone should do something about you.."] + }; + }; + }; + case default { + switch (_spokenLineType) do { + case MEET_AND_GREET: { // meet & greet + ["Hello...",format["Hello, I am %1",[_target] call cse_fnc_getName], "Hi", "How are you, sir?"] + }; + case ASK_ABOUT_OCCUPATION: { + [format["My occupation is %1",[_target, "Occupation"] call cse_fnc_getProfileInformation_AIM]] + }; + case ASK_ABOUT_STANCE: { + [format["I support %1",str ([_target, "SupportedSides"] call cse_fnc_getProfileInformation_AIM)]] + }; + case ASK_ABOUT_HOME: { + ["Sorry, I won't answer that"] + }; + case ASK_ABOUT_CULTURE: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_DOB: { + ["Sorry, I will not answer that"] + }; + case ASK_ABOUT_INTEL: { + _nearEntities = _target nearEntities ["CaManBase", 1000]; + _enemyResults = []; + { + if (side _x != side _caller && {random(1)>0.2} && {side _x != side _target}) then { + _foundLocations = (nearestLocations [getPos _x, ALL_LOCATIONS, NEAREST_LOCATION_RADIUS]); + if !(_foundLocations isEqualTo []) then { + _enemyResults pushback format["There might be some from side %1 near %2", side _x, text(_foundLocations select 0)]; + }; + }; + }foreach _nearEntities; + if (_enemyResults isEqualTo []) then { + _enemyResults pushback "I'm afraid I cannot tell you anything"; + }; + _enemyResults; + }; + case ASK_ABOUT_ENEMY: { + ["I am afraid I can't tell you anything"] + }; + case GIVE_MONEY: { + ["Thank you"] + }; + case GIVE_AID_PACKAGE: { + ["Thank you"] + }; + case OFFER_MEDICAL_AID: { + ["Thank you"] + }; + default { + ["Hello"] + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionTypeOfUnit_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionTypeOfUnit_AIM.sqf new file mode 100644 index 0000000000..0bb558f173 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_getReactionTypeOfUnit_AIM.sqf @@ -0,0 +1,58 @@ +/** + * fn_getReactionTypeOfUnit_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target","_caller","_stanceTowardsPlayerSide","_possibleReactionTypes","_selectedReactionType", "_selectNewReactionType", "_oldStance"]; +_target = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_caller = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; + +_stanceTowardsPlayerSide = switch (side _caller) do { + case WEST: {cse_stance_systemBlufor}; + case EAST: {cse_stance_systemOpfor}; + case independent: {cse_stance_systemRes}; + default {0}; +}; +if (side _caller == side _target) then { + _stanceTowardsPlayerSide = 500; +}; + +_selectNewReactionType = false; +_reactionType = _target getvariable "CSE_SYS_AIM_REACTION_TYPE"; +if (isnil "_reactionType") then { + _selectNewReactionType = true; +} else { + _oldStance = _reactionType select 1; + if (abs(_oldStance - _stanceTowardsPlayerSide) > 50) then { + _selectNewReactionType = true; + ["Need to refresh stance"] call cse_fnc_debug; + } else { + _selectedReactionType = _reactionType select 0; + }; +}; + +if (_selectNewReactionType) then { + _possibleReactionTypes = switch (true) do { + case (_stanceTowardsPlayerSide > 200): { + ["friendly", "neutral", "careless"]; + }; + case (_stanceTowardsPlayerSide > 0 ): { + ["agressive", "friendly", "neutral", "careless"]; + }; + case (_stanceTowardsPlayerSide < -500): { + ["agressive", "hostile"]; + }; + default { + ["agressive", "careless", "hostile", "neutral"]; + }; + }; + + _selectedReactionType = (_possibleReactionTypes select round (random (count _possibleReactionTypes - 1))); + _target setvariable ["CSE_SYS_AIM_REACTION_TYPE",[_selectedReactionType, _stanceTowardsPlayerSide]]; +}; +_selectedReactionType \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_isALIVECivlianSystemActive_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_isALIVECivlianSystemActive_AIM.sqf new file mode 100644 index 0000000000..6c798af500 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_isALIVECivlianSystemActive_AIM.sqf @@ -0,0 +1,15 @@ +/** + * fn_isALiVECivilianSystemActive.sqf + * Descr: Check if the ALiVE Civilian system is active + * Author: Glowbal + * + * Arguments: [] + * Return: BOOL true if ALiVE civilian system is active + * PublicAPI: true + */ + +if ([] call cse_fnc_isLoaded_ALiVE_Mod) then { + (["server","Subject",[[1],{[] call ALIVE_fnc_isCivilianSystemActive}]] call ALiVE_fnc_BUS) +} else { + false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_loadLocal_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_loadLocal_aim.sqf new file mode 100644 index 0000000000..d002d0e91f --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_loadLocal_aim.sqf @@ -0,0 +1,30 @@ +/* +fnc_loadLocal.sqf +Usage: +Author: Glowbal + +Arguments: array [unit (object), vehicle (object), unit (object)] +Returns: + +Affects: +Executes: +*/ + +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; + +_unit moveInCargo _vehicle; +_loaded = _vehicle getvariable ["cse_loaded_detainees_AIM",[]]; +_loaded pushback _unit; +_vehicle setvariable ["cse_loaded_detainees_AIM",_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; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_load_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_load_aim.sqf new file mode 100644 index 0000000000..dd01e1c1fe --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_load_aim.sqf @@ -0,0 +1,31 @@ +/* + fnc_load.sqf + Usage: loads specified unit into a vehicle + Author: Glowbal + + Arguments: array [unit (object), unit (object)] + Returns: none + + Affects: + Executes: +*/ + +private ["_caller", "_unit","_vehicle", "_loaded"]; +_caller = _this select 0; +_unit = _this select 1; + +if (!([_unit] call cse_fnc_isArrested)) exitwith { + hintSilent "This player is awake and cannot be loaded"; +}; + +_vehicle = [_caller, _unit] call cse_fnc_loadPerson_F; +if (!isNull _vehicle) then { + _loaded = _vehicle getvariable ["cse_loaded_detainees_AIM",[]]; + _loaded pushback _unit; + _vehicle setvariable ["cse_loaded_detainees_AIM",_loaded,true]; + + if (!isnil "CSE_DROP_ADDACTION_AIM") then { + _caller removeAction CSE_DROP_ADDACTION_AIM; + CSE_DROP_ADDACTION_AIM = nil; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_move_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_move_aim.sqf new file mode 100644 index 0000000000..e28c9ecbf2 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_move_aim.sqf @@ -0,0 +1,21 @@ +/* + NAME: fnc_release + USAGE: switches state of unit to arrested + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + + if ([_caller,_cursor,[-0.25,0.5,0]] call cse_fnc_carryObj) then { + //_cursor switchmove "UnaErcPoslechVelitele2"; + [_cursor,"UnaErcPoslechVelitele2",true] call cse_fnc_broadcastAnim; + hint format["You move this person"]; + } else { + //hint format["FAILED"]; + }; + diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_onCivilianKilled_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_onCivilianKilled_AIM.sqf new file mode 100644 index 0000000000..e9f12b3081 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_onCivilianKilled_AIM.sqf @@ -0,0 +1,23 @@ +/** + * fn_onCivilianKilled_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_killer","_victem"]; +_killer = _this select 0; +_victem = _this select 1; +if (side _victem == civilian) then { + if (CSE_ENABLED_DIALOG_INTERACTION_AIM && {isPlayer _killer} && {local _victem}) then { + switch (side _killer) do { + case WEST: {cse_stance_systemBlufor = cse_stance_systemBlufor - (random 300); publicVariable "cse_stance_systemBlufor";}; + case EAST: { cse_stance_systemOpfor = cse_stance_systemOpfor - (random 300); publicVariable "cse_stance_systemOpfor";}; + case independent: {cse_stance_systemRes = cse_stance_systemRes - (random 300); publicVariable "cse_stance_systemRes";}; + default {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personReactionToLine_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personReactionToLine_AIM.sqf new file mode 100644 index 0000000000..2c97f3016a --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personReactionToLine_AIM.sqf @@ -0,0 +1,30 @@ +/** + * fn_personReactionToLine_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_target", "_caller", "_civilian", "_array","_position","_textFromCiv", "_conversation"]; +_target = _this select 0; +_caller = _this select 1; +_lineType = _this select 2; + +if ((_target getvariable ["cse_profile_information_aim",[]]) isEqualTo []) then { + [[_target], "cse_fnc_generateProfileInformation_AIM", false, false] call BIS_fnc_MP; + waituntil {!((_target getvariable ["cse_profile_information_aim",[]]) isEqualTo [])}; +}; +sleep 3; + +_array = [_target, _caller, _lineType, ([_target, _caller] call cse_fnc_getReactionTypeOfUnit_AIM)] call cse_fnc_getReactionLinesOfPerson_AIM; +_position = round (random (count _array -1)); +_textFromCiv = _array select _position; +titleText [_textFromCiv,"PLAIN DOWN"]; + +[_target,[_target] call cse_fnc_getName, _textFromCiv ] call cse_fnc_addToConversationLog_AIM; + +CSE_PERFORMING_TALKING_ACTION_AIM = false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personSpeaksLine_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personSpeaksLine_AIM.sqf new file mode 100644 index 0000000000..e04e5b324a --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_personSpeaksLine_AIM.sqf @@ -0,0 +1,20 @@ +/** + * fn_personSpeaksLine_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target", "_caller", "_civilian", "_array","_position","_textFromCiv", "_conversation"]; +_target = _this select 0; +_caller = _this select 1; + +_array = [ ([_target, _caller] call cse_fnc_getReactionTypeOfUnit_AIM) , 0] call cse_fnc_getDialogLines_AIM; +_position = round (random (count _array -1)); +_textFromCiv = _array select _position; +titleText [_textFromCiv,"PLAIN DOWN"]; + +[_target,[_target] call cse_fnc_getName, _textFromCiv ] call cse_fnc_addToConversationLog_AIM; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_placedown_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_placedown_aim.sqf new file mode 100644 index 0000000000..3e19aee8ac --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_placedown_aim.sqf @@ -0,0 +1,18 @@ +/* + NAME: fnc_release + USAGE: switches state of unit to arrested + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + + private ["_caller","_cursor"]; + _caller = _this select 0; + _cursor = _this select 1; + [_caller,ObjNull] call cse_fnc_carryObj; + //_cursor switchmove "aidlpsitmstpsnonwnondnon_ground00"; + if ([_cursor] call cse_fnc_isAwake) then { + [_cursor,"aidlpsitmstpsnonwnondnon_ground00",true] call cse_fnc_broadcastAnim; + }; + hint format["You place this person on the ground"]; diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerSpeaksLine_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerSpeaksLine_AIM.sqf new file mode 100644 index 0000000000..d79e0374c3 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerSpeaksLine_AIM.sqf @@ -0,0 +1,31 @@ +/** + * fn_playerSpeaksLine_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_target", "_caller", "_civilian", "_array","_position","_textFromCiv", "_conversation", "_typeSelected"]; +_target = _this select 0; +_caller = _this select 1; + +if (CSE_PERFORMING_TALKING_ACTION_AIM) exitwith {}; + +waituntil {!CSE_PERFORMING_TALKING_ACTION_AIM}; +CSE_PERFORMING_TALKING_ACTION_AIM = true; + +_typeSelected = lbCurSel 400; +_array = [_target, _caller, _typeSelected] call cse_fnc_getPlayerSpokenLineType_AIM; +_position = round (random (count _array -1)); +_textFromCiv = _array select _position; +titleText [_textFromCiv,"PLAIN DOWN"]; + + +[_target,[_caller] call cse_fnc_getName, _textFromCiv ] call cse_fnc_addToConversationLog_AIM; + + +_handle = [_target, _caller, _typeSelected] spawn cse_fnc_personReactionToLine_AIM; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerStartConverationWith_AIM.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerStartConverationWith_AIM.sqf new file mode 100644 index 0000000000..5ee86247b6 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_playerStartConverationWith_AIM.sqf @@ -0,0 +1,46 @@ +/** + * fn_playerStartConverationWith_AIM.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target", "_caller", "_civilian", "_array","_position","_textFromCiv"]; +_target = _this select 0; +_caller = _this select 1; + +[_this] call cse_fnc_debug; +disableSerialization; +CSE_AIM_DIALOG_INTERACTION_TARGET_AIM = _target; +createDialog "cse_dialog_menu_aim"; +[_target] spawn cse_fnc_fillDialogWithConversationLines_AIM; + +if (count (_target getvariable ["cse_profile_information_aim",[]]) == 0) then { + //[_target] call cse_fnc_generateProfileInformation_AIM; + [[_target], "cse_fnc_generateProfileInformation_AIM", false, false] call BIS_fnc_MP; +}; + +lbadd [400, localize "STR_CSE_DIALOG_MEET_AND_GREET" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_OCCUPATION" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_STANCE" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_HOME" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_CULTURE" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_DOB" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_INTEL" ]; +lbadd [400, localize "STR_CSE_DIALOG_ASK_ABOUT_ENEMY" ]; +// lbadd [400, localize "STR_CSE_DIALOG_GIVE_MONEY" ]; +// lbadd [400, localize "STR_CSE_DIALOG_GIVE_AID_PACKAGE" ]; +// lbadd [400, localize "STR_CSE_DIALOG_OFFER_MEDICAL_AID" ]; +lbSetCurSel [400, 0]; + +ctrlSetText[12, "Name: "+ ([_target] call cse_fnc_getName)]; + +[_target] spawn { + _target = _this select 0; + [[_target,"Stop"],"cse_fnc_dialogMovementOrder_AIM",_target, false] spawn BIS_fnc_MP; + waituntil {!dialog}; + [[_target,"Move"],"cse_fnc_dialogMovementOrder_AIM",_target, false] spawn BIS_fnc_MP; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_release_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_release_aim.sqf new file mode 100644 index 0000000000..8069151ee9 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_release_aim.sqf @@ -0,0 +1,20 @@ +/* + NAME: fnc_release + USAGE: switches state of unit to arrested + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target , of type man + RETURN: void +*/ + + +private ["_caller","_cursor"]; +_caller = _this select 0; +_target = _this select 1; +[_caller,ObjNull] call cse_fnc_carryObj; +[_target, false] call cse_fnc_setArrestState; +hint format["You release this person"]; + +if (CSE_USE_EQUIPMENT_AIM) then { + // Disabled, as these are zipties. We would not be getting them back. +// _caller addItem "cse_Keycuffs"; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPersonCondition_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPersonCondition_aim.sqf new file mode 100644 index 0000000000..7ae1a2d9ae --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPersonCondition_aim.sqf @@ -0,0 +1,20 @@ +/* + NAME: fnc_searchPersonCondition + USAGE: Checks if caller can search target + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target + RETURN: boolean +*/ + + + +private ["_caller","_cursor", "_return"]; +_caller = _this select 0; +_cursor = _this select 1; +_return = false; + +if (group _caller != group _cursor && {_cursor iskindof "CaManBase"} && {_cursor distance _caller < 5}) then { + _return = true; +}; + +_return diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPerson_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPerson_aim.sqf new file mode 100644 index 0000000000..642f495094 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_searchPerson_aim.sqf @@ -0,0 +1,16 @@ +/* + NAME: fnc_searchPerson + USAGE: Opens gear menu of target object for caller + AUTHOR: Glowbal + ARGUMENTS: OBJECT unit, OBJECT target + RETURN: void +*/ + + +private ["_caller","_cursor"]; +_caller = _this select 0; +_cursor = _this select 1; + +if ([_caller, _cursor] call cse_fnc_searchPersonCondition_AIM) then { + _caller action ["GEAR", _cursor]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/functions/fn_unload_aim.sqf b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_unload_aim.sqf new file mode 100644 index 0000000000..8dc0909f3a --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/functions/fn_unload_aim.sqf @@ -0,0 +1,33 @@ +/* +fnc_unload.sqf +Usage: +Author: Glowbal + +Arguments: array [unit (object), unit (object), vehicle (object)] +Returns: + +Affects: +Executes: +*/ + +private ["_caller", "_unit","_vehicle", "_drag", "_handle"]; +_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; +_drag = [_this, 2, false, [false]] call BIS_fnc_Param; + +_vehicle = vehicle _unit; +if ([_caller, _unit] call cse_fnc_unloadPerson_F) then { + _loaded = _vehicle getvariable ["cse_loaded_detainees_AIM",[]]; + _loaded = _loaded - [_unit]; + _vehicle setvariable ["cse_loaded_detainees_AIM",_loaded,true]; + if (_drag) then { + if ((vehicle _caller) == _caller) then { + _handle = [_caller, _unit] spawn { + _caller = _this select 0; + _unit = _this select 1; + waituntil {(vehicle _unit == _unit)}; + [[_caller,_unit], "cse_fnc_move_AIM", _caller, false] spawn BIS_fnc_MP; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/gui/define.h b/TO_MERGE/cse/sys_advanced_interaction/gui/define.h new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/gui/define.h @@ -0,0 +1,797 @@ + +#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/sys_advanced_interaction/gui/dialog_menu.h b/TO_MERGE/cse/sys_advanced_interaction/gui/dialog_menu.h new file mode 100644 index 0000000000..beeff47d76 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/gui/dialog_menu.h @@ -0,0 +1,172 @@ +class cse_dialog_menu_aim { + idd = 54327; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_dialog_menu_aim', _this select 0];"; + onUnload = "uiNamespace setVariable ['cse_dialog_menu_aim', nil];"; + class controlsBackground { + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class LeftBackground: CenterBackground { + y = "4.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "12.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "25 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class RightBackground: LeftBackground { + x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + w = "12.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "Dialog with Person"; + }; + + class labelShow : cse_gui_staticBase { + idc = 12; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.3 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Name:"; + }; + class labelShow2: cse_gui_staticBase { + idc = 13; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.4 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "State:"; + }; + + class actionClose : cse_gui_buttonBase { + idc = 10; + text = "Close"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((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)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "closedialog 0;"; + }; + + class listboxConversationOverView: cse_gui_listNBox { + idc = 200; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.25}; + }; + + class labelTitle: cse_gui_staticBase { + idc = 250; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Conversation Selection"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + + + class actionListBox1: cse_gui_listBoxBase { + idc = 400; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "7.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0, 0.9}; + colorSelectBackground[] = {0,0,0, 0.9}; + colorSelectBackground2[] = { 0.9, 0.9, 0.9, 0.9}; + color[] = {1, 1, 1, 1}; + colorText[] = {1, 1, 1, 1}; + colorSelect[] = {1, 1, 1, 1}; + colorSelect2[] = {0,0,0, 1}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.75)"; + rowHeight = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.75)"; + }; + + class labelKey: cse_gui_staticBase { + idc = 300; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "6.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + + + class actionPerformAction: actionClose { + idc = 30; + text = "Say selected line type"; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)"; + action = "[CSE_AIM_DIALOG_INTERACTION_TARGET_AIM, player] call cse_fnc_playerSpeaksLine_AIM; "; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {0,0,0, 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}; + }; + + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/gui/search_menu.h b/TO_MERGE/cse/sys_advanced_interaction/gui/search_menu.h new file mode 100644 index 0000000000..f1c83f64b3 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/gui/search_menu.h @@ -0,0 +1,26 @@ +class cse_searchMenu_aim { + idd = 54327; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_searchMenu_aim', _this select 0];"; + onUnload = "uiNamespace setVariable ['cse_searchMenu_aim', nil];"; + class controlsBackground { + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + }; + + class controls { + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_advanced_interaction/hiide.p3d b/TO_MERGE/cse/sys_advanced_interaction/hiide.p3d new file mode 100644 index 0000000000..818c9ed45c Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/hiide.p3d differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/9v_battery.paa b/TO_MERGE/cse/sys_advanced_interaction/img/9v_battery.paa new file mode 100644 index 0000000000..c68a998b10 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/9v_battery.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/HIIDE.paa b/TO_MERGE/cse/sys_advanced_interaction/img/HIIDE.paa new file mode 100644 index 0000000000..33f080ebb8 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/HIIDE.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/hexiblocks.paa b/TO_MERGE/cse/sys_advanced_interaction/img/hexiblocks.paa new file mode 100644 index 0000000000..29f2f7b271 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/hexiblocks.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/keycuffs.paa b/TO_MERGE/cse/sys_advanced_interaction/img/keycuffs.paa new file mode 100644 index 0000000000..fde5797f66 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/keycuffs.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/notebook.paa b/TO_MERGE/cse/sys_advanced_interaction/img/notebook.paa new file mode 100644 index 0000000000..7a603a5a95 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/notebook.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/oldphone.paa b/TO_MERGE/cse/sys_advanced_interaction/img/oldphone.paa new file mode 100644 index 0000000000..1b24958231 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/oldphone.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/scissor.paa b/TO_MERGE/cse/sys_advanced_interaction/img/scissor.paa new file mode 100644 index 0000000000..d9ec6503e3 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/scissor.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/wallet.paa b/TO_MERGE/cse/sys_advanced_interaction/img/wallet.paa new file mode 100644 index 0000000000..8a5ccf235a Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/wallet.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/watch_expensive.paa b/TO_MERGE/cse/sys_advanced_interaction/img/watch_expensive.paa new file mode 100644 index 0000000000..7f7d5513b7 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/watch_expensive.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/img/wires.paa b/TO_MERGE/cse/sys_advanced_interaction/img/wires.paa new file mode 100644 index 0000000000..180c212898 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/img/wires.paa differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/mobile.p3d b/TO_MERGE/cse/sys_advanced_interaction/mobile.p3d new file mode 100644 index 0000000000..c4e10c9035 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/mobile.p3d differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/mobile_folded.p3d b/TO_MERGE/cse/sys_advanced_interaction/mobile_folded.p3d new file mode 100644 index 0000000000..1e141ae0c7 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/mobile_folded.p3d differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/sounds/cse_cable_tie_zipping.ogg b/TO_MERGE/cse/sys_advanced_interaction/sounds/cse_cable_tie_zipping.ogg new file mode 100644 index 0000000000..4f76037eb1 Binary files /dev/null and b/TO_MERGE/cse/sys_advanced_interaction/sounds/cse_cable_tie_zipping.ogg differ diff --git a/TO_MERGE/cse/sys_advanced_interaction/stringtable.xml b/TO_MERGE/cse/sys_advanced_interaction/stringtable.xml new file mode 100644 index 0000000000..49d8df22e8 --- /dev/null +++ b/TO_MERGE/cse/sys_advanced_interaction/stringtable.xml @@ -0,0 +1,167 @@ + + + + + + Meet and Greet + Meet and Greet + Przedstaw siÄ™ i przywitaj + Saludar + + + Ask about Occupation + Ask about Occupation + Zapytaj o zawĂ³d + Preguntar sobre su ocupaciĂ³n + + + Ask about Their supported side + Ask about Their supported side + Zapytaj ktĂ³rÄ… stronÄ™ wspierajÄ… + Preguntar sobre su bando + + + Ask about there home + Ask about there home + Zapytaj o dom + Preguntar acerca de su hogar + + + Find out their culture + Find out their culture + Zapytaj o kulturÄ™ + AverigĂ¼e su cultura + + + Ask about Date of Birth + Ask about Date of Birth + Zapytaj o datÄ™ urodzenia + Preguntar fecha de nacimiento + + + Ask information + Ask information + Zapytaj o informacjÄ™ + Pedir informaciĂ³n + + + Ask about enemy + Ask about enemy + Zapytaj o przeciwnika + Preguntar sobre el enemigo + + + Give Money + Give Money + Podaruj pieniÄ…dze + Dar Dinero + + + Give Aid Package + Give Aid Package + Podaruj apteczkÄ™ + Dar paquete de ayuda mĂ©dica + + + Offer medical Aid + Offer medical Aid + Zaoferuj pomoc medycznÄ… + Ofrecer ayuda mĂ©dica + + + + + + Keycuffs + Bridas + + + Keycuffs, used for detaining a suspect + Bridas, usadas para detener a un sospechoso + + + + Biometric Scanner (HIIDE) + EscĂ¡ner BiomĂ©trico (HIIDE) + + + Biometric Scanner (HIIDE) + EscĂ¡ner BiomĂ©trico (HIIDE) + + + + Old Phone + TelĂ©fono Antiguo + + + Old Phone + TelĂ©fono Antiguo + + + + Old Phone (Folded) + TelĂ©fono Antiguo (Cerrado) + + + Old Phone (Folded) + TelĂ©fono Antiguo (Cerrado) + + + + Watch (Expensive) + Reloj (Caro) + + + Watch (Expensive) + Reloj (Caro) + + + + Wallet + Billetera + + + Wallet + Billetera + + + + 9 volt battery + Pila de 9 voltios + + + 9 volt battery + Pila de 9 voltios + + + + Notebook + Cuaderno + + + + + Notebook + Cuaderno + + + + Scissors + Tijeras + + + Scissors + Tijeras + + + + Wires + Alambre + + + Wires + Alambre + + + + diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgAmmo.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgAmmo.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgFunctions.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgFunctions.h new file mode 100644 index 0000000000..463b661da6 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgFunctions.h @@ -0,0 +1,11 @@ +class CfgFunctions { + class CSE { + class WindDeflection { + file = "cse\cse_sys_ballistics\basicBallistics\functions"; + class handleFired_DEFLECT { recompile = 1; }; + class onWeatherMeterOpened_DEFLECT { recompile = 1; }; + class weatherMeterOpenWindView_DEFLECT { recompile = 1; }; + class weatherMeterOpenWeatherView_DEFLECT { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgMagazines.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgMagazines.h new file mode 100644 index 0000000000..fbfb6f9372 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgMagazines.h @@ -0,0 +1,15 @@ +class CfgMagazines { + class Default; + class CA_magazine: Default{}; + class cse_weather_meter: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Weather Meter (GREEN)"; + picture = "\cse\cse_sys_ballistics\basicBallistics\data\pocket_weather_meter_day_green.paa"; + descriptionShort = "Provides information about weather and wind"; + descriptionUse = "Provides information about humidity, wind speed, direction and strenght."; + mass = 5; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgVehicles.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgVehicles.h new file mode 100644 index 0000000000..568af426ef --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgVehicles.h @@ -0,0 +1,31 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_winddeflection: Module_F { + scope = 2; + displayName = "Basic Ballistics [CSE]"; + icon = "\cse\cse_main\data\cse_rifle_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class forAI { + displayName = "Enable for AI"; + description = "Should the module be enabled for AI"; + typeName = "BOOL"; + defaultValue = 0; + }; + class allowNonLocal { + displayName = "Non Local"; + description = "Should the module be enabled for non local units"; + typeName = "BOOL"; + defaultValue = 0; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgWeapons.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgWeapons.h new file mode 100644 index 0000000000..7950800aba --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/CfgWeapons.h @@ -0,0 +1,18 @@ +class CfgWeapons { + class Default; + class cse_weather_meter: Default { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Weather Meter"; + picture = "\cse\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Provides information about weather and wind"; + descriptionUse = "Provides information about humidity, wind speed, direction and strenght."; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + simulation = "Weapon"; + class ItemInfo + { + mass = 10; + }; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..05dbf8b31d --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/Combat_Space_Enhancement.h @@ -0,0 +1,34 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_winddeflection { + init = "call compile preprocessFile 'cse\cse_sys_ballistics\basicBallistics\init_sys_winddeflection.sqf';"; + name = "Wind Deflection"; + class EventHandlers { + class CAManBase { + fired = "_this call cse_fnc_handleFired_DEFLECT; false"; + }; + }; + class Configurations { + class check_wind_direction { + type = ACTION_KEYBINDING; + title = "Check Wind Direction"; + description = "Displays a hint with the current wind direction and speed."; + value[] = {0,0,0,0}; + onPressed = "[] call cse_fnc_checkWindDir_WIND;"; + }; + class open_weather_meter { + type = ACTION_KEYBINDING; + title = "Open the Weather Meter"; + description = "When you have the weather meter in your inventory, pressing this key will open the menu, showing you the current weather information."; + value[] = {0,0,0,0}; + onPressed = "if (([player,'cse_weather_meter'] call cse_fnc_hasMagazine)) then { createDialog 'cse_weather_meter'; }; "; + idd = 65423; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/GUI.h b/TO_MERGE/cse/sys_ballistics/basicBallistics/GUI.h new file mode 100644 index 0000000000..e27240144e --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/GUI.h @@ -0,0 +1,2 @@ +#include "gui\define.hpp" +#include "gui\weather_meter.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/config.cpp b/TO_MERGE/cse/sys_ballistics/basicBallistics/config.cpp new file mode 100644 index 0000000000..583105bed7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/config.cpp @@ -0,0 +1,26 @@ +class CfgPatches { + class cse_sys_winddeflection { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main"}; + versionDesc = "CSE Wind Deflection"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class cse_sys_winddeflection { + class PreloadAddons { + class cse_sys_winddeflection { + list[] = {"cse_sys_winddeflection"}; + }; + }; +}; +#include "CfgAmmo.h" +#include "CfgVehicles.h" +#include "CfgMagazines.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" +#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/data/icon_weather_meter.paa b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/icon_weather_meter.paa new file mode 100644 index 0000000000..bc2395644d Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/icon_weather_meter.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_day_green.paa b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_day_green.paa new file mode 100644 index 0000000000..ed990f53cb Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_day_green.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_night_green.paa b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_night_green.paa new file mode 100644 index 0000000000..c13719e9bb Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/pocket_weather_meter_night_green.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/data/weatherMeter.paa b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/weatherMeter.paa new file mode 100644 index 0000000000..51d2b9491d Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/basicBallistics/data/weatherMeter.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_handleFired_DEFLECT.sqf b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_handleFired_DEFLECT.sqf new file mode 100644 index 0000000000..fb7ec63952 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_handleFired_DEFLECT.sqf @@ -0,0 +1,102 @@ +/** + * CSE fnc HandleFired DEFLECT. + * Handles wind deflection for projectiles. + * Is expected to be triggered by the fired eventhandler from BI. + * + * Params: + * 1. unit: Object - Object the event handler is assigned to + * 2. weapon: String - Fired weapon + * 3. muzzle: String - Muzzle that was used + * 4. mode: String - Current mode of the fired weapon + * 5. ammo: String - Ammo used + * 6. magazine: String - magazine name which was used + * 7. projectile: Object - Object of the projectile that was shot (Arma 2: OA and onwards) + * + * Author: Glowbal, Ruthberg + * + */ + +if (isNil "CSE_DISABLE_HANDLE_DEFLECTION") then { CSE_DISABLE_HANDLE_DEFLECTION = false; }; +if (CSE_DISABLE_HANDLE_DEFLECTION) exitWith { true }; + +private ["_unit", "_weapon", "_ammo", "_bullet", "_airFriction", "_index"]; +_unit = _this select 0; + +if (!CSE_WIND_DEFLECTION_EFFECT_AI_BB && !(isPlayer _unit)) exitWith {}; +if (cse_AB_WindEnabled && (gunner _unit) getVariable ["cse_enabled_AdvancedBallistics", false]) exitWith {}; + +_bullet = _this select 5; +if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { + _bullet = _this select 6; // with CBA magazine and projectile are reverted +}; + +if ((CSE_WIND_DEFLECTION_ALLOW_NON_LOCAL_BB || local _unit) && (_bullet isKindOf "BulletBase")) then { + _weapon = _this select 1; + _ammo = _this select 4; + + _airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); + + _index = count cse_basicBallistics_bulletDatabase; + if (count cse_basicBallistics_bulletDatabaseFreeIndices > 0) then { + _index = cse_basicBallistics_bulletDatabaseFreeIndices select 0; + cse_basicBallistics_bulletDatabaseFreeIndices = cse_basicBallistics_bulletDatabaseFreeIndices - [_index]; + }; + + cse_basicBallistics_bulletDatabase set[_index, [_bullet, _airFriction, _index]]; + cse_basicBallistics_bulletDatabaseLastFrame set[_index, time]; + + cse_basicBallistics_bulletDatabaseOccupiedIndices pushBack _index; + + if (count cse_basicBallistics_bulletDatabaseOccupiedIndices == 1) then { + ["basicBallistics", "onEachFrame", { + private ["_bullet", "_airFriction", "_index", "_deltaT", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueVelocity", "_dragRef", "_drag", "_accelRef", "_accel"]; + + { + _bullet = (cse_basicBallistics_bulletDatabase select _x) select 0; + _index = (cse_basicBallistics_bulletDatabase select _x) select 2; + if (!alive _bullet) then { + cse_basicBallistics_bulletDatabaseOccupiedIndices = cse_basicBallistics_bulletDatabaseOccupiedIndices - [_index]; + cse_basicBallistics_bulletDatabaseFreeIndices pushBack _index; + }; + } forEach cse_basicBallistics_bulletDatabaseOccupiedIndices; + + if (count cse_basicBallistics_bulletDatabaseOccupiedIndices == 0) exitWith { + /// Resetting all the variables. + cse_basicBallistics_bulletDatabase = []; + cse_basicBallistics_bulletDatabaseLastFrame = []; + cse_basicBallistics_bulletDatabaseOccupiedIndices = []; + cse_basicBallistics_bulletDatabaseFreeIndices = []; + ["basicBallistics", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + { + _bullet = (cse_basicBallistics_bulletDatabase select _x) select 0; + _airFriction = (cse_basicBallistics_bulletDatabase select _x) select 1; + _index = (cse_basicBallistics_bulletDatabase select _x) select 2; + + _deltaT = time - (cse_basicBallistics_bulletDatabaseLastFrame select _index); + cse_basicBallistics_bulletDatabaseLastFrame set[_index, time]; + + _bulletVelocity = velocity _bullet; + _bulletSpeed = vectorMagnitude _bulletVelocity; + + if (vectorMagnitude wind > 0) then { + _trueVelocity = _bulletVelocity vectorDiff wind; + _trueSpeed = vectorMagnitude _trueVelocity; + + _dragRef = _deltaT * _airFriction * _bulletSpeed * _bulletSpeed; + _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); + _bulletVelocity = _bulletVelocity vectorDiff _accelRef; + + _drag = _deltaT * _airFriction * _trueSpeed * _trueSpeed; + _accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); + _bulletVelocity = _bulletVelocity vectorAdd _accel; + }; + + _bullet setVelocity _bulletVelocity; + } forEach cse_basicBallistics_bulletDatabaseOccupiedIndices; + + }] call BIS_fnc_addStackedEventHandler; + }; +}; +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_onWeatherMeterOpened_DEFLECT.sqf b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_onWeatherMeterOpened_DEFLECT.sqf new file mode 100644 index 0000000000..d27fa411e7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_onWeatherMeterOpened_DEFLECT.sqf @@ -0,0 +1,26 @@ +/** + * fn_onWeatherMeterOpened_DEFLECT.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (isnil "CSE_WEATHER_METER_CURRENT_SCREEN_DEFLECT") then { + CSE_WEATHER_METER_CURRENT_SCREEN_DEFLECT = "WIND_VIEW"; +}; +if (isnil "CSE_WEATHER_METER_IS_OPEN_DEFLECT") then { + CSE_WEATHER_METER_IS_OPEN_DEFLECT = false; +}; + +while { CSE_WEATHER_METER_IS_OPEN_DEFLECT } do { + switch (CSE_WEATHER_METER_CURRENT_SCREEN_DEFLECT) do { + case "WEATHER_VIEW": {[] call cse_fnc_weatherMeterOpenWeatherView_DEFLECT;}; + case "WIND_VIEW": { [] call cse_fnc_weatherMeterOpenWindView_DEFLECT;}; + default {}; + }; + uisleep 1; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWeatherView_DEFLECT.sqf b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWeatherView_DEFLECT.sqf new file mode 100644 index 0000000000..a8e25227bd --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWeatherView_DEFLECT.sqf @@ -0,0 +1,28 @@ +/** + * fn_weatherMeterOpenWeatherView_DEFLECT.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display","_backgroundCtrl","_categoryCtrl","_lineOneCtrl", "_lineTwoCtrl","_LineThreeCtrl", "_textLineOne","_textLineTwo"]; + +disableSerialization; +_display = uiNamespace getvariable "cse_weather_meter"; + +_backgroundCtrl = _display displayCtrl 1; +_categoryCtrl = _display displayCtrl 10; +_lineOneCtrl = _display displayCtrl 11; +_lineTwoCtrl = _display displayCtrl 12; +_LineThreeCtrl = _display displayCtrl 13; + +_categoryCtrl ctrlSetText (localize "STR_CSE_WEATHER_METER_WEATHER_CATEGORY"); + +_textLineOne = format [ localize "STR_CSE_WEATHER_METER_WEATHER_HUMIDITY", floor (humidity * 100)]; + +_lineOneCtrl ctrlSetText _textLineOne; +_lineTwoCtrl ctrlSetText ""; +_LineThreeCtrl ctrlSetText ""; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWindView_DEFLECT.sqf b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWindView_DEFLECT.sqf new file mode 100644 index 0000000000..82c8e96a65 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/functions/fn_weatherMeterOpenWindView_DEFLECT.sqf @@ -0,0 +1,29 @@ +/** + * fn_weatherMeterOpenWindView_DEFLECT.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display","_backgroundCtrl","_categoryCtrl","_lineOneCtrl", "_lineTwoCtrl","_LineThreeCtrl", "_textLineOne","_textLineTwo"]; + +disableSerialization; +_display = uiNamespace getvariable "cse_weather_meter"; + +_backgroundCtrl = _display displayCtrl 1; +_categoryCtrl = _display displayCtrl 10; +_lineOneCtrl = _display displayCtrl 11; +_lineTwoCtrl = _display displayCtrl 12; +_LineThreeCtrl = _display displayCtrl 13; + +_categoryCtrl ctrlSetText (localize "STR_CSE_WEATHER_METER_WIND_CATEGORY"); + +_textLineOne = format [ localize "STR_CSE_WEATHER_METER_WIND_SPEED", (wind distance [0,0,0])]; +_textLineTwo = format [ localize "STR_CSE_WEATHER_METER_WIND_DIRECTION", windDir]; + +_lineOneCtrl ctrlSetText _textLineOne; +_lineTwoCtrl ctrlSetText _textLineTwo; +_LineThreeCtrl ctrlSetText ""; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/gui/define.hpp b/TO_MERGE/cse/sys_ballistics/basicBallistics/gui/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/gui/define.hpp @@ -0,0 +1,797 @@ + +#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/sys_ballistics/basicBallistics/gui/weather_meter.hpp b/TO_MERGE/cse/sys_ballistics/basicBallistics/gui/weather_meter.hpp new file mode 100644 index 0000000000..fd9e979bcd --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/gui/weather_meter.hpp @@ -0,0 +1,101 @@ +class cse_weather_meter { + idd = 65423; + movingEnable = 1; + onLoad = "uiNamespace setVariable ['cse_weather_meter', _this select 0];CSE_WEATHER_METER_IS_OPEN_DEFLECT = true; NUL = [] spawn cse_fnc_onWeatherMeterOpened_DEFLECT;"; + onUnload = "CSE_WEATHER_METER_IS_OPEN_DEFLECT = false; "; + + class controlsBackground { + class backgroundImg: cse_gui_backgroundBase{ + idc = 1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "0 * (((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 = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "cse\cse_sys_ballistics\basicBallistics\data\pocket_weather_meter_day_green.paa"; + moving = 1; + }; + }; + + class controls { + class labelTextMenu : cse_gui_staticBase { + idc = 10; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "19 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "6.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + text = "CATEGORY NAME"; + colorBackground[] = {0,0,0,0.0}; + colorText[] = {0.0, 0.0, 0.0, 1.0}; + style = ST_CENTER; + }; + class labelTextLineOne : labelTextMenu { + idc = 11; + x = "4.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 = "6.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.6)"; + text = ""; + style = ST_LEFT; + }; + class labelTextLineTwo : labelTextLineOne { + idc = 12; + y = "20.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class labelTextLineThree : labelTextLineOne { + idc = 13; + y = "21.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + + + + class actionClose : cse_gui_buttonBase { + idc = 30; + text = ""; + x = "4.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "28.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.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)"; + 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 = "closedialog 0;"; + }; + + class actionButtonLeft : actionClose { + idc = 31; + text = ""; + x = "4.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "23 * ((((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 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "[] call cse_fnc_weatherMeterOpenWindView_DEFLECT; CSE_WEATHER_METER_CURRENT_SCREEN_DEFLECT = 'WIND_VIEW';"; + }; + class actionButtonRight : actionButtonLeft { + idc = 32; + text = ""; + x = "9.25 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "23 * ((((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 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "[] call cse_fnc_weatherMeterOpenWeatherView_DEFLECT; CSE_WEATHER_METER_CURRENT_SCREEN_DEFLECT = 'WEATHER_VIEW';"; + }; + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/init_sys_winddeflection.sqf b/TO_MERGE/cse/sys_ballistics/basicBallistics/init_sys_winddeflection.sqf new file mode 100644 index 0000000000..33db0953d7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/init_sys_winddeflection.sqf @@ -0,0 +1,53 @@ +CSE_WIND_DEFLECTION_EFFECT_AI_BB = false; +CSE_WIND_DEFLECTION_ALLOW_NON_LOCAL_BB = false; + +private ["_args"]; +_args = _this; + +{ + if (_x select 0 == "forAI") then { + CSE_WIND_DEFLECTION_EFFECT_AI_BB = _x select 1; + }; + if (_x select 0 == "allowNonLocal") then { + CSE_WIND_DEFLECTION_ALLOW_NON_LOCAL_BB = _x select 1; + }; + +}foreach _args; + +cse_basicBallistics_bulletDatabase = []; +cse_basicBallistics_bulletDatabaseLastFrame = []; +cse_basicBallistics_bulletDatabaseOccupiedIndices = []; +cse_basicBallistics_bulletDatabaseFreeIndices = []; + +if (hasInterface) then { + + cse_fnc_checkWindDir_WIND = { + private ["_windDir","_windSpeed"]; + + if (vehicle player == player && [player] call cse_fnc_canInteract) then { + if(windDir >= 340 && windDir <= 360 || windDir >= 0 && windDir <= 20) then {_windDir = "North";}; + if(windDir >= 20 && windDir <= 60) then {_windDir = "North East";}; + if(windDir >= 60 && windDir <= 110) then {_windDir = "East";}; + if(windDir >= 110 && windDir <= 160) then {_windDir = "South East";}; + if(windDir >= 160 && windDir <= 200) then {_windDir = "South";}; + if(windDir >= 200 && windDir <= 250) then {_windDir = "South West";}; + if(windDir >= 250 && windDir <= 290) then {_windDir = "West";}; + if(windDir >= 290 && windDir <= 340) then {_windDir = "North West";}; + hintSilent ("Wind Direction: "+ _windDir + "\nWind Strength: " + str floor(wind distance [0,0,0]) + "m/s"); + sleep 4; + hintSilent ""; + }; + }; + + //["check_wind_direction", (["check_wind_direction","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), cse_fnc_checkWindDir_WIND] call cse_fnc_addKeyBindingForAction_F; + //["check_wind_direction","action","Check Wind Direction","Displays a hint with the current wind direction and speed."] call cse_fnc_settingsDefineDetails_F; + + //["open_weather_meter", (["open_weather_meter","menu",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), {if (([player,'cse_weather_meter'] call cse_fnc_hasMagazine)) then { createDialog "cse_weather_meter"; }; }, 65423] call cse_fnc_addKeyBindingForMenu_F; + //["open_weather_meter","menu","Open the Weather Meter","When you have the weather meter in your inventory, pressing this key will open the menu, showing you the current weather information. "] call cse_fnc_settingsDefineDetails_F; + + waituntil{!isnil "cse_gui"}; + _entries = [ + ["Weather Meter", {([player,'cse_weather_meter'] call cse_fnc_hasMagazine)}, "cse\cse_sys_ballistics\basicBallistics\data\icon_weather_meter.paa", { closeDialog 0; createDialog "cse_weather_meter"; }, "Use Weather Meter"] + ]; + ["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/readme.txt b/TO_MERGE/cse/sys_ballistics/basicBallistics/readme.txt new file mode 100644 index 0000000000..6c46f48def --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/readme.txt @@ -0,0 +1,10 @@ +Legacy Module for cse_sys_windDeflection. +by Glowbal. Modifications by Ruthberg. + +This module has been integrated into cse_sys_ballistics as part of the CSE project restructure. +The module will stay available to allow for backwards compatibilty. All functionality will remain the same as in previous CSE versions. + +------------ +Adjustments made: +- Improved ballistics calculation based upon Ruthberg's advancedBallistics code. +- Adjusted paths to direct to cse\cse_sys_ballistics\basicBallistics instead of cse\cse_sys_windDeflection. diff --git a/TO_MERGE/cse/sys_ballistics/basicBallistics/stringtable.xml b/TO_MERGE/cse/sys_ballistics/basicBallistics/stringtable.xml new file mode 100644 index 0000000000..a834816ddb --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/basicBallistics/stringtable.xml @@ -0,0 +1,37 @@ + + + + + + Wind Information + Wind Information + Informacje o wietrze + InformaciĂ³n del viento + + + Direction: %1 + Direction: %1 + Kierunek: %1 + DirecciĂ³n: %1 + + + Speed: %1 m/s + Speed: %1 m/s + PrÄ™dkość: %1 + Velocidad: %1 m/s + + + Weather Information + Weather Information + Informacje o pogodzie + InformaciĂ³n MeteorolĂ³gica + + + Humidity: %1% + Humidity: %1% + Wilgotność: %1 + Humedad: %1% + + + + diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerIDs_Server_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerIDs_Server_CC.sqf new file mode 100644 index 0000000000..3b444910f0 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerIDs_Server_CC.sqf @@ -0,0 +1,52 @@ +/* + NAME: fnc_assignTrackersServer + USAGE: running serverside, assigning IDs to all newly found trackers + AUTHOR: Glowbal + ARGUMENTS: none + RETURN: void +*/ + +// SERVER SIDE ONLY + + +if !(isServer) exitwith{}; +private ["_storedIDs","_newID","_availableClasses"]; +_availableClasses = ["cse_m_tablet","cse_m_pda"]; + +waituntil {!isnil "CSE_CC_LOGIC_OBJECT_CC"}; +_storedIDs = []; +{ + _storedIDs set[count _storedIDs,[]]; +}foreach _availableClasses; +_newID = ""; +while {true} do { + { + private ["_unit","_IDCollection"]; + _unit = _x; + if (alive _unit) then { + _IDCollection = 0; + { + _foundIt = (_x in ((backpackItems _unit) + (uniformItems _unit)+ (vestItems _unit) + (assignedItems _unit))); + if (_foundIt) exitwith { + _newID = format["%1_%2",_x,count(_storedIDs select _IDCollection)+1]; + + _check = CSE_CC_LOGIC_OBJECT_CC getvariable _newID; + if (isnil "_check") then { + (_storedIDs select _IDCollection) set [count((_storedIDs select _IDCollection)),_newID]; + _trackerStatus = _unit getvariable ["cse_bft_info_cc",["Infantry"," ",true,false]]; + CSE_CC_LOGIC_OBJECT_CC setvariable [_newID,_trackerStatus,true]; + + if (_x in (assignedItems _unit)) then { + _unit unassignItem _x; + }; + [[_unit,_x,_newID], "cse_fnc_switchItem", owner _unit, false] spawn BIS_fnc_MP; + //waituntil {(!((_x in ((backpackItems _unit) + (uniformItems _unit)+ (vestItems _unit) + (assignedItems _unit)))) || (!alive _unit))}; + }; + }; + _IDCollection = _IDCollection + 1; + }foreach _availableClasses; + //sleep 0.001; + sleep 1; + }; + }foreach allUnits; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerInformation_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerInformation_CC.sqf new file mode 100644 index 0000000000..0cd4f473dd --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_assignTrackerInformation_CC.sqf @@ -0,0 +1,25 @@ +/* + fnc_assignTrackerInfo.sqf + Usage: Assigns tracker info for the BFT + Author: Glowbal + + Arguments: array [logic (OBJECT)] + Returns: void + + Affects: All localities + Executes: All Localities + +*/ + +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + + _type = _logic getvariable ["type","Infantry"]; + _callsign = _logic getvariable ["callSign",""]; + _objects = synchronizedObjects _logic; + { + _x setvariable ["cse_bft_info_cc",[_type,_callsign,true,false]]; + }foreach _objects; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbolOnPerson_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbolOnPerson_CC.sqf new file mode 100644 index 0000000000..ef8fa9e8b9 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbolOnPerson_CC.sqf @@ -0,0 +1,48 @@ +/* + NAME: fnc_displayBFTSymbolOnPerson.sqf + USAGE: grabs BFT item and information from unit, then returns information + AUTHOR: Glowbal + ARGUMENTS: PERSON / UNIT. + RETURN: 2d ARRAY. Contains information about every tracker on unit. +*/ + +private ["_person","_trackers","_tracker","_newMarker","_filterLevel","_return"]; +_person = _this select 0; +_return = []; +_trackers = [_person] call cse_fnc_getAllBFTItems_CC; +{ + _trackerInfo = [_person] call cse_fnc_getTrackerInformation_CC; + + if (_trackerInfo select 2) then { + _prefix = switch (([_x] call cse_fnc_getDeviceSide_CC)) do { + case WEST: {"b_"}; + case EAST: {"o_"}; + case independent: {"n_"}; + default {"n_"}; + }; + + _prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix; + _icon = switch (_trackerInfo select 0) do { + case "Infantry": {_prefix+"inf.paa"}; + case "Motorized": {_prefix+"motor_inf.paa"}; + case "Plane": {_prefix+"plane.paa"}; + case "Helicopter": {_prefix+"air.paa"}; + case "Armor": {_prefix+"armor.paa"}; + case "Naval": {_prefix+"naval.paa"}; + case "HQ": {_prefix+"hq.paa"}; + case "Medical": {_prefix+"med.paa"}; + case "Maintanance": {_prefix+"maint.paa"}; + case "Artillery": {_prefix+"art.paa"}; + case "Mortar": {_prefix+"mortar.paa"}; + case "Service": {_prefix+"service.paa"}; + case "Recon": {_prefix+"recon.paa"}; + case "Mechanized": {_prefix+"mech_inf.paa"}; + case "uav": {_prefix+"uav.paa"}; + case "Installation": {_prefix+"installation.paa"}; + default {_prefix+"unknown.paa"}; + }; + + _return pushback [_icon,getPos _person, (_trackerInfo select 1),CSE_SIDE_WEST_COLOR,_x,_person,([_x] call cse_fnc_getDeviceSide_CC)]; + }; +}foreach _trackers; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbols_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbols_CC.sqf new file mode 100644 index 0000000000..dbb77aed37 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFTSymbols_CC.sqf @@ -0,0 +1,118 @@ + +private ["_enableTracking","_toggleRoute","_toggleIntel","_return", "_iconType", "_callsign", "_person", "_trackerInfo"]; +_return = []; +if (!isDedicated) then { + { + _person = _x; + _trackerInfo = [_person] call cse_fnc_getTrackerInformation_CC; + if (_trackerInfo select 2) then { + _positionOf = getPosASL _person; + _trackers = [_person] call cse_fnc_getAllBFTItems_CC; + { + _sideOfDevice = ([_x] call cse_fnc_getDeviceSide_CC); + + _prefix = switch (_sideOfDevice) do { + case WEST: {"b_"}; + case EAST: {"o_"}; + case independent: {"n_"}; + default {"n_"}; + }; + + _prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix; + _icon = switch (_trackerInfo select 0) do { + case "Infantry": {_prefix+"inf.paa"}; + case "Motorized": {_prefix+"motor_inf.paa"}; + case "Plane": {_prefix+"plane.paa"}; + case "Helicopter": {_prefix+"air.paa"}; + case "Armor": {_prefix+"armor.paa"}; + case "Naval": {_prefix+"naval.paa"}; + case "HQ": {_prefix+"hq.paa"}; + case "Medical": {_prefix+"med.paa"}; + case "Maintanance": {_prefix+"maint.paa"}; + case "Artillery": {_prefix+"art.paa"}; + case "Mortar": {_prefix+"mortar.paa"}; + case "Service": {_prefix+"service.paa"}; + case "Recon": {_prefix+"recon.paa"}; + case "Mechanized": {_prefix+"mech_inf.paa"}; + case "uav": {_prefix+"uav.paa"}; + case "Installation": {_prefix+"installation.paa"}; + default {_prefix+"unknown.paa"}; + }; + _return pushback [_icon, _positionOf, (_trackerInfo select 1), CSE_SIDE_WEST_COLOR, _x, _person, _sideOfDevice]; + }foreach _trackers; + }; + }foreach allUnits; + + { + _info = _x getvariable "cse_bft_info_cc"; + if (!isnil "_info") then { + if (isEngineOn _x) then { + _prefix = switch (side _x) do { + case WEST: {"b_"}; + case EAST: {"o_"}; + case independent: {"n_"}; + default {"n_"}; + }; + _prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix; + _icon = switch (_info select 0) do { + case "Infantry": {_prefix+"inf.paa"}; + case "Motorized": {_prefix+"motor_inf.paa"}; + case "Plane": {_prefix+"plane.paa"}; + case "Helicopter": {_prefix+"air.paa"}; + case "Armor": {_prefix+"armor.paa"}; + case "Naval": {_prefix+"naval.paa"}; + case "HQ": {_prefix+"hq.paa"}; + case "Medical": {_prefix+"med.paa"}; + case "Maintanance": {_prefix+"maint.paa"}; + case "Artillery": {_prefix+"art.paa"}; + case "Mortar": {_prefix+"mortar.paa"}; + case "Service": {_prefix+"service.paa"}; + case "Recon": {_prefix+"recon.paa"}; + case "Mechanized": {_prefix+"mech_inf.paa"}; + case "uav": {_prefix+"uav.paa"}; + case "Installation": {_prefix+"installation.paa"}; + default {_prefix+"unknown.paa"}; + }; + + _return pushback [_icon,getPosASL _x, _info select 1,CSE_SIDE_WEST_COLOR,"vehicle",_x, side _x]; + }; + } else { + if !(_x in allUnitsUav) then { + if (local _x) then { + if (CSE_AUTO_ASSIGN_CALLSIGNS_CC == 0 || CSE_AUTO_ASSIGN_CALLSIGNS_CC == 1) then { + _iconType = switch (true) do { + case (_x isKindOf "Car"): {"Motorized"}; + case (_x isKindOf "Helicopter"): {"Helicopter"}; + case (_x isKindOf "Air"): {"Plane"}; + case (_x isKindOf "Armor"): {"Armor"}; + case (_x isKindOf "Boat"): {"Naval"}; + case (_x isKindOf "Artillery"): {"Artillery"}; + default {"Unknown"}; + }; + _callsign = [_x] call cse_fnc_findTargetName_gui; + _x setvariable ["cse_bft_info_cc", [_iconType, _callsign, false, true], true]; + }; + }; + }; + }; + + }foreach vehicles; + + if (CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT) then { + { + _info = _x getvariable "cse_bft_info_cc"; + if (isnil "_info") then { + if (isEngineOn _x) then { + _prefix = switch (side _x) do { + case WEST: {"b_"}; + case EAST: {"o_"}; + case independent: {"n_"}; + default {"n_"}; + }; + _return pushback [ "\A3\ui_f\data\map\markers\nato\" + _prefix + "uav.paa",getPosASL _x, [_x] call cse_fnc_findTargetName_gui,CSE_SIDE_WEST_COLOR,"uav",_x, side _x]; + }; + }; + }foreach allUnitsUav; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFT_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFT_CC.sqf new file mode 100644 index 0000000000..c7fd6c9979 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_displayBFT_CC.sqf @@ -0,0 +1,54 @@ +/** + * fn_displayBFT_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName", "_display"]; +_deviceName = _this select 0; +if (isnil "CSE_CURRENT_SELECTED_FILTER_CC_APP_CC") then { + CSE_CURRENT_SELECTED_FILTER_CC_APP_CC = -1; + CSE_TOGGLE_ROUTE_LAYER_CC = true; + CSE_TOGGLE_INTEL_LAYER_CC = true; + CSE_TOGGLE_CALLSIGNS_CC = true; + CSE_SELECTED_ICON_CC = ""; +}; + +if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then { + CSE_INTEL_MARKER_COLLECTION_CC = []; +}; +if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then { + CSE_ROUTE_MARKER_COLLECTION_CC = []; +}; +if (isnil "CSE_TRACKER_ICONS") then { + CSE_TRACKER_ICONS = []; +}; + +/* + { + if (call (_X select 0)) then { + { + [_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC; + }foreach (_x select 1); + }; + }foreach CSE_MARKER_COLLECTIONS_CC; +*/ + + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +(_display displayCtrl 10) ctrlAddEventHandler ["draw"," + {[_x,(_this select 0)] call cse_fnc_drawBFTIcons_CC;}foreach CSE_TRACKER_ICONS; + + if (CSE_TOGGLE_INTEL_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_INTEL_MARKER_COLLECTION_CC;}; + if (CSE_TOGGLE_ROUTE_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_ROUTE_MARKER_COLLECTION_CC;}; + "]; + +(_display displayCtrl 10) ctrlAddEventHandler ["MouseButtonUp",'if ((_this select 1) == 0) then {[[_this select 2, _this select 3]] call cse_fnc_clickedOnMap_CC;};']; +(_display displayCtrl 10) ctrlAddEventHandler ["MouseMoving",'CSE_MOUSE_RELATIVE_POSITION = [_this select 1, _this select 2];']; +(_display displayCtrl 10) ctrlMapAnimAdd [0, 0.05, player]; +ctrlMapAnimCommit (_display displayCtrl 10); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTIcons_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTIcons_CC.sqf new file mode 100644 index 0000000000..8dda24a02d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTIcons_CC.sqf @@ -0,0 +1,30 @@ +/** + * fn_drawBFTIcons_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_trackerInfo", "_icon", "_pos", "_text", "_unit", "_side", "_color", "_map"]; +_trackerInfo = _this select 0; +_map = _this select 1; + +_icon = _trackerInfo select 0; +_pos = _trackerInfo select 1; +_text = _trackerInfo select 2; +_unit = _trackerInfo select 5; +_side = _trackerInfo select 6; + +if (([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC) == _side || ([] call cse_fnc_getCurrentDeviceName_CC) == "") then { + if (!CSE_TOGGLE_CALLSIGNS_CC) then { + _text = ""; + }; + _color = _trackerInfo select 3; + if (_unit == player) then { + _color = [0.78,0.8,0.1,1]; + }; + _map drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right']; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTMarker_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTMarker_CC.sqf new file mode 100644 index 0000000000..56bdfbe297 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_drawBFTMarker_CC.sqf @@ -0,0 +1,26 @@ +/** + * fn_drawBFTMarkers_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +_marker = _this select 0; +_map = _this select 1; +if !(_marker isEqualTo []) then { + _pos = _marker select 0; + _args = _marker select 1; + _icon = _args select 0; + _text = _args select 1; + _color = _args select 2; + + _timeOfPlacement = _marker select 2; + _side = _marker select 3; + if (([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC) == _side) then { + _map drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right']; + }; +}; diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItemsOfType_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItemsOfType_CC.sqf new file mode 100644 index 0000000000..ba07467985 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItemsOfType_CC.sqf @@ -0,0 +1,17 @@ + +private["_unit","_return","_toCheck"]; +_unit = _this select 0; +_item = _this select 1; +_return = []; + + +_itemArray = toArray _item; +{ + _compArray = toArray _x; + if (_compArray select 0 == _itemArray select 0) then { + if ([_item,_x] call BIS_fnc_inString) then { + _return pushback _x; + }; + }; +}foreach ([_unit] call cse_fnc_getAllBFTItems_CC); +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItems_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItems_CC.sqf new file mode 100644 index 0000000000..fdba4efc68 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getAllBFTItems_CC.sqf @@ -0,0 +1,20 @@ + +private["_unit","_return","_toCheck","_item"]; +_unit = _this select 0; +_return = []; +_toCheck = []; +if (!isNull _unit) then { + if (_unit iskindof "CaManBase") then { + _toCheck = items _unit; + }; + { + if (_x != "") then { + if (((toArray _x) select 0) == ((toArray 'c') select 0)) then { + if ([_x] call cse_fnc_isBFTItem_CC) then { + _return pushback _x; + }; + }; + }; + }foreach _toCheck; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getDeviceSide_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getDeviceSide_CC.sqf new file mode 100644 index 0000000000..c7579ad664 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getDeviceSide_CC.sqf @@ -0,0 +1,13 @@ + +private ["_device","_side","_deviceName"]; +_deviceName = _this select 0; +_side = playerSide; +if (isnil "CSE_REGISTERED_DEVICES_CC") then { + CSE_REGISTERED_DEVICES_CC = []; +}; +{ + if ((_x select 0) == _deviceName) exitwith { + _side = _x select 3; + }; +}foreach CSE_REGISTERED_DEVICES_CC; +_side \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getTrackerInformation_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getTrackerInformation_CC.sqf new file mode 100644 index 0000000000..e3a02ce5f0 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_getTrackerInformation_CC.sqf @@ -0,0 +1,11 @@ +/** + * fn_getTrackerInformation_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +((_this select 0) getvariable ["cse_bft_info_cc",["Infantry","",true,false]]) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasItem_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasItem_CC.sqf new file mode 100644 index 0000000000..7598a06b8e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasItem_CC.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasItem_CC.sqf + * @Descr: Check if unit has an item of type. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, item STRING (Classname of CfgWeapons item)] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_unit","_item"]; +_unit = _this select 0; +_item = _this select 1; + +if !(_unit isKindOf "CAManBase") exitwith {false}; +(_item in ((items _unit) + (assignedItems _unit))); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasTrackerItem_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasTrackerItem_CC.sqf new file mode 100644 index 0000000000..3ef814842e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hasTrackerItem_CC.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasTrackerItem_CC.sqf + * @Descr: Check if unit has a BFT enabled item + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private["_unit"]; +_unit = _this select 0; +if (!isNull _unit && {(_unit iskindof "CaManBase")}) exitwith { + (({([_x] call cse_fnc_isBFTItem_CC)}count ((items _unit) + (assignedItems _unit))) > 0); +}; +false \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hideAllBFTSymbols_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hideAllBFTSymbols_CC.sqf new file mode 100644 index 0000000000..34a871459d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_hideAllBFTSymbols_CC.sqf @@ -0,0 +1,6 @@ +if (isnil "CSE_EXISTING_BFTRACKERS_CC") then { + CSE_EXISTING_BFTRACKERS_CC = []; +}; +{ + _x setMarkerAlphaLocal 0.0; +}foreach CSE_EXISTING_BFTRACKERS_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_isBFTItem_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_isBFTItem_CC.sqf new file mode 100644 index 0000000000..6761d70dbd --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_isBFTItem_CC.sqf @@ -0,0 +1,11 @@ +/** + * fn_isBFTItem_CC.sqf + * @Descr: Check if item has blue force tracking enabled. + * @Author: Glowbal + * + * @Arguments: [item STRING (Classname of item)] + * @Return: BOOL + * @PublicAPI: true + */ + +(getNumber(configFile >> "CfgWeapons" >> (_this select 0) >> "cse_blueForceTracker") == 1); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeIntelMarker_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeIntelMarker_CC.sqf new file mode 100644 index 0000000000..1014d499fb --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeIntelMarker_CC.sqf @@ -0,0 +1,45 @@ +/* +fnc_removeIntelMarker.sqf +Usage: Removes intel marker nearest to given position +Author: Glowbal + +Arguments: array [position (Position 3D)] + 0: Position. Format: 3D [ x, y, z] +Returns: Void + +Affects: Global +Executes: Local + +Example: + [[50,20,0] call cse_fnc_removeIntelMarker_CC; +*/ + +private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"]; +if (count _this < 2) exitwith { + _mpSync = [_this, count _this, "", [""]] call BIS_fnc_param; + if (isnil "_mpSync") then { + _mpSync = ""; + }; + if (_mpSync != "MP_SYNC") then { + _args = _this + ["MP_SYNC"]; + [_args, "cse_fnc_removeIntelMarker_CC", true, true] spawn BIS_fnc_MP; + }; +}; +if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then { + waituntil{!isnil "CSE_INTEL_MARKER_COLLECTION_CC"}; +}; +_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param; +_count = 0; +_nearest = 25; +_lastestCount = -1; +{ + _pos = (_x select 0); + if ((_pos distance _position) < _nearest) then { + _nearest = _pos distance _position; + _lastestCount = _count; + }; + _count = _count + 1; +}count CSE_INTEL_MARKER_COLLECTION_CC; +if (_lastestCount < 0) exitwith {}; + CSE_INTEL_MARKER_COLLECTION_CC set [ _lastestCount, "REMOVE"]; + CSE_INTEL_MARKER_COLLECTION_CC = CSE_INTEL_MARKER_COLLECTION_CC - ["REMOVE"]; diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeRouteMarker_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeRouteMarker_CC.sqf new file mode 100644 index 0000000000..8affaa8cf1 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_removeRouteMarker_CC.sqf @@ -0,0 +1,48 @@ +/* +fnc_removeRouteMarker.sqf +Usage: Removes route marker nearest to given position +Author: Glowbal + +Arguments: array [position (Position 3D)] + 0: Position. Format: 3D [ x, y, z] +Returns: Void + +Affects: Global +Executes: Local + +Example: + [[50,20,0] call cse_fnc_removeRouteMarker_CC; +*/ + +private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"]; +if (count _this < 2) exitwith { + _mpSync = [_this, 1, "", [""]] call BIS_fnc_param; + + if (isnil "_mpSync") then { + _mpSync = ""; + }; + if (_mpSync != "MP_SYNC") then { + _args = _this + ["MP_SYNC"]; + [_args, "cse_fnc_removeRouteMarker_CC", true, true] spawn BIS_fnc_MP; + }; +}; +if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then { + // This is a fix for waiting MP JIP synchronization. + waituntil{!isnil "CSE_ROUTE_MARKER_COLLECTION_CC"}; +}; + +_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param; +_count = 0; +_nearest = 25; +_lastestCount = -1; +{ + _pos = (_x select 0); + if ((_pos distance _position) < _nearest) then { + _nearest = _pos distance _position; + _lastestCount = _count; + }; + _count = _count + 1; +}count CSE_ROUTE_MARKER_COLLECTION_CC; +if (_lastestCount < 0) exitwith {}; +CSE_ROUTE_MARKER_COLLECTION_CC set [ _lastestCount, "REMOVE"]; +CSE_ROUTE_MARKER_COLLECTION_CC = CSE_ROUTE_MARKER_COLLECTION_CC - ["REMOVE"]; diff --git a/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_setTrackerInformation_CC.sqf b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_setTrackerInformation_CC.sqf new file mode 100644 index 0000000000..321deef0c9 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/BlueForceTracking/functions/fn_setTrackerInformation_CC.sqf @@ -0,0 +1,7 @@ +private ["_id","_info"]; +_id = _this select 0; +_info = _this select 1; + +CSE_CC_LOGIC_OBJECT_CC setvariable [_id,_info,true]; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/CfgFactionClasses.h b/TO_MERGE/cse/sys_cc/CfgFactionClasses.h new file mode 100644 index 0000000000..b0fd80e0f9 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/CfgFactionClasses.h @@ -0,0 +1,7 @@ +class CfgFactionClasses +{ + class NO_CATEGORY; + class cseCCModule: NO_CATEGORY { + displayName = "CSE Command & Control"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/CfgFunctions.h b/TO_MERGE/cse/sys_cc/CfgFunctions.h new file mode 100644 index 0000000000..4ec4bd24d7 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/CfgFunctions.h @@ -0,0 +1,126 @@ +class CfgFunctions { + class CSE { + class CC { + file = "cse\cse_sys_cc\Modules\functions"; + class assignTrackerInfo_CC { recompile = 1; }; + class modulePlaceIntelMarker_CC { recompile = 1; }; + }; + + class Tablets + { + file = "cse\cse_sys_cc\tablets\functions"; + class registerDevice_CC { recompile = 1; }; + class registerApp_CC{ recompile = 1; }; + class getDeviceSettings_CC { recompile = 1; }; + class openDevice_CC { recompile = 1; }; + class openDeviceSmall_CC { recompile = 1; }; + class openLastScreen_CC { recompile = 1; }; + class getLastScreen_CC { recompile = 1; }; + class openScreen_CC { recompile = 1; }; + class getCurrentApplication_CC { recompile = 1; }; + class openIntelMarkersMenu_CC { recompile = 1; }; + class openRouteMarkersMenu_CC { recompile = 1; }; + class openIconSelectMenu_CC { recompile = 1; }; + class isSideBarOpen_CC { recompile = 1; }; + class getCurrentDeviceName_CC { recompile = 1; }; + class clickedOnMap_CC { recompile = 1; }; + class clearDeviceScreen_CC { recompile = 1; }; + class isLoggedIn_CC { recompile = 1; }; + class setLoggedIn_CC { recompile = 1; }; + class placeMarker_CC { recompile = 1; }; + class placeMarkerGlobal_CC { recompile = 1; }; + class manageLayers_CC { recompile = 1; }; + }; + + class TabletResources + { + file = "cse\cse_sys_cc\TabletResources\functions"; + class setBackground_CC { recompile = 1; }; + class setMap_CC { recompile = 1; }; + class setNavBar_CC { recompile = 1; }; + class setPiP_CC { recompile = 1; }; + class setTitle_CC { recompile = 1; }; + class setSideBar_CC { recompile = 1; }; + class setOptionField_CC { recompile = 1; }; + class getFirstAvailableOptionField_CC { recompile = 1; }; + class removeOptionField_CC { recompile = 1; }; + class getOptionFieldOnPos_CC { recompile = 1; }; + class sideBarHasMap_CC { recompile = 1; }; + class setPopUpMenu_CC { recompile = 1; }; + class setPopUpOptions_CC { recompile = 1; }; + class popUpAccept_CC { recompile = 1; }; + class isPopUpOpen_CC { recompile = 1; }; + class getPopUpRatio_CC { recompile = 1; }; + class setProgramIcons_CC { recompile = 1; }; + class getSideBarOptionFields_CC { recompile = 1; }; + class isMapOpen_CC { recompile = 1; }; + class isPiPOpen_CC { recompile = 1; }; + class getSideBarRatio_CC { recompile = 1; }; + class getNavBarRatio_CC { recompile = 1; }; + class removeSelectMenu_CC { recompile = 1; }; + class isSelectMenuOpen_CC { recompile = 1; }; + class setBottomBar_CC { recompile = 1; }; + class isOpenBottomBar_CC { recompile = 1; }; + class showLoadingScreen_CC { recompile = 1; }; + class editIntelMarker_CC { recompile = 1; }; + }; + + class tabletScreens + { + file = "cse\cse_sys_cc\tabletScreens\functions"; + class openScreen_cc_app_CC { recompile = 1; }; + class openScreen_home_CC { recompile = 1; }; + class openScreen_login_CC { recompile = 1; }; + class openScreen_notepad_CC { recompile = 1; }; + class openScreen_settings_CC { recompile = 1; }; + class openScreen_startUp_CC { recompile = 1; }; + class openScreen_liveFeed_app_CC { recompile = 1; }; + }; + + class BlueForceTracking + { + file = "cse\cse_sys_cc\BlueForceTracking\functions"; + class displayBFT_CC { recompile = 1; }; + class displayBFTSymbols_CC { recompile = 1; }; + class displayBFTSymbolOnPerson_CC { recompile = 1; }; + class getAllBFTItems_CC { recompile = 1; }; + class hasTrackerItem_CC { recompile = 1; }; + class hasItem_CC { recompile = 1; }; + class getAllBFTItemsOfType_CC { recompile = 1; }; + class getDeviceSide_CC { recompile = 1; }; + class isBFTItem_CC { recompile = 1; }; + class hideAllBFTSymbols_CC { recompile = 1; }; + class assignTrackerIDs_Server_CC { recompile = 1; }; + class getTrackerInformation_CC { recompile = 1; }; + class setTrackerInformation_CC { recompile = 1; }; + class removeIntelMarker_CC { recompile = 1; }; + class removeRouteMarker_CC { recompile = 1; }; + class drawBFTIcons_CC { recompile = 1; }; + class drawBFTMarker_CC { recompile = 1; }; + }; + + class LiveFeed { + file = "cse\cse_sys_cc\LiveFeed\functions"; + class openScreen_LiveFeed_CC { recompile = 1; }; + class viewLiveFeed_CC { recompile = 1; }; + class setLiveFeedTargetObj_CC { recompile = 1; }; + class canViewFeed_CC { recompile = 1; }; + class getAllViewableFeeds_CC { recompile = 1; }; + class takeControlUAV_CC { recompile = 1; }; + }; + + class VehicleDisplaysBFT { + file = "cse\cse_sys_cc\vehicles\functions"; + class openFlight_Display_CC; + class hasFlightDisplay_CC; + class drawBFTMarker_Vehicles_CC; + class drawBFTIcons_Vehicles_CC; + class canUseOnBoard_BFT_Device_CC; + }; + + class FutureSoldier { + file = "cse\cse_sys_cc\FutureSoldier\functions"; + class startFutureSoldierDisplay_CC { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/CfgMagazines.h b/TO_MERGE/cse/sys_cc/CfgMagazines.h new file mode 100644 index 0000000000..73260427c5 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/CfgMagazines.h @@ -0,0 +1,59 @@ +class CfgMagazines { + class Default; + class CA_magazine: Default{}; + class cse_m_tablet: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Military Tablet (NATO)"; + descriptionUse = "Military Tablet (NATO)"; + picture = "\cse\cse_sys_cc\data\m_tablet.paa"; + descriptionShort = "Military Tablet"; + mass = 5; + }; + class cse_m_pda: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + descriptionUse = "A PDA, for use in the field. NATO Software compatible."; + descriptionShort = "A PDA for use in the field (NATO)"; + displayName = "PDA (NATO)"; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + mass = 2; + }; + class cse_m_tablet_uk: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + descriptionUse = "UK Tablet. NATO Software compatible."; + descriptionShort = "A Tablet for use in the field (UK)"; + displayName = "Military Tablet (UK)"; + picture = "\cse\cse_sys_cc\data\uk_tablet.paa"; + mass = 5; + }; + class cse_m_tablet_o: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + descriptionUse = "OPFOR Tablet. OPFOR Software compatible."; + descriptionShort = "A Tablet for use in the field (OPFOR)"; + displayName = "Military Tablet (OPFOR)"; + picture = "\cse\cse_sys_cc\data\m_tablet.paa"; + mass = 5; + }; + class cse_m_pda_o: CA_magazine { + scope = 2; + value = 1; + count = 1; + type = 16; + descriptionUse = "OPFOR PDA. OPFOR Software compatible."; + descriptionShort = "A PDA for use in the field (OPFOR)"; + displayName = "Military PDA (OPFOR)"; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + mass = 2; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/CfgVehicles.h b/TO_MERGE/cse/sys_cc/CfgVehicles.h new file mode 100644 index 0000000000..733b58ef02 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/CfgVehicles.h @@ -0,0 +1,370 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic + { + class ArgumentsBaseUnits + { + }; + }; + class cse_sys_cc: Module_F + { + scope = 2; + displayName = "Command and Control [CSE]"; + icon = "\cse\cse_main\data\cse_cc_module.paa"; + category = "cseCCModule"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class allowFeeds { + displayName = "Enable Live Feeds"; + description = "Enable Live Feeds & UAV control"; + typeName = "BOOL"; + defaultValue = true; + }; + class showUAV { + displayName = "UAVs on BFT"; + description = "Automatically show UAVs on the BFT Map"; + typeName = "BOOL"; + defaultValue = true; + }; + class uavRestriction { + displayName = "Restrict UAV Feeds"; + description = "Should UAV Feeds be restricted"; + typeName = "BOOL"; + defaultValue = false; + }; + class allowVehicleDisplays { + displayName = "Vehicle Display"; + description = "Allow Vehicle Displays"; + typeName = "BOOL"; + defaultValue = false; + }; + class autoAssignCallSigns { + displayName = "Auto Assign Callsigns"; + description = "Automatically assign callsigns for units"; + typeName = "NUMBER"; + defaultValue = -1; + class values { + class disabled {name="Disabled"; value=-1; default=1; }; + class all {name="All"; value = 0; }; + class vehicles {name="Vehicles only"; value = 1; }; + class groups {name="Groups Only"; value = 2; }; + }; + }; + class allowDisplayOnMainMap { + displayName = "Allow Main Map"; + description = "Allow CC to be used on the main map"; + typeName = "BOOL"; + defaultValue = false; + }; + }; + }; + + class cse_assignTrackerInfo_CC: Module_F + { + scope = 2; + displayName = "Assign BFT Information [CSE]"; + icon = "\cse\cse_main\data\cse_cc_module.paa"; + category = "cseCCModule"; + function = "cse_fnc_assignTrackerInfo_CC"; + functionPriority = 1; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Combat Space Enhancement"; + class Arguments + { + class EnableList { + displayName = "List"; + description = "List of unit names that will be used for assigning the BFT information, separated by commas."; + defaultValue = ""; + }; + + class type + { + displayName = "Type of Icon"; + description = "What icon is being displayed on BFT"; + typeName = "STRING"; + class values { + class Infantry {name="Infantry"; value="Infantry"; default=1; }; + class Motorized {name="Motorized"; value="Motorized";}; + class Plane {name="Plane"; value="Plane";}; + class Helicopter {name="Helicopter"; value="Helicopter";}; + class Armor {name="Armor"; value="Armor";}; + class Naval {name="Naval"; value="Naval";}; + class HQ {name="HQ"; value="HQ";}; + class Medical {name="Medical"; value="Medical";}; + class Maintanance {name="Maintanance"; value="Maintanance";}; + class Artillery {name="Artillery"; value="Artillery";}; + class Mortar {name="Mortar"; value="Mortar";}; + class Service {name="Service"; value="Service";}; + class Recon {name="Recon"; value="Recon";}; + class Mechanized {name="Mechanized"; value="Mechanized";}; + class uav {name="uav"; value="uav";}; + }; + }; + class callSign + { + displayName = "Call Sign"; + description = "The Call Sign being displayed on BFT"; + typeName = "STRING"; + defaultValue = ""; + }; + }; + class ModuleDescription { + description = "Sync this module to objects to assign tracker information.
Please be aware that synchronizing this to JIP players does not work currently.
Visit our wiki (wiki.csemod.com) for more information."; + sync[] = {"Car","Air", "Amoured"}; + }; + }; + class cse_placeIntelMarker_CC: Module_F + { + scope = 2; + displayName = "Place SALUTE Report[CSE]"; + icon = "\cse\cse_main\data\cse_cc_module.paa"; + category = "cseCCModule"; + function = "cse_fnc_modulePlaceIntelMarker_CC"; + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments + { + class Type + { + displayName = "Type of Icon"; + description = "What icon is being displayed on BFT"; + typeName = "STRING"; + class values { + class Infantry {name="Infantry"; value="Infantry"; default=1; }; + class Motorized {name="Motorized"; value="Motorized";}; + class Plane {name="Plane"; value="Plane";}; + class Helicopter {name="Helicopter"; value="Helicopter";}; + class Armor {name="Armor"; value="Armor";}; + class Naval {name="Naval"; value="Naval";}; + class HQ {name="HQ"; value="HQ";}; + class Medical {name="Medical"; value="Medical";}; + class Maintanance {name="Maintanance"; value="Maintanance";}; + class Artillery {name="Artillery"; value="Artillery";}; + class Mortar {name="Mortar"; value="Mortar";}; + class Service {name="Service"; value="Service";}; + class Recon {name="Recon"; value="Recon";}; + class Mechanized {name="Mechanized"; value="Mechanized";}; + class uav {name="uav"; value="uav";}; + }; + }; + class Side + { + displayName = "Side"; + description = "Side of the marker icon (Visual)"; + typeName = "STRING"; + class values { + class BLUFOR {name="BLUFOR"; value="BLUFOR"; default=1;}; + class OPFOR {name="OPFOR"; value="OPFOR";}; + class GREENFOR {name="GREENFOR"; value="GREENFOR";}; + class UNKNOWN {name="UNKNOWN"; value="UNKNOWN";}; + }; + }; + class Direction + { + displayName = "Direction"; + description = "Which direction is the moment"; + typeName = "STRING"; + class values { + class Static {name="Static"; value="Static"; default=1;}; + class North {name="North"; value="North";}; + class NorthEast {name="North East"; value="North East";}; + class East {name="East"; value="East";}; + class SouthEast {name="South East"; value="South East";}; + class South {name="South"; value="South";}; + class SouthWest {name="South West"; value="South West";}; + class West {name="West"; value="West";}; + class NorthWest {name="North West"; value="North West";}; + }; + }; + class Size + { + displayName = "Size"; + description = "What is the amount of Units spotted"; + typeName = "STRING"; + class values { + class Building {name="Building"; value="Building"; default=1;}; + class Fortication {name="Fortication"; value="Fortication";}; + class Pax {name="Pax"; value="Pax";}; + class FireTeam {name="Fire Team"; value="Fire Team";}; + class Section {name="Section"; value="Section";}; + class Platoon {name="Platoon"; value="Platoon";}; + class Company {name="Company"; value="Company";}; + class Battalion {name="Battalion"; value="Battalion";}; + class Regiment {name="Regiment"; value="Regiment";}; + class Brigade {name="Brigade"; value="Brigade";}; + }; + }; + class Number + { + displayName = "Number"; + description = "What is the amount of Units spotted"; + typeName = "STRING"; + class values { + class One {name="1x"; value="1x"; default=1;}; + class Two {name="2x"; value="2x";}; + class Three {name="3x"; value="3x";}; + class Four {name="4x"; value="4x";}; + class Five {name="5x"; value="5x";}; + class Six {name="6x"; value="6x";}; + class Seven {name="7x"; value="7x";}; + }; + }; + class Note + { + displayName = "Note"; + description = "Note for Salute Report"; + typeName = "STRING"; + defaultValue = ""; + }; + class PlacementSide + { + displayName = "Placement Side"; + description = "Side for which the marker will be placed."; + typeName = "STRING"; + class values { + class BLUFOR {name="BLUFOR"; value="west"; default=1;}; + class OPFOR {name="OPFOR"; value="east";}; + class GREENFOR {name="Independent"; value="independent";}; + }; + }; + + }; + }; + + + class Item_Base_F; + class cse_m_tabletItem: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Military Tablet (NATO)"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_m_tablet + { + name = "cse_m_tablet"; + count = 1; + }; + }; + }; + class cse_m_pdaItem: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Military PDA (NATO)"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_m_pda + { + name = "cse_m_pda"; + count = 1; + }; + }; + }; + class cse_m_tablet_uk_Item: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Military Tablet (UK)"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_m_tablet_uk + { + name = "cse_m_tablet_uk"; + count = 1; + }; + }; + }; + class cse_m_tablet_o_Item: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Military Tablet (OPFOR)"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_m_tablet_o + { + name = "cse_m_tablet_o"; + count = 1; + }; + }; + }; + class cse_m_pda_o_Item: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Military PDA (OPFOR)"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_m_pda_o + { + name = "cse_m_pda_o"; + count = 1; + }; + }; + }; + + class NATO_Box_Base; + class cse_ccItems_W : NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "CC Devices [NATO] (CSE)"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + author = "Combat Space Enhancement"; + class TransportItems { + class cse_m_tablet { + name = "cse_m_tablet"; + count = 5; + }; + class cse_m_pda { + name = "cse_m_pda"; + count = 5; + }; + }; + }; + class cse_ccItems_O: cse_ccItems_W { + displayName = "CC Devices [OPFOR] (CSE)"; + class TransportItems { + class cse_m_tablet_o { + name = "cse_m_tablet_o"; + count = 5; + }; + class cse_m_pda_o { + name = "cse_m_pda_o"; + count = 5; + }; + }; + }; + class cse_ccItems_G: cse_ccItems_W { + displayName = "CC Devices [IND] (CSE)"; + class TransportItems { + class cse_m_tablet_g { + name = "cse_m_tablet_g"; + count = 5; + }; + class cse_m_pda_g { + name = "cse_m_pda_g"; + count = 5; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_cc/CfgWeapons.h b/TO_MERGE/cse/sys_cc/CfgWeapons.h new file mode 100644 index 0000000000..ba44c89ef0 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/CfgWeapons.h @@ -0,0 +1,166 @@ +class CfgWeapons { + + class ItemCore; + class InventoryItem_Base_F; + class cse_m_tablet: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = $STR_ITEM_CSE_M_TABLET_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_tablet.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + descriptionShort = $STR_ITEM_CSE_M_TABLET_DESC; + descriptionUse = $STR_ITEM_CSE_M_TABLET_DESC_USE; + cse_blueForceTracker = 1; // enable Blue Force Tracking for item + class ItemInfo: InventoryItem_Base_F + { + mass=6; + type=201; + + }; + }; + class cse_m_pda: cse_m_tablet + { + descriptionUse = $STR_ITEM_CSE_M_PDA_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_PDA_DESC; + displayName = $STR_ITEM_CSE_M_PDA_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + class cse_m_tablet_uk: cse_m_tablet + { + descriptionUse = $STR_ITEM_CSE_M_TABLET_UK_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_TABLET_UK_DESC; + displayName = $STR_ITEM_CSE_M_TABLET_UK_DISPLAY; + picture = "\cse\cse_sys_cc\data\uk_tablet.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=6; + type=201; + + }; + }; + class cse_m_tablet_o: cse_m_tablet + { + descriptionUse = $STR_ITEM_CSE_M_TABLET_O_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_TABLET_O_DESC; + displayName = $STR_ITEM_CSE_M_TABLET_O_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_tablet.paa"; + }; + class cse_m_pda_o: cse_m_pda + { + descriptionUse = $STR_ITEM_CSE_M_PDA_O_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_PDA_O_DESC; + displayName = $STR_ITEM_CSE_M_PDA_O_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + + class cse_m_tablet_g: cse_m_tablet + { + descriptionUse = $STR_ITEM_CSE_M_TABLET_G_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_TABLET_G_DESC; + displayName = $STR_ITEM_CSE_M_TABLET_O_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_tablet.paa"; + }; + class cse_m_pda_g: cse_m_pda + { + descriptionUse = $STR_ITEM_CSE_M_PDA_G_DESC_USE; + descriptionShort = $STR_ITEM_CSE_M_PDA_G_DESC; + displayName = $STR_ITEM_CSE_M_PDA_G_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + + class cse_itemHelmetCamera_W: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_DESC_SHORT; + descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_DESC; + displayName = $STR_ITEM_CSE_HELMET_CAMERA_DISPLAY; + picture = "\cse\cse_sys_cc\data\helmet_camera.paa"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + simulation = "Weapon"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + class cse_itemHelmetCamera_O: cse_itemHelmetCamera_W { + descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_O_DESC_SHORT; + descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_O_DESC; + displayName = $STR_ITEM_CSE_HELMET_CAMERA_O_DISPLAY; + picture = "\cse\cse_sys_cc\data\helmet_camera.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + class cse_itemHelmetCamera_G: cse_itemHelmetCamera_W { + descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_G_DESC_SHORT; + descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_G_DESC; + displayName = $STR_ITEM_CSE_HELMET_CAMERA_G_DISPLAY; + picture = "\cse\cse_sys_cc\data\helmet_camera.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + + class cse_trackerItem_w: cse_m_tablet { + displayName = $STR_ITEM_CSE_TRACKERITEM_W_DISPLAY; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + descriptionShort = $STR_ITEM_CSE_TRACKERITEM_W_DESC; + descriptionUse = $STR_ITEM_CSE_TRACKERITEM_W_DESC_SHORT; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + + }; + }; + class cse_trackerItem_o: cse_trackerItem_w { + displayName = $STR_ITEM_CSE_TRACKERITEM_O_DISPLAY; + descriptionShort = $STR_ITEM_CSE_TRACKERITEM_O_DESC; + descriptionUse = $STR_ITEM_CSE_TRACKERITEM_O_DESC_SHORT; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; + class cse_trackerItem_g: cse_trackerItem_w { + displayName = $STR_ITEM_CSE_TRACKERITEM_G_DISPLAY; + descriptionShort = $STR_ITEM_CSE_TRACKERITEM_G_DESC; + descriptionUse = $STR_ITEM_CSE_TRACKERITEM_G_DESC_SHORT; + picture = "\cse\cse_sys_cc\data\m_pda.paa"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_cc/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..a01b2f2245 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/Combat_Space_Enhancement.h @@ -0,0 +1,30 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_cc { + init = "call compile preprocessFile 'cse\cse_sys_cc\init_sys_cc.sqf';"; + name = "Command and Control"; + class Configurations { + class Command_and_Control { + type = MENU_KEYBINDING; + title = $STR_OPEN_CC_DEVICE_CONFIGURATION_TITLE; + description = $STR_OPEN_CC_DEVICE_CONFIGURATION_DESC; + value[] = {35,0,1,0}; + onPressed = "switch (true) do {case ([player,'cse_m_tablet'] call cse_fnc_hasItem_CC): {['cse_m_tablet'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_tablet_uk'] call cse_fnc_hasItem_CC): {['cse_m_tablet_uk'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_tablet_o'] call cse_fnc_hasItem_CC): {['cse_m_tablet_o'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_pda'] call cse_fnc_hasItem_CC): {['cse_m_pda'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_pda_o'] call cse_fnc_hasItem_CC): {['cse_m_pda_o'] call cse_fnc_openDevice_CC;};default {};};"; + idd = 590823; + }; + class OpenOnBoard_BFT_Device { + type = MENU_KEYBINDING; + title = $STR_OPEN_CC_ONBOARD_CONFIGURATION_TITLE; + description = $STR_OPEN_CC_ONBOARD_CONFIGURATION_DESC; + value[] = {0,0,0,0}; + onPressed = "[vehicle player] call cse_fnc_openFlight_Display_CC;"; + idd = 590823; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/FutureSoldier/functions/fn_startFutureSoldierDisplay_CC.sqf b/TO_MERGE/cse/sys_cc/FutureSoldier/functions/fn_startFutureSoldierDisplay_CC.sqf new file mode 100644 index 0000000000..949b69bf6d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/FutureSoldier/functions/fn_startFutureSoldierDisplay_CC.sqf @@ -0,0 +1,32 @@ + +_code = { + if (isnil "CSE_INTEL_MARKER_COLLECTION_CC" || !(([player] call cse_fnc_hasTrackerItem_CC))) exitwith {}; + + _playerPos = (getPos player); + { + + _pos = _x select 0; + _args = _x select 1; + _icon = _args select 0; + _text = _args select 1; + _color = _args select 2; + _side = _x select 3; + if (playerSide == _side && {_playerPos distance _pos < 200}) then { + drawIcon3D [_icon,_color, _pos, 1, 1, 0, _text, 0, 0.03, 'PuristaMedium']; + }; + + false; + }count CSE_INTEL_MARKER_COLLECTION_CC; + + { + _pos = _x select 1; + _unit = _x select 5; + if (playerSide == (_x select 6) && {_playerPos distance _pos < 200} && {_unit != player}) then { + drawIcon3D [(_x select 0), (_X select 3), _pos, 1, 1, 0, (_x select 2), 0, 0.03, 'PuristaMedium']; + }; + false; + }count CSE_TRACKER_ICONS; + +}; + +["cse_futureSoldierDraw", [], _code] call cse_fnc_addTaskToPool_f; diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_canViewFeed_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_canViewFeed_CC.sqf new file mode 100644 index 0000000000..262b0cd4e4 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_canViewFeed_CC.sqf @@ -0,0 +1,40 @@ +/** + * fn_canViewFeed_CC.sqf + * @Descr: Check if the provided device can view the feed of target if available. + * @Author: Glowbal + * + * @Arguments: [target OBJECT, device STRING (Device classname)] + * @Return: BOOL True if targets feed can be viewed with devices of given classname. + * @PublicAPI: true + */ + +private ["_target", "_return", "_deviceName", "_item"]; +_target = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_deviceName = [_this, 1, "", [""]] call BIS_fnc_Param; + +_return = false; +if (_target isKindOf "CAManBase") then { + //if ([_target] call cse_fnc_hasTrackerItem_CC) then { + if (_target getvariable ["cse_hasCameraFeed_enabled_CC", false]) then { + _item = switch (([_deviceName] call cse_fnc_getDeviceSide_CC)) do { + case WEST: {"cse_itemHelmetCamera_W"}; + case EAST: {"cse_itemHelmetCamera_O"}; + case independent: {"cse_itemHelmetCamera_I"}; + default {""}; + }; + if (_item == "") exitwith{}; + if ([_target, _item] call cse_fnc_hasItem_CC) then { + _return = true; + }; + }; + //}; +} else { + if (_deviceName != "") then { + if (_target in allUnitsUAV) then { + if (side _target == ([_deviceName] call cse_fnc_getDeviceSide_CC)) then { + _return = true; + }; + }; + }; +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_closeLiveFeedScreen_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_closeLiveFeedScreen_CC.sqf new file mode 100644 index 0000000000..70f91897cf --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_closeLiveFeedScreen_CC.sqf @@ -0,0 +1 @@ +[_deviceName,"main","hide"] call cse_fnc_setPiP_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_getAllviewableFeeds_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_getAllviewableFeeds_CC.sqf new file mode 100644 index 0000000000..d67cd977ac --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_getAllviewableFeeds_CC.sqf @@ -0,0 +1,40 @@ +/** + * fn_getAllviewableFeeds_CC.sqf + * @Descr: Get all feeds that are viewable for provided device classname. + * @Author: Glowbal + * + * @Arguments: [deviceName STRING (Device classname)] + * @Return: ARRAY An array with objects that have a viewable feed. + * @PublicAPI: true + */ + +private ["_deviceName", "_return", "_displayText"]; +_deviceName = _this select 0; + +_return = []; +{ + if (_x isKindOf "CAManBase") then { + if ([_x, _deviceName] call cse_fnc_canViewFeed_CC) then { + _trackerInfo = [_x] call cse_fnc_getTrackerInformation_CC; + _displayText = _trackerInfo select 1; + if (_displayText == "") then { + _displayText = format["Unknown: ", _trackerInfo select 0]; + }; + _return pushback [_displayText, [_x]]; + }; + }; +}foreach allUnits; + +{ + if ([_x, _deviceName] call cse_fnc_canViewFeed_CC) then { + _trackerInfo = [_x] call cse_fnc_getTrackerInformation_CC; + _displayText = _trackerInfo select 1; + if (_displayText == "") then { + _displayText = format["UAV: %1", [_x] call cse_fnc_findTargetName_gui]; + }; + _return pushback [_displayText, [_x]]; + }; + +}foreach allUnitsUAV; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_openScreen_liveFeed_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_openScreen_liveFeed_CC.sqf new file mode 100644 index 0000000000..8114a31851 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_openScreen_liveFeed_CC.sqf @@ -0,0 +1,58 @@ +/** + * fn_openScreen_liveFeed_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName", "_appOpening", "_display", "_background"]; +_deviceName = _this select 0; + +if (isnil "CSE_LIVEFEED_TARGET_CC") exitwith {}; // error +[_deviceName,"main","full"] call cse_fnc_setPiP_CC; +[true] call cse_fnc_viewLiveFeed_CC; + +CSE_PREVIOUS_APPLICATION_CC = [_deviceName] call cse_fnc_getCurrentApplication_CC; + +_appOpening = "LiveFeed_Viewing"; +if (CSE_LIVEFEED_TARGET_CC in allUnitsUAV) then { + _sideBarFullScreen = { + private["_deviceName","_cfg","_allowSidebar"]; + _deviceName = _this select 0; + + _allowSidebar = 0; + if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; + }; + + { + if (_x select 0 == _deviceName) exitwith { + _allowSidebar = _x select 2; + }; + }foreach CSE_REGISTERED_DEVICES_CC; + _allowSidebar + }; + + _sideBarN = ([_deviceName] call _sideBarFullScreen); + if (_sideBarN == 1) then { + _appOpening = _appOpening + "_UAV"; + }; +}; + +call compile format["CSE_CURRENT_APPLICATION_%1_CC = '%2';",_deviceName, _appOpening]; + +if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + [_deviceName,"right"] call cse_fnc_setSideBar_CC; +}; + +_display = uiNamespace getvariable _deviceName; +_background = _display displayCtrl 602; +_background ctrlSetPosition [0,0,0,0]; +_background ctrlSetBackgroundColor [0.9,0.9,0.9,1]; +_background ctrlCommit 0; + +(_display displayCtrl 603) ctrlSetText ""; +(_display displayCtrl 604) ctrlSetText ""; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_setLiveFeedTargetObj_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_setLiveFeedTargetObj_CC.sqf new file mode 100644 index 0000000000..58e14f9ce8 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_setLiveFeedTargetObj_CC.sqf @@ -0,0 +1,115 @@ +/** + * fn_setLiveFeedTarget_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define QUAD_COPTER_POS [0,0,-0.5] +#define LARGE_UAV_POS [0,0.5,-1.0] +#define GAV_POS [0,0,1] + +private ["_target", "_camera", "_cameraAttachToPos"]; +_target = _this select 0; +CSE_LIVEFEED_TARGET_CC = _target; + +[format["Setting live feed target: %1",_this]] call cse_fnc_debug; + +if (isNull _target) then { + [false] call cse_fnc_viewLiveFeed_CC; +} else { + _camera = objNull; + if (isnil "CSE_PIP_CAMERA_CC") then { + _camera = "camera" camCreate (position _target); + CSE_PIP_CAMERA_CC = _camera; + _camera cameraEffect ["INTERNAL", "BACK", "rendertarget11"]; + } else { + if (isNull CSE_PIP_CAMERA_CC) then { + ["LiveFeed Camera was null. Creating a new one."] call cse_fnc_debug; + _camera = "camera" camCreate (position _target); + CSE_PIP_CAMERA_CC = _camera; + _camera cameraEffect ["INTERNAL", "BACK", "rendertarget11"]; + }; + _camera = CSE_PIP_CAMERA_CC; + }; + detach _camera; + if (_target isKindOf "CaManBase") then { + _camera attachto [_target,[-0.18,0.1,0.1], "head"]; + + [_target, _camera] spawn { + _target = _this select 0; + _camera = _this select 1; + while {((alive _target) && (CSE_LIVEFEED_TARGET_CC == _target) && alive _camera && dialog)} do { + if (vehicle _target != _target) then { + _positionInWorld = _target modelToWorld (_target selectionPosition "head"); + _vehPos = (vehicle _target) worldToModel _positionInWorld; + _camera attachTo [(vehicle _target),_vehPos]; + } else { + _camera attachto [_target,[-0.18,0.1,0.1], "head"]; + }; + }; + }; + + } else { + if ((_target in allUnitsUAV)) then { + // TODO Make this dynamic through an array. + _cameraAttachToPos = switch (typeOf _target) do { + case "B_UAV_01_F": { + QUAD_COPTER_POS; + }; + case "B_UAV_02_CAS_F": { + LARGE_UAV_POS; + }; + case "B_UAV_02_F": { + LARGE_UAV_POS; + }; + case "B_UGV_01_F": { + GAV_POS; + }; + case "B_UGV_01_rcws_F": { + GAV_POS; + }; + + case "O_UAV_01_F": { + QUAD_COPTER_POS; + }; + case "O_UAV_02_CAS_F": { + LARGE_UAV_POS; + }; + case "O_UAV_02_F": { + LARGE_UAV_POS; + }; + case "O_UGV_01_F": { + GAV_POS; + }; + case "O_UGV_01_rcws_F": { + GAV_POS; + }; + + case "I_UAV_01_F": { + QUAD_COPTER_POS; + }; + case "I_UAV_02_CAS_F": { + LARGE_UAV_POS; + }; + case "I_UAV_02_F": { + LARGE_UAV_POS; + }; + case "I_UGV_01_F": { + GAV_POS; + }; + case "I_UGV_01_rcws_F": { + GAV_POS; + }; + default { + QUAD_COPTER_POS; + }; + }; + + _camera attachto [_target,_cameraAttachToPos]; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_takeControlUAV_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_takeControlUAV_CC.sqf new file mode 100644 index 0000000000..ae383f31b6 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_takeControlUAV_CC.sqf @@ -0,0 +1,39 @@ +/** + * fn_takeControlUAV_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [uav OBJECT (Of type UAV)] + * @Return: + * @PublicAPI: false + */ + +private ["_uav", "_continue"]; +_uav = _this select 0; +if (_uav in allUnitsUAV) then { + if (isnil "CSE_CONTROL_UAV_RESTRICTED_CC") then { + CSE_CONTROL_UAV_RESTRICTED_CC = false; + }; + _continue = true; + if (CSE_CONTROL_UAV_RESTRICTED_CC) then { + _continue = player getvariable ["cse_canControlUAVs_CC", false]; + }; + + if (!_continue) exitwith {}; // has no access to control the UAV. + if (!("GUNNER" in uavControl _uav)) then { + if (count (crew _uav) >= 2) then { + player remoteControl ((crew _uav) select 1); + _uav switchCamera "Gunner"; + closeDialog 0; + } else { + if (!("DRIVER" in uavControl _uav)) then { + if (count (crew _uav) >= 1) then { + player remoteControl ((crew _uav) select 0); + _uav switchCamera "INTERNAL"; + closeDialog 0; + }; + }; + }; + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_viewLiveFeed_CC.sqf b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_viewLiveFeed_CC.sqf new file mode 100644 index 0000000000..cb8c3ff886 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/LiveFeed/functions/fn_viewLiveFeed_CC.sqf @@ -0,0 +1,42 @@ +/** + * fn_viewLiveFeed_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_display","_view","_ctrl", "_camera"]; + +_view = _this select 0; + +disableSerialization; +_deviceName = [] call cse_fnc_getCurrentDeviceName_CC; +[format["fn_viewLiveFeed_CC %1 %2",_this, _deviceName]] call cse_fnc_debug; +_display = uiNamespace getvariable _deviceName; +_ctrl = (_display displayCtrl 20); + +if (_view) then { + _camera = objNull; + if (isnil "CSE_PIP_CAMERA_CC") then { + _camera = "camera" camCreate (position player); + CSE_PIP_CAMERA_CC = _camera; + _camera cameraEffect ["INTERNAL", "BACK","rendertarget11"]; + } else { + if (isNull CSE_PIP_CAMERA_CC) then { + ["LiveFeed Camera was null. Creating a new one."] call cse_fnc_debug; + _camera = "camera" camCreate (position player); + CSE_PIP_CAMERA_CC = _camera; + _camera cameraEffect ["INTERNAL", "BACK","rendertarget11"]; + }; + _camera = CSE_PIP_CAMERA_CC; + }; + "rendertarget11" setPiPEffect [0]; + _ctrl ctrlsettext "#(argb,256,256,1)r2t(rendertarget11,1.0)"; + _ctrl ctrlcommit 0; +} else { + _ctrl ctrlsettext ""; + _ctrl ctrlcommit 0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/Modules/functions/fn_assignTrackerInfo_CC.sqf b/TO_MERGE/cse/sys_cc/Modules/functions/fn_assignTrackerInfo_CC.sqf new file mode 100644 index 0000000000..05cb0865c2 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/Modules/functions/fn_assignTrackerInfo_CC.sqf @@ -0,0 +1,69 @@ +/** + * fn_assignTrackerInfo_CC.sqf + * @Descr: assigns tracker info for the BFT. Does not work well with JIP players. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic", "_type", "_objects", "_callsign"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + +[format["AssigningTrackerInfo called. Arguments are: %1", _this]] call cse_fnc_debug; +if (!isNull _logic) then { + + _type = _logic getvariable ["type","Infantry"]; + _callsign = _logic getvariable ["callSign",""]; + + _list = _logic getvariable ["EnableList",""]; + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call cse_fnc_string_removeWhiteSpace; + if !(isnil _x) then { + if (_nilCheckPassedList == "") then { + _nilCheckPassedList = _x; + } else { + _nilCheckPassedList = _nilCheckPassedList + ","+ _x; + }; + }; + }foreach _splittedList; + + _list = "[" + _nilCheckPassedList + "]"; + _parsedList = [] call compile _list; + _objects = synchronizedObjects _logic; + if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { + + /* + This has been enabled again to allow backwards compatability for older CSE missions. + */ + [["synchronizedObjects for the 'assign BFT Information' Module is deprecated. Please use the enable for list instead!"], 1] call cse_fnc_debug; + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + (vehicle _x) setvariable ["cse_bft_info_cc",[_type,_callsign,true,false],true]; + }; + }; + }; + }foreach _objects; + }; + + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + (vehicle _x) setvariable ["cse_bft_info_cc",[_type,_callsign,true,false],true]; + }; + }; + }; + }foreach _parsedList; + +} else { + [format["AssigningTrackerInfo called but logic is NULL"]] call cse_fnc_debug; + deleteVehicle _logic; +}; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/Modules/functions/fn_modulePlaceIntelMarker_CC.sqf b/TO_MERGE/cse/sys_cc/Modules/functions/fn_modulePlaceIntelMarker_CC.sqf new file mode 100644 index 0000000000..e4cbe90e65 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/Modules/functions/fn_modulePlaceIntelMarker_CC.sqf @@ -0,0 +1,39 @@ +/** + * fn_modulePlaceIntelMarker_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private["_logic", "_placeMentSide"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isServer) exitwith{}; +if (!isNull _logic) then { + if (!isnil "cse_fnc_placeMarker_CC") then { + + _placeMentSide = _logic getvariable ["PlacementSide", "west"], + _placeMentSide = switch (_placeMentSide) do { + case "west": {west}; + case "east": {east}; + case "independent": {independent}; + default {west}; + }; + + [ + [ + _logic getvariable "Type", + _logic getvariable "Side", + _logic getvariable "Direction", + _logic getvariable "Size", + _logic getvariable "Number", + _logic getVariable "Note", + [0,0,0,0,0] + ], + ASLToATL getPosASL _logic, + "intel", _placeMentSide + ] call cse_fnc_placeMarker_CC; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/SupportRequests/fn_supportRequests_CC.sqf b/TO_MERGE/cse/sys_cc/SupportRequests/fn_supportRequests_CC.sqf new file mode 100644 index 0000000000..0d9c673d22 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/SupportRequests/fn_supportRequests_CC.sqf @@ -0,0 +1,9 @@ +/* + Support Requests: + + - different amount of lines + - different priorities + - action on + + +*/ \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/UI.h b/TO_MERGE/cse/sys_cc/UI.h new file mode 100644 index 0000000000..49e034d68b --- /dev/null +++ b/TO_MERGE/cse/sys_cc/UI.h @@ -0,0 +1,5 @@ +#include "ui\define.hpp" +#include "ui\cse_m_tablet.hpp" +#include "ui\cse_m_pda.hpp" +#include "ui\cse_m_tablet_uk.hpp" +#include "ui\m_flight_display.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/config.cpp b/TO_MERGE/cse/sys_cc/config.cpp new file mode 100644 index 0000000000..332b69f12e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/config.cpp @@ -0,0 +1,28 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_cc + { + units[] = {"cse_m_tabletItem", "cse_m_pdaItem", "cse_m_tablet_uk_Item", "cse_m_tablet_o_Item", "cse_m_pda_o_Item"}; + weapons[] = {"cse_m_tablet","cse_m_pda","cse_m_tablet_uk","cse_m_tablet_o", "cse_m_pda_o"}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main", "A3_Weapons_F", "A3_Weapons_F_Items"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_sys_cc { + list[] = {"cse_sys_cc"}; + }; + }; +}; + +#include "CfgFactionClasses.h" +#include "CfgVehicles.h" +#include "CfgWeapons.h" +#include "CfgFunctions.h" +#include "ui.h" +#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/data/black_background.paa b/TO_MERGE/cse/sys_cc/data/black_background.paa new file mode 100644 index 0000000000..c1af9b82c8 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/black_background.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/button_dropdown_menu.paa b/TO_MERGE/cse/sys_cc/data/button_dropdown_menu.paa new file mode 100644 index 0000000000..a37ddb4ee8 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/button_dropdown_menu.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/button_dropdown_menu_hover.paa b/TO_MERGE/cse/sys_cc/data/button_dropdown_menu_hover.paa new file mode 100644 index 0000000000..35c17ae73e Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/button_dropdown_menu_hover.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/dropdown_menu2.paa b/TO_MERGE/cse/sys_cc/data/dropdown_menu2.paa new file mode 100644 index 0000000000..511e46aab9 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/dropdown_menu2.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/empty_background.paa b/TO_MERGE/cse/sys_cc/data/empty_background.paa new file mode 100644 index 0000000000..1e708c623d Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/empty_background.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/empty_background.png b/TO_MERGE/cse/sys_cc/data/empty_background.png new file mode 100644 index 0000000000..7840c05423 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/empty_background.png differ diff --git a/TO_MERGE/cse/sys_cc/data/empty_background2.paa b/TO_MERGE/cse/sys_cc/data/empty_background2.paa new file mode 100644 index 0000000000..8fdc404973 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/empty_background2.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/helmet_camera.paa b/TO_MERGE/cse/sys_cc/data/helmet_camera.paa new file mode 100644 index 0000000000..dbf519925f Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/helmet_camera.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/home_icon.paa b/TO_MERGE/cse/sys_cc/data/home_icon.paa new file mode 100644 index 0000000000..6f204172b4 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/home_icon.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/icons/Thumbs.db b/TO_MERGE/cse/sys_cc/data/icons/Thumbs.db new file mode 100644 index 0000000000..f2f0037220 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/icons/Thumbs.db differ diff --git a/TO_MERGE/cse/sys_cc/data/icons/calculator_icon.paa b/TO_MERGE/cse/sys_cc/data/icons/calculator_icon.paa new file mode 100644 index 0000000000..0e583c2f0e Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/icons/calculator_icon.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/icons/icon_template.png b/TO_MERGE/cse/sys_cc/data/icons/icon_template.png new file mode 100644 index 0000000000..06dc5e8601 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/icons/icon_template.png differ diff --git a/TO_MERGE/cse/sys_cc/data/icons/map-icon.paa b/TO_MERGE/cse/sys_cc/data/icons/map-icon.paa new file mode 100644 index 0000000000..3d9638f361 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/icons/map-icon.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/icons/settings-icon.paa b/TO_MERGE/cse/sys_cc/data/icons/settings-icon.paa new file mode 100644 index 0000000000..1d9a72d28c Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/icons/settings-icon.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/m_flight_display.paa b/TO_MERGE/cse/sys_cc/data/m_flight_display.paa new file mode 100644 index 0000000000..c84ce7914b Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/m_flight_display.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/m_pda.paa b/TO_MERGE/cse/sys_cc/data/m_pda.paa new file mode 100644 index 0000000000..7c29772968 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/m_pda.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/m_tablet.paa b/TO_MERGE/cse/sys_cc/data/m_tablet.paa new file mode 100644 index 0000000000..3aab4e4e78 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/m_tablet.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/m_vehicle_display.paa b/TO_MERGE/cse/sys_cc/data/m_vehicle_display.paa new file mode 100644 index 0000000000..d2fb6b4b3c Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/m_vehicle_display.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/menuIcon.paa b/TO_MERGE/cse/sys_cc/data/menuIcon.paa new file mode 100644 index 0000000000..34e7a6e681 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/menuIcon.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/sidebar_background.paa b/TO_MERGE/cse/sys_cc/data/sidebar_background.paa new file mode 100644 index 0000000000..2c8ecbcfb9 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/sidebar_background.paa differ diff --git a/TO_MERGE/cse/sys_cc/data/uk_tablet.paa b/TO_MERGE/cse/sys_cc/data/uk_tablet.paa new file mode 100644 index 0000000000..04a83c08d5 Binary files /dev/null and b/TO_MERGE/cse/sys_cc/data/uk_tablet.paa differ diff --git a/TO_MERGE/cse/sys_cc/init_server.sqf b/TO_MERGE/cse/sys_cc/init_server.sqf new file mode 100644 index 0000000000..4a424150cf --- /dev/null +++ b/TO_MERGE/cse/sys_cc/init_server.sqf @@ -0,0 +1,20 @@ +/* +server_init.sqf +Usage: Initalizes the Command and Control Server functionality +Author: Glowbal + +Arguments: array [] +Returns: void + +Affects: Server +Executes: All Localities +*/ + +//if (isServer) exitwith{}; + +if (isnil "CSE_CC_LOGIC_OBJECT_CC") then { + _group = createGroup sideLogic; + CSE_CC_LOGIC_OBJECT_CC = _group createUnit ["logic", [1,1,1], [], 0, "FORM"]; + publicVariable "CSE_CC_LOGIC_OBJECT_CC"; +// [] call cse_fnc_assignTrackerIDs_Server_CC; // temp disabled, switching to non id based??? +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/init_sys_cc.sqf b/TO_MERGE/cse/sys_cc/init_sys_cc.sqf new file mode 100644 index 0000000000..c58bb51cee --- /dev/null +++ b/TO_MERGE/cse/sys_cc/init_sys_cc.sqf @@ -0,0 +1,147 @@ +/** + * init_sys_cc.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_args"]; +_args = _this; +CSE_CONTROL_UAV_RESTRICTED_CC = false; +CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT = false; +CSE_ALLOW_LIVE_FEEDS_CC = true; +CSE_ALLOW_VEHICLE_DISPLAYS_CC = true; +CSE_AUTO_ASSIGN_CALLSIGNS_CC = -1; +CSE_VIEW_ON_MAIN_MAP_SETTING_CC = false; +CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC = false; + +{ + if (_x select 0 == "uavRestriction") then { + CSE_CONTROL_UAV_RESTRICTED_CC = (_x select 1); + }; + if (_x select 0 == "showUAV") then { + CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT = _x select 1; + }; + if (_x select 0 == "allowFeeds") then { + CSE_ALLOW_LIVE_FEEDS_CC = _x select 1; + }; + if (_x select 0 == "allowVehicleDisplays") then { + CSE_ALLOW_VEHICLE_DISPLAYS_CC = _x select 1; + }; + if (_x select 0 == "autoAssignCallSigns") then { + CSE_AUTO_ASSIGN_CALLSIGNS_CC = _x select 1; + }; + if (_x select 0 == "allowDisplayOnMainMap") then { + CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC = _x select 1; + }; +}foreach _args; + +[format["AIM - Command and Control initialisation started"],3] call cse_fnc_debug; +waituntil{!isnil "cse_gui"}; +[format["CC - Command and Control Module initialised"],2] call cse_fnc_debug; + + +["cse_sys_cc_allowUseOfMainMap", ["Enable", "Disable"], (["cse_sys_cc_allowUseOfMainMap", 0] call cse_fnc_getClientSideOptionFromProfile_F), { + CSE_VIEW_ON_MAIN_MAP_SETTING_CC = (_this select 1) == 0; +}] call cse_fnc_addClientSideOptions_f; + +["cse_sys_cc_allowUseOfMainMap","option","Use main map (CC)","Use Command and Control on the main map when you have a CC device. Read only."] call cse_fnc_settingsDefineDetails_F; + + + +["cse_m_tablet",[-0.03,0.06,1.014,0.827],1,WEST] call cse_fnc_registerDevice_CC; +["cse_m_pda",[0.2761,0.38,0.33,0.47],2,WEST] call cse_fnc_registerDevice_CC; + +["cse_m_tablet_o",[-0.03,0.06,1.014,0.827],1,EAST] call cse_fnc_registerDevice_CC; +["cse_m_pda_o",[0.2761,0.38,0.33,0.47],2,EAST] call cse_fnc_registerDevice_CC; + +["cse_m_tablet_g",[-0.03,0.06,1.014,0.827],1,independent] call cse_fnc_registerDevice_CC; +["cse_m_pda_g",[0.2761,0.38,0.33,0.47],2,independent] call cse_fnc_registerDevice_CC; + +["cse_m_tablet_uk",[-0.03,0.06,1.014,0.827],1,WEST] call cse_fnc_registerDevice_CC; + +cse_fnc_switchItem = { + private ["_unit","_orig","_newI"]; + _unit = _this select 0; + _orig = _this select 1; + _newI = _this select 2; + _unit removeItem _orig; + _unit addItem _newI; +}; + +CSE_DISPLAY_CC_VIEW_FULL_SCREEN_CC = false; +[] call compile preprocessFile "cse\cse_sys_cc\register_applications.sqf"; +[] call compile preprocessFile "cse\cse_sys_cc\init_server.sqf"; + +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; +CSE_LIVEFEED_TARGET_CC = ObjNull; +_entries = [ + ["PDA (NATO)", {([player,"cse_m_pda"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda"] call cse_fnc_openDevice_CC;}, "Open PDA (NATO)"], + ["Tablet (NATO)", {([player,"cse_m_tablet"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet"] call cse_fnc_openDevice_CC;}, "Open Tablet (NATO)"], + ["Tablet (UK)", {([player,"cse_m_tablet_uk"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet_uk.paa", {closeDialog 0; ["cse_m_tablet_uk"] call cse_fnc_openDevice_CC;}, "Open Tablet (UK)"], + ["PDA (OPFOR)", {([player,"cse_m_pda_o"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda_o"] call cse_fnc_openDevice_CC;}, "Open PDA (OPFOR)"], + ["Tablet (OPFOR)", {([player,"cse_m_tablet_o"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet_o"] call cse_fnc_openDevice_CC;}, "Open Tablet (OPFOR)"], + ["PDA (IND)", {([player,"cse_m_pda_g"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda_g"] call cse_fnc_openDevice_CC;}, "Open PDA (IND)"], + ["Tablet (IND)", {([player,"cse_m_tablet_g"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet_g"] call cse_fnc_openDevice_CC;}, "Open Tablet (IND)"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + +cse_fnc_hasHelmetCameraItem_CC = { + (([player,"cse_itemHelmetCamera_W"] call cse_fnc_hasItem_CC) || ([player,"cse_itemHelmetCamera_O"] call cse_fnc_hasItem_CC) || ([player,"cse_itemHelmetCamera_G"] call cse_fnc_hasItem_CC)) +}; + +_entries = [ + ["Enable Camera", {(([] call cse_fnc_hasHelmetCameraItem_CC) && !(player getvariable ["cse_hasCameraFeed_enabled_CC", false]))}, CSE_ICON_PATH + "icon_helmetCam_small.paa", {closeDialog 0; player setvariable ["cse_hasCameraFeed_enabled_CC", true, true];}, "Turn on your helmet camera"], + ["Disable Camera", {(([] call cse_fnc_hasHelmetCameraItem_CC) && (player getvariable ["cse_hasCameraFeed_enabled_CC", false]))}, CSE_ICON_PATH + "icon_helmetCam_small.paa", {closeDialog 0; player setvariable ["cse_hasCameraFeed_enabled_CC", false, true];}, "Turn off your helmet camera"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +// Request players to access their BFT device(s) +_entries = [ + ["PDA (NATO)", {([_this select 1,"cse_m_pda"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda'] call cse_fnc_hasItem_CC) then { ['cse_m_pda'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (NATO)"], + + ["Tablet (NATO)", {([_this select 1,"cse_m_tablet"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (NATO)"], + + ["Tablet (UK)", {([_this select 1,"cse_m_tablet_uk"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet_uk.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_uk'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_uk'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (UK)"], + + ["PDA (OPFOR)", {([_this select 1,"cse_m_pda_o"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda_o'] call cse_fnc_hasItem_CC) then { ['cse_m_pda_o'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (OPFOR)"], + + ["Tablet (OPFOR)", {([_this select 1,"cse_m_tablet_o"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_o'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_o'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (OPFOR)"], + + ["PDA (IND)", {([_this select 1,"cse_m_pda_g"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda_g'] call cse_fnc_hasItem_CC) then { ['cse_m_pda_g'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (IND)"], + + ["Tablet (IND)", {([_this select 1,"cse_m_tablet_g"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_g'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_g'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (IND)"] +]; +["ActionMenu","interaction", _entries] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +_entries = [ + ["BFT Display", {[player, vehicle player] call cse_fnc_canUseOnBoard_BFT_Device_CC}, CSE_ICON_PATH + "icon_m_flight_display.paa", {closeDialog 0; [vehicle player] call cse_fnc_openFlight_Display_CC;}, "Use onboard BFT Display"] +]; +["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +if (hasInterface) then { + // set the event handlers for the map + { + _x spawn { + disableserialization; + waituntil {!isnull (finddisplay _this displayctrl 51)}; + + private "_control"; + _control = finddisplay _this displayctrl 51; + _control ctrlAddEventHandler ["draw"," + if ([player] call cse_fnc_hasTrackerItem_CC && CSE_VIEW_ON_MAIN_MAP_SETTING_CC && CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC) then { + {[_x,(_this select 0)] call cse_fnc_drawBFTIcons_CC;}foreach CSE_TRACKER_ICONS; + if (CSE_TOGGLE_INTEL_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_INTEL_MARKER_COLLECTION_CC;}; + if (CSE_TOGGLE_ROUTE_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_ROUTE_MARKER_COLLECTION_CC;}; + }; + "]; + }; + } foreach [getnumber (configfile >> "RscDisplayMainMap" >> "idd"), getnumber (configfile >> "RscDisplayGetReady" >> "idd"), getnumber (configfile >> "RscDisplayClientGetReady" >> "idd"), getnumber (configfile >> "RscDisplayServerGetReady" >> "idd") + ]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/register_applications.sqf b/TO_MERGE/cse/sys_cc/register_applications.sqf new file mode 100644 index 0000000000..03baabb4c3 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/register_applications.sqf @@ -0,0 +1,73 @@ +/* +registerApplications.sqf +Usage: Registers applications for the Command and Control Module +Author: Glowbal + +Arguments: array [] +Returns: Void + +Affects: Clients +Executes: All Localities +*/ + +_r = profilenamespace getvariable ['Map_BLUFOR_R',0]; +_g = profilenamespace getvariable ['Map_BLUFOR_G',0.8]; +_b = profilenamespace getvariable ['Map_BLUFOR_B',1]; +_a = profilenamespace getvariable ['Map_BLUFOR_A',0.8]; +CSE_SIDE_WEST_COLOR = [_r,_g,_b,_a]; + +CSE_SIDE_EAST_COLOR = + [ + profilenamespace getvariable ['Map_OPFOR_R',0.5], + profilenamespace getvariable ['Map_OPFOR_G',0], + profilenamespace getvariable ['Map_OPFOR_B',0], + profilenamespace getvariable ['Map_OPFOR_A',0.8] + ]; + +_r = profilenamespace getvariable ['Map_Independent_R',0]; +_g = profilenamespace getvariable ['Map_Independent_G',1]; +_b = profilenamespace getvariable ['Map_Independent_B',1]; +_a = profilenamespace getvariable ['Map_OPFOR_A',0.8]; +CSE_SIDE_IND_COLOR = [_r,_g,_b,_a]; + +if (isDedicated) exitwith {}; + + ["home","","",1,[["Show BFT Icon","button","private '_var'; _var = [player] call cse_fnc_getTrackerInformation_CC; _var set [2, true]; player setvariable ['cse_bft_info_cc', _var, true]; ",0], ["Hide BFT Icon","button","private '_var'; _var = [player] call cse_fnc_getTrackerInformation_CC; _var set [2, false]; player setvariable ['cse_bft_info_cc', _var, true]; ",0]],[WEST,EAST,INDEPENDENT],"[_this select 0] call cse_fnc_openScreen_home_CC;", ["All"]]call cse_fnc_registerApp_CC; + + _sideBarCC_APP = [["Blue Force Tracking","label","",0], + ["Toggle Intel Layer","button","if (isnil 'CSE_TOGGLE_INTEL_LAYER_CC') then { CSE_TOGGLE_INTEL_LAYER_CC = true; } else { CSE_TOGGLE_INTEL_LAYER_CC = !CSE_TOGGLE_INTEL_LAYER_CC; };",0], + ["Toggle Route Layer","button","if (isnil 'CSE_TOGGLE_ROUTE_LAYER_CC') then { CSE_TOGGLE_ROUTE_LAYER_CC = true; } else { CSE_TOGGLE_ROUTE_LAYER_CC = !CSE_TOGGLE_ROUTE_LAYER_CC; };",0], + ["Toggle Callsigns","button","if (isnil 'CSE_TOGGLE_CALLSIGNS_CC') then { CSE_TOGGLE_CALLSIGNS_CC = true; } else { CSE_TOGGLE_CALLSIGNS_CC = !CSE_TOGGLE_CALLSIGNS_CC; };",0] + ]; + ["cc_app","C2","cse\cse_sys_cc\data\icons\map-icon.paa",0,_sideBarCC_APP,[WEST,EAST,INDEPENDENT],"[_this select 0,WEST] call cse_fnc_openScreen_cc_app_CC;", ["All"]] call cse_fnc_registerApp_CC; + + CSE_TOGGLE_CALLSIGNS_CC = true; + CSE_TOGGLE_ROUTE_LAYER_CC = true; + CSE_TOGGLE_INTEL_LAYER_CC = true; + +[] spawn { + waituntil { + CSE_TRACKER_ICONS = [] call cse_fnc_displayBFTSymbols_CC; + uisleep 5; + false; + }; +}; + + +if (CSE_ALLOW_LIVE_FEEDS_CC) then { + _sideBarCC_APP = [["Live Feed","label","",0], + ["Disconnect","button","[call cse_fnc_getCurrentDeviceName_CC, CSE_PREVIOUS_APPLICATION_CC] call cse_fnc_openScreen_CC; [call cse_fnc_getCurrentDeviceName_CC,'main', 'hidden'] call cse_fnc_setPiP_CC; ",0] + ]; + ["LiveFeed_Viewing","","", 1,_sideBarCC_APP,[WEST,EAST,INDEPENDENT],"if (!isNull CSE_LIVEFEED_TARGET_CC) then { if (CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[_this select 0] call cse_fnc_openScreen_liveFeed_CC;} else {[_this select 0, 'LiveFeed_app'] call cse_fnc_openScreen_CC;}; };", ["All"]] call cse_fnc_registerApp_CC; + + + _sideBarCC_APP = [["Live Feed","label","",0], + ["Disconnect","button","[call cse_fnc_getCurrentDeviceName_CC, CSE_PREVIOUS_APPLICATION_CC] call cse_fnc_openScreen_CC; [call cse_fnc_getCurrentDeviceName_CC,'main', 'hidden'] call cse_fnc_setPiP_CC; ",0], + ["Take Control","button","if (!isNull CSE_LIVEFEED_TARGET_CC) then { if !(CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[CSE_LIVEFEED_TARGET_CC] call cse_fnc_takeControlUAV_CC; }; };",0] + ]; + ["LiveFeed_Viewing_UAV","","", 1, _sideBarCC_APP,[WEST,EAST,INDEPENDENT],"if (!isNull CSE_LIVEFEED_TARGET_CC) then { if !(CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[_this select 0] call cse_fnc_openScreen_liveFeed_CC;} else {[_this select 0, 'LiveFeed_app'] call cse_fnc_openScreen_CC;};};", ["All"]] call cse_fnc_registerApp_CC; + + + ["LiveFeed_app","TACNET","cse\cse_sys_cc\data\icons\icon_livefeed_app.paa", 0,[],[WEST,EAST,INDEPENDENT],"[_this select 0] call cse_fnc_openScreen_liveFeed_app_CC;", ["All"]] call cse_fnc_registerApp_CC; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/stringtable.xml b/TO_MERGE/cse/sys_cc/stringtable.xml new file mode 100644 index 0000000000..b25f4ec012 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/stringtable.xml @@ -0,0 +1,238 @@ + + + + + + open BFT Tablet/PDA + OtwĂ³rz Tablet/PDA BFT + Abrir Tableta BFT/PDA + + + Opens the tablet or PDA from CC if you have one in your inventory. Tablet takes priority above PDA. + Otwiera tablet lub PDA z poziomu Konsoli Dowodzenia jeżeli posiadasz takowy na wyposażeniu. Tablet ma priorytet nad PDA. + Abre la Tableta o PDA desde CC si tienes una en el inventario. La Tableta tiene priorida sobre la PDA + + + + open On board BFT Device + OtwĂ³rz pokÅ‚adowe urzÄ…dzenie BFT + Abre el dispositivo BFT de a bordo + + + Opens the onboard BFT device of the vehicle the player is currently in, if available. + Otwiera pokÅ‚adowe urzÄ…dzenie BFT w pojeździe, w ktĂ³rym znajduje siÄ™ gracz, jeżeli pojazd ten posiada takowe urzadzenie. + Abre el dispositivo BFT del vehĂ­culo del jugador, si estuviera disponible. + + + + + + Military Tablet (NATO) + Wojskowy Tablet (NATO) + Tableta Militar (OTAN) + + + Military Tablet (NATO) + Wojskowy Tablet (NATO) + Tableta Militar (OTAN) + + + Military Tablet (NATO) + Wojskowy Tablet (NATO) + Tableta Militar (OTAN) + + + + PDA (NATO) + PDA (NATO) + PDA (OTAN) + + + A PDA for use in the field (NATO) + Palmtop przystosowany do użytku w polu (NATO) + PDA para uso en el campo de batalla (OTAN) + + + A PDA, for use in the field (NATO) + Palmtop przystosowany do użytku w polu (NATO) + PDA para uso en el campo de batalla (OTAN) + + + + Military Tablet (UK/NATO) + Wojskowy Tablet (UK/NATO) + Tableta Militar (UK/OTAN) + + + A Tablet for use in the field (UK/NATO) + Tablet przystosowany do użytku w polu (UK/NATO) + Una Tableta para uso en el campo de batalla (UK/OTAN) + + + UK Tablet. Functions with NATO side. + Brytyjski Tablet. WspĂ³Å‚dziaÅ‚a dla strony NATO. + Tableta UK. Funciones del bando OTAN. + + + + Military Tablet (OPFOR) + Wojskowy Tablet (OPFOR) + Tableta Militar (OPFOR) + + + Military Tablet for OPFOR + Wojskowy Tablet dla strony OPFOR + Tableta Militar para OPFOR + + + OPFOR Tablet + Tablet OPFOR + Tableta Militar OPFOR + + + + PDA (OPFOR) + PDA (OPFOR) + PDA (OPFOR) + + + A PDA for use in the field (OPFOR) + Palmtop przystosowany do użytku w polu (OPFOR) + PDA para uso en el campo de batalla (OPFOR) + + + OPFOR PDA + PDA (OPFOR) + PDA OPFOR + + + + + Military Tablet (IND) + Wojskowy Tablet (IND) + Tableta Militar (IND) + + + Military Tablet for IND + Wojskowy Tablet dla strony INDFOR + Tableta Militar para IND + + + Independent Tablet + Wojskowy Tablet (IND) + Tableta del bando Independiente + + + + PDA (IND) + PDA (IND) + PDA (IND) + + + A PDA for use in the field (IND) + Palmtop przystosowany do użytku w polu (IND) + PDA para uso en el campo de batalla (IND) + + + Independent PDA + PDA (INDFOR) + PDA del bando Independiente + + + + Helmet Camera (NATO) + Kamera naheÅ‚mowa (NATO) + CĂ¡mara del Casco (OTAN) + + + Helmet Camera for NATO forces + Kamera naheÅ‚mowa dla siÅ‚ NATO + CĂ¡mara del Casco para fuerzas de la OTAN + + + NATO Helmet Camera + Kamera naheÅ‚mowa NATO + CĂ¡mara del Casco OTAN + + + + Helmet Camera (OPFOR) + Kamera naheÅ‚mowa (OPFOR) + CĂ¡mara del Casco (OPFOR) + + + Helmet Camera for OPFOR forces + Kamera naheÅ‚mowa dla siÅ‚ OPFOR + CĂ¡mara del Casco para fuerzas OPFOR + + + OPFOR Helmet Camera + Kamera naheÅ‚mowa OPFOR + CĂ¡mara del Casco OPFOR + + + + Helmet Camera (IND) + Kamera naheÅ‚mowa (IND) + CĂ¡mara del Casco (IND) + + + Helmet Camera for Independent + Kamera naheÅ‚mowa dla siÅ‚ INDFOR + CĂ¡mara del Casco de los Independientes + + + IND Helmet Camera + Kamera naheÅ‚mowa INDFOR + CĂ¡mara del Casco IND + + + + + Blue Force Tracker (IND) + Blue Force Tracker (IND) + Blue Force Tracker (IND) + + + Blue Force Tracker for Independent + Blue Force Tracker dla strony INDFOR + Blue Force Tracker para Independentes + + + Blue Force Tracker (IND) + Blue Force Tracker (IND) + Blue Force Tracker (IND) + + + Blue Force Tracker (OPFOR) + Blue Force Tracker (OPFOR) + Blue Force Tracker (OPFOR) + + + Blue Force Tracker for OPFOR + Blue Force Tracker dla strony OPFOR + Blue Force Tracker para OPFOR + + + Blue Force Tracker (OPFOR) + Blue Force Tracker (OPFOR) + Blue Force Tracker (OPFOR) + + + Blue Force Tracker (BLUFOR) + Blue Force Tracker (BLUFOR) + Blue Force Tracker (BLUFOR) + + + Blue Force Tracker for BLUFOR + Blue Force Tracker dla strony BLUFOR + Blue Force Tracker para BLUFOR + + + Blue Force Tracker (BLUFOR) + Blue Force Tracker (BLUFOR) + Blue Force Tracker (BLUFOR) + + + + diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_editIntelMarker_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_editIntelMarker_CC.sqf new file mode 100644 index 0000000000..8b5a5e147a --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_editIntelMarker_CC.sqf @@ -0,0 +1,39 @@ + +private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"]; +_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param; +_nearest = 25; +_lastestCount = -1; + +_marker = []; +{ + _pos = (_x select 0); + if ((_pos distance _position) < _nearest) then { + _nearest = _pos distance _position; + _lastestCount = _foreachIndex; + _marker = _x; + }; +}foreach CSE_INTEL_MARKER_COLLECTION_CC; +if (_lastestCount < 0) exitwith {}; +_selection = _marker select 4; +_usedDesc = _marker select 5; +_inputDesc = if (_usedDesc) then { _marker select 1 select 1;} else { "" }; + +_device = call cse_fnc_getCurrentDeviceName_CC; +[_device,"open","SALUTE Report",format["[_this,%1,'intel', ([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC)] call cse_fnc_updateMarker_CC",_position]] call cse_fnc_setPopUpMenu_CC; + +_opt = [ + ["Type:","combo","", + ["Infantry","Motorized","Plane","Helicopter","Armor","Naval","HQ","Medical","Maintanance","Artillery","Mortar","Service","Recon","Mechanized","uav","Installation","Unknown"], _selection select 0 + ], + ["Side:","combo","",["BLUFOR","OPFOR","GREENFOR","UNKNOWN"], _selection select 1], + ["direction:","combo","",["Static","North","North East","East","South East","South","South West","West","North West"], _selection select 2], + ["Size:","combo","",["Pax","Fire Team","Section","Platoon","Company","Battalion","Regiment", "Brigade"], _selection select 3], + ["","combo","",["1x","2x","3x","4x","5x","6x", "7x"], _selection select 4], + ["Description:","input",_inputDesc] + ]; +[_device,_opt] call cse_fnc_setPopUpOptions_CC; + +cse_fnc_updateMarker_CC = { + [CSE_CLICKED_ON_MAP_FOUND_INTELMARKER_CC] call cse_fnc_removeIntelMarker_CC; + _this call cse_fnc_placeMarker_CC; +}; diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionFieldMain_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionFieldMain_CC.sqf new file mode 100644 index 0000000000..e771e0b2bb --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionFieldMain_CC.sqf @@ -0,0 +1,50 @@ +/** + * fn_getFirstAvailableOptionFieldMain_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_LABEL_IDC 140 +#define START_COMBO_IDC 150 +#define START_BUTTON_IDC 160 +#define START_EDIT_IDC 171 +#define START_LB_IDC 180 + +private ["_deviceName","_display","_type","_idcStart","_return"]; +_deviceName = _this select 0; +_type = _this select 1; + + disableSerialization; + _display = uiNamespace getvariable _deviceName; + + _idcStart = switch (_type) do { + case "label": { + START_LABEL_IDC + }; + case "drop": { + START_COMBO_IDC + }; + case "button": { + START_BUTTON_IDC + }; + case "edit": { + START_EDIT_IDC + }; + case "lb": { + START_LB_IDC + }; + default {-1}; + }; + _return = controlNull; + for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do { + _ctrl = (_display displayCtrl _i); + _foundPos = ctrlPosition _ctrl; + if (_foundPos select 2 <= 0) exitwith { + _return = _ctrl; + }; + }; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionField_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionField_CC.sqf new file mode 100644 index 0000000000..082b309f7e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getFirstAvailableOptionField_CC.sqf @@ -0,0 +1,46 @@ +/** + * fn_getFirstAvailableOptionField_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_LABEL_IDC 40; +#define START_LB_IDC 50; +#define START_BUTTON_IDC 60; +#define START_EDIT_IDC 71; + +private ["_deviceName","_display","_type","_idcStart","_return"]; +_deviceName = _this select 0; +_type = _this select 1; + + disableSerialization; + _display = uiNamespace getvariable _deviceName; + + _idcStart = switch (_type) do { + case "label": { + START_LABEL_IDC + }; + case "drop": { + START_LB_IDC + }; + case "button": { + START_BUTTON_IDC + }; + case "edit": { + START_EDIT_IDC + }; + default {-1}; + }; + _return = controlNull; + for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do { + _ctrl = (_display displayCtrl _i); + _foundPos = ctrlPosition _ctrl; + if (_foundPos select 2 <= 0) exitwith { + _return = _ctrl; + }; + }; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getMainOptionFieldCtrl_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getMainOptionFieldCtrl_CC.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getNavBarRatio_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getNavBarRatio_CC.sqf new file mode 100644 index 0000000000..c694eaf448 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getNavBarRatio_CC.sqf @@ -0,0 +1,16 @@ +/** + * fn_getNavBarRatio_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings"]; +_deviceName = _this select 0; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_settings set[3,(_settings select 3) / 13]; + +_settings \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getOptionFieldOnPos_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getOptionFieldOnPos_CC.sqf new file mode 100644 index 0000000000..1740122ded --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getOptionFieldOnPos_CC.sqf @@ -0,0 +1,60 @@ +/** + * fn_getOptionFieldOnPos_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_LABEL_IDC 40; +#define START_LB_IDC 50; +#define START_BUTTON_IDC 60; +#define START_EDIT_IDC 71; + +private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_idcStart","_ctrlPosition","_return","_possibleTypes","_sideBarHeight","_buttonHeightwithSpacing","_buttonSpacing","_buttonHeight","_maxPositions"]; +_deviceName = _this select 0; +_pos = _this select 1; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_maxPositions = (_settings select 3) / 0.05; +_maxPositions = 12; +_sideBarHeight = _sideBarRatio select 3; +_buttonHeightwithSpacing = _sideBarHeight / _maxPositions; +_buttonSpacing = _buttonHeightwithSpacing / 20; +_buttonHeight = _buttonHeightwithSpacing - _buttonSpacing; + +_ctrlPosition = [(_sideBarRatio select 0) + 0.001, (_sideBarRatio select 1) + (_navBarRatio select 3)/1.5, (_sideBarRatio select 2) - 0.002, _buttonHeight]; +_ctrlPosition set[1, (_ctrlPosition select 1) + (_pos * (_buttonHeight + _buttonSpacing))+ 0.002]; + +_display = uiNamespace getvariable _deviceName; +_return = controlNull; + + _possibleTypes = ["label","drop","button","edit"]; + { + _idcStart = switch (_x) do { + case "label": { + START_LABEL_IDC + }; + case "drop": { + START_LB_IDC + }; + case "button": { + START_BUTTON_IDC + }; + case "edit": {START_EDIT_IDC}; + default {-1}; + }; + private ["_i","_foundPos"]; + for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do { + _ctrl = (_display displayCtrl _i); + _foundPos = ctrlPosition _ctrl; + + if (((_foundPos select 0 == _ctrlPosition select 0) && (_foundPos select 1 == _ctrlPosition select 1) && (_foundPos select 2 == _ctrlPosition select 2) && (_foundPos select 3 == _ctrlPosition select 3))) then { + _return = _ctrl; + }; + }; + }foreach _possibleTypes; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getPopUpRatio_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getPopUpRatio_CC.sqf new file mode 100644 index 0000000000..e4060260ec --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getPopUpRatio_CC.sqf @@ -0,0 +1,20 @@ +/** + * fn_getPopUpRatio_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_spacingSide","_spacingTop","_widthOfPopUp","_heightOfPopUp"]; + disableSerialization; + _deviceName = (call cse_fnc_getCurrentDeviceName_CC); + _settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + _spacingSide = (_settings select 2) / 10; + _spacingTop = (_settings select 3) / 10; + _widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2); + _heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2); + +([(_settings select 0) + _spacingSide, (_settings select 1) + _spacingTop,_widthOfPopUp, _heightOfPopUp]) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarOptionFields_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarOptionFields_CC.sqf new file mode 100644 index 0000000000..3a7c478524 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarOptionFields_CC.sqf @@ -0,0 +1,50 @@ +/** + * fn_getSideBarOptionFields_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_currentApp","_cfg","_return","_posCounter","_pos"]; +_deviceName = _this select 0; +_return = []; +_currentApp = call cse_fnc_getCurrentApplication_CC; +_posCounter = 0; + +if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; +}; + +{ + if (_x select 0 == _currentApp) exitwith { + { + private ["_text","_type","_action","_newOptionField"]; + _text = _x select 0; + _type = _x select 1; + _action = _x select 2; + _pos = _x select 3; + _option = [_text,_type,_action]; + + if (_pos < _posCounter) then { + _pos = _posCounter; + }; + if (_posCounter < _pos) then { + _posCounter = _pos; + }; + + + if (_type == "drop") then { + private ["_values","_valueCfg"]; + _values = (_x select 4); + _option set[3,_values]; + }; + _newOptionField = [_pos,_option]; + _return pushback _newOptionField; + _posCounter = _posCounter + 1; + }foreach (_x select 4); + }; +}foreach CSE_REGISTERED_APPLICATIONS_CC; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarRatio_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarRatio_CC.sqf new file mode 100644 index 0000000000..ea98c02ed2 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_getSideBarRatio_CC.sqf @@ -0,0 +1,42 @@ +/** + * fn_getSideBarRatio_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl"]; +_deviceName = _this select 0; + +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_navBarSettings = [_deviceName] call cse_fnc_getNavBarRatio_CC; + +_sideBarFullScreen = { + private["_deviceName","_cfg","_allowSideBar"]; + _deviceName = _this select 0; + + _allowSidebar = 0; + if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; + }; + + { + if (_x select 0 == _deviceName) exitwith { + _allowSidebar = _x select 2; + }; + }foreach CSE_REGISTERED_DEVICES_CC; + _allowSidebar +}; + +_sideBarN = ([_deviceName] call _sideBarFullScreen); +_return = switch (_sideBarN) do { + case 1: {[(_settings select 0) + ((_settings select 2)-((_settings select 2) / 4.5)), (_settings select 1) + (_navBarSettings select 3)/2, (_settings select 2)/4.5, (_settings select 3) - (_navBarSettings select 3)/2]}; + case 2: {[(_settings select 0) + ((_settings select 2)-((_settings select 2) / 1.5)), (_settings select 1)+ (_navBarSettings select 3)/2, (_settings select 2)/1.5, (_settings select 3) - (_navBarSettings select 3)/2]}; + case 3: {[_settings select 0, (_settings select 1)+ (_navBarSettings select 3)/2, _settings select 2, (_settings select 3) - (_navBarSettings select 3)/2]}; + default {[0,0,0,0]}; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isMapOpen_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isMapOpen_CC.sqf new file mode 100644 index 0000000000..30499de28d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isMapOpen_CC.sqf @@ -0,0 +1,20 @@ +/** + * fn_isMapOpen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_return","_idc"]; +_deviceName = _this select 0; +_selected = _this select 1; +_display = uiNamespace getvariable _deviceName; +_idc = switch (_selected) do { + case "main": {10}; + case "sidebar": {11}; + default {10}; +}; +!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 1 == 0)) diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isOpenBottomBar_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isOpenBottomBar_CC.sqf new file mode 100644 index 0000000000..bdbf29babc --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isOpenBottomBar_CC.sqf @@ -0,0 +1,15 @@ +/** + * fn_isOpenBottomBar_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_return","_idc"]; +_deviceName = _this select 0; +_display = uiNamespace getvariable _deviceName; +_idc = 155; +!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 2 == 0)) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPiPOpen_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPiPOpen_CC.sqf new file mode 100644 index 0000000000..6f89467f3b --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPiPOpen_CC.sqf @@ -0,0 +1,20 @@ +/** + * fn_isPiPOpen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_return","_idc"]; +_deviceName = _this select 0; +_selected = _this select 1; +_display = uiNamespace getvariable _deviceName; +_idc = switch (_selected) do { + case "main": {20}; + case "sidebar": {21}; + default {20}; +}; +!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 2 == 0)) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPopUpOpen_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPopUpOpen_CC.sqf new file mode 100644 index 0000000000..77ac0b510b --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isPopUpOpen_CC.sqf @@ -0,0 +1,24 @@ +/** + * fn_isPopUpOpen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName"]; +_deviceName = _this select 0; + + disableSerialization; + _display = uiNamespace getvariable _deviceName; + _backGroundCtrl = (_display displayCtrl 150); + _return = false; + { + if (_x != 0) then { + _return = true; + }; + }foreach (ctrlPosition _backGroundCtrl); + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isSelectMenuOpen_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isSelectMenuOpen_CC.sqf new file mode 100644 index 0000000000..5313bd636f --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_isSelectMenuOpen_CC.sqf @@ -0,0 +1,19 @@ +/** + * fn_isSelectMenuOpen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC 260 +#define NUMBER_OF_IC 9 + +private ["_deviceName","_display"]; +_deviceName = _this select 0; +_display = uiNamespace getvariable _deviceName; + + +(((ctrlPosition (_display displayCtrl START_IDC)) select 2) != 0) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_popUpAccept_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_popUpAccept_CC.sqf new file mode 100644 index 0000000000..6102fe4151 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_popUpAccept_CC.sqf @@ -0,0 +1,78 @@ +/** + * fn_popUpAccept_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC_LABEL 240 +#define START_IDC_COMBO 250 +#define START_IDC_BTN 260 +#define START_IDC_LIST 280 +#define START_IDC_INPUT 270 + +private ["_deviceName","_display","_ctrlBtn","_ctrlLbl","_ctrlCmbo","_return","_name","_type","_action","_ctrlRight","_ctrlLeft","_content","_ctrlInput"]; +_deviceName = _this select 0; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; + +_ctrlBtn = START_IDC_BTN; +_ctrlLbl = START_IDC_LABEL; +_ctrlCmbo = START_IDC_COMBO; +_ctrlInput = START_IDC_INPUT; +_return = []; +_selectables = []; +{ + _name = _x select 0; + _type = _x select 1; + _action = _x select 2; + + switch (_type) do { + case "btn": { + _ctrlRight = (_display displayCtrl _ctrlBtn); + _ctrlBtn = _ctrlBtn + 1; + _selectables pushback -1; + }; + case "label": { + _ctrlRight = (_display displayCtrl _ctrlLbl); + _ctrlLbl = _ctrlLbl + 1; + _selectables pushback -1; + }; + case "combo": { + _ctrlRight = (_display displayCtrl _ctrlCmbo); + _ctrlLeft = (_display displayCtrl _ctrlLbl); + _ctrlCmbo = _ctrlCmbo + 1; + _ctrlLbl = _ctrlLbl + 1; + + _content = (_x select 3); + if (isnil "_content") then { + _content = []; + }; + if (typeName _content != typeName []) then { + _content = []; + }; + + _selected = lbCurSel _ctrlRight; + if (_selected <0) then { + _selected = 0; + }; + _value = (_content select _selected); + _return pushback _value; + _selectables pushback _selected; + }; + case "input": { + _ctrlRight = (_display displayCtrl _ctrlInput); + _ctrlInput = _ctrlInput + 1; + _return pushback (ctrlText _ctrlRight); + _selectables pushback -1; + }; + default {}; + }; +}foreach CSE_POP_UP_OPTIONS_CC; +_return pushback _selectables; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeOptionField_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeOptionField_CC.sqf new file mode 100644 index 0000000000..094de05005 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeOptionField_CC.sqf @@ -0,0 +1,23 @@ +/** + * fn_removeOptionField_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_LABEL_IDC 40; +#define START_LB_IDC 50; +#define START_BUTTON_IDC 60; + + +private ["_deviceName","_pos","_return","_ctrl"]; +_deviceName = _this select 0; +_pos = _this select 1; +_ctrl = [_deviceName,_pos] call cse_fnc_getOptionFieldOnPos_CC; +_ctrl ctrlSetPosition [0,0,0,0]; +_ctrl ctrlCommit 0; + +_ctrl \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeSelectMenu_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeSelectMenu_CC.sqf new file mode 100644 index 0000000000..87a62354fc --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_removeSelectMenu_CC.sqf @@ -0,0 +1,22 @@ +/** + * fn_removeSelectMenu_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC 260 +#define NUMBER_OF_IC 9 + + +private ["_deviceName","_display"]; +_deviceName = _this select 0; +_display = uiNamespace getvariable _deviceName; + +for [{_i=START_IDC},{_i < START_IDC + NUMBER_OF_IC},{_i=_i+1}] do { + (_display displayCtrl _i) ctrlSetPosition [0,0,0,0]; + (_display displayCtrl _i) ctrlCommit 0; +}; diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBackground_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBackground_CC.sqf new file mode 100644 index 0000000000..d042548c4e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBackground_CC.sqf @@ -0,0 +1,36 @@ +/** + * fn_setBackground_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_newBackGround"]; +_deviceName = _this select 0; +_pos = _this select 1; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +_ctrl = (_display displayCtrl 1); + +_newPos = switch (_pos) do { + case "full": {_settings}; + case "hidden": {[0,0,0,0]}; +}; + +_newBackGround = "cse\cse_sys_cc\data\empty_background2.paa"; +if (count _this > 2) then { + _newBackGround = switch (_this select 2) do { + case "black": {"cse\cse_sys_cc\data\black_background.paa"}; + default {"cse\cse_sys_cc\data\empty_background2.paa"}; + }; +}; + +_ctrl ctrlSetText _newBackGround; +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBottomBar_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBottomBar_CC.sqf new file mode 100644 index 0000000000..b15d094f93 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setBottomBar_CC.sqf @@ -0,0 +1,65 @@ +/** + * fn_setBottomBar_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_newBackGround"]; +_deviceName = _this select 0; +_pos = _this select 1; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_settings set[1,(_settings select 1) + (_settings select 3) - ((_settings select 3) / 13)]; +_settings set[3,(_settings select 3) / 13]; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +_ctrl = (_display displayCtrl 155); + +_newPos = switch (_pos) do { + case "show": {_settings}; + case "hidden": {[0,0,0,0]}; +}; +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; + +_ctrl = (_display displayCtrl 156); +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlSetText ""; +_ctrl ctrlCommit 0; + +if (_pos == "Show") then { + [_deviceName] spawn { + _deviceName = _this select 0; + disableSerialization; + _display = uiNamespace getvariable _deviceName; + _ctrl = (_display displayCtrl 156); + _mapCtrl = (_display displayCtrl 10); + if (isnil "CSE_MOUSE_RELATIVE_POSITION") then { + CSE_MOUSE_RELATIVE_POSITION = [0,0]; + }; + + while {([_deviceName] call cse_fnc_isOpenBottomBar_CC)} do { + if !([_deviceName, "main"] call cse_fnc_isPiPOpen_CC) then { + _WorldCoord = _mapCtrl posScreenToWorld CSE_MOUSE_RELATIVE_POSITION; + _WorldCoord set [2, 0]; + _mousePosition = mapGridPosition _WorldCoord; + _positionPlayer = mapGridPosition player; + _playerPos = getPos player; + _playerPos set [2, 0]; + _ctrl ctrlSetText format["CUR: %1 TAG: %2 DIS: %3",_positionPlayer,_mousePosition, _playerPos distance _WorldCoord]; + } else { + _targetPos = getPos CSE_LIVEFEED_TARGET_CC; + _targetPos set [2, 0]; + _mousePosition = mapGridPosition _targetPos; + _positionPlayer = mapGridPosition player; + _playerPos = getPos player; + _playerPos set [2, 0]; + _ctrl ctrlSetText format["CUR: %1 TAG: %2 DIS: %3",_positionPlayer,_mousePosition, _playerPos distance _targetPos]; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMainOptionField_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMainOptionField_CC.sqf new file mode 100644 index 0000000000..0ba7c73878 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMainOptionField_CC.sqf @@ -0,0 +1,19 @@ +/** + * fn_setMainOptionField_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_buttonHeightwithSpacing","_sideBarHeight","_buttonHeight","_buttonSpacing"]; +_deviceName = _this select 0; +_pos = round(_this select 1); +_options = _this select 2; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_maxPositions = (_settings select 3) / 0.05; +_maxPositions = 12; diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMap_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMap_CC.sqf new file mode 100644 index 0000000000..55737c4cbd --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setMap_CC.sqf @@ -0,0 +1,80 @@ +/** + * fn_setMap_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos"]; +_deviceName = _this select 0; +_selected = _this select 1; +_pos = _this select 2; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; + +_idc = switch (_selected) do { + case "main": {10}; + case "sidebar": {11}; + default {10}; +}; + +_ctrl = (_display displayCtrl _idc); + +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_navBarHeight = _navBarRatio select 3; +_sideBarWidth = _sideBarRatio select 2; + + +_fullScreenSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2) - _sideBarWidth, (_settings select 3) - (_navBarHeight*2)]; +_fullScreenNoSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_settings select 3) - (_navBarHeight*2)]; + +_newPos = switch (_pos) do { + case "full": { + [_deviceName,"show"] call cse_fnc_setBottomBar_CC; + if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + _fullScreenSideBar + } else { + _fullScreenNoSideBar + }; + }; + default { /* includes hidden */ + [_deviceName,"hidden"] call cse_fnc_setBottomBar_CC; + [0,0,0,0] + }; +}; +if (_selected == "sidebar") then { + _sideBarMapWidth = _sideBarWidth - 0.02; + _sideBarMapHeight = ((_sideBarRatio select 3) / 12) * 2; + _newPos = switch (_pos) do { + case "top": {[(_sideBarRatio select 0) + 0.01 , (_settings select 1) + _navBarHeight + _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]}; + case "center": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth*2,_sideBarMapWidth, _sideBarMapHeight]}; + case "bottom": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]}; + case "hidden": {[0,0,0,0]}; + default {[0,0,0,0]}; + }; + if (_pos == "invisable" || _pos == "visable") then { + _newPos = ctrlPosition _ctrl; + if (_pos == "invisable") then { + _ctrl ctrlShow false; + } else { + _ctrl ctrlShow true; + }; + }; +}; +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; +_ctrl ctrlEnable true; +if (_selected == "sidebar" && !(_pos == "visable" || _pos == "invisable" || _pos == "hidden")) then { + if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + [_deviceName,"sidebar","visable"] call cse_fnc_setMap_CC; + } else { + [_deviceName,"sidebar","invisable"] call cse_fnc_setMap_CC; + }; +}; +_ctrl \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setNavBar_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setNavBar_CC.sqf new file mode 100644 index 0000000000..402f494afd --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setNavBar_CC.sqf @@ -0,0 +1,73 @@ + + +private ["_deviceName","_settings","_display","_pos","_ctrl", "_moment", "_lastNumber"]; +_deviceName = _this select 0; +_pos = _this select 1; +_settings = [_deviceName] call cse_fnc_getNavBarRatio_CC; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +_ctrl = (_display displayCtrl 3); + +_newPos = switch (_pos) do { + case "top": {_settings}; + case "hidden": {[0,0,0,0]}; +}; +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; + +_allowsideBar = { + private["_deviceName","_cfg","_allowSideBar"]; + _deviceName = _this select 0; + _allowSidebar = 0; + if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; + }; + + { + if (_x select 0 == _deviceName) exitwith { + _allowSidebar = _x select 2; + }; + }foreach CSE_REGISTERED_DEVICES_CC; + (_allowSidebar > 0) +}; + +if ([_deviceName] call _allowsideBar) then { + _openSideBarCtrl = (_display displayCtrl 4); + _openSideBarCtrl ctrlSetPosition [ + (_settings select 0) + (( _settings select 2) - (_settings select 3)), + (_settings select 1), + (_settings select 3), + (_settings select 3) + ]; + _openSideBarCtrl ctrlCommit 0; + _openSideBarCtrl ctrlSetEventHandler ["ButtonClick", format["['%1','toggle'] call cse_fnc_setSideBar_CC;",_deviceName]]; +}; + +_navBarIconHomeCtrl = (_display displayCtrl 199); +_navBarIconHomeCtrl ctrlSetPosition [(_settings select 0),(_settings select 1),(_settings select 3),(_settings select 3)]; +_navBarIconHomeCtrl ctrlSetText "cse\cse_sys_cc\data\home_icon.paa"; +_navBarIconHomeCtrl ctrlCommit 0; + +(_display displayCtrl 198) ctrlSetPosition [(_settings select 0),(_settings select 1),(_settings select 3),(_settings select 3)]; +(_display displayCtrl 198) ctrlCommit 0; +(_display displayCtrl 198) ctrlSetEventHandler ["ButtonClick", format["['%1','home'] call cse_fnc_openScreen_CC;",_deviceName]]; + +_infoLabelCtrl = (_display displayCtrl 5); +_infoLabelCtrl ctrlSetPosition [ + (_settings select 0), + (_settings select 1),(_settings select 2) - (_settings select 3),(_settings select 3) +]; +_infoLabelCtrl ctrlCommit 0; +[_infoLabelCtrl] spawn { + disableSerialization; + _infoLabelCtrl = _this select 0; + while {dialog} do { + _lastNumber = date select 4; + _moment = format["%1:%2",date select 3, _lastNumber]; + if (_lastNumber < 10) then { + _moment = format["%1:0%2",date select 3, _lastNumber]; + }; + _infoLabelCtrl ctrlSetText _moment; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setOptionField_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setOptionField_CC.sqf new file mode 100644 index 0000000000..1acc9cb491 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setOptionField_CC.sqf @@ -0,0 +1,79 @@ +/** + * fn_setOptionField_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_buttonHeightwithSpacing","_sideBarHeight","_buttonHeight","_buttonSpacing"]; +_deviceName = _this select 0; +_pos = round(_this select 1); +_options = _this select 2; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_maxPositions = (_settings select 3) / 0.05; +_maxPositions = 12; + +_sideBarHeight = _sideBarRatio select 3; +_buttonHeightwithSpacing = _sideBarHeight / _maxPositions; +_buttonSpacing = _buttonHeightwithSpacing / 20; +_buttonHeight = _buttonHeightwithSpacing - _buttonSpacing; + +_type = _options select 1; + +if (((_pos < 0) || _pos >= _maxPositions) && !(_type == "map")) exitwith {}; + + disableSerialization; + _display = uiNamespace getvariable _deviceName; + _ctrlPosition = [(_sideBarRatio select 0) + 0.001, (_sideBarRatio select 1) + (_navBarRatio select 3)/ 1.5, (_sideBarRatio select 2) - 0.002, _buttonHeight]; + _ctrlPosition set[1, (_ctrlPosition select 1) + (_pos * (_buttonHeight + _buttonSpacing))+ 0.002]; + //_ctrlPosition set[2, 0.2]; + //_ctrlPosition set[3,0.04]; + + _labelText = _options select 0; + + [_deviceName,_pos] call cse_fnc_removeOptionField_CC; + _ctrl = [_deviceName,_type] call cse_fnc_getFirstAvailableOptionField_CC; + _ctrl ctrlSetPosition _ctrlPosition; + //_ctrl ctrlSetFontHeight _buttonHeight; + + switch (_type) do { + case "label": { + _ctrl ctrlSetText _labelText; + }; + case "edit": { + _ctrl ctrlSetText ""; + }; + case "drop": { + private ["_index","_availableSelection"]; + _availableSelection = _options select 3; + lbClear _ctrl; + if (count _availableSelection > 0) then { + _index = 0; + { + _ctrl lbadd (_x select 0); + _ctrl lbSetData [_index, (_x select 1)]; + _index = _index + 1; + }foreach _availableSelection; + } else { + //private ["_refill"]; + //_refill = getText ((_cfg select _i) >> "refill"); + //[_deviceName, _ctrl] call compile _refill; + }; + _ctrl ctrlSetEventHandler ["LBSelChanged", format["['%1',_this] call %2;",_deviceName,compile (_options select 2)]]; + }; + case "button": { + _ctrl ctrlSetText _labelText; + _ctrl ctrlSetEventHandler ["ButtonClick", format["['%1',_this] call %2;",_deviceName,compile (_options select 2)]]; + }; + case "map": { + [_deviceName,"sidebar","bottom"] call cse_fnc_setMap_CC; + }; + default {}; + }; + _ctrl ctrlCommit 0; +_ctrl \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPiP_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPiP_CC.sqf new file mode 100644 index 0000000000..3f4a671a8e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPiP_CC.sqf @@ -0,0 +1,81 @@ +/** + * fn_setPiP_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos"]; +_deviceName = _this select 0; +_selected = _this select 1; +_pos = _this select 2; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; + +_idc = switch (_selected) do { + case "main": {20}; + case "sidebar": {21}; + default {20}; +}; + +_ctrl = (_display displayCtrl _idc); + +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_navBarHeight = _navBarRatio select 3; +_sideBarWidth = _sideBarRatio select 2; + + +_fullScreenSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2) - _sideBarWidth, (_settings select 3) - (_navBarHeight*2)]; +_fullScreenNoSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_settings select 3) - (_navBarHeight*2)]; + +_newPos = switch (_pos) do { + case "full": { + [_deviceName,"show"] call cse_fnc_setBottomBar_CC; + if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + _fullScreenSideBar + } else { + _fullScreenNoSideBar + }; + }; + default { /* includes hidden */ + [_deviceName,"hidden"] call cse_fnc_setBottomBar_CC; + [0,0,0,0] + }; +}; +if (_selected == "sidebar") then { + _sideBarMapWidth = _sideBarWidth - 0.02; + _sideBarMapHeight = ((_sideBarRatio select 3) / 12) * 2; + _newPos = switch (_pos) do { + case "top": {[(_sideBarRatio select 0) + 0.01 , (_settings select 1) + _navBarHeight + _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]}; + case "center": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth*2,_sideBarMapWidth, _sideBarMapHeight]}; + case "bottom": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]}; + case "hidden": {[0,0,0,0]}; + default {[0,0,0,0]}; + }; + if (_pos == "invisable" || _pos == "visable") then { + _newPos = ctrlPosition _ctrl; + if (_pos == "invisable") then { + _ctrl ctrlShow false; + } else { + _ctrl ctrlShow true; + }; + }; +}; +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; +_ctrl ctrlEnable true; + +if (_selected == "sidebar" && !(_pos == "visable" || _pos == "invisable" || _pos == "hidden")) then { + if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + [_deviceName,"sidebar","visable"] call cse_fnc_setPiP_CC; + } else { + [_deviceName,"sidebar","invisable"] call cse_fnc_setPiP_CC; + }; +}; +_ctrl \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpMenu_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpMenu_CC.sqf new file mode 100644 index 0000000000..e16ac1f669 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpMenu_CC.sqf @@ -0,0 +1,102 @@ +/** + * fn_setPopUpMenu_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_toggle","_deviceName","_position","_display","_backGroundCtrl"]; +_deviceName = _this select 0; +_toggle = _this select 1; + + +//if (([_deviceName] call cse_fnc_isPopUpOpen_CC) && _toggle == "open") exitwith { }; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +_backGroundCtrl = (_display displayCtrl 150); +_headerCtrl = (_display displayCtrl 151); +_headerTitle = (_display displayCtrl 152); + +_buttonClose = (_display displayCtrl 154); +_buttonAccept = (_display displayCtrl 153); +if (_toggle == "open") then { + disableSerialization; + + //_navBarSettings = [_deviceName] call cse_fnc_getNavBarRatio_CC; + if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + [_deviceName,"hidden"] call cse_fnc_setSideBar_CC; + }; + (_display displayCtrl 10) ctrlEnable false; + + _settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + _spacingSide = (_settings select 2) / 10; + _spacingTop = (_settings select 3) / 10; + _widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2); + _heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2); + + _newPos = [(_settings select 0) + _spacingSide, (_settings select 1) + _spacingTop,_widthOfPopUp, _heightOfPopUp]; + _backGroundCtrl ctrlSetPosition _newPos; + _backGroundCtrl ctrlCommit 0; + + _newPos set [3,_heightOfPopUp / 10]; + _headerCtrl ctrlSetPosition _newPos; + _headerCtrl ctrlCommit 0; + + _headerTitle ctrlSetPosition _newPos; + _headerTitle ctrlCommit 0; + + _newPos set [1, (_newPos select 1) + (_heightOfPopUp - (_heightOfPopUp / 10))]; + _newPos set [2, (_newPos select 2) / 2]; + _buttonClose ctrlSetPosition _newPos; + _buttonClose ctrlCommit 0; + + _newPos set [0, (_newPos select 0) + (_newPos select 2)]; + _buttonAccept ctrlSetPosition _newPos; + _buttonAccept ctrlCommit 0; + + _title = _this select 2; + if (isnil "_title") then { + _title = ""; + }; + if (typeName _title != typeName "") then { + _title = ""; + }; + ctrlSetText[152,_title]; + + + _buttonClose ctrlSetEventHandler ["ButtonClick", format["['%1','close'] call cse_fnc_setPopUpMenu_CC",_deviceName]]; + + _onAccept = (_this select 3); + if (isnil "_onAccept") then { + _onAccept = ""; + }; + if (typeName _onAccept != typeName "") then { + _onAccept = ""; + }; + _buttonAccept ctrlSetEventHandler ["ButtonClick", format["(['%1'] call cse_fnc_popUpAccept_CC) call %2; ['%1','close'] call cse_fnc_setPopUpMenu_CC;",_deviceName,compile _onAccept]]; + + [_deviceName, (_display displayCtrl 10)] spawn { + waituntil {!([_this select 0] call cse_fnc_isPopUpOpen_CC)}; + (_this select 1) ctrlEnable true; + }; +} else { + _newPos = [0,0,0,0]; + _backGroundCtrl ctrlSetPosition _newPos; + _backGroundCtrl ctrlCommit 0; + _headerCtrl ctrlSetPosition _newPos; + _headerCtrl ctrlCommit 0; + _headerTitle ctrlSetPosition _newPos; + _headerTitle ctrlCommit 0; + + _buttonClose ctrlSetPosition _newPos; + _buttonClose ctrlCommit 0; + + _buttonAccept ctrlSetPosition _newPos; + _buttonAccept ctrlCommit 0; + ctrlSetText[152,""]; + [_deviceName,[]] call cse_fnc_setPopUpOptions_CC; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpOptions_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpOptions_CC.sqf new file mode 100644 index 0000000000..a655ab3ba6 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setPopUpOptions_CC.sqf @@ -0,0 +1,132 @@ +/** + * fn_setPopUpOptions_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC_LABEL 242 +#define START_IDC_COMBO 250 +#define START_IDC_BTN 260 +#define START_IDC_LIST 280 +#define START_IDC_INPUT 270 + +private["_deviceName","_options","_display","_settings","_spacingSide", "_spacingTop","_positionLeft","_positionRight","_widthOfPopUp","_heightOfPopUp","_ctrl","_ctrlInput", "_select"]; +_deviceName = _this select 0; +_options = _this select 1; + +_settings = ([_deviceName] call cse_fnc_getDeviceSettings_CC); +_spacingSide = (_settings select 2) / 10; +_spacingTop = (_settings select 3) / 10; +_widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2); +_heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2); + +_positionLeft = [(_settings select 0) + _spacingSide + 0.01, (_settings select 1) + _spacingTop + (_heightOfPopUp / 10),(_widthOfPopUp / 2) - 0.02, _heightOfPopUp / 10]; +_positionRight = [(_settings select 0) + _spacingSide + 0.01 + (_widthOfPopUp / 2), (_settings select 1) + _spacingTop + (_heightOfPopUp / 10),(_widthOfPopUp / 2) - 0.02, _heightOfPopUp / 10]; + +_increasePerTime = (_heightOfPopUp / 10) + 0.01; +disableSerialization; +_display = uiNamespace getvariable _deviceName; + +_ctrlBtn = START_IDC_BTN; +_ctrlLbl = START_IDC_LABEL; +_ctrlCmbo = START_IDC_COMBO; +_ctrlInput = START_IDC_INPUT; + +{ + _idc = _x; + for [{_x=_idc},{_x< (_idc + 10)},{_x=_x+1}] do { + _ctrl = (_display displayCtrl _x); + _ctrl ctrlSetPosition [100,100,0.1,0.1]; /* Cannot use 0 for editfields */ + _ctrl ctrlCommit 0; + }; +}foreach [START_IDC_BTN,START_IDC_LABEL,START_IDC_COMBO,START_IDC_INPUT]; + +CSE_POP_UP_OPTIONS_CC = +_options; +{ + _name = _x select 0; + _type = _x select 1; + _action = _x select 2; + + switch (_type) do { + case "btn": { + _ctrlRight = (_display displayCtrl _ctrlBtn); + _ctrlRight ctrlSetPosition _positionRight; + _ctrlRight ctrlSetText _name; + _ctrlRight ctrlCommit 0; + _positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime]; + _positionRight set [ 1, (_positionRight select 1)+_increasePerTime]; + _ctrlBtn = _ctrlBtn + 1; + }; + case "label": { + _ctrlRight = (_display displayCtrl _ctrlLbl); + _ctrlRight ctrlSetPosition _positionRight; + _ctrlRight ctrlSetText (toUpper _name); + _ctrlRight ctrlCommit 0; + + _positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime]; + _positionRight set [ 1, (_positionRight select 1)+_increasePerTime]; + _ctrlLbl = _ctrlLbl + 1; + }; + case "combo": { + private ["_content"]; + _ctrlRight = (_display displayCtrl _ctrlCmbo); + _ctrlRight ctrlSetPosition _positionRight; + _ctrlRight ctrlCommit 0; + _content = (_x select 3); + _select = -1; + if (count _x > 3) then { + _select = _x select 4; + [format["_select %1",_select]] call cse_fnc_debug; + }; + if (isnil "_content") then { + _content = []; + }; + if (typeName _content != typeName []) then { + _content = []; + }; + lbClear _ctrlCmbo; + { + _ctrlRight lbadd format["%1",_x]; + }foreach _content; + if (_select >= 0) then { + _ctrlRight lbSetCurSel _select; + }; + _ctrlLeft = (_display displayCtrl _ctrlLbl); + _ctrlLeft ctrlSetPosition _positionLeft; + _ctrlLeft ctrlSetText (toUpper _name); + _ctrlLeft ctrlCommit 0; + + _positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime]; + _positionRight set [ 1, (_positionRight select 1)+_increasePerTime]; + _ctrlCmbo = _ctrlCmbo + 1; + _ctrlLbl = _ctrlLbl + 1; + }; + + case "input": { + _ctrlRight = (_display displayCtrl _ctrlInput); + _ctrlRight ctrlSetPosition _positionRight; + if (count _x > 3) then { + _ctrlRight ctrlSetText (_x select 3); + } else { + _ctrlRight ctrlSetText ""; + }; + _ctrlRight ctrlCommit 0; + + _ctrlLeft = (_display displayCtrl _ctrlLbl); + _ctrlLeft ctrlSetPosition _positionLeft; + _ctrlLeft ctrlSetText (toUpper _name); + _ctrlLeft ctrlCommit 0; + + _positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime]; + _positionRight set [ 1, (_positionRight select 1)+_increasePerTime]; + _ctrlInput = _ctrlInput + 1; + _ctrlLbl = _ctrlLbl + 1; + }; + default {}; + }; + +}foreach _options; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setProgramIcons_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setProgramIcons_CC.sqf new file mode 100644 index 0000000000..d0abef88f3 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setProgramIcons_CC.sqf @@ -0,0 +1,98 @@ +/** + * fn_setProgramIcons_CC.sqf + * @Descr: Set the program or Application icons on the desktop of a cC device. + * @Author: Glowbal + * + * @Arguments: [deviceName STRING (the classname of the device)] + * @Return: nil + * @PublicAPI: false + */ + +#define AVAILABLE_ICONS [100,101,102,103,104,105,106,107,108,109,110,111,112] +#define ICON_WIDTH 0.05 +#define ICON_HEIGHT ICON_WIDTH + +private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos","_cfg","_availablePrograms","_displayName","_iconWidth","_startingPos","_maxIconsOnWidth","_currentIconN","_ctrlButton","_ctrlLabel", "_devices"]; +_deviceName = _this select 0; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; + +_availablePrograms = []; +if (isnil 'CSE_REGISTERED_APPLICATIONS_CC') then { + CSE_REGISTERED_APPLICATIONS_CC = []; +}; + +// Collect all applications that will be displayed on the Desktop and are available for the device. +{ + // Check if application is hidden (such as main). 0 = show, 1 = hidden. + if ((_x select 3) == 0) then { + _devices = _x select 7; + + // Check if the device Classname matches any entry in the devices list, to ensure the application is registered for this device. + if (_deviceName in _devices || "All" in _devices) then { + // store the: Name, Icon, displayName. + _option = [_x select 0,_x select 2,_x select 1]; + _availablePrograms pushback _option; + } else { + [format["Application %1 is not registered on device %2 | %3", (_x select 0), _deviceName, _devices],3] call cse_fnc_debug; + }; + }; +}foreach CSE_REGISTERED_APPLICATIONS_CC; + +disableSerialization; +_display = uiNamespace getvariable _deviceName; +if (isnil "_display") exitwith {}; // error +if (isNull _display) exitwith {}; // error + +// Set all desktop icons in normal state +{ + (_display displayCtrl _x) ctrlSetPosition [0,0,0,0]; + (_display displayCtrl _x) ctrlCommit 0; + (_display displayCtrl (_x + 20)) ctrlSetPosition [0,0,0,0]; + (_display displayCtrl (_x + 20)) ctrlCommit 0; +}foreach AVAILABLE_ICONS; + +// Calculate height width and placement for icons. +_iconWidth = (_settings select 3) / 10; +_iconHeight = _iconWidth; +_startingPos = [(_settings select 0) + (_iconWidth / 4),(_settings select 1) + ((_settings select 3) / 13) + (_iconHeight / 2),_iconHeight,_iconWidth]; +_maxIconsOnWidth = round(((_settings select 2) / _iconWidth) - 1); +_currentIconN = 1; + +{ + // To ensure that we won't accidently try to place down more icons as available. + if (_foreachIndex < count AVAILABLE_ICONS) then { + _name = _x select 0; + _icon = _x select 1; + _displayName = _x select 2; + + // Set icon on correct position. + _ctrl = (_display displayCtrl (AVAILABLE_ICONS select _foreachIndex)); + _ctrl ctrlSetPosition _startingPos; + _ctrl ctrlSetText _icon; + _ctrl ctrlCommit 0; + + // Set the button on the correct position with ButtonClick eventhandler. + _ctrlButton = (_display displayCtrl ((AVAILABLE_ICONS select _foreachIndex) + 20)); + _ctrlButton ctrlSetPosition _startingPos; + _ctrlButton ctrlCommit 0; + _ctrlButton ctrlSetEventHandler ["ButtonClick", format["['%1','%2'] call cse_fnc_openScreen_CC",_deviceName,_name]]; + + // Setting the label underneat the button/icon. + _ctrlLabel = (_display displayCtrl ((AVAILABLE_ICONS select _foreachIndex) + 40)); + _ctrlLabel ctrlSetPosition [_startingPos select 0, (_startingPos select 1) + (_iconHeight / 1.31), _iconHeight, 0.03]; + _ctrlLabel ctrlSetText format["%1",_displayName]; + _ctrlLabel ctrlSetFontHeight (_iconHeight * 0.35); + _ctrlLabel ctrlCommit 0; + + // calculate position for next icon. + _startingPos set[0,(_startingPos select 0) + _iconWidth + 0.005]; + + // Start next row of icons. + if ((_foreachIndex+1) % _maxIconsOnWidth == 0) then { + _startingPos set[0,(_startingPos select 0) - (_iconWidth + 0.005) * _maxIconsOnWidth]; + _startingPos set[1,(_startingPos select 1) + (_iconWidth * 1.1)]; + }; + }; +}foreach _availablePrograms; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setSideBar_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setSideBar_CC.sqf new file mode 100644 index 0000000000..7b89ebaa90 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setSideBar_CC.sqf @@ -0,0 +1,75 @@ +/** + * fn_setSideBar_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_pos","_ctrl"]; +_deviceName = _this select 0; +_pos = _this select 1; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_display = uiNamespace getvariable _deviceName; + +if (count (call cse_fnc_getSideBarOptionFields_CC) < 1) then { + _pos = "hidden"; +}; + +if (_pos == 'toggle') then { + if ((ctrlPosition ((_display displayCtrl 2)) select 0 == 0) && + ((ctrlPosition (_display displayCtrl 2)) select 1 == 0) && (ctrlPosition ((_display displayCtrl 2)) select 2 == 0) && (ctrlPosition ((_display displayCtrl 2)) select 3 == 0)) then { + _pos = "right"; + } else { + _pos = "hidden"; + }; +}; +disableSerialization; + +_ctrl = (_display displayCtrl 2); +_newPos = switch (_pos) do { + //case "left": {[_settings select 0, _settings select 1, (_settings select 2) / 4.5, _settings select 3]}; + case "right": {[_deviceName] call cse_fnc_getSideBarRatio_CC}; + case "hidden": {[0,0,0,0]}; + default {[0,0,0,0]}; +}; + + +_ctrl ctrlsetPosition _newPos; +_ctrl ctrlCommit 0; + + +for [{_i=0},{_i < 20},{_i=_i+1}] do { + [_deviceName,_i] call cse_fnc_removeOptionField_CC; +}; + +if (_pos != "hidden") then { + { + _args = [_deviceName] + _x; + _args call cse_fnc_setOptionField_CC; + }foreach (call cse_fnc_getSideBarOptionFields_CC); + [_deviceName,"hidden"] spawn cse_fnc_setPopUpMenu_CC; + if ([_deviceName,"sidebar"] call cse_fnc_isMapOpen_CC) then { + if (call cse_fnc_sideBarHasMap_CC) then { + [_deviceName,"sidebar","visable"] call cse_fnc_setMap_CC; + } else { + [_deviceName,"sidebar","hidden"] call cse_fnc_setMap_CC; + }; + }; +} else { + + if ([_deviceName,"sidebar"] call cse_fnc_isMapOpen_CC) then { + [_deviceName,"sidebar","invisable"] call cse_fnc_setMap_CC; + }; +}; +if ([_deviceName,"main"] call cse_fnc_isMapOpen_CC) then { + [_deviceName,"main","full"] call cse_fnc_setMap_CC; +}; +if ([_deviceName,"main"] call cse_fnc_isPiPOpen_CC) then { + [_deviceName,"main","full"] call cse_fnc_setPiP_CC; +}; +if ([_deviceName] call cse_fnc_isSelectMenuOpen_CC) exitwith { + [_deviceName] call cse_fnc_removeSelectMenu_CC; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setTitle_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setTitle_CC.sqf new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_setTitle_CC.sqf @@ -0,0 +1,2 @@ + + diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_showLoadingScreen_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_showLoadingScreen_CC.sqf new file mode 100644 index 0000000000..e11187c6cf --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_showLoadingScreen_CC.sqf @@ -0,0 +1,67 @@ + + +_deviceName = _this select 0; +_showTime = _this select 1; + +disableSerialization; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_display = uiNamespace getvariable _deviceName; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_navBarHeight = _navBarRatio select 3; +_heightOfLB = (_settings select 3) - (_navBarHeight*2)/2; + +_barPosition = [(_settings select 0) + ((_settings select 2) / 4),(_settings select 1) + ((_settings select 3) / 2) - (_navBarHeight/2) , (_settings select 2) / 2, _navBarHeight]; +_labelPosition = [(_settings select 0) + ((_settings select 2) / 4),(_settings select 1) + ((_settings select 3) / 2) - (_navBarHeight * 1.5) , (_settings select 2) / 2, _navBarHeight]; + + +_background = _display displayCtrl 607; +_bar = _display displayCtrl 606; +_label = _display displayCtrl 608; + +_background ctrlSetPosition _settings; +_background ctrlSetBackgroundColor [0.8,0.8,0.8,1]; +_background ctrlCommit 0; + +_loadingText = "LOADING"; +_label ctrlSetText _loadingText; +_label ctrlSetPosition _labelPosition; +_label ctrlCommit 0; + +_bar ctrlSetPosition _barPosition; +_bar ctrlCommit 0; + +_newStatus = 0; +_toSleep = (1 / _showTime) / 20; +_start = time; +_numOfDots = 0; +_runs = 0; + +while {(_newStatus <= 1.00 && !(isNull _display))} do { + uisleep 0.01; + _bar progressSetPosition _newStatus; + _newStatus = _newStatus + _toSleep; + if (_runs >= 30) then { + _runs = 0; + if (_loadingText == "LOADING") then { + _loadingText = "PLEASE WAIT"; + } else { + _loadingText = "LOADING"; + }; + _label ctrlSetText _loadingText; + } else { + _runs = _runs + 1; + }; +}; + +uisleep 0.5; +if !(isNull _display) then { + _background ctrlSetPosition [0,0,0,0]; + _background ctrlCommit 0; + + _bar ctrlSetPosition [0,0,0,0]; + _bar ctrlCommit 0; + + _label ctrlSetText ""; + _label ctrlSetPosition [0,0,0,0]; + _label ctrlCommit 0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_sideBarHasMap_CC.sqf b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_sideBarHasMap_CC.sqf new file mode 100644 index 0000000000..59e44203a3 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletResources/functions/fn_sideBarHasMap_CC.sqf @@ -0,0 +1,31 @@ +/** + * fn_sideBarHasMap_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_currentApp","_cfg","_hasMap","_return"]; +//_currentApp = call cse_fnc_getCurrentApplication_CC; +_return = false; +/*_cfg = (missionConfigFile >> "Combat_Space_Enhancement" >> "command_and_control" >> "applications" >> _currentApp >> "sideBar"); +_hasMap = 0; +if (isClass _cfg) then { + for [{_i=0},{_i < (count _cfg)},{_i=_i+1}] do { + if (isClass (_cfg select _i)) then { + private ["_type"]; + _type = getText ((_cfg select _i) >> "type"); + if (_type == "map") then { + _hasMap = _hasMap + 1; + }; + }; + }; +}; + +if (_hasMap > 0) then { + _return = true; +};*/ +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_cc_app_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_cc_app_CC.sqf new file mode 100644 index 0000000000..47d3499dae --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_cc_app_CC.sqf @@ -0,0 +1,24 @@ +/** + * fn_openScreen_cc_app_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +//_this spawn { + //[_deviceName] call cse_fnc_clearDeviceScreen_CC; + private ["_deviceName"]; + _deviceName = _this select 0; + [_deviceName,"main","full"] call cse_fnc_setMap_CC; + + if (isnil "CSE_CURRENT_SELECTED_FILTER_CC_APP_CC") then { + CSE_CURRENT_SELECTED_FILTER_CC_APP_CC = -1; + CSE_TOGGLE_ROUTE_LAYER_CC = false; + CSE_TOGGLE_INTEL_LAYER_CC = false; + CSE_TOGGLE_CALLSIGNS_CC = false; + CSE_SELECTED_ICON_CC = ""; + }; + diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_home_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_home_CC.sqf new file mode 100644 index 0000000000..9b4b271dd1 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_home_CC.sqf @@ -0,0 +1,19 @@ +/** + * fn_openScreen_home_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display"]; +_deviceName = _this select 0; + +[_deviceName] call cse_fnc_clearDeviceScreen_CC; +[_deviceName,"full"] call cse_fnc_setBackground_CC; +[_deviceName,"top"] call cse_fnc_setNavBar_CC; +[_deviceName,"hidden"] call cse_fnc_setSideBar_CC; +[_deviceName,"hidden"] call cse_fnc_setBottomBar_CC; +[_deviceName] call cse_fnc_setProgramIcons_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_liveFeed_app_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_liveFeed_app_CC.sqf new file mode 100644 index 0000000000..0071c659c4 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_liveFeed_app_CC.sqf @@ -0,0 +1,73 @@ +/** + * fn_openScreen_liveFeed_app_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName", "_allAvailableFeeds"]; +_deviceName = _this select 0; + +disableSerialization; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_display = uiNamespace getvariable _deviceName; + +_background = _display displayCtrl 602; +_listBox = _display displayCtrl 601; + +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC; +_navBarHeight = _navBarRatio select 3; +_sideBarWidth = _sideBarRatio select 2; +_heightOfLB = (_settings select 3) - (_navBarHeight*2)/2; + +_fullBackground = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_heightOfLB/4)*1.01]; +_background ctrlSetPosition _fullBackground; +_background ctrlSetBackgroundColor [0.9,0.9,0.9,1]; +_background ctrlCommit 0; + +_listBoxPosition = [_settings select 0,(_settings select 1) + _navBarHeight + (_heightOfLB/4), (_settings select 2), ((_heightOfLB)/4)*3]; +_listBox ctrlSetPosition _listBoxPosition; +_listBox ctrlEnable false; +_listBox ctrlEnable true; +_listBox ctrlCommit 0; + +_listBox ctrlSetEventHandler ["MouseButtonDblClick", " + [_this] call cse_fnc_debug; + _lb = _this select 0; + _currentSelection = lbCurSel _lb; + if (_currentSelection >= 0) then { + _targetArray = CSE_ALL_AVAILABLE_LIVE_FEEDS_AT_MOMENT_CC select _currentSelection; + _target = _targetArray select 1 select 0; + [_target] call cse_fnc_setLiveFeedTargetObj_CC; + + _lb ctrlSetPosition [0,0,0,0]; + _lb ctrlCommit 0; + _lb ctrlEnable false; + [[] call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_openScreen_liveFeed_CC; + }; +"]; + +lbclear 601; +_allAvailableFeeds = [_deviceName] call cse_fnc_getAllViewableFeeds_CC; +CSE_ALL_AVAILABLE_LIVE_FEEDS_AT_MOMENT_CC = _allAvailableFeeds; +{ + lbadd [601, (_x select 0)]; + //lbSetData [601, _foreachIndex, str ((_x select 1) select 0)]; +}foreach _allAvailableFeeds; + +ctrlSetFocus _listBox; +_listBox lbSetCurSel 0; +(_display displayCtrl 603) ctrlSetPosition [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), _navBarHeight]; +(_display displayCtrl 604) ctrlSetPosition [_settings select 0,(_settings select 1) + _navBarHeight + _navBarHeight, (_settings select 2), (_heightOfLB/4)*1.01 - _navBarHeight]; + +(_display displayCtrl 603) ctrlSetText "TACNET"; +(_display displayCtrl 604) ctrlSetText "Select an feed in the list below. To view the feed, double click on the item."; + + +(_display displayCtrl 603) ctrlCommit 0; +(_display displayCtrl 604) ctrlCommit 0; +(_display displayCtrl 604) ctrlEnable false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_login_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_login_CC.sqf new file mode 100644 index 0000000000..66bf7d109c --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_login_CC.sqf @@ -0,0 +1,6 @@ +private ["_deviceName"]; +_deviceName = _this select 0; +hint 'you are required to log in'; + +[_deviceName,"open","login"] spawn cse_fnc_setPopUpMenu_CC; + diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_notepad_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_notepad_CC.sqf new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_notepad_CC.sqf @@ -0,0 +1,2 @@ + + diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_settings_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_settings_CC.sqf new file mode 100644 index 0000000000..59e3287617 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_settings_CC.sqf @@ -0,0 +1,15 @@ +/** + * fn_openScreen_settings_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName"]; +_deviceName = _this select 0; +[_deviceName] call cse_fnc_clearDeviceScreen_CC; +[_deviceName,"full","black"] call cse_fnc_setBackground_CC; +[_deviceName,"top"] call cse_fnc_setNavBar_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_startUp_CC.sqf b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_startUp_CC.sqf new file mode 100644 index 0000000000..139597f9cb --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tabletScreens/functions/fn_openScreen_startUp_CC.sqf @@ -0,0 +1,2 @@ + + diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_clearDeviceScreen_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_clearDeviceScreen_CC.sqf new file mode 100644 index 0000000000..00886bd2c2 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_clearDeviceScreen_CC.sqf @@ -0,0 +1,47 @@ +/** + * fn_clearDeviceScreen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_cfg","_display","_excludeIDCs"]; +_deviceName = _this select 0; +_cfg = (MissionconfigFile >> _deviceName >> "controls"); +if (!isClass _cfg) then { + _cfg = (configFile >> _deviceName >> "controls"); +}; +disableSerialization; +_display = uiNamespace getvariable _deviceName; + +(_display displayCtrl 10) ctrlEnable true; + +_excludeIDCs = [-1,0,1,2,3,4,5,6, 606, 607, 608]; +if (isClass _cfg) then { + for [{_i=0},{_i < count _cfg},{_i=_i+1}] do { + if (isClass (_cfg select _i)) then { + private ["_idc","_ctrl"]; + _idc = getNumber ((_cfg select _i) >> "idc"); + if (!(_idc in _excludeIDCs)) then { + _ctrl = (_display displayCtrl _idc); + + //_Ctrl ctrlShow false; + if (_idc == 601) then { + _Ctrl ctrlSetPosition [100,100,0.1,0.1]; // lb cannot go for wierd dimensions? + } else { + if (_idc > 269 && _idc < 280) then { + _Ctrl ctrlSetPosition [100,100,0.1,0.1]; + } else { + _ctrl ctrlSetPosition [0,0,0,0]; + }; + }; + _ctrl ctrlCommit 0; + }; + + }; + }; +}; + diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_clickedOnMap_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_clickedOnMap_CC.sqf new file mode 100644 index 0000000000..80a94d6ac4 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_clickedOnMap_CC.sqf @@ -0,0 +1,218 @@ +/* +fnc_clickedOnMap.sqf +Usage: Displays CC Pop-up menu selection +Author: Glowbal + +Arguments: array [position (ARRAY)] + 0: Position 2D. Format [ X, Y ] +Returns: void + +Affects: Local +Executes: Local. Default execution when clicked on map in CC App. + +Example: + [0,0] call cse_fnc_clickedOnMap_CC; + +*/ + +private ["_position","_buttonWidth","_nearest","_found","_posTrackerIcon","_text","_ctrlBtn","_lastIDC","_deviceName","_settings","_sideBarRatio","_navBarRatio","_maxPositions","_sideBarHeight","_buttonHeightwithSpacing","_buttonSpacing","_buttonHeight","_display","_optionsPos"]; +//_args = _this; +_position = [_this, 0, [0,0], [[]],2] call BIS_fnc_param; + +[format["fnc_clickedOnMap %1", _this]] call cse_fnc_debug; +if (typeName _position != typeName []) exitwith {}; +disableSerialization; +_deviceName = call cse_fnc_getCurrentDeviceName_CC; +if (_deviceName == "") exitwith {}; + +if ([_deviceName] call cse_fnc_isSelectMenuOpen_CC) exitwith { + [_deviceName] call cse_fnc_removeSelectMenu_CC; +}; +_optionsPos = [(_position select 0), _position select 1]; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC; +_maxPositions = (_settings select 3) / 0.05; +_maxPositions = 12; + +_sideBarHeight = _sideBarRatio select 3; +_buttonHeightwithSpacing = _sideBarHeight / _maxPositions; +_buttonSpacing = _buttonHeightwithSpacing / 10; +_buttonHeight = _buttonHeightwithSpacing - _buttonSpacing; +_buttonWidth = (_sideBarRatio select 2) - 0.002; + _display = uiNamespace getvariable _deviceName; + +(_display displayCtrl 10) ctrlEnable false; +_position = (_display displayCtrl 10) ctrlMapScreenToWorld _position; +_position set [2, 0]; + +if ((_optionsPos select 0) + _buttonWidth > ((_settings select 0) + (_settings select 2))) then { + _buttonWidth = _buttonWidth - (((_optionsPos select 0) + _buttonWidth - ((_settings select 0) + (_settings select 2)))); +}; +_optionsPos set[2, _buttonWidth]; +_optionsPos set[3,_buttonHeight]; +_lastIDC = 260; +_nearest = 25; +_found = []; +{ + _side = _x select 6; + if (([_deviceName] call cse_fnc_getDeviceSide_CC) == _side) then { + _posTrackerIcon = +(_x select 1); + _posTrackerIcon set [2, 0]; + if ((_posTrackerIcon distance _position) < _nearest) then { + _nearest = _posTrackerIcon distance _position; + _found = _x; + }; + }; +}foreach CSE_TRACKER_ICONS; + + + +_foudIntelMarker = []; +if (CSE_TOGGLE_INTEL_LAYER_CC) then { + _nearest = 25; + { + _side =(_x select 3); + if (([_deviceName] call cse_fnc_getDeviceSide_CC) == _side) then { + _pos = (_x select 0); + if ((_pos distance _position) < _nearest) then { + _nearest = _pos distance _position; + _foudIntelMarker = _x; + }; + }; + }foreach CSE_INTEL_MARKER_COLLECTION_CC; +}; + +_foudRouteMarker = []; +if (CSE_TOGGLE_ROUTE_LAYER_CC) then { + _nearest = 25; + { + _side =(_x select 3); + if (([_deviceName] call cse_fnc_getDeviceSide_CC) == _side) then { + _pos = (_x select 0); + if ((_pos distance _position) < _nearest) then { + _nearest = _pos distance _position; + _foudRouteMarker = _x; + }; + }; + }foreach CSE_ROUTE_MARKER_COLLECTION_CC; +}; +/* +if (isnil "CSE_CLICKED_ON_MAP_OPTIONS_CC") then { + CSE_CLICKED_ON_MAP_OPTIONS_CC = []; +}; + +{ + if ([_found, _foudIntelMarker, _foudRouteMarker] call (_x select 0)) then { + _text =[_found, _foudIntelMarker, _foudRouteMarker] call (_x select 1); + _formattedCode = [_found, _foudIntelMarker, _foudRouteMarker] call (_x select 2); + + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _ctrlBtn ctrlSetText _text; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format[_formattedCode, _position,_deviceName]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; + }; +}foreach CSE_CLICKED_ON_MAP_OPTIONS_CC;*/ + +if !(_found isEqualTo []) then { + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _text = _found select 2; + if (_text == "") then { + _text = "icon"; + }; + CSE_CLICKED_ON_MAP_FOUND_CC = _found; + _ctrlBtn ctrlSetText format["Select: %1",_text]; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC; ['%2',%1] call cse_fnc_openIconSelectMenu_CC;", _position,_deviceName]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +}; + +if (true) then { + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _ctrlBtn ctrlSetText "SALUTE Report"; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC; ['%2',%1] call cse_fnc_openIntelMarkersMenu_CC;", _position,_deviceName]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +}; + +if (true) then { + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _ctrlBtn ctrlSetText "Route Planning"; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC; ['%2',%1] call cse_fnc_openRouteMarkersMenu_CC;", _position,_deviceName]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +}; + +if !(_foudIntelMarker isEqualTo []) then { + CSE_CLICKED_ON_MAP_FOUND_INTELMARKER_CC = _position; +/* + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _text = "Edit SALUTE"; + _ctrlBtn ctrlSetText _text; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC;[CSE_CLICKED_ON_MAP_FOUND_INTELMARKER_CC] call cse_fnc_editIntelMarker_CC;", _position,_deviceName,_found]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +*/ + /* END */ + + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _text = "Remove SALUTE"; + _ctrlBtn ctrlSetText _text; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC;[CSE_CLICKED_ON_MAP_FOUND_INTELMARKER_CC] call cse_fnc_removeIntelMarker_CC;", _position,_deviceName,_found]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +}; +if !(_foudRouteMarker isEqualTo []) then { + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _text = "Remove Route"; + CSE_CLICKED_ON_MAP_FOUND_ROUTEMARKER_CC = _position; + _ctrlBtn ctrlSetText _text; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC;[CSE_CLICKED_ON_MAP_FOUND_ROUTEMARKER_CC] call cse_fnc_removeRouteMarker_CC", _position,_deviceName,_found]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; +}; +(_display displayCtrl 10) ctrlEnable true; + +[_position,_display,_deviceName] spawn { + private ["_originalPos","_display","_position"]; + disableSerialization; + _position = _this select 0; + _display = _this select 1; + _originalPos = +((_display displayCtrl 10) ctrlMapWorldToScreen _position); + + waituntil {(((_display displayCtrl 10) ctrlMapWorldToScreen _position) select 0 != (_originalPos select 0))}; + [_this select 2] call cse_fnc_removeSelectMenu_CC; +}; + + +if !(_found isEqualTo []) then { + if (!CSE_ALLOW_LIVE_FEEDS_CC) exitwith {}; + _ctrlBtn = (_display displayCtrl _lastIDC); + _ctrlBtn ctrlSetPosition _optionsPos; + _unit = _found select 5; + + if ([_unit, _deviceName] call cse_fnc_canViewFeed_CC) then { + _text = "View Feed"; + [_unit] call cse_fnc_setLiveFeedTargetObj_CC; + + _ctrlBtn ctrlSetText _text; + _CtrlBtn ctrlSetEventHandler ["ButtonClick", format["['%2'] call cse_fnc_removeSelectMenu_CC; ['%2'] call cse_fnc_openScreen_liveFeed_CC;", _position,_deviceName, _unit]]; + _ctrlBtn ctrlCommit 0; + _lastIDC = _lastIDC + 1; + _optionsPos set[1, (_optionsPos select 1) + (_buttonHeight)]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentApplication_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentApplication_CC.sqf new file mode 100644 index 0000000000..fa03e0429f --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentApplication_CC.sqf @@ -0,0 +1,18 @@ +/** + * fn_getCurrentApplication_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return","_deviceName"]; + +_deviceName = (call cse_fnc_getCurrentDeviceName_CC); +_return = "home"; +if (!isnil format["CSE_CURRENT_APPLICATION_%1_CC",_deviceName]) then { + _return = call compile format["CSE_CURRENT_APPLICATION_%1_CC",_deviceName]; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentDeviceName_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentDeviceName_CC.sqf new file mode 100644 index 0000000000..f165910456 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getCurrentDeviceName_CC.sqf @@ -0,0 +1,23 @@ +/** + * fn_getCurrentDeviceName_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display"]; +disableSerialization; +if (isnil "CSE_CURRENT_DEVICE_NAME_CC") then { + CSE_CURRENT_DEVICE_NAME_CC = ""; +}; + + _display = findDisplay 590823; + if (isNull _display) then { + CSE_CURRENT_DEVICE_NAME_CC = ""; + } else { + +}; +CSE_CURRENT_DEVICE_NAME_CC \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_getDeviceSettings_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getDeviceSettings_CC.sqf new file mode 100644 index 0000000000..d8a384b8e3 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getDeviceSettings_CC.sqf @@ -0,0 +1,31 @@ +/** + * fn_getDeviceSettings_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_screenName","_settings"]; +_deviceName = _this select 0; +_settings = [0,0,0,0]; + +if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; +}; + +{ + if ((_x select 0) == _deviceName) exitwith { + _found = _x select 1; + if (!CSE_DISPLAY_CC_VIEW_FULL_SCREEN_CC) then { + _settings = [_found select 0, _found select 1, _found select 2,_found select 3]; + } else { + _settings = [safezoneX, safezoneY, safezoneW, safezoneH]; + }; + }; +}foreach CSE_REGISTERED_DEVICES_CC; + +_settings \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_getLastScreen_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getLastScreen_CC.sqf new file mode 100644 index 0000000000..49f24f18cc --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_getLastScreen_CC.sqf @@ -0,0 +1,15 @@ +/** + * fn_getLastScreen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_lastScreen"]; +_deviceName = _this select 0; + _lastScreen = player getvariable ["cse_cc_lastScreen_" + _deviceName, "home"]; + +_lastScreen diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_hasDevice_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_hasDevice_CC.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_isLoggedIn_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_isLoggedIn_CC.sqf new file mode 100644 index 0000000000..dbe3957220 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_isLoggedIn_CC.sqf @@ -0,0 +1,24 @@ +/** + * fn_isLoggedIn_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName"]; +_deviceName = _this select 0; +_loggedIn = false; + +_trackers = [player,_deviceName] call cse_fnc_getAllBFTItemsOfType_CC; +{ + _info = [_x] call cse_fnc_getTrackerInformation_CC; + if (_info select 3) then { + _loggedIn = true; + }; +}foreach _trackers; +//_trackerInfo = [_tracker] call cse_fnc_getTrackerInformation_CC; + +_loggedIn \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_isSideBarOpen_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_isSideBarOpen_CC.sqf new file mode 100644 index 0000000000..74e42270c2 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_isSideBarOpen_CC.sqf @@ -0,0 +1,16 @@ +/** + * fn_isSideBarOpen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_settings","_display","_return"]; +_deviceName = _this select 0; +_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC; +_display = uiNamespace getvariable _deviceName; + +!((ctrlPosition ((_display displayCtrl 2)) select 0 == 0) && ((ctrlPosition (_display displayCtrl 2)) select 1 == 0)) diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_manageLayers_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_manageLayers_CC.sqf new file mode 100644 index 0000000000..fcfc77f993 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_manageLayers_CC.sqf @@ -0,0 +1,23 @@ +/** + * fn_manageLayers_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_device","_position"]; +_device = call cse_fnc_getCurrentDeviceName_CC; + +[_device,"open","Manage Layers",format[""]] spawn cse_fnc_setPopUpMenu_CC; + +_layerNames = []; + +_opt = [ + ["Layer Name:","combo","",_layerNames], + ["Enable","btn",""] + ]; + +[_device,_opt] call cse_fnc_setPopUpOptions_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDeviceSmall_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDeviceSmall_CC.sqf new file mode 100644 index 0000000000..e89122db1d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDeviceSmall_CC.sqf @@ -0,0 +1,40 @@ +/** + * fn_openDeviceSmall_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +_this spawn { +if (isnil 'CSE_CC_BFT_LOOP_CC') then { + CSE_CC_BFT_LOOP_CC = false; +}; +waituntil {!CSE_CC_BFT_LOOP_CC}; + + + _deviceName = "cse_view_small"; + CSE_CURRENT_DEVICE_NAME_CC = _deviceName; + CSE_SMALL_SCREEN_DISPLAY_CC = true; + ("CSE_BFT_SMALL_LAYER" call BIS_fnc_rscLayer) cutRsc [_deviceName,"PLAIN",0]; + [_deviceName] spawn cse_fnc_displayBFT_CC; + //[_deviceName,"top"] call cse_fnc_setNavBar_CC; + [_deviceName,"main","full"] call cse_fnc_setMap_CC; + + disableSerialization; + _display = uiNamespace getvariable _deviceName; + _ctrl = (_display displayCtrl 10); + _ctrl ctrlSetBackgroundColor [1, 1, 1, 0]; + _ctrl ctrlCommit 0; + while {(!dialog && alive player)} do { + _pos = getPos player; + _pos set [1, (_pos select 1) + 300]; + _pos set [0, (_pos select 0) - 350]; + _ctrl ctrlMapAnimAdd [0, 0.3, _pos]; + ctrlMapAnimCommit _ctrl; + }; + ("CSE_BFT_SMALL_LAYER" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; + CSE_SMALL_SCREEN_DISPLAY_CC = false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDevice_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDevice_CC.sqf new file mode 100644 index 0000000000..ce074f7bd2 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openDevice_CC.sqf @@ -0,0 +1,24 @@ +/** + * fn_openDevice_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName"]; +_deviceName = _this select 0; + +disableSerialization; +createDialog _deviceName; +CSE_CURRENT_DEVICE_NAME_CC = _deviceName; +CSE_SMALL_SCREEN_DISPLAY_CC = false; +// [_deviceName, 1] spawn cse_fnc_showLoadingScreen_CC; +[_deviceName] call cse_fnc_clearDeviceScreen_CC; +[_deviceName,"full"] call cse_fnc_setBackground_CC; +[_deviceName,"top"] call cse_fnc_setNavBar_CC; +[_deviceName,"hidden"] call cse_fnc_setSideBar_CC; +[_deviceName,[_deviceName] call cse_fnc_getCurrentApplication_CC] call cse_fnc_openScreen_CC; +[_deviceName] call cse_fnc_displayBFT_CC; diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIconSelectMenu_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIconSelectMenu_CC.sqf new file mode 100644 index 0000000000..f48409206a --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIconSelectMenu_CC.sqf @@ -0,0 +1,62 @@ +/** + * fn_openIconSelectMenu_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_device","_position", "_unit", "_currentInfo", "_opt"]; +_device = _this select 0; +_position = _this select 1; + + +// figure out side with device! +[_device,"open","SELECTED TRACKER", format["[CSE_CLICKED_ON_MAP_FOUND_CC, _this] call cse_fnc_updateTrackerInfo_CC;"]] call cse_fnc_setPopUpMenu_CC; + +_unit = CSE_CLICKED_ON_MAP_FOUND_CC select 5; +_currentInfo = _unit getvariable ["cse_bft_info_cc",["Infantry"," ",true,false]]; + +_opt = [ + ["Type:","combo","", + ["Infantry","Motorized","Plane","Helicopter","Armor","Naval","HQ","Medical","Maintanance","Artillery","Mortar","Service","Recon","Mechanized","uav","Unknown"] + ], + [_currentInfo select 0,"input", "", _currentInfo select 1] + ]; +[_device,_opt] call cse_fnc_setPopUpOptions_CC; + + +cse_fnc_updateTrackerInfo_CC = { + private ["_unit","_info","_currentInfo","_deviceName","_sideBarN", "_sideBarFullScreen"]; + _unit = CSE_CLICKED_ON_MAP_FOUND_CC select 5; + _info = _this select 1; + _currentInfo = _unit getvariable ["cse_bft_info_cc",["Infantry"," ",true,false]]; + _currentInfo set [0, _info select 0]; + + _deviceName = [] call cse_fnc_getCurrentDeviceName_CC; + _sideBarFullScreen = { + private["_deviceName","_cfg","_allowSidebar"]; + _deviceName = _this select 0; + + _allowSidebar = 0; + if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; + }; + + { + if (_x select 0 == _deviceName) exitwith { + _allowSidebar = _x select 2; + }; + }foreach CSE_REGISTERED_DEVICES_CC; + _allowSidebar + }; + + _sideBarN = ([_deviceName] call _sideBarFullScreen); + + if (_unit == player || _sideBarN == 1) then { + _currentInfo set [1, _info select 1]; + }; + _unit setvariable ["cse_bft_info_cc",_currentInfo, true]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIntelMarkersMenu_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIntelMarkersMenu_CC.sqf new file mode 100644 index 0000000000..beee9cfc98 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openIntelMarkersMenu_CC.sqf @@ -0,0 +1,28 @@ +/** + * fn_openIntelMarkersMenu_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_device","_position", "_opt"]; +_device = _this select 0; +_position = _this select 1; + +[_device,"open","SALUTE Report",format["[_this,%1,'intel', ([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC)] call cse_fnc_placeMarker_CC",_position]] call cse_fnc_setPopUpMenu_CC; + + +_opt = [ + ["Type:","combo","", + ["Infantry","Motorized","Plane","Helicopter","Armor","Naval","HQ","Medical","Maintanance","Artillery","Mortar","Service","Recon","Mechanized","uav","Installation","Unknown"] + ], + ["Side:","combo","",["BLUFOR","OPFOR","GREENFOR","UNKNOWN"]], + ["direction:","combo","",["Static","North","North East","East","South East","South","South West","West","North West"]], + ["Size:","combo","",["Pax","Fire Team","Section","Platoon","Company","Battalion","Regiment", "Brigade"]], + ["","combo","",["1x","2x","3x","4x","5x","6x", "7x"]], + ["Description:","input",""] + ]; +[_device,_opt] call cse_fnc_setPopUpOptions_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openLastScreen_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openLastScreen_CC.sqf new file mode 100644 index 0000000000..3ccddcfb49 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openLastScreen_CC.sqf @@ -0,0 +1,14 @@ +/** + * fn_openLastScreen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName"]; +_deviceName = _this select 0; + +[_deviceName,[_deviceName] call cse_fnc_getLastScreen_CC] call cse_fnc_openScreen_CC; diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openRouteMarkersMenu_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openRouteMarkersMenu_CC.sqf new file mode 100644 index 0000000000..dd271e8408 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openRouteMarkersMenu_CC.sqf @@ -0,0 +1,30 @@ +/** + * fn_openRouteMarkersMenu_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_device","_position"]; +_device = _this select 0; +_position = _this select 1; + +[_device,"open","Route Planning",format["[_this,%1,'route', ([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC)] call cse_fnc_placeMarker_CC",_position]] call cse_fnc_setPopUpMenu_CC; + +if (isnil "_layerNames") then { + _layerNames = []; +}; +_opt = [ + ["Type:","combo","",["Dot","Waypoint","ReOrg","Crossing","Ambush","LZ","HLS","Destroy","Capture","Secure","Danger","Avoid","Arrow"]], + ["Color:","combo","",["blue","red","green", "yellow", "purple", "orange", "white", "black"]], + ["Text:","input",""] + ]; + +if !(_layerNames isEqualTo []) then { + _opt pushback ["Layer:","combo","",_layerNames]; +}; + +[_device,_opt] call cse_fnc_setPopUpOptions_CC; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_openScreen_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openScreen_CC.sqf new file mode 100644 index 0000000000..99056bbb03 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_openScreen_CC.sqf @@ -0,0 +1,48 @@ +/** + * fn_openScreen_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_screenName","_init","_cfg", "_availablePrograms"]; +_deviceName = _this select 0; +_screenName = _this select 1; + + +[format["CC - openScreen: %1 test",_screenName],2] call cse_fnc_debug; +[_deviceName,"full"] call cse_fnc_setBackground_CC; +_availablePrograms = []; +_cfg = (missionConfigFile >> "Combat_Space_Enhancement" >> "command_and_control" >> "applications" >> _screenName); + +_found = false; +{ + if ((_x select 0) == _screenName) exitwith { + [_deviceName] call compile (_x select 6); + _found = true; + }; +}foreach CSE_REGISTERED_APPLICATIONS_CC; + +if (_found) then { + //_init = getText (_cfg>> "init"); + //[_deviceName] spawn compile _init; +} else { + [_deviceName] spawn cse_fnc_openScreen_home_CC; + _screenName = "home"; + [_deviceName,"show"] call cse_fnc_setBottomBar_CC; +}; + + +CSE_PREVIOUS_APPLICATION_CC = [_deviceName] call cse_fnc_getCurrentApplication_CC; +//CSE_CURRENT_APPLICATION_CC = _screenName; +call compile format["CSE_CURRENT_APPLICATION_%1_CC = '%2';",_deviceName,_screenName]; + + +//player sidechat format[" Current Application is set to: %1",call compile format["CSE_CURRENT_APPLICATION_%1_CC",_deviceName]]; +if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then { + [_deviceName,"right"] call cse_fnc_setSideBar_CC; +}; +//player setvariable ["cse_cc_lastScreen_" + _deviceName, _screenName]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarkerGlobal_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarkerGlobal_CC.sqf new file mode 100644 index 0000000000..f98cba36c3 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarkerGlobal_CC.sqf @@ -0,0 +1,142 @@ +/** + * fn_placeMarker_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_args","_position","_type"]; +_args = (_this select 0); +_position = _this select 1; +_type = _this select 2; +_side = _this select 3; + +if (isnil "CSE_SIDE_WEST_COLOR") then { + _r = profilenamespace getvariable ['Map_BLUFOR_R',0]; + _g = profilenamespace getvariable ['Map_BLUFOR_G',0.8]; + _b = profilenamespace getvariable ['Map_BLUFOR_B',1]; + _a = profilenamespace getvariable ['Map_BLUFOR_A',0.8]; + CSE_SIDE_WEST_COLOR = [_r,_g,_b,_a]; + + CSE_SIDE_EAST_COLOR = + [ + profilenamespace getvariable ['Map_OPFOR_R',1], + profilenamespace getvariable ['Map_OPFOR_G',0.5], + profilenamespace getvariable ['Map_OPFOR_B',0.5], + profilenamespace getvariable ['Map_OPFOR_A',0.8] + ]; + + _r = profilenamespace getvariable ['Map_Independent_R',0]; + _g = profilenamespace getvariable ['Map_Independent_G',1]; + _b = profilenamespace getvariable ['Map_Independent_B',1]; + _a = profilenamespace getvariable ['Map_OPFOR_A',0.8]; + CSE_SIDE_IND_COLOR = [_r,_g,_b,_a]; +}; + +if (_type == "intel") exitwith { + CSE_TOGGLE_INTEL_LAYER_CC = true; + if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then { + CSE_INTEL_MARKER_COLLECTION_CC = []; + }; + _usedDesc = false; + _text = ""; + if ((_args select 5) == "") then { + _text = _text + (_args select 0); + _text = _text + " / " + (_args select 2); + _text = _text + " / " + (_args select 4); + _text = _text + (_args select 3); + } else { + _text = _args select 5; + _usedDesc = true; + }; + _text = _text + format["(%1:%2)",Date select 3, Date select 4]; + + _prefix = switch (_args select 1) do { + case "BLUFOR": {"b_"}; + case "OPFOR": {"o_"}; + case "GREENFOR": {"n_"}; + default {"n_"}; + }; + _prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix; + _icon = switch (_args select 0) do { + case "Infantry": {_prefix+"inf.paa"}; + case "Motorized": {_prefix+"motor_inf.paa"}; + case "Plane": {_prefix+"plane.paa"}; + case "Helicopter": {_prefix+"air.paa"}; + case "Armor": {_prefix+"armor.paa"}; + case "Naval": {_prefix+"naval.paa"}; + case "HQ": {_prefix+"hq.paa"}; + case "Medical": {_prefix+"med.paa"}; + case "Maintanance": {_prefix+"maint.paa"}; + case "Artillery": {_prefix+"art.paa"}; + case "Mortar": {_prefix+"mortar.paa"}; + case "Service": {_prefix+"service.paa"}; + case "Recon": {_prefix+"recon.paa"}; + case "Mechanized": {_prefix+"mech_inf.paa"}; + case "uav": {_prefix+"uav.paa"}; + case "Installation": {_prefix+"installation.paa"}; + default {_prefix+"unknown.paa"}; + }; + + + _color = switch (_args select 1) do { + case "BLUFOR": {CSE_SIDE_WEST_COLOR}; + case "OPFOR": {CSE_SIDE_EAST_COLOR}; + case "GREENFOR": {CSE_SIDE_IND_COLOR}; + case "UNKNOWN": {[0.6,0.2,0.1,0.8]}; + default {CSE_SIDE_IND_COLOR}; + }; + + _placementArgs = [ _icon, _text, +_color]; + [format["Placed a Marker: %1", [_position, _placementArgs, time, _side, _args select 6, _usedDesc]]] call cse_fnc_debug; + CSE_INTEL_MARKER_COLLECTION_CC pushback [_position,_placementArgs,time, _side, _args select 6, _usedDesc]; +}; + +if (_type == "route") exitwith { + CSE_TOGGLE_ROUTE_LAYER_CC = true; + if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then { + CSE_ROUTE_MARKER_COLLECTION_CC = []; + }; + _text = ""; + _text = _text + (_args select 2); + _text = _text + format["(%1:%2)",Date select 3, Date select 4]; + + + _prefix = "\A3\ui_f\data\map\markers\military\"; + _icon = switch (_args select 0) do { + case "waypoint": {"\A3\ui_f\data\map\groupicons\waypoint.paa"}; + case "ReOrg": {"\A3\ui_f\data\map\groupicons\waypoint.paa"}; + case "Crossing": {"\A3\ui_f\data\map\markers\military\pickup_CA.paa"}; + case "Ambush": {"\A3\ui_f\data\map\markers\military\ambush_CA.paa"}; + case "LZ": {"\A3\ui_f\data\map\markers\military\pickup_CA.paa"}; + case "HLS": {"\A3\ui_f\data\map\markers\military\pickup_CA.paa"}; + case "Destory": {"\A3\ui_f\data\map\markers\military\destroy_CA.paa"}; + case "Capture": {"\A3\ui_f\data\map\markers\military\objective_CA.paa"}; + case "Secure": {"\A3\ui_f\data\map\markers\military\objective_CA.paa"}; + case "Danger": {"\A3\ui_f\data\map\markers\military\warning_CA.paa"}; + case "Avoid": {"\A3\ui_f\data\map\markers\military\warning_CA.paa"}; + case "Dot": {"\A3\ui_f\data\map\markers\military\dot_CA.paa"}; + case "Arrow": {"\A3\ui_f\data\map\markers\military\arrow_CA.paa"}; + default {"\A3\ui_f\data\map\groupicons\waypoint.paa"}; + }; + + _color = switch (_args select 1) do { + case "blue": {CSE_SIDE_WEST_COLOR}; + case "red": {CSE_SIDE_EAST_COLOR}; + case "green": {CSE_SIDE_IND_COLOR}; + case "yellow": {[0.74, 0.74, 0.08, 0.9]}; + case "orange": {[1, 0.51, 0.08, 0.9]}; + case "white": {[1,1,1, 0.9]}; + case "black": {[0,0,0, 0.9]}; + case "purple": {[0.34,0.6,0.42, 0.9]}; + default {CSE_SIDE_IND_COLOR}; + }; + + _placementArgs = [ _icon, _text, +_color]; + CSE_ROUTE_MARKER_COLLECTION_CC pushback [_position,_placementArgs,time, _side, _args select 3]; + [format["Placed a Marker: %1", [_position,_placementArgs,time, _side, _args select 3]]] call cse_fnc_debug; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarker_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarker_CC.sqf new file mode 100644 index 0000000000..5317a1c8ea --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_placeMarker_CC.sqf @@ -0,0 +1,12 @@ +/** + * fn_placeMarker_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +[_this, "cse_fnc_placeMarkerGlobal_CC", true, true] spawn BIS_fnc_MP; +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerApp_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerApp_CC.sqf new file mode 100644 index 0000000000..8cbfc8c731 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerApp_CC.sqf @@ -0,0 +1,25 @@ +/** + * fn_registerApp_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_displayName","_icon","_hideOnDesktop","_side","_sideBar","_init", "_devices"]; +_name = _this select 0; +_displayName = _this select 1; +_icon = _this select 2; +_hideOnDesktop = _this select 3; +_sideBar = _this select 4; +_side = _this select 5; +_init = _this select 6; +_devices = _this select 7; + +if (isnil 'CSE_REGISTERED_APPLICATIONS_CC') then { + CSE_REGISTERED_APPLICATIONS_CC = []; +}; + +CSE_REGISTERED_APPLICATIONS_CC pushback [_name,_displayName,_icon,_hideOnDesktop,_sideBar,_side,_init, _devices]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerDevice_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerDevice_CC.sqf new file mode 100644 index 0000000000..9c2f1ab054 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_registerDevice_CC.sqf @@ -0,0 +1,24 @@ +/** + * fn_registerDevice_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_ratio","_typeOfSideBar"]; +_deviceName = _this select 0; +_ratio = _this select 1; +_typeOfSideBar = _this select 2; +_side = _this select 3; + +//if (!isclass (ConfigFile >> _deviceName)) exitwith {}; +if (isnil 'CSE_REGISTERED_DEVICES_CC') then { + CSE_REGISTERED_DEVICES_CC = []; +}; +if (count _ratio != 4) exitwith {}; +//_navRatio = [_ratio select 0, _ratio select 1, _ratio select 2, (_ratio select 3) / 13]; + +CSE_REGISTERED_DEVICES_CC pushback [_deviceName,_ratio,_typeOfSideBar,_side]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_setLoggedIn_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_setLoggedIn_CC.sqf new file mode 100644 index 0000000000..d162c11d8d --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_setLoggedIn_CC.sqf @@ -0,0 +1,20 @@ +/** + * fn_setLoggedIn_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_loggedIn","_trackers"]; +_deviceName = _this select 0; +_loggedIn = _this select 1; + +_trackers = [player,_deviceName] call cse_fnc_getAllBFTItemsOfType_CC; +{ + _info = [_x] call cse_fnc_getTrackerInformation_CC; + _info set [3, _loggedIn]; + [_x, _info] call cse_fnc_setTrackerInformation_CC; +}foreach _trackers; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/tablets/functions/fn_viewLiveFeed_CC.sqf b/TO_MERGE/cse/sys_cc/tablets/functions/fn_viewLiveFeed_CC.sqf new file mode 100644 index 0000000000..5d450a2823 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/tablets/functions/fn_viewLiveFeed_CC.sqf @@ -0,0 +1,39 @@ +/** + * fn_viewLiveFeed_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_deviceName","_display","_view","_ctrl", "_camera"]; + +_view = _this select 0; + +disableSerialization; +_deviceName = [] call cse_fnc_getCurrentDeviceName_CC; +[format["fn_viewLiveFeed_CC %1 %2",_this, _deviceName]] call cse_fnc_debug; +_display = uiNamespace getvariable _deviceName; +_ctrl = (_display displayCtrl 20); + +if (_view) then { + _camera = objNull; + if (isnil "CSE_PIP_CAMERA_CC") then { + _camera = "camera" camCreate (position player); + CSE_PIP_CAMERA_CC = _camera; + _camera cameraEffect ["INTERNAL", "BACK","rendertarget0"]; + } else { + _camera = CSE_PIP_CAMERA_CC; + //_camera attachto [vehicle CSE_LIVEFEED_TARGET_CC,[-0.18,0.1,0.1], "head" ]; + }; + [format["VIEW LIVE TARGET: %1 %2", CSE_LIVEFEED_TARGET_CC, _camera]] call cse_fnc_debug; + "rendertarget0" setPiPEffect [0]; + _ctrl ctrlsettext "#(argb,256,256,1)r2t(rendertarget0,1.0)"; + _ctrl ctrlcommit 0; + +} else { + _ctrl ctrlsettext ""; + _ctrl ctrlcommit 0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/RscTitles.hpp b/TO_MERGE/cse/sys_cc/ui/RscTitles.hpp new file mode 100644 index 0000000000..50dd1552ca --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/RscTitles.hpp @@ -0,0 +1,75 @@ +class RscTitles{ + //#include "cse_m_tablet.hpp" + //#include "cse_view_small.hpp" + + + class cse_future_soldier_blueforce { + onLoad = "uiNamespace setVariable ['cse_future_soldier_blueforce', _this select 0];"; + duration = 10e10; + fadein = 0; + fadeout = 0; + idd = 590824; + movingEnable = false; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = 3; + y = 2; + w = 1; + h = 0.5; + text = ""; + }; + }; + + class controls { + + + + class display_hud_backgroundImg: cse_gui_backgroundBase { + idc = 1; + x = safezoneX + 0.01; + y = safezoneY + 0.01; + w = 0.4; + h = 0.4; + text = "cse\cse_sys_cc\data\empty_background2.paa"; + colorText[] = {0, 0, 0, 0.2}; + }; + + + class informationDisplay: cse_gui_staticBase { + idc = 2; + x = safezoneX + 0.02; + y = safezoneY + 0.02; + w = 0.31; + h = 0.05; + style = ST_LEFT; + sizeEx = 0.03921; + colorText[] = {0.95, 0.95, 0.95, 0.8}; + colorBackground[] = {0, 0, 0, 0}; + text = "LOCAL TIME: 05:21"; + }; + class informationDisplay2: informationDisplay { + idc = 3; + //x = safezoneX + 0.05; + y = safezoneY + 0.07; + text = "OBJECTIVE: 0534 1235"; + }; + class informationDisplay3: informationDisplay { + idc = 4; + //x = safezoneX + 0.05; + y = safezoneY + 0.12; + text = "DISTANCE: 1530m"; + }; + class informationDisplay4: informationDisplay { + idc = 5; + //x = safezoneX + 0.05; + y = safezoneY + 0.17; + text = "SPEED: 10km"; + }; + + + + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/cse_m_pda.hpp b/TO_MERGE/cse/sys_cc/ui/cse_m_pda.hpp new file mode 100644 index 0000000000..f8506f6106 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/cse_m_pda.hpp @@ -0,0 +1,17 @@ + +class cse_m_pda : cse_m_tablet { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_pda', _this select 0]; ['cse_m_pda', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_pda', false] call cse_fnc_gui_blurScreen;"; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_pda.paa"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/cse_m_tablet.hpp b/TO_MERGE/cse/sys_cc/ui/cse_m_tablet.hpp new file mode 100644 index 0000000000..f0860bbc3c --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/cse_m_tablet.hpp @@ -0,0 +1,776 @@ +class cse_m_tablet { + idd = 590823; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_m_tablet', _this select 0]; ['cse_m_tablet', true] call cse_fnc_gui_blurScreen;"; + onUnload = "['cse_m_tablet', false] call cse_fnc_gui_blurScreen;"; + duration = 10e10; + fadein = 0; + fadeout = 0; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_tablet.paa"; + }; + }; + + class controls { + class cse_empty_background : cse_gui_backgroundBase { + idc = 1; + x = 0; + y = 0; + w = 0; + h = 0; + text = "cse\cse_sys_cc\data\empty_background2.paa"; + }; + + class cse_icon1 : cse_gui_backgroundBase { + idc = 100; + x = 0; + y = 0; + w = 0; + h = 0; + text = ""; + }; + + class cse_icon2 : cse_icon1 { + idc = 101; + }; + class cse_icon3 : cse_icon1 { + idc = 102; + }; + class cse_icon4 : cse_icon1 { + idc = 103; + }; + class cse_icon5 : cse_icon1 { + idc = 104; + }; + class cse_icon6 : cse_icon1 { + idc = 105; + }; + class cse_icon7 : cse_icon1 { + idc = 106; + }; + class cse_icon8 : cse_icon1 { + idc = 107; + }; + class cse_icon9 : cse_icon1 { + idc = 108; + }; + class cse_icon10 : cse_icon1 { + idc = 109; + }; + class cse_icon11 : cse_icon1 { + idc = 110; + }; + class cse_icon12 : cse_icon1 { + idc = 111; + }; + class cse_icon13 : cse_icon1 { + idc = 112; + }; + + class cse_icon_button1 : cse_gui_buttonBase { + idc = 120; + x = 0; + y = 0; + w = 0; + h = 0; + color[] = {1.0, 1.0, 1.0, 0}; + color2[] = {1.0, 1.0, 1.0, 0}; + colorBackground[] = {1.0, 1.0, 1.0, 0}; + colorbackground2[] = {1.0, 1.0, 1.0, 0}; + colorDisabled[] = {1.0, 1.0, 1.0, 0}; + text = ""; + animTextureNormal = ""; + animTextureDisabled = ""; + animTextureOver = ""; + animTextureFocused = ""; + animTexturePressed = ""; + animTextureDefault = ""; + }; + + class cse_icon_button2 : cse_icon_button1 { + idc = 121; + }; + class cse_icon_button3 : cse_icon_button1 { + idc = 122; + }; + class cse_icon_button4 : cse_icon_button1 { + idc = 123; + }; + class cse_icon_button5 : cse_icon_button1 { + idc = 124; + }; + class cse_icon_button6 : cse_icon_button1 { + idc = 125; + }; + class cse_icon_button7 : cse_icon_button1 { + idc = 126; + }; + class cse_icon_button8 : cse_icon_button1 { + idc = 127; + }; + class cse_icon_button9 : cse_icon_button1 { + idc = 128; + }; + class cse_icon_button10 : cse_icon_button1 { + idc = 129; + }; + class cse_icon_button11 : cse_icon_button1 { + idc = 130; + }; + class cse_icon_button12 : cse_icon_button1 { + idc = 131; + }; + class cse_icon_button13 : cse_icon_button1 { + idc = 132; + }; + + class cse_icon_label1 : cse_gui_staticBase { + idc = 140; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_CENTER; + }; + class cse_icon_label2: cse_icon_label1 { + idc = 141; + }; + class cse_icon_label3: cse_icon_label1 { + idc = 142; + }; + class cse_icon_label4: cse_icon_label1 { + idc = 143; + }; + class cse_icon_label5: cse_icon_label1 { + idc = 144; + }; + class cse_icon_label6: cse_icon_label1 { + idc = 145; + }; + + + + class mapDisplay1: cse_gui_mapBase { + idc = 10; + x = 100; + y = 100; + w = 0.3; + h = 0.3; + type = 101; + moveOnEdges = 0; + showCountourInterval = 1; + }; + + // 150 t/m 165 + class cse_popUpMenuBackground: cse_gui_backgroundBase { + idc = 150; + x = 0; + y = 0; + w = 0; + h = 0; + //text = "cse\cse_sys_cc\data\dropdown_menu2.paa"; + type = CT_STATIC; + style = ST_LEFT + ST_SHADOW; + text = ""; + colorText[] = {0.95,0.95,0.95,1}; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + class cse_popUpMenuBackgroundheader: cse_popUpMenuBackground { + idc = 151; + colorBackground[] = {0.05,0.05,0.05,1}; + }; + class cse_popUpMenuHeaderTitle: cse_gui_staticBase { + idc = 152; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_CENTER; + }; + class popUpMenuBtn_accept: cse_gui_buttonBase { + idc = 153; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_CENTER; + /*animTextureNormal = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDisabled = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureOver = "cse\cse_sys_cc\data\button_dropdown_menu_hover.paa"; + animTextureFocused = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTexturePressed = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDefault = "cse\cse_sys_cc\data\button_dropdown_menu.paa";*/ + animTextureNormal = "#(argb,8,8,3)color(0.2,0.2,0.2,1)"; + animTextureDisabled = "#(argb,8,8,3)color(0.4,0.4,0.4,1)"; + animTextureOver = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureFocused = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTexturePressed = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureDefault = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + colorBackground[] = {0.97,0.97,0.97,1}; + colorbackground2[] = {0.97,0.97,0.97,1}; + colorDisabled[] = {0.97,0.97,0.97,1}; + colorFocused[] = {0.97,0.97,0.97,1}; + colorBackgroundFocused[] = {1,1,1,1}; + text = "Accept"; + }; + class popUpMenuBtn_close: popUpMenuBtn_accept { + idc = 154; + text = "Close"; + }; + + class cse_bottomBar: cse_gui_backgroundBase { + idc = 155; + x = 0; + y = 0; + w = 0; + h = 0; + //text = "cse\cse_sys_cc\data\dropdown_menu2.paa"; + type = CT_STATIC; + style = ST_LEFT + ST_SHADOW; + text = ""; + colorText[] = {0.95,0.95,0.95,1}; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + class bottomBar_Text: cse_gui_staticBase { + idc = 156; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_LEFT; + sizeEx = 0.025; + }; + + class cse_sidebar_background : cse_gui_backgroundBase { + idc = 2; + x = 0; + y = 0; + w = 0; + h = 0; + //text = "cse\cse_sys_cc\data\dropdown_menu2.paa"; + type = CT_STATIC; + style = ST_LEFT + ST_SHADOW; + text =""; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + + class mapDisplay2: mapDisplay1 { + idc = 11; + }; + + class cse_navBar_background : cse_sidebar_background { + idc = 3; + x = 0; + y = 0; + w = 0; + h = 0; + //text = "cse\cse_sys_cc\data\dropdown_menu2.paa"; + text = ""; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0.1,0.1,0.1,1}; + }; + class cse_toggleSideBar : cse_gui_buttonBase { + idc = 4; + x = 0; + y = 0; + w = 0; + h = 0; + color[] = {0.97,0.97,0.97,1}; + color2[] = {0.97,0.97,0.97,1}; + colorBackground[] = {0.97,0.97,0.97,0.7}; + colorbackground2[] = {0.97,0.97,0.97, 0.7}; + colorDisabled[] = {0.97,0.97,0.97, 0.6}; + colorFocused[] = {0.97,0.97,0.97, 1}; + colorBackgroundFocused[] = {0.97,0.97,0.97, 1}; + text = ""; + animTextureNormal = "cse\cse_sys_cc\data\menuIcon.paa"; + animTextureDisabled = "cse\cse_sys_cc\data\menuIcon.paa"; + animTextureOver = "cse\cse_sys_cc\data\menuIcon.paa"; + animTextureFocused = "cse\cse_sys_cc\data\menuIcon.paa"; + animTexturePressed = "cse\cse_sys_cc\data\menuIcon.paa"; + animTextureDefault = "cse\cse_sys_cc\data\menuIcon.paa"; + + }; + + class information_label1: cse_gui_staticBase { + idc = 5; + style = ST_RIGHT; + text = ""; + x = 0; + y = 0; + w = 0; + h = 0; + }; + + class cse_homeIconNavBarBtn : cse_gui_buttonBase { + idc = 198; + x = 0; + y = 0; + w = 0; + h = 0; + color[] = {1.0, 1.0, 1.0, 1}; + color2[] = {1.0, 1.0, 1.0, 1}; + colorBackground[] = {1.0, 1.0, 1.0, 0.7}; + colorbackground2[] = {1.0, 1.0, 1.0, 0.7}; + colorDisabled[] = {1.0, 1.0, 1.0, 0.6}; + colorFocused[] = {1.0, 1.0, 1.0, 1}; + colorBackgroundFocused[] = {1.0, 1.0, 1.0, 1}; + text = ""; + animTextureNormal = "cse\cse_sys_cc\data\home_icon.paa"; + animTextureDisabled = "cse\cse_sys_cc\data\home_icon.paa"; + animTextureOver = "cse\cse_sys_cc\data\home_icon.paa"; + animTextureFocused = "cse\cse_sys_cc\data\home_icon.paa"; + animTexturePressed = "cse\cse_sys_cc\data\home_icon.paa"; + animTextureDefault = "cse\cse_sys_cc\data\home_icon.paa"; + + }; + + class cse_navBarIconHome: cse_icon1 { + idc = 199; + }; + class cse_navBarIcon1: cse_navBarIconHome { + idc = 200; + }; + + + class ppDisplay: cse_gui_backgroundBase { + idc = 20; + type = 0; + style = 48; + text = ""; + x = 0; + y = 0; + w = 0; + h = 0; + colorText[] = {1,1,1,1}; + colorBackground[] = {0, 0, 0, 0.3}; + font = "TahomaB"; + sizeEx = 0; + lineSpacing = 0; + fixedWidth = 0; + shadow = 0; + }; + class ppDisplay2: ppDisplay { + idc = 21; + }; + + + class sideBar_label1: cse_gui_staticBase{ + idc = 40; + x = 0; + y = 0; + w = 0; + h = 0; + text = "hi"; + }; + class sideBar_label2: sideBar_label1{ + idc = 41; + }; + class sideBar_label3: sideBar_label1{ + idc = 42; + }; + class sideBar_label4: sideBar_label1{ + idc = 43; + }; + class sideBar_label5: sideBar_label1{ + idc = 44; + }; + class sideBar_label6: sideBar_label1{ + idc = 45; + }; + class sideBar_label7: sideBar_label1{ + idc = 46; + }; + class sideBar_label8: sideBar_label1{ + idc = 47; + }; + class sideBar_label9: sideBar_label1{ + idc = 48; + }; + class sideBar_label10: sideBar_label1{ + idc = 49; + }; + + class sideBar_cb1: cse_gui_comboBoxBase{ + idc = 50; + x = 0; + y = 0; + w = 0; + h = 0; + }; + class sideBar_cb2: sideBar_cb1{ + idc = 51; + }; + class sideBar_lb3: sideBar_cb1{ + idc = 52; + }; + class sideBar_lb4: sideBar_cb1{ + idc = 53; + }; + class sideBar_lb5: sideBar_cb1{ + idc = 54; + }; + class sideBar_lb6: sideBar_cb1{ + idc = 55; + }; + class sideBar_lb7: sideBar_cb1{ + idc = 56; + }; + class sideBar_lb8: sideBar_cb1{ + idc = 57; + }; + class sideBar_lb9: sideBar_cb1{ + idc = 58; + }; + class sideBar_lb10: sideBar_cb1{ + idc = 59; + }; + + class sideBar_button1: cse_gui_buttonBase { + idc = 60; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_CENTER; + /*animTextureNormal = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDisabled = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureOver = "cse\cse_sys_cc\data\button_dropdown_menu_hover.paa"; + animTextureFocused = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTexturePressed = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDefault = "cse\cse_sys_cc\data\button_dropdown_menu.paa";*/ + animTextureNormal = "#(argb,8,8,3)color(0.2,0.2,0.2,1)"; + animTextureDisabled = "#(argb,8,8,3)color(0.4,0.4,0.4,1)"; + animTextureOver = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureFocused = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTexturePressed = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureDefault = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.9,0.9,0.9,1}; + colorFocused[] = {1,1,1,1}; + color[] = {0.9,0.9,0.9, 1}; + color2[] = {1,1,1, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + }; + class sideBar_button2: sideBar_button1 { + idc = 61; + }; + class sideBar_button3: sideBar_button1 { + idc = 62; + }; + class sideBar_button4: sideBar_button1 { + idc = 63; + }; + class sideBar_button5: sideBar_button1 { + idc = 64; + }; + class sideBar_button6: sideBar_button1 { + idc = 65; + }; + class sideBar_button7: sideBar_button1 { + idc = 66; + }; + class sideBar_button8: sideBar_button1 { + idc = 67; + }; + class sideBar_button9: sideBar_button1 { + idc = 68; + }; + class sideBar_button10: sideBar_button1 { + idc = 69; + }; + + class main_label1: cse_gui_staticBase{ + idc = 240; + x = 0; + y = 0; + w = 0; + h = 0; + text = ""; + style = ST_RIGHT; + }; + class main_label2: main_label1 { + idc = 241; + }; + class main_label3: main_label1 { + idc = 242; + }; + class main_label4: main_label1 { + idc = 243; + }; + class main_label5: main_label1 { + idc = 244; + }; + class main_label6: main_label1 { + idc = 245; + }; + class main_label7: main_label1 { + idc = 246; + }; + class main_label8: main_label1 { + idc = 247; + }; + class main_label9: main_label1 { + idc = 248; + }; + class main_label10: main_label1 { + idc = 249; + }; + + class main_combo1: cse_gui_comboBoxBase{ + idc = 250; + x = 0; + y = 0; + w = 0; + h = 0; + sizeEx = 0.031; + wholeHeight = 0.9; + }; + class main_combo2: main_combo1{ + idc = 251; + }; + class main_combo3: main_combo1{ + idc = 252; + }; + class main_combo4: main_combo1{ + idc = 253; + }; + class main_combo5: main_combo1{ + idc = 254; + }; + class main_combo6: main_combo1{ + idc = 255; + }; + + class main_button1: cse_gui_buttonBase { + idc = 260; + x = 0; + y = 0; + w = 0; + h = 0; + style = ST_CENTER; + /*animTextureNormal = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDisabled = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureOver = "cse\cse_sys_cc\data\button_dropdown_menu_hover.paa"; + animTextureFocused = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTexturePressed = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + animTextureDefault = "cse\cse_sys_cc\data\button_dropdown_menu.paa"; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.9,0.9,0.9,1}; + colorFocused[] = {1,1,1,1}; + color[] = {0.9,0.9,0.9, 1}; + color2[] = {1,1,1, 1}; + colorBackgroundFocused[] = {1,1,1,1};*/ + animTextureNormal = "#(argb,8,8,3)color(0.2,0.2,0.2,1)"; + animTextureDisabled = "#(argb,8,8,3)color(0.4,0.4,0.4,1)"; + animTextureOver = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureFocused = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTexturePressed = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + animTextureDefault = "#(argb,8,8,3)color(0.3,0.3,0.3,1)"; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.9,0.9,0.9,1}; + colorFocused[] = {1,1,1,1}; + color[] = {0.9,0.9,0.9, 1}; + color2[] = {1,1,1, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + }; + class main_button2: main_button1 { + idc = 261; + }; + class main_button3: main_button1 { + idc = 262; + }; + class main_button4: main_button1 { + idc = 263; + }; + class main_button5: main_button1 { + idc = 264; + }; + class main_button6: main_button1 { + idc = 265; + }; + class main_button7: main_button1 { + idc = 266; + }; + class main_button8: main_button1 { + idc = 267; + }; + class main_button9: main_button1 { + idc = 268; + }; + class main_button10: main_button1 { + idc = 269; + }; + class main_inputField1: cse_gui_editBase + { + idc = 270; + x = 100; + y = 100; + h = 0.05; + w = 0.05; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + autocomplete = ""; + font = "PuristaMedium"; + colorBackground[] = { 0, 0, 0, 1}; + colorText[] = { 1, 1, 1, 1}; + colorDisabled[] = { 1, 1, 1, 0.25}; + colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 1}; + colorActive[] = {1,1,1,1}; + tooltip = ""; + canModify = 1; + }; + class main_inputField2: main_inputField1 + { + idc = 271; + }; + class main_inputField3: main_inputField1 + { + idc = 272; + }; + class main_inputField4: main_inputField1 + { + idc = 273; + }; + class main_inputField5: main_inputField1 + { + idc = 274; + }; + class main_inputField6: main_inputField1 + { + idc = 275; + }; + + class main_lb1: cse_gui_listBoxBase{ + idc = 280; + x = 0; + y = 0; + w = 0; + h = 0; + }; + class main_lb2: main_lb1{ + idc = 281; + }; + class main_lb3: main_lb1{ + idc = 282; + }; + class main_lb4: main_lb1{ + idc = 283; + }; + + class listBox_APP1: cse_gui_listBoxBase{ + idc=601; + x = 100; + y = 100; + w = 1; + h = 1; + sizeEx = 0.032; + rowHeight = 0.03; + color[] = {0.9,0.9,0.9, 1}; + colorText[] = {0.9,0.9,0.9, 1}; + colorScrollbar[] = {0.9,0.9,0.9, 1}; + colorSelect[] = {0.9,0.9,0.9, 1}; + colorSelect2[] = {0.9,0.9,0.9, 1}; + colorSelectBackground[] = {0.2,0.2,0.2, 1}; + colorSelectBackground2[] = {0.2,0.2,0.2, 1}; + colorBackground[] = {0.1, 0.1, 0.1, 1}; + }; + class app_extraBackground: cse_gui_backgroundBase { + idc = 602; + x = 0; + y = 0; + w = 0; + h = 0; + type = CT_STATIC; + style = ST_LEFT + ST_SHADOW; + text = ""; + colorText[] = {0.95,0.95,0.95,1}; + colorBackground[] = {0.9,0.9,0.9,1}; + }; + class app_labelTitle: cse_gui_staticBase{ + idc = 603; + x = 0; + y = 0; + w = 0; + h = 0; + text = ""; + style = ST_CENTER; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.1,0.1,0.1, 1}; + }; + + class labelDesc: cse_gui_staticBase { + idc = 604; + x = 0; + y = 0; + w = 0; + h = 0; + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.1,0.1,0.1, 1}; + }; + + class labelNoSignal: cse_gui_staticBase { + idc = 605; + x = 0; + y = 0; + w = 0; + h = 0; + text = "NO SIGNAL"; + style = ST_LEFT; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.1,0.1,0.1, 1}; + }; + + class loadScreenBackground: cse_gui_backgroundBase { + idc = 607; + x = 0; + y = 0; + w = 0; + h = 0; + type = CT_STATIC; + style = ST_LEFT + ST_SHADOW; + text = ""; + colorText[] = {0.95,0.95,0.95,1}; + colorBackground[] = {0.9,0.9,0.9,1}; + }; + + class Progress_Bar1: cse_gui_RscProgress { + idc = 606; + x = "100 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "100 * ((((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,1}; + 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 loadingScreen_Label: cse_gui_staticBase{ + idc = 608; + x = 0; + y = 0; + w = 0; + h = 0; + text = ""; + style = ST_CENTER; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.1,0.1,0.1, 1}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/cse_m_tablet_uk.hpp b/TO_MERGE/cse/sys_cc/ui/cse_m_tablet_uk.hpp new file mode 100644 index 0000000000..2fd77046bc --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/cse_m_tablet_uk.hpp @@ -0,0 +1,85 @@ +class cse_m_tablet_uk : cse_m_tablet { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_tablet_uk', _this select 0]; ['cse_m_tablet_uk', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_tablet_uk', false] call cse_fnc_gui_blurScreen;"; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\uk_tablet.paa"; + }; + }; +}; + +class cse_m_tablet_o : cse_m_tablet { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_tablet_o', _this select 0]; ['cse_m_tablet_o', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_tablet_o', false] call cse_fnc_gui_blurScreen;"; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_tablet.paa"; + }; + }; +}; + +class cse_m_pda_o : cse_m_pda { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_pda_o', _this select 0]; ['cse_m_pda_o', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_pda_o', false] call cse_fnc_gui_blurScreen;"; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_pda.paa"; + }; + }; +}; + +class cse_m_tablet_g : cse_m_tablet { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_tablet_g', _this select 0]; ['cse_m_tablet_g', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_tablet_g', false] call cse_fnc_gui_blurScreen;"; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_tablet.paa"; + }; + }; +}; + +class cse_m_pda_g : cse_m_pda { + //idd = 590824; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_m_pda_g', _this select 0]; ['cse_m_pda_g', true] call cse_fnc_gui_blurScreen;"; + onUnload = " ['cse_m_pda_g', false] call cse_fnc_gui_blurScreen;"; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = -0.7; + y = -0.3; + w = 2.35; + h = 1.55; + text = "cse\cse_sys_cc\data\m_pda.paa"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/cse_view_small.hpp b/TO_MERGE/cse/sys_cc/ui/cse_view_small.hpp new file mode 100644 index 0000000000..b178e66556 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/cse_view_small.hpp @@ -0,0 +1,16 @@ +class cse_view_small: cse_m_tablet { + onLoad = "uiNamespace setVariable ['cse_view_small', _this select 0];"; + duration = 10e10; + fadein = 0; + fadeout = 0; + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = 3; + y = 2; + w = 1; + h = 0.5; + text = ""; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/ui/define.hpp b/TO_MERGE/cse/sys_cc/ui/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/define.hpp @@ -0,0 +1,797 @@ + +#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/sys_cc/ui/m_flight_display.h b/TO_MERGE/cse/sys_cc/ui/m_flight_display.h new file mode 100644 index 0000000000..38eb69cbe5 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/ui/m_flight_display.h @@ -0,0 +1,62 @@ +class cse_m_flight_display { + idd = 590823; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_m_flight_display', _this select 0]; ['cse_m_flight_display', true] call cse_fnc_gui_blurScreen;"; + onUnload = "['cse_m_flight_display', false] call cse_fnc_gui_blurScreen;"; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = "5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "-1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "30 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "cse\cse_sys_cc\data\m_flight_display.paa"; + }; + }; + class controls { + + class mapDisplay: cse_gui_mapBase { + idc = 10; + x = "11.75 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "16.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "22 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 101; + moveOnEdges = 0; + showCountourInterval = 1; + }; + }; +}; + + +class cse_m_vehicle_display { + idd = 590823; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_m_vehicle_display', _this select 0]; ['cse_m_vehicle_display', true] call cse_fnc_gui_blurScreen;"; + onUnload = "['cse_m_vehicle_display', false] call cse_fnc_gui_blurScreen;"; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = "-5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "-1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "55 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "cse\cse_sys_cc\data\m_vehicle_display.paa"; + }; + }; + class controls { + + class mapDisplay: cse_gui_mapBase { + idc = 10; + x = "8.75 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "27.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "22 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 101; + moveOnEdges = 0; + showCountourInterval = 1; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/vehicles/functions/fn_canUseOnBoard_BFT_Device_CC.sqf b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_canUseOnBoard_BFT_Device_CC.sqf new file mode 100644 index 0000000000..b37a55d2b9 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_canUseOnBoard_BFT_Device_CC.sqf @@ -0,0 +1,20 @@ +/** + * fn_canUseOnBoard_BFT_Device_CC.sqf + * @Descr: Check if unit can use on board BFT device from given vehicle. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, vehicle OBJECT] + * @Return: BOOL True if unit can use on Board BFT Device from vehicle + * @PublicAPI: true + */ + +private ["_unit", "_vehicle", "_info"]; +_unit = _this select 0; +_vehicle = _this select 1; + +if (_vehicle isKindOf "CAManBase") exitwith {false}; +if !([_unit] call cse_fnc_canInteract) exitwith {false}; +if !([_vehicle] call cse_fnc_hasFlightDisplay_CC) exitwith {false}; +if !(isEngineOn _vehicle) exitwith {false}; + +(vehicle _unit == _vehicle && {!(_unit in assignedCargo _vehicle)}); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTIcons_Vehicles_CC.sqf b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTIcons_Vehicles_CC.sqf new file mode 100644 index 0000000000..95bd2a2b9e --- /dev/null +++ b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTIcons_Vehicles_CC.sqf @@ -0,0 +1,29 @@ +/** + * fn_drawBFTIcons_Vehicles_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_trackerInfo", "_icon", "_pos", "_text", "_unit", "_side", "_color", "_map"]; +_trackerInfo = _this select 0; +_map = _this select 1; + +_icon = _trackerInfo select 0; +_pos = _trackerInfo select 1; +_text = _trackerInfo select 2; +_unit = _trackerInfo select 5; +_side = _trackerInfo select 6; + +if ((side CSE_CURRENT_VEHICLE_BFT_DISPLAY_CC) == _side) then { + if (!CSE_TOGGLE_CALLSIGNS_CC) then { + _text = ""; + }; + _color = _trackerInfo select 3; + if (_unit == CSE_CURRENT_VEHICLE_BFT_DISPLAY_CC) then {_color = [0.78,0.8,0.1,1]; }; + _map drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right']; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTMarker_Vehicles_CC.sqf b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTMarker_Vehicles_CC.sqf new file mode 100644 index 0000000000..7591f85580 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_drawBFTMarker_Vehicles_CC.sqf @@ -0,0 +1,25 @@ +/** + * fn_drawBFTMarker_Vehicles_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private [ "_marker", "_map"]; +_marker = _this select 0; +if !(_marker isEqualTo []) then { + _pos = _marker select 0; + _args = _marker select 1; + _icon = _args select 0; + _text = _args select 1; + _color = _args select 2; + + _timeOfPlacement = _marker select 2; + _side = _marker select 3; + if ((side CSE_CURRENT_VEHICLE_BFT_DISPLAY_CC) == _side) then { + (_this select 1) drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right']; + }; +}; diff --git a/TO_MERGE/cse/sys_cc/vehicles/functions/fn_hasFlightDisplay_CC.sqf b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_hasFlightDisplay_CC.sqf new file mode 100644 index 0000000000..90dfc20722 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_hasFlightDisplay_CC.sqf @@ -0,0 +1,23 @@ +/** + * fn_hasFlightDisplay_CC.sqf + * @Descr: Check if vehicle has an onboard BFT display. Works for aircraft and other vehicles. + * @Author: Glowbal + * + * @Arguments: [vehicle OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_vehicle"]; +_vehicle = _this select 0; + +if (alive _vehicle) then { + if (_vehicle isKindOf "CAManBase") exitwith {false}; + if (_vehicle getvariable ["cse_disableVehicleDisplay_CC", false]) exitwith {false}; + if !(CSE_ALLOW_VEHICLE_DISPLAYS_CC) exitwith {false}; + _info = _vehicle getvariable "cse_bft_info_cc"; + if (isnil "_info") exitwith {false}; + true; +} else { + false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_cc/vehicles/functions/fn_openFlight_Display_CC.sqf b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_openFlight_Display_CC.sqf new file mode 100644 index 0000000000..c58d32ecb5 --- /dev/null +++ b/TO_MERGE/cse/sys_cc/vehicles/functions/fn_openFlight_Display_CC.sqf @@ -0,0 +1,52 @@ +/** + * fn_openFlight_Display_CC.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_vehicle", "_displayName"]; +_vehicle = _this select 0; + +if !([player, _vehicle] call cse_fnc_canUseOnBoard_BFT_Device_CC) exitWith {}; + +_displayName = "cse_m_flight_display"; + +if !(_vehicle isKindOf "Air") then { + _displayName = "cse_m_vehicle_display"; +}; + +createDialog _displayName; +CSE_CURRENT_VEHICLE_BFT_DISPLAY_CC = _vehicle; + +if (isnil "CSE_CURRENT_SELECTED_FILTER_CC_APP_CC") then { + CSE_CURRENT_SELECTED_FILTER_CC_APP_CC = -1; + CSE_TOGGLE_ROUTE_LAYER_CC = true; + CSE_TOGGLE_INTEL_LAYER_CC = true; + CSE_TOGGLE_CALLSIGNS_CC = true; + CSE_SELECTED_ICON_CC = ""; +}; + +if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then { + CSE_INTEL_MARKER_COLLECTION_CC = []; +}; +if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then { + CSE_ROUTE_MARKER_COLLECTION_CC = []; +}; +if (isnil "CSE_TRACKER_ICONS") then { + CSE_TRACKER_ICONS = []; +}; + +CSE_CURRENT_VEHICLE_BFT_DISPLAY_ICON_CC = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "icon"); + +disableSerialization; +_display = uiNamespace getvariable _displayName; + +(_display displayCtrl 10) ctrlAddEventHandler ["draw"," + {[_x,(_this select 0)] call cse_fnc_drawBFTIcons_Vehicles_CC;}foreach CSE_TRACKER_ICONS; + if (CSE_TOGGLE_INTEL_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_Vehicles_CC;}foreach CSE_INTEL_MARKER_COLLECTION_CC;}; + if (CSE_TOGGLE_ROUTE_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_Vehicles_CC;}foreach CSE_ROUTE_MARKER_COLLECTION_CC;}; + "]; diff --git a/TO_MERGE/cse/sys_combatdeaf/CfgFunctions.h b/TO_MERGE/cse/sys_combatdeaf/CfgFunctions.h new file mode 100644 index 0000000000..e5c097e69c --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/CfgFunctions.h @@ -0,0 +1,18 @@ +class CfgFunctions { + class CSE { + class combatdeaf { + file = "cse\cse_sys_combatdeaf\functions"; + class handleFiredNear_DEAF { recompile = 1; }; + class handleFired_DEAF { recompile = 1; }; + class getAttenuation_DEAF { recompile = 1; }; + class applyEletronicEarProtection_DEAF { recompile = 1; }; + class explosion_DEAF { recompile = 1; }; + class handlePressureWave_DEAF { recompile = 1; }; + class getIn_DEAF { recompile = 1; }; + class getOut_DEAF { recompile = 1; }; + class register_ear_protection_actions_DEAF { recompile = 1; }; + class getMuzzleAccessory_DEAF { recompile = 1; }; + class hasMuzzleAccessory_DEAF { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/CfgSounds.h b/TO_MERGE/cse/sys_combatdeaf/CfgSounds.h new file mode 100644 index 0000000000..6230b98a63 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/CfgSounds.h @@ -0,0 +1,9 @@ +class CfgSounds +{ + class cse_combatdeaf_ear_ringing + { + name="cse_combatdeaf_ear_ringing"; + sound[]={"\cse\cse_sys_combatdeaf\sound\ear_ringing.ogg",1,1}; + titles[]={}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/CfgVehicles.h b/TO_MERGE/cse/sys_combatdeaf/CfgVehicles.h new file mode 100644 index 0000000000..c844679424 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/CfgVehicles.h @@ -0,0 +1,85 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_combatdeaf: Module_F { + scope = 2; + displayName = "Combat Deafness [CSE]"; + icon = "\cse\cse_main\data\cse_earmuffs_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class DEAFNESS_EFFECT_INTENSITY { + displayName = "Deafness effect intensity"; + description = "Allows to tune down the deafness effect (2.0 - dual intensity, 1.0 - default intensity, 0.5 - half intensity)"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class DISABLE_EAR_RINGING { + displayName = "Disable ear ringing"; + description = "Disables the ear ringing effect"; + typeName = "BOOL"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = "Combat deafness"; + }; + }; + + class Item_Base_F; + class cse_earplugsItem: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Earplugs"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_earplugs + { + name = "cse_earplugs"; + count = 1; + }; + }; + }; + class cse_earplugs_electronicItem: cse_earplugsItem + { + class TransportItems + { + class cse_earplugs_electronic + { + name = "cse_earplugs_electronic"; + count = 1; + }; + }; + }; + + class NATO_Box_Base; + class cse_crateCombatDeafness: NATO_Box_Base + { + scope = 2; + displayName = "Earplugs Crate [CSE]"; + author = "Combat Space Enhancement"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + class TransportWeapons + { + class _xx_cse_earplugs + { + weapon="cse_earplugs"; + count=50; + }; + class _xx_cse_earplugs_electronic + { + weapon="cse_earplugs_electronic"; + count=10; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_combatdeaf/CfgWeapons.h b/TO_MERGE/cse/sys_combatdeaf/CfgWeapons.h new file mode 100644 index 0000000000..e7568824b0 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/CfgWeapons.h @@ -0,0 +1,27 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class cse_earplugs: ItemCore + { + scope=2; + value = 1; + count = 1; + type = 16; + displayName="Earplugs"; + model="\cse\cse_sys_combatdeaf\equipment\earplugs_simple.p3d"; + picture="\cse\cse_sys_combatdeaf\equipment\icons\earplugs_simple_icon.paa"; + descriptionShort="Earplugs"; + class ItemInfo: InventoryItem_Base_F + { + mass=0.01; + type=201; + }; + }; + class cse_earplugs_electronic: cse_earplugs + { + displayName="Electronic earplugs"; + model="\cse\cse_sys_combatdeaf\equipment\earplugs_electronic.p3d"; + picture="\cse\cse_sys_combatdeaf\equipment\icons\earplugs_electronic_icon.paa"; + descriptionShort="Eletronic earplugs"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_combatdeaf/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..3efadef3bd --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/Combat_Space_Enhancement.h @@ -0,0 +1,14 @@ +class Combat_Space_Enhancement { + class CfgModules { + class cse_sys_combatdeaf { + init = "call compile preprocessFile 'cse\cse_sys_combatdeaf\init_sys_combatdeaf.sqf';"; + name = "Combat Deafness"; + class EventHandlers { + class AllVehicles { + GetIn = "call cse_fnc_getIn_DEAF; false"; + GetOut = "call cse_fnc_getOut_DEAF; false"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/config.cpp b/TO_MERGE/cse/sys_combatdeaf/config.cpp new file mode 100644 index 0000000000..372d5fa9ae --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/config.cpp @@ -0,0 +1,26 @@ +class CfgPatches { + class cse_sys_combatdeaf { + units[] = {"cse_crateCombatDeafness", "cse_earplugsItem", "cse_earplugs_electronicItem"}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main"}; + versionDesc = "CSE Combat Deafness"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class cse_sys_combatdeaf { + class PreloadAddons { + class cse_sys_combatdeaf { + list[] = {"cse_sys_combatdeaf"}; + }; + }; +}; + +#include "CfgVehicles.h" +#include "CfgWeapons.h" +#include "CfgSounds.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/data/cse_combatdeaf_deafness.paa b/TO_MERGE/cse/sys_combatdeaf/data/cse_combatdeaf_deafness.paa new file mode 100644 index 0000000000..8cd1069a64 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/data/cse_combatdeaf_deafness.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic.rvmat b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic.rvmat new file mode 100644 index 0000000000..5743771bbe --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic.rvmat @@ -0,0 +1,92 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.703999,0.703999,0.703999,0.000000}; +specularPower=70.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="cse\cse_sys_combatdeaf\equipment\data\earplugs_electronic_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 +{ + texture="cse\cse_sys_medical\equipment\data\env_co.tga"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_co.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_co.paa new file mode 100644 index 0000000000..5a8aa676b4 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_co.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_nohq.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_nohq.paa new file mode 100644 index 0000000000..4d29071c01 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_electronic_nohq.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple.rvmat b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple.rvmat new file mode 100644 index 0000000000..deb96f14e8 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple.rvmat @@ -0,0 +1,92 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.703999,0.703999,0.703999,0.000000}; +specularPower=70.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="cse\cse_sys_combatdeaf\equipment\data\earplugs_simple_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 +{ + texture="cse\cse_sys_medical\equipment\data\env_co.tga"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_co.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_co.paa new file mode 100644 index 0000000000..bd7904b497 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_co.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_nohq.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_nohq.paa new file mode 100644 index 0000000000..1e4d3ea283 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/data/earplugs_simple_nohq.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_electronic.p3d b/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_electronic.p3d new file mode 100644 index 0000000000..4020a0e801 Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_electronic.p3d differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_simple.p3d b/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_simple.p3d new file mode 100644 index 0000000000..472c83259f Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/earplugs_simple.p3d differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_electronic_icon.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_electronic_icon.paa new file mode 100644 index 0000000000..f401554c5d Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_electronic_icon.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_simple_icon.paa b/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_simple_icon.paa new file mode 100644 index 0000000000..30154b3e5b Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/equipment/icons/earplugs_simple_icon.paa differ diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/defines.h b/TO_MERGE/cse/sys_combatdeaf/functions/defines.h new file mode 100644 index 0000000000..8ee75925fc --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/defines.h @@ -0,0 +1,4 @@ +#define EARPLUGS_ID 18312 +#define NO_EARPLUGS 0 +#define STANDARD_EARPLUGS 1 +#define ELECTRONIC_EARPLUGS 2 \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_applyEletronicEarProtection_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_applyEletronicEarProtection_DEAF.sqf new file mode 100644 index 0000000000..0022ac97f1 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_applyEletronicEarProtection_DEAF.sqf @@ -0,0 +1,34 @@ +#include "defines.h" + +private ["_audibleFire", "_attenuation", "_totalAttenuation", "_ID"]; +_audibleFire = _this; + +if (_audibleFire < 1) exitWith {}; + +_totalAttenuation = 1; + +if (_audibleFire > 1) then { + // TODO: Use a headgear config entry instead + if (headgear player == "H_Cap_headphones") then { + _attenuation = 0.25 max (1 / _audibleFire) min 1; // max. -20 dB + _totalAttenuation = _totalAttenuation * _attenuation; + _audibleFire = _audibleFire * _attenuation; + }; +}; + +if (_audibleFire > 1) then { + if (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] == ELECTRONIC_EARPLUGS) then { + _attenuation = 0.125 max (1 / _audibleFire) min 1; // max. -30 dB + _totalAttenuation = _totalAttenuation * _attenuation; + _audibleFire = _audibleFire * _attenuation; + }; +}; + +if (_totalAttenuation < 1) then { + _ID = floor(random 1000000); + [format["electronicHearingProtection_%1", _ID], _totalAttenuation, true] call cse_fnc_setHearingCapability; + _ID spawn { + sleep 2; + [format["electronicHearingProtection_%1", _this], 1, false] call cse_fnc_setHearingCapability; + }; +}; diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_explosion_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_explosion_DEAF.sqf new file mode 100644 index 0000000000..b7a85bcad9 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_explosion_DEAF.sqf @@ -0,0 +1,8 @@ +private ["_unit", "_damage", "_attenuation", "_sp"]; +_unit = _this select 0; +_damage = _this select 1; + +_attenuation = player call cse_fnc_getAttenuation_DEAF; + +_sp = _attenuation * _damage * 500; +_sp call cse_fnc_handlePressureWave_DEAF; diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_getAttenuation_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getAttenuation_DEAF.sqf new file mode 100644 index 0000000000..c440e1e1f9 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getAttenuation_DEAF.sqf @@ -0,0 +1,16 @@ +#include "defines.h" + +private ["_unit", "_attenuation"]; +_unit = _this; + +_attenuation = 1; + +if (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] != NO_EARPLUGS) then { + _attenuation = _attenuation * 0.125; // -30 dB +}; +// TODO: Use a headgear config entry instead +if (headgear player == "H_Cap_headphones") then { + _attenuation = _attenuation * 0.25; // -20 dB +}; + +_attenuation diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_getIn_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getIn_DEAF.sqf new file mode 100644 index 0000000000..55173940c9 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getIn_DEAF.sqf @@ -0,0 +1,9 @@ +private ["_vehicle", "_position", "_unit", "_handle"]; +_vehicle = _this select 0; +_position = _this select 1; +_unit = _this select 2; + +if (_unit != player) exitWith {}; +_handle = _vehicle addEventHandler ["Fired", {_this call cse_fnc_handleFired_DEAF}]; + +_vehicle setVariable ["cse_combat_deaf_fired_event_handler", _handle]; diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_getMuzzleAccessory_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getMuzzleAccessory_DEAF.sqf new file mode 100644 index 0000000000..01f70f32e5 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getMuzzleAccessory_DEAF.sqf @@ -0,0 +1,20 @@ +/** + * fn_getMuzzleAccessory_DEAF.sqf + * @Descr: N/A Throws exception NO_WEAPON_UNIT + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: STRING classname. Empty string if no assescory for Muzzle + * @PublicAPI: false + */ + + private ["_unit"]; +_unit = _this select 0; +_accessories = [_unit] call cse_fnc_getWeaponItems_F; +_items = switch (currentWeapon _unit) do { + case (primaryWeapon _unit): { _accessories select 0 }; + case (secondaryWeapon _unit): { _accessories select 1 }; + case (handgunWeapon _unit): { _accessories select 2 }; + default { throw "NO_WEAPON_UNIT"; }; +}; +(_items select 0); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_getOut_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getOut_DEAF.sqf new file mode 100644 index 0000000000..8345953097 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_getOut_DEAF.sqf @@ -0,0 +1,12 @@ +private ["_vehicle", "_position", "_unit", "_handle"]; +_vehicle = _this select 0; +_position = _this select 1; +_unit = _this select 2; + +if (_unit != player) exitWith {}; +_handle = _vehicle getVariable "cse_combat_deaf_fired_event_handler"; + +if (!isNil "_handle") then { + _vehicle removeEventHandler ["Fired", _handle]; + _vehicle setVariable ["cse_combat_deaf_fired_event_handler", nil]; +}; diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFiredNear_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFiredNear_DEAF.sqf new file mode 100644 index 0000000000..984fba7f55 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFiredNear_DEAF.sqf @@ -0,0 +1,85 @@ +/** + * fn_handleFiredNear_DEAF.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define MAX_DISTANCE 10 +#define BLUR_DELAY 0.1 +#define SPEED_OF_SOUND 340.29 + +private ["_unit", "_firer", "_distance", "_weapon", "_ammo", "_pressureRatio", "_audibleFire", "_audibleFireToSPL", "_audibleFireDistanceCorrected", "_accessoryConfig", "_sp"]; +_unit = _this select 0; +_firer = _this select 1; +_distance = _this select 2; +_weapon = _this select 3; +_ammo = _this select 6; + +if (_distance > MAX_DISTANCE) exitWith {}; +if (_weapon in ["Throw", "Put"]) exitWith {}; +if (getNumber (configFile >> "CfgWeapons" >> _weapon >> "type") == 0) exitWith { + [format["Weapon type was 0. Exiting (%1)", _weapon]] call cse_fnc_debug; +}; + +_pressureRatio = 1 / 3; +if ([_unit] call cse_fnc_isInBuilding && [_firer] call cse_fnc_isInBuilding) then { + _pressureRatio = 1.0; +} else { + if (_unit != _firer) then { + // calculate direction deviation (shotdirection - (firer -> unit direction)) + _shotDirection = _firer weaponDirection currentWeapon _firer; + _hearerDirection = (getPosASL _firer) vectorFromTo (getPosASL _unit); + _cosOfAngle = _shotDirection vectorCos _hearerDirection; // -1 .. +1 + _pressureRatio = (1 / 3) * (2 + _cosOfAngle); // 0.333 .. 1 + if (lineIntersects [eyePos _firer, eyePos _unit, _firer, _unit]) then { + _pressureRatio = _pressureRatio / 2; + }; + }; +}; + +try { + _audibleFire = getNumber(configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); + _accessoryConfig = (configFile >> "CfgWeapons" >> ([_firer] call cse_fnc_getMuzzleAccessory_DEAF)); + if (isClass _accessoryConfig) then { + _audibleFire = (getNumber (_accessoryConfig >> "ItemInfo" >> "AmmoCoef" >> "audibleFire")) * _audibleFire; + }; + + _distance = 1 max _distance; + _audibleFireToSPL = abs(10 * log(1 / (4 * PI * _distance^2))); + _audibleFireDistanceCorrected = 0 max (_audibleFire / 2^(_audibleFireToSPL / 10)); + _sp = _pressureRatio * (_unit call cse_fnc_getAttenuation_DEAF) * _audibleFireDistanceCorrected / 3; + hintSilent format["%1, %2, %3, %4, %5, %6", _distance, _pressureRatio, (_unit call cse_fnc_getAttenuation_DEAF), _sp, _audibleFire, _audibleFireDistanceCorrected]; + + _sp call cse_fnc_handlePressureWave_DEAF; + _audibleFireDistanceCorrected call cse_fnc_applyEletronicEarProtection_DEAF; + + if (_sp > 1 && goggles _unit == "" && _unit != _firer) then { + [_distance, _sp] spawn { + private ["_distance", "_blur"]; + _distance = _this select 0; + _blur = (sqrt(_this select 1) / 5) min 2; + sleep (_distance / SPEED_OF_SOUND); + cse_sys_combatdeaf_blurEffect ppEffectEnable true; + cse_sys_combatdeaf_blurEffect ppEffectAdjust [_blur / (_distance^2)]; + cse_sys_combatdeaf_blurEffect ppEffectCommit BLUR_DELAY; + sleep BLUR_DELAY; + for "_i" from floor(_distance) to MAX_DISTANCE do { + cse_sys_combatdeaf_blurEffect ppEffectAdjust [_blur * (MAX_DISTANCE - _i)]; + cse_sys_combatdeaf_blurEffect ppEffectCommit (_blur * (BLUR_DELAY / 2)); + sleep (_blur * (BLUR_DELAY / 2)); + }; + cse_sys_combatdeaf_blurEffect ppEffectEnable false; + }; + }; +}catch { + // This should never happen. + if (_exception == "NO_WEAPON_UNIT") then { + [format["Unit (%1) that fired has no weapon. Cannot retrieve silencer accessory", _firer]] call cse_fnc_debug; + } else { + [_exception] call cse_fnc_debug; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFired_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFired_DEAF.sqf new file mode 100644 index 0000000000..4d07b1fccb --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handleFired_DEAF.sqf @@ -0,0 +1,8 @@ +private ["_unit", "_weapon", "_muzzle", "_mode", "_ammo"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_mode = _this select 3; +_ammo = _this select 4; + +[_unit, _unit, 0, _weapon, _muzzle, _mode, _ammo] call cse_fnc_handleFiredNear_DEAF; diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_handlePressureWave_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handlePressureWave_DEAF.sqf new file mode 100644 index 0000000000..32324b6ce8 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_handlePressureWave_DEAF.sqf @@ -0,0 +1,46 @@ +#define PAIN_THRESHOLD 5 +#define DAMAGE_THRESHOLD 40 +#define HEARING_CAPABILITY_MAP_ID 1713 + +private ["_sp", "_deafness"]; +_sp = _this; + +if !(alive player) exitWith {}; + +if (_sp > 0.5 && cse_DeafnessIntensity > 0.0) then { + _deafness = ((player getVariable ["cse_combatdeaf_deafness", 0]) + _sp) min (DAMAGE_THRESHOLD / cse_DeafnessIntensity); + player setVariable ["cse_combatdeaf_deafness", _deafness, false]; + + if (!cse_sys_combatdeaf_deafness_running) then { + [] spawn { + private ["_deafness", "_ringing", "_ringingStart", "_img", "_volume"]; + cse_sys_combatdeaf_deafness_running = true; + _deafness = player getVariable ["cse_combatdeaf_deafness", 0]; + _ringing = false; + _ringingStart = time - 120; + while {alive player && _deafness > 0.01} do { + if (_deafness > DAMAGE_THRESHOLD / cse_DeafnessIntensity) then { + ["cse_sys_combatdeaf_deafIcon", true, "cse\cse_sys_combatdeaf\data\cse_combatdeaf_deafness.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + } else { + ["cse_sys_combatdeaf_deafIcon", false, "", [1,1,1,1]] call cse_fnc_gui_displayIcon; + if (!cse_DisableEarRinging && _deafness > PAIN_THRESHOLD / cse_DeafnessIntensity) then { + if (!_ringing || time - _ringingStart > 120) then { + playSound "cse_combatdeaf_ear_ringing"; + _ringingStart = time; + _ringing = true; + }; + } else { + _ringing = false; + }; + }; + _deafness = player getVariable ["cse_combatdeaf_deafness", 0]; + _volume = 0 max (1 - (_deafness / (DAMAGE_THRESHOLD / cse_DeafnessIntensity))); + [format["hearingCapability_%1", HEARING_CAPABILITY_MAP_ID], _volume, true] call cse_fnc_setHearingCapability; + player setVariable ["cse_combatdeaf_deafness", 0 max (_deafness - 0.5 / (1 max _deafness min (DAMAGE_THRESHOLD / cse_DeafnessIntensity))), false]; + sleep 1; + }; + cse_sys_combatdeaf_deafness_running = false; + [format["hearingCapability_%1", HEARING_CAPABILITY_MAP_ID], 1, false] call cse_fnc_setHearingCapability; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_hasMuzzleAccessory_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_hasMuzzleAccessory_DEAF.sqf new file mode 100644 index 0000000000..616f3d0ad6 --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_hasMuzzleAccessory_DEAF.sqf @@ -0,0 +1,20 @@ +/** + * fn_hasMuzzleAccessory_DEAF.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + private ["_unit"]; +_unit = _this select 0; +_accessories = [_unit] call cse_fnc_getWeaponItems_F; +_items = switch (currentWeapon _unit) do { + case (primaryWeapon _unit): { _accessories select 0 }; + case (secondaryWeapon _unit): { _accessories select 1 }; + case (handgunWeapon _unit): { _accessories select 2 }; + default { throw "NO_WEAPON_UNIT"; }; +}; +(_items select 0) != ""; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/functions/fn_register_ear_protection_actions_DEAF.sqf b/TO_MERGE/cse/sys_combatdeaf/functions/fn_register_ear_protection_actions_DEAF.sqf new file mode 100644 index 0000000000..2c5351e7fd --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/functions/fn_register_ear_protection_actions_DEAF.sqf @@ -0,0 +1,60 @@ +#include "defines.h" + +if (isDedicated) exitwith{}; +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; + +cse_hearingProtectionDisplaySubMenu = { + [_this] call cse_fnc_Debug; + + private ["_subMenus"]; + _subMenus = []; + + // Put on standard earplugs + if (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] == NO_EARPLUGS && [player, "cse_earplugs"] call cse_fnc_hasItem) then { + _subMenus pushBack ["Use earplugs", CSE_ICON_PATH + "icon_earplugs_standard.paa", { + closeDialog 0; + player setVariable ["cse_combatdeaf_earplugs", STANDARD_EARPLUGS, false]; + player removeItem "cse_earplugs"; + [format["earplugsAttenuation_ID_%1", EARPLUGS_ID], 0.125] call cse_fnc_setHearingCapability; + }, true, "Use standard earplugs"]; + }; + + // Put on electronic earplugs + if (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] == NO_EARPLUGS && [player, "cse_earplugs_electronic"] call cse_fnc_hasItem) then { + _subMenus pushBack ["Use earplugs", CSE_ICON_PATH + "icon_earplugs_electronic.paa", { + closeDialog 0; + player setVariable ["cse_combatdeaf_earplugs", ELECTRONIC_EARPLUGS, false]; + player removeItem "cse_earplugs_electronic"; + }, true, "Use electronic earplugs"]; + }; + + // Remove earplugs + if (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] != NO_EARPLUGS) then { + switch (player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS]) do { + case STANDARD_EARPLUGS: { + _subMenus pushBack ["Earplugs out", CSE_ICON_PATH + "icon_earplugs_remove.paa", { + closeDialog 0; + player setVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS, false]; + player addItem "cse_earplugs"; + [format["earplugsAttenuation_ID_%1", EARPLUGS_ID], 1, false] call cse_fnc_setHearingCapability; + }, true, "Remove standard earplugs"]; + }; + case ELECTRONIC_EARPLUGS: { + _subMenus pushBack ["Earplugs out", CSE_ICON_PATH + "icon_earplugs_remove.paa", { + closeDialog 0; + player setVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS, false]; + player addItem "cse_earplugs_electronic"; + }, true, "Remove electronic earplugs"]; + }; + }; + }; + + [_this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; +}; + + +_entries = [ + ["Hearing", {((player getVariable ["cse_combatdeaf_earplugs", NO_EARPLUGS] != NO_EARPLUGS) || (([player, "cse_earplugs_electronic"] call cse_fnc_hasItem) || ([player, "cse_earplugs"] call cse_fnc_hasItem)))}, CSE_ICON_PATH + "icon_ear_protection.paa", cse_hearingProtectionDisplaySubMenu, "Show available hearing protections"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + diff --git a/TO_MERGE/cse/sys_combatdeaf/init_sys_combatdeaf.sqf b/TO_MERGE/cse/sys_combatdeaf/init_sys_combatdeaf.sqf new file mode 100644 index 0000000000..a8bd8fcd8d --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/init_sys_combatdeaf.sqf @@ -0,0 +1,29 @@ +#include "functions\defines.h" + +if (!hasInterface) exitwith {}; +waituntil{!isnil "cse_gui" && !isnil "cse_main"}; + +waitUntil {!isNull player}; + +private ["_args"]; +_args = _this; +{ + _varName = "cse_"+(_x select 0); + missionNamespace setVariable[_varName, _x select 1]; +} forEach _args; + +if (isNil "cse_DeafnessIntensity") then { cse_DeafnessIntensity = cse_DEAFNESS_EFFECT_INTENSITY }; +if (isNil "cse_DisableEarRinging") then { cse_DisableEarRinging = cse_DISABLE_EAR_RINGING }; + +["cse_combatdeaf_deafness", 0, false, "cd"] call cse_fnc_defineVariable; +["cse_combatdeaf_earplugs", NO_EARPLUGS, false, "cd"] call cse_fnc_defineVariable; + +call cse_fnc_register_ear_protection_actions_DEAF; + +player addEventHandler ["FiredNear", {_this call cse_fnc_handleFiredNear_DEAF}]; +player addEventHandler ["Explosion", {_this call cse_fnc_explosion_DEAF}]; + +cse_sys_combatdeaf_blurEffect = ppEffectCreate ["dynamicBlur", -11723]; +cse_sys_combatdeaf_deafness_running = false; + +cse_sys_combatdeaf = true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_combatdeaf/sound/ear_ringing.ogg b/TO_MERGE/cse/sys_combatdeaf/sound/ear_ringing.ogg new file mode 100644 index 0000000000..9bbc7b504b Binary files /dev/null and b/TO_MERGE/cse/sys_combatdeaf/sound/ear_ringing.ogg differ diff --git a/TO_MERGE/cse/sys_combatdeaf/stringtable.xml b/TO_MERGE/cse/sys_combatdeaf/stringtable.xml new file mode 100644 index 0000000000..0c3a9168de --- /dev/null +++ b/TO_MERGE/cse/sys_combatdeaf/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgAmmo.h b/TO_MERGE/cse/sys_equipment/CfgAmmo.h new file mode 100644 index 0000000000..f73b099245 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgAmmo.h @@ -0,0 +1,159 @@ +#define FUSEE_TIME_TO_LIVE 600 +#define FUSEE_FLARE_SIZE 2 +#define FUSEE_INTENSITY 3000 + +#define FLARE_TIME_TO_LIVE 60 +#define FLARE_SIZE 10 +#define FLARE_INTENSITY 4000 + +class cfgAmmo { + class F_20mm_White; + class F_20mm_Red: F_20mm_White {}; + class F_20mm_Yellow: F_20mm_White {}; + class F_20mm_Green: F_20mm_White {}; + + class CSE_FuseeWhite: F_20mm_White { + intensity = FUSEE_INTENSITY; + flareSize = FUSEE_FLARE_SIZE; + timeToLive = FUSEE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FuseeRed: F_20mm_Red { + intensity = FUSEE_INTENSITY; + flareSize = FUSEE_FLARE_SIZE; + timeToLive = FUSEE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FuseeYellow: F_20mm_Yellow { + intensity = FUSEE_INTENSITY; + flareSize = FUSEE_FLARE_SIZE; + timeToLive = FUSEE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FuseeGreen: F_20mm_Green { + intensity = FUSEE_INTENSITY; + flareSize = FUSEE_FLARE_SIZE; + timeToLive = FUSEE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + + + class CSE_FlareWhite: F_20mm_White { + intensity = FLARE_INTENSITY; + flareSize = FLARE_SIZE; + timeToLive = FLARE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FlareRed: F_20mm_Red { + intensity = FLARE_INTENSITY; + flareSize = FLARE_SIZE; + timeToLive = FLARE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FlareYellow: F_20mm_Yellow { + intensity = FLARE_INTENSITY; + flareSize = FLARE_SIZE; + timeToLive = FLARE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; + class CSE_FlareGreen: F_20mm_Green { + intensity = FLARE_INTENSITY; + flareSize = FLARE_SIZE; + timeToLive = FLARE_TIME_TO_LIVE; + airFriction = -0.0005; + thrust = 210; + thrustTime = 1.5; + }; +}; + + +class CfgMagazines { + class HandGrenade; + class CSE_Flare_Base: HandGrenade { + value = 2; + nameSoundWeapon = "smokeshell"; + nameSound = "smokeshell"; + mass = 4; + initSpeed = 22; + }; + class CSE_FlareWhite: CSE_Flare_Base { + ammo = "CSE_FlareWhite"; + displayname = $STR_CSE_FLARE_WHITE; + descriptionshort = $STR_CSE_FLARE_WHITE; + displayNameShort = $STR_CSE_FLARE_WHITE; + model = "\A3\weapons_f\ammo\flare_white"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; + }; + class CSE_FlareRed: CSE_Flare_Base { + ammo = "CSE_FlareRed"; + displayname = $STR_CSE_FLARE_RED; + descriptionshort = $STR_CSE_FLARE_RED; + displayNameShort = $STR_CSE_FLARE_RED; + model = "\A3\weapons_f\ammo\flare_red"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; + }; + class CSE_FlareYellow: CSE_Flare_Base { + ammo = "CSE_FlareYellow"; + displayname = $STR_CSE_FLARE_YELLOW; + descriptionshort = $STR_CSE_FLARE_YELLOW; + displayNameShort = $STR_CSE_FLARE_YELLOW; + model = "\A3\weapons_f\ammo\flare_yellow"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; + }; + class CSE_FlareGreen: CSE_Flare_Base { + ammo = "CSE_FlareGreen"; + displayname = $STR_CSE_FLARE_GREEN; + descriptionshort = $STR_CSE_FLARE_GREEN; + displayNameShort = $STR_CSE_FLARE_GREEN; + model = "\A3\weapons_f\ammo\flare_green"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; + }; + + + class CSE_RoadFlareWhite: CSE_Flare_Base { + ammo = "CSE_FuseeWhite"; + displayname = $STR_CSE_ROAD_FLARE_WHITE; + descriptionshort = $STR_CSE_ROAD_FLARE_WHITE; + displayNameShort = $STR_CSE_ROAD_FLARE_WHITE; + model = "\A3\weapons_f\ammo\flare_white"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; + }; + class CSE_RoadFlareRed: CSE_Flare_Base { + ammo = "CSE_FuseeRed"; + displayname = $STR_CSE_ROAD_FLARE_RED; + descriptionshort = $STR_CSE_ROAD_FLARE_RED; + displayNameShort = $STR_CSE_ROAD_FLARE_RED; + model = "\A3\weapons_f\ammo\flare_red"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; + }; + class CSE_RoadFlareYellow: CSE_Flare_Base { + ammo = "CSE_FuseeYellow"; + displayname = $STR_CSE_ROAD_FLARE_YELLOW; + descriptionshort = $STR_CSE_ROAD_FLARE_YELLOW; + displayNameShort = $STR_CSE_ROAD_FLARE_YELLOW; + model = "\A3\weapons_f\ammo\flare_yellow"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; + }; + class CSE_RoadFlareGreen: CSE_Flare_Base { + ammo = "CSE_FuseeGreen"; + displayname = $STR_CSE_ROAD_FLARE_GREEN; + descriptionshort = $STR_CSE_ROAD_FLARE_GREEN; + displayNameShort = $STR_CSE_ROAD_FLARE_GREEN; + model = "\A3\weapons_f\ammo\flare_green"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgFactionClasses.h b/TO_MERGE/cse/sys_equipment/CfgFactionClasses.h new file mode 100644 index 0000000000..3eed8715b8 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgFactionClasses.h @@ -0,0 +1,7 @@ +class CfgFactionClasses +{ + class NO_CATEGORY; + class cse_equipment: NO_CATEGORY { + displayName = "CSE Equipment"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgFunctions.h b/TO_MERGE/cse/sys_equipment/CfgFunctions.h new file mode 100644 index 0000000000..0112eaf16b --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgFunctions.h @@ -0,0 +1,49 @@ +class CfgFunctions { + class CSE { + class Equipment { + file = "cse\cse_sys_equipment\functions"; + class hasAttachableItem_EQ { recompile = 1; }; + class attachItem_EQ { recompile = 1; }; + class detachItem_EQ { recompile = 1; }; + class isAttachableItem_EQ { recompile = 1; }; + class hasItemAttached_EQ { recompile = 1; }; + class getAllEquipmentOptions_EQ { recompile = 1; }; + class registerNewEquipmentOption_EQ { recompile = 1; }; + class areEquipmentOptionsAvailable_EQ { recompile = 1; }; + class dropFlare_EQ { recompile = 1; }; + class moduleFlare_EQ { recompile = 1; }; + class hasFlare_EQ { recompile = 1; }; + class isFlare_EQ { recompile = 1; }; + class putWeaponOnBack_EQ { recompile = 1; }; + class getPercentageAmmoMagazine_EQ { recompile = 1; }; + class hideUnitInfoAmmo_EQ { recompile = 1; }; + }; + class WeaponRest { + file = "cse\cse_sys_equipment\weaponresting\functions"; + class keyPressed_WR { recompile = 1; }; + class canRestWeapon_WR { recompile = 1; }; + class canDeployBipod_WR { recompile = 1; }; + class restWeapon_WR { recompile = 1; }; + class unrestWeapon_WR { recompile = 1; }; + class deployWeapon_WR { recompile = 1; }; + class undeployWeapon_WR { recompile = 1; }; + class actionReleaseWeapon_WR { recompile = 1; }; + class hasBipod_WR { recompile = 1; }; + }; + class WeaponSafety { + file = "cse\cse_sys_equipment\weaponsafety\functions"; + class safetyOff_ws { recompile = 1; }; + class safetyOn_ws { recompile = 1; }; + }; + class nightVisionModule { + file = "cse\cse_sys_equipment\nvg\functions"; + class adjustBrightness_NVG { recompile = 1; }; + }; + + class MagazineRepack { + file = "cse\cse_sys_equipment\magazineRepack\functions"; + class repackMagazines { recompile = 1; }; + class repackMagazinesAll { recompile = 1; }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_equipment/CfgMovesBasic.h b/TO_MERGE/cse/sys_equipment/CfgMovesBasic.h new file mode 100644 index 0000000000..af719e15fc --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgMovesBasic.h @@ -0,0 +1,277 @@ +// Adpated from: https://github.com/Taosenai/tmr/blob/master/tmr_autorest/config.cpp + +#define CSE_DEPLOYED_TURNSPEED 0.1 + +class CfgMovesBasic { + class Default; + + class Actions { + class RifleStandActions; + class RifleStandActions_cse_deployed : RifleStandActions { + stop = "AmovPercMstpSrasWrflDnon_cse_deployed"; + default = "AmovPercMstpSrasWrflDnon_cse_deployed"; + turnL = "AmovPercMstpSrasWrflDnon_cse_deployed"; + turnR = "AmovPercMstpSrasWrflDnon_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustLStandActions; + class RifleAdjustLStandActions_cse_deployed : RifleAdjustLStandActions { + stop = "AadjPercMstpSrasWrflDleft_cse_deployed"; + default = "AadjPercMstpSrasWrflDleft_cse_deployed"; + AdjustL = "AadjPercMstpSrasWrflDleft_cse_deployed"; + turnL = "AadjPercMstpSrasWrflDleft_cse_deployed"; + turnR = "AadjPercMstpSrasWrflDleft_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustRStandActions; + class RifleAdjustRStandActions_cse_deployed : RifleAdjustRStandActions { + stop = "AadjPercMstpSrasWrflDright_cse_deployed"; + default = "AadjPercMstpSrasWrflDright_cse_deployed"; + AdjustRight = "AadjPercMstpSrasWrflDright_cse_deployed"; + turnL = "AadjPercMstpSrasWrflDright_cse_deployed"; + turnR = "AadjPercMstpSrasWrflDright_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFStandActions; + class RifleAdjustFStandActions_cse_deployed : RifleAdjustFStandActions { + stop = "AadjPercMstpSrasWrflDup_cse_deployed"; + default = "AadjPercMstpSrasWrflDup_cse_deployed"; + AdjustF = "AadjPercMstpSrasWrflDup_cse_deployed"; + turnL = "AadjPercMstpSrasWrflDup_cse_deployed"; + turnR = "AadjPercMstpSrasWrflDup_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustBStandActions; + class RifleAdjustBStandActions_cse_deployed : RifleAdjustBStandActions { + stop = "AadjPercMstpSrasWrflDdown_cse_deployed"; + default = "AadjPercMstpSrasWrflDdown_cse_deployed"; + AdjustB = "AadjPercMstpSrasWrflDdown_cse_deployed"; + turnR = "AadjPercMstpSrasWrflDdown_cse_deployed"; + turnL = "AadjPercMstpSrasWrflDdown_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustLKneelActions; + class RifleAdjustLKneelActions_cse_deployed : RifleAdjustLKneelActions { + stop = "AadjPknlMstpSrasWrflDleft_cse_deployed"; + default = "AadjPknlMstpSrasWrflDleft_cse_deployed"; + turnL = "AadjPknlMstpSrasWrflDleft_cse_deployed"; + turnR = "AadjPknlMstpSrasWrflDleft_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustRKneelActions; + class RifleAdjustRKneelActions_cse_deployed : RifleAdjustRKneelActions { + stop = "AadjPknlMstpSrasWrflDright_cse_deployed"; + default = "AadjPknlMstpSrasWrflDright_cse_deployed"; + turnL = "AadjPknlMstpSrasWrflDright_cse_deployed"; + turnR = "AadjPknlMstpSrasWrflDright_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFKneelActions; + class RifleAdjustFKneelActions_cse_deployed : RifleAdjustFKneelActions { + stop = "AadjPknlMstpSrasWrflDup_cse_deployed"; + default = "AadjPknlMstpSrasWrflDup_cse_deployed"; + turnL = "AadjPknlMstpSrasWrflDup_cse_deployed"; + turnR = "AadjPknlMstpSrasWrflDup_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustBKneelActions; + class RifleAdjustBKneelActions_cse_deployed : RifleAdjustBKneelActions { + stop = "AadjPknlMstpSrasWrflDdown_cse_deployed"; + default = "AadjPknlMstpSrasWrflDdown_cse_deployed"; + turnL = "AadjPknlMstpSrasWrflDdown_cse_deployed"; + turnR = "AadjPknlMstpSrasWrflDdown_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleKneelActions; + class RifleKneelActions_cse_deployed : RifleKneelActions { + stop = "AmovPknlMstpSrasWrflDnon_cse_deployed"; + default = "AmovPknlMstpSrasWrflDnon_cse_deployed"; + crouch = "AmovPknlMstpSrasWrflDnon_cse_deployed"; + turnL = "AmovPknlMstpSrasWrflDnon_cse_deployed"; + turnR = "AmovPknlMstpSrasWrflDnon_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleProneActions; + class RifleProneActions_cse_deployed : RifleProneActions { + stop = "AmovPpneMstpSrasWrflDnon_cse_deployed"; + default = "AmovPpneMstpSrasWrflDnon_cse_deployed"; + turnL = "AmovPpneMstpSrasWrflDnon_cse_deployed"; + turnR = "AmovPpneMstpSrasWrflDnon_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFProneActions; + class RifleAdjustFProneActions_cse_deployed : RifleAdjustFProneActions { + stop = "aadjppnemstpsraswrfldup_cse_deployed"; + default = "aadjppnemstpsraswrfldup_cse_deployed"; + turnL = "aadjppnemstpsraswrfldup_cse_deployed"; + turnR = "aadjppnemstpsraswrfldup_cse_deployed"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleStandActions_cse_rested : RifleStandActions { + stop = "AmovPercMstpSrasWrflDnon_cse_rested"; + default = "AmovPercMstpSrasWrflDnon_cse_rested"; + turnL = "AmovPercMstpSrasWrflDnon_cse_rested"; + turnR = "AmovPercMstpSrasWrflDnon_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustLStandActions_cse_rested : RifleAdjustLStandActions { + stop = "AadjPercMstpSrasWrflDleft_cse_rested"; + default = "AadjPercMstpSrasWrflDleft_cse_rested"; + AdjustL = "AadjPercMstpSrasWrflDleft_cse_rested"; + turnL = "AadjPercMstpSrasWrflDleft_cse_rested"; + turnR = "AadjPercMstpSrasWrflDleft_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustRStandActions_cse_rested : RifleAdjustRStandActions { + stop = "AadjPercMstpSrasWrflDright_cse_rested"; + default = "AadjPercMstpSrasWrflDright_cse_rested"; + AdjustRight = "AadjPercMstpSrasWrflDright_cse_rested"; + turnL = "AadjPercMstpSrasWrflDright_cse_rested"; + turnR = "AadjPercMstpSrasWrflDright_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFStandActions_cse_rested : RifleAdjustFStandActions { + stop = "AadjPercMstpSrasWrflDup_cse_rested"; + default = "AadjPercMstpSrasWrflDup_cse_rested"; + AdjustF = "AadjPercMstpSrasWrflDup_cse_rested"; + turnL = "AadjPercMstpSrasWrflDup_cse_rested"; + turnR = "AadjPercMstpSrasWrflDup_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustBStandActions_cse_rested : RifleAdjustBStandActions { + stop = "AadjPercMstpSrasWrflDdown_cse_rested"; + default = "AadjPercMstpSrasWrflDdown_cse_rested"; + AdjustB = "AadjPercMstpSrasWrflDdown_cse_rested"; + turnR = "AadjPercMstpSrasWrflDdown_cse_rested"; + turnL = "AadjPercMstpSrasWrflDdown_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustLKneelActions_cse_rested : RifleAdjustLKneelActions { + stop = "AadjPknlMstpSrasWrflDleft_cse_rested"; + default = "AadjPknlMstpSrasWrflDleft_cse_rested"; + turnL = "AadjPknlMstpSrasWrflDleft_cse_rested"; + turnR = "AadjPknlMstpSrasWrflDleft_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustRKneelActions_cse_rested : RifleAdjustRKneelActions { + stop = "AadjPknlMstpSrasWrflDright_cse_rested"; + default = "AadjPknlMstpSrasWrflDright_cse_rested"; + turnL = "AadjPknlMstpSrasWrflDright_cse_rested"; + turnR = "AadjPknlMstpSrasWrflDright_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFKneelActions_cse_rested : RifleAdjustFKneelActions { + stop = "AadjPknlMstpSrasWrflDup_cse_rested"; + default = "AadjPknlMstpSrasWrflDup_cse_rested"; + turnL = "AadjPknlMstpSrasWrflDup_cse_rested"; + turnR = "AadjPknlMstpSrasWrflDup_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustBKneelActions_cse_rested : RifleAdjustBKneelActions { + stop = "AadjPknlMstpSrasWrflDdown_cse_rested"; + default = "AadjPknlMstpSrasWrflDdown_cse_rested"; + turnL = "AadjPknlMstpSrasWrflDdown_cse_rested"; + turnR = "AadjPknlMstpSrasWrflDdown_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleKneelActions_cse_rested : RifleKneelActions { + stop = "AmovPknlMstpSrasWrflDnon_cse_rested"; + default = "AmovPknlMstpSrasWrflDnon_cse_rested"; + crouch = "AmovPknlMstpSrasWrflDnon_cse_rested"; + turnL = "AmovPknlMstpSrasWrflDnon_cse_rested"; + turnR = "AmovPknlMstpSrasWrflDnon_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleProneActions_cse_rested : RifleProneActions { + stop = "AmovPpneMstpSrasWrflDnon_cse_rested"; + default = "AmovPpneMstpSrasWrflDnon_cse_rested"; + turnL = "AmovPpneMstpSrasWrflDnon_cse_rested"; + turnR = "AmovPpneMstpSrasWrflDnon_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustLProneActions; + class RifleAdjustLProneActions_cse_rested : RifleAdjustLProneActions { + stop = "aadjppnemstpsraswrfldleft_cse_rested"; + default = "aadjppnemstpsraswrfldleft_cse_rested"; + turnL = "aadjppnemstpsraswrfldleft_cse_rested"; + turnR = "aadjppnemstpsraswrfldleft_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustRProneActions; + class RifleAdjustRProneActions_cse_rested : RifleAdjustRProneActions { + stop = "aadjppnemstpsraswrfldright_cse_rested"; + default = "aadjppnemstpsraswrfldright_cse_rested"; + turnL = "aadjppnemstpsraswrfldright_cse_rested"; + turnR = "aadjppnemstpsraswrfldright_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustBProneActions; + class RifleAdjustBProneActions_cse_rested : RifleAdjustBProneActions { + stop = "aadjppnemstpsraswrflddown_cse_rested"; + default = "aadjppnemstpsraswrflddown_cse_rested"; + turnL = "aadjppnemstpsraswrflddown_cse_rested"; + turnR = "aadjppnemstpsraswrflddown_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + + class RifleAdjustFProneActions_cse_rested : RifleAdjustFProneActions { + stop = "aadjppnemstpsraswrfldup_cse_rested"; + default = "aadjppnemstpsraswrfldup_cse_rested"; + turnL = "aadjppnemstpsraswrfldup_cse_rested"; + turnR = "aadjppnemstpsraswrfldup_cse_rested"; + turnSpeed = CSE_DEPLOYED_TURNSPEED; + limitFast = 1; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_equipment/CfgMovesMaleSdr.h b/TO_MERGE/cse/sys_equipment/CfgMovesMaleSdr.h new file mode 100644 index 0000000000..207622724a --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgMovesMaleSdr.h @@ -0,0 +1,403 @@ +// Adpated from: https://github.com/Taosenai/tmr/blob/master/tmr_autorest/config.cpp + +#define CSE_SWAY_DEPLOYED 0.06 +#define CSE_SWAY_DEPLOYED_PRONE 0.03 +#define CSE_SWAY_RESTED 0.30 +#define CSE_SWAY_RESTED_PRONE 0.10 + +class CfgMovesMaleSdr : CfgMovesBasic { + class States { + class AmovPercMstpSrasWrflDnon; + class AmovPercMstpSrasWrflDnon_cse_deployed : AmovPercMstpSrasWrflDnon { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleStandActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"AmovPercMstpSrasWrflDnon_cse_deployed", 0.02}; + ConnectFrom[] = {"AmovPercMstpSrasWrflDnon_cse_deployed", 0.02}; + InterpolateFrom[] = {"AmovPercMstpSrasWrflDnon", 0.02}; + InterpolateTo[] = {"AmovPercMstpSrasWrflDnon", 0.02}; + }; + + class aadjpercmstpsraswrfldup; + class aadjpercmstpsraswrfldup_cse_deployed : aadjpercmstpsraswrfldup { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustFStandActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldup_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldup_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldup", 0.02}; + }; + + class aadjpercmstpsraswrflddown; + class aadjpercmstpsraswrflddown_cse_deployed : aadjpercmstpsraswrflddown { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustBStandActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrflddown_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrflddown_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrflddown", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrflddown", 0.02}; + }; + + class aadjpercmstpsraswrfldright; + class aadjpercmstpsraswrfldright_cse_deployed : aadjpercmstpsraswrfldright { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustRStandActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldright_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldright_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldright", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldright", 0.02}; + }; + + class aadjpercmstpsraswrfldleft; + class aadjpercmstpsraswrfldleft_cse_deployed : aadjpercmstpsraswrfldleft { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustLStandActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldleft_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldleft_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldleft", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldleft", 0.02}; + }; + + class aadjpknlmstpsraswrfldup; + class aadjpknlmstpsraswrfldup_cse_deployed : aadjpknlmstpsraswrfldup { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustFKneelActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldup_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldup_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldup", 0.02}; + }; + + class amovpknlmstpsraswrfldnon; + class amovpknlmstpsraswrfldnon_cse_deployed : amovpknlmstpsraswrfldnon { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleKneelActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"amovpknlmstpsraswrfldnon_cse_deployed", 0.02}; + ConnectFrom[] = {"amovpknlmstpsraswrfldnon_cse_deployed", 0.02}; + InterpolateFrom[] = {"amovpknlmstpsraswrfldnon", 0.02}; + InterpolateTo[] = {"amovpknlmstpsraswrfldnon", 0.02}; + }; + + class aadjpknlmstpsraswrflddown; + class aadjpknlmstpsraswrflddown_cse_deployed : aadjpknlmstpsraswrflddown { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustBKneelActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrflddown_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrflddown_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrflddown", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrflddown", 0.02}; + }; + + class aadjpknlmstpsraswrfldleft; + class aadjpknlmstpsraswrfldleft_cse_deployed : aadjpknlmstpsraswrfldleft { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustLKneelActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldleft_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldleft_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldleft", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldleft", 0.02}; + }; + + class aadjpknlmstpsraswrfldright; + class aadjpknlmstpsraswrfldright_cse_deployed : aadjpknlmstpsraswrfldright { + aimPrecision = CSE_SWAY_DEPLOYED; + actions = "RifleAdjustRKneelActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldright_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldright_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldright", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldright", 0.02}; + }; + + class aadjppnemstpsraswrfldup; + class aadjppnemstpsraswrfldup_cse_deployed : aadjppnemstpsraswrfldup { + aimPrecision = CSE_SWAY_DEPLOYED_PRONE; + actions = "RifleAdjustFProneActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjppnemstpsraswrfldup_cse_deployed", 0.02}; + ConnectFrom[] = {"aadjppnemstpsraswrfldup_cse_deployed", 0.02}; + InterpolateFrom[] = {"aadjppnemstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjppnemstpsraswrfldup", 0.02}; + }; + + class amovppnemstpsraswrfldnon; + class amovppnemstpsraswrfldnon_cse_deployed : amovppnemstpsraswrfldnon { + aimPrecision = CSE_SWAY_DEPLOYED_PRONE; + actions = "RifleProneActions_cse_deployed"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"amovppnemstpsraswrfldnon_cse_deployed", 0.02}; + ConnectFrom[] = {"amovppnemstpsraswrfldnon_cse_deployed", 0.02}; + InterpolateFrom[] = {"amovppnemstpsraswrfldnon", 0.02}; + InterpolateTo[] = {"amovppnemstpsraswrfldnon", 0.02}; + }; + + class AmovPercMstpSrasWrflDnon_cse_rested : AmovPercMstpSrasWrflDnon { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleStandActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"AmovPercMstpSrasWrflDnon_cse_rested", 0.02}; + ConnectFrom[] = {"AmovPercMstpSrasWrflDnon_cse_rested", 0.02}; + InterpolateFrom[] = {"AmovPercMstpSrasWrflDnon", 0.02}; + InterpolateTo[] = {"AmovPercMstpSrasWrflDnon", 0.02}; + }; + + class aadjpercmstpsraswrfldup_cse_rested : aadjpercmstpsraswrfldup { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustFStandActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldup_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldup_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldup", 0.02}; + }; + + class aadjpercmstpsraswrflddown_cse_rested : aadjpercmstpsraswrflddown { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustBStandActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrflddown_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrflddown_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrflddown", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrflddown", 0.02}; + }; + + class aadjpercmstpsraswrfldright_cse_rested : aadjpercmstpsraswrfldright { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustRStandActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldright_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldright_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldright", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldright", 0.02}; + }; + + class aadjpercmstpsraswrfldleft_cse_rested : aadjpercmstpsraswrfldleft { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustLStandActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpercmstpsraswrfldleft_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpercmstpsraswrfldleft_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpercmstpsraswrfldleft", 0.02}; + InterpolateTo[] = {"aadjpercmstpsraswrfldleft", 0.02}; + }; + + class aadjpknlmstpsraswrfldup_cse_rested : aadjpknlmstpsraswrfldup { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustFKneelActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldup_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldup_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldup", 0.02}; + }; + + class amovpknlmstpsraswrfldnon_cse_rested : amovpknlmstpsraswrfldnon { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleKneelActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"amovpknlmstpsraswrfldnon_cse_rested", 0.02}; + ConnectFrom[] = {"amovpknlmstpsraswrfldnon_cse_rested", 0.02}; + InterpolateFrom[] = {"amovpknlmstpsraswrfldnon", 0.02}; + InterpolateTo[] = {"amovpknlmstpsraswrfldnon", 0.02}; + }; + + class aadjpknlmstpsraswrflddown_cse_rested : aadjpknlmstpsraswrflddown { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustBKneelActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrflddown_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrflddown_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrflddown", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrflddown", 0.02}; + }; + + class aadjpknlmstpsraswrfldleft_cse_rested : aadjpknlmstpsraswrfldleft { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustLKneelActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldleft_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldleft_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldleft", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldleft", 0.02}; + }; + + class aadjpknlmstpsraswrfldright_cse_rested : aadjpknlmstpsraswrfldright { + aimPrecision = CSE_SWAY_RESTED; + actions = "RifleAdjustRKneelActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjpknlmstpsraswrfldright_cse_rested", 0.02}; + ConnectFrom[] = {"aadjpknlmstpsraswrfldright_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjpknlmstpsraswrfldright", 0.02}; + InterpolateTo[] = {"aadjpknlmstpsraswrfldright", 0.02}; + }; + + class aadjppnemstpsraswrfldup_cse_rested : aadjppnemstpsraswrfldup { + aimPrecision = CSE_SWAY_RESTED_PRONE; + actions = "RifleAdjustFProneActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjppnemstpsraswrfldup_cse_rested", 0.02}; + ConnectFrom[] = {"aadjppnemstpsraswrfldup_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjppnemstpsraswrfldup", 0.02}; + InterpolateTo[] = {"aadjppnemstpsraswrfldup", 0.02}; + }; + + class aadjppnemstpsraswrfldleft; + class aadjppnemstpsraswrfldleft_cse_rested : aadjppnemstpsraswrfldleft { + aimPrecision = CSE_SWAY_RESTED_PRONE; + actions = "RifleAdjustLProneActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjppnemstpsraswrfldleft_cse_rested", 0.02}; + ConnectFrom[] = {"aadjppnemstpsraswrfldleft_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjppnemstpsraswrfldleft", 0.02}; + InterpolateTo[] = {"aadjppnemstpsraswrfldleft", 0.02}; + }; + + class aadjppnemstpsraswrfldright; + class aadjppnemstpsraswrfldright_cse_rested : aadjppnemstpsraswrfldright { + aimPrecision = CSE_SWAY_RESTED_PRONE; + actions = "RifleAdjustRProneActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjppnemstpsraswrfldright_cse_rested", 0.02}; + ConnectFrom[] = {"aadjppnemstpsraswrfldright_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjppnemstpsraswrfldright", 0.02}; + InterpolateTo[] = {"aadjppnemstpsraswrfldright", 0.02}; + }; + + class aadjppnemstpsraswrflddown; + class aadjppnemstpsraswrflddown_cse_rested : aadjppnemstpsraswrflddown { + aimPrecision = CSE_SWAY_RESTED_PRONE; + actions = "RifleAdjustBProneActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"aadjppnemstpsraswrflddown_cse_rested", 0.02}; + ConnectFrom[] = {"aadjppnemstpsraswrflddown_cse_rested", 0.02}; + InterpolateFrom[] = {"aadjppnemstpsraswrflddown", 0.02}; + InterpolateTo[] = {"aadjppnemstpsraswrflddown", 0.02}; + }; + + class amovppnemstpsraswrfldnon_cse_rested : amovppnemstpsraswrfldnon { + aimPrecision = CSE_SWAY_RESTED_PRONE; + actions = "RifleProneActions_cse_rested"; + aiming = "aimingLying"; + speed = 0.01; + onLandEnd = true; + onLandBeg = true; + + ConnectTo[] = {"amovppnemstpsraswrfldnon_cse_rested", 0.02}; + ConnectFrom[] = {"amovppnemstpsraswrfldnon_cse_rested", 0.02}; + InterpolateFrom[] = {"amovppnemstpsraswrfldnon", 0.02}; + InterpolateTo[] = {"amovppnemstpsraswrfldnon", 0.02}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgSounds.h b/TO_MERGE/cse/sys_equipment/CfgSounds.h new file mode 100644 index 0000000000..87c417cc0e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgSounds.h @@ -0,0 +1,28 @@ +class CfgSounds +{ + class cse_magrepack_finished + { + name="cse_magrepack_finished"; + sound[]={"\cse\cse_sys_equipment\magazineRepack\sound\magrepack_finished.wav",1,1}; + titles[]={}; + }; + class cse_magrepack_single + { + name="cse_magrepack_single"; + sound[]={"\cse\cse_sys_equipment\magazineRepack\sound\magrepack_single.wav",1,1}; + titles[]={}; + }; + + class cse_weaponrest_rest + { + name="cse_weaponrest_rest"; + sound[]={"\cse\cse_sys_equipment\weaponresting\sound\weaponrest_rest.wav",1,1}; + titles[]={}; + }; + class cse_weaponrest_unrest + { + name="cse_weaponrest_unrest"; + sound[]={"\cse\cse_sys_equipment\weaponresting\sound\weaponrest_unrest.wav",1,1}; + titles[]={}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgVehicles.h b/TO_MERGE/cse/sys_equipment/CfgVehicles.h new file mode 100644 index 0000000000..f37c4dd6e9 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgVehicles.h @@ -0,0 +1,224 @@ +class CfgVehicles +{ + class Land_HelipadEmpty_F; + class cse_LogicDummy: Land_HelipadEmpty_F + { + scope = 1; + slx_xeh_disabled = 1; + class EventHandlers { + init = "(_this select 0) enableSimulation false"; + }; + }; + + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + + class cse_sys_equipment: Module_F { + scope = 2; + displayName = "Equipment Options [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class magazineRepack { + displayName = "Magazine Repack"; + description = "Lets players repack their magazines in the field"; + typeName = "BOOL"; + defaultValue = true; + }; + class attachableItems { + displayName = "Attachable Items"; + description = "Allows for attaching chemlights, IR strobes and the like"; + typeName = "BOOL"; + defaultValue = true; + }; + class weaponResting { + displayName = "Weapon Resting"; + description = "Allow players to rest their weapons and deploy bipods."; + typeName = "BOOL"; + defaultValue = true; + }; + class weaponSafety { + displayName = "Weapon Safety"; + description = "Allow players to put their weapons on safe."; + typeName = "BOOL"; + defaultValue = true; + }; + class adjustableNVG { + displayName = "NVG Adjustments"; + description = "Allow players to adjust their NVG brightness"; + typeName = "BOOL"; + defaultValue = true; + }; + class allowWeaponSelect { + displayName = "Weapon selection"; + description = "Allow players to select weapons through keybindings"; + typeName = "BOOL"; + defaultValue = true; + }; + class allowAmmoChecking { + displayName = "Ammo Checking"; + description = "Allow players to check their Ammunition"; + typeName = "BOOL"; + defaultValue = true; + }; + class hideAmmoValues { + displayName = "Hide Ammo"; + description = "Hide the Ammunition counter for players"; + typeName = "NUMBER"; + defaultValue = 0; + class values { + class enable { + name = "Yes"; + value = 1; + }; + class disable { + name = "No"; + value = 0; + default = 1; + }; + }; + }; + }; + class ModuleDescription { + description = "Various actions/equipment settings."; + sync[] = {}; + }; + }; + + // BACKWARDS COMPATABILITY MODULES PRESSENCE + class cse_sys_magazineRepack: Module_F { + scope = 1; // hidden for backwards compatability + displayName = "Magazine Repack [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + }; + class ModuleDescription { + description = "Lets players repack their magazines in the field"; + sync[] = {}; + }; + }; + class cse_sys_attachableItems: Module_F { + scope = 1; // hidden for backwards compatability + displayName = "Attachable Items [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + }; + class ModuleDescription { + description = "Allows for attaching chemlights, IR strobes and the like"; + sync[] = {}; + }; + }; + + class cse_sys_weaponrest: Module_F { + scope = 1; // hidden for backwards compatability + displayName = "Weapon Resting [CSE]"; + icon = "\cse\cse_main\data\cse_rifle_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments + { + + }; + }; + + class cse_sys_weaponsafety: Module_F { + scope = 1; // hidden for backwards compatability + displayName = "Weapon Safety [CSE]"; + icon = "\cse\cse_main\data\cse_rifle_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments + { + + }; + }; + + class cse_sys_nightvision: Module_F { + scope = 1; // hidden for backwards compatability + displayName = "Night Vision [CSE]"; + icon = "\cse\cse_main\data\cse_nvg_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + }; + }; + // END BACKWARDS COMPATABILITY + + + // curator modules + class cse_moduleGroundFlare_White: Module_F { + scope = 1; + scopeCurator = 2; + displayName = "White Flare (Ground)"; + icon = "\a3\Modules_F_Curator\Data\iconFlare_ca.paa"; + category = "Effects"; + function = "cse_fnc_moduleFlare_EQ"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + ammo = "CSE_FlareWhite"; + class Arguments { + }; + class ModuleDescription { + description = "Places a white flare on the ground"; + sync[] = {}; + }; + }; + class cse_moduleGroundFlare_Red: cse_moduleGroundFlare_White { + displayName = "Red Flare (Ground)"; + ammo = "CSE_FlareRed"; + class Arguments { + }; + class ModuleDescription { + description = "Places a red flare on the ground"; + sync[] = {}; + }; + }; + class cse_moduleGroundFlare_Yellow: cse_moduleGroundFlare_White { + displayName = "Yellow Flare (Ground)"; + ammo = "CSE_FlareYellow"; + class Arguments { + }; + class ModuleDescription { + description = "Places a yellow flare on the ground"; + sync[] = {}; + }; + }; + class cse_moduleGroundFlare_Green: cse_moduleGroundFlare_White { + displayName = "Green Flare (Ground)"; + ammo = "CSE_FlareGreen"; + class Arguments { + }; + class ModuleDescription { + description = "Places a green flare on the ground"; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/CfgWeapons.h b/TO_MERGE/cse/sys_equipment/CfgWeapons.h new file mode 100644 index 0000000000..2aa1cb1840 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/CfgWeapons.h @@ -0,0 +1,56 @@ +class CfgWeapons { + class GrenadeLauncher; + class Throw: GrenadeLauncher { + muzzles[] += {"CSE_FlareWhiteMuzzle", "CSE_FlareRedMuzzle", "CSE_FlareGreenMuzzle", "CSE_FlareYellowMuzzle", "CSE_RoadFlareWhiteMuzzle", "CSE_RoadFlareRedMuzzle", "CSE_RoadFlareGreenMuzzle", "CSE_RoadFlareYellowMuzzle"}; + class ThrowMuzzle; + class CSE_FlareWhiteMuzzle: ThrowMuzzle { + magazines[] = {"CSE_FlareWhite"}; + }; + class CSE_FlareRedMuzzle: ThrowMuzzle { + magazines[] = {"CSE_FlareRed"}; + }; + class CSE_FlareGreenMuzzle: ThrowMuzzle { + magazines[] = {"CSE_FlareGreen"}; + }; + class CSE_FlareYellowMuzzle: ThrowMuzzle { + magazines[] = {"CSE_FlareYellow"}; + }; + + class CSE_RoadFlareWhiteMuzzle: ThrowMuzzle { + magazines[] = {"CSE_RoadFlareWhite"}; + }; + class CSE_RoadFlareRedMuzzle: ThrowMuzzle { + magazines[] = {"CSE_RoadFlareRed"}; + }; + class CSE_RoadFlareGreenMuzzle: ThrowMuzzle { + magazines[] = {"CSE_RoadFlareGreen"}; + }; + class CSE_RoadFlareYellowMuzzle: ThrowMuzzle { + magazines[] = {"CSE_RoadFlareYellow"}; + }; + }; + + class Rifle_Base_F; + class Rifle_Long_Base_F; + class arifle_MX_Base_F; + class arifle_MX_SW_F: arifle_MX_Base_F + { + cse_bipod = 1; + }; + class LMG_Mk200_F: Rifle_Base_F + { + cse_bipod = 1; + }; + class LMG_Zafir_F: Rifle_Base_F + { + cse_bipod = 1; + }; + class LRR_base_F: Rifle_Long_Base_F + { + cse_bipod = 1; + }; + class GM6_base_F: Rifle_Long_Base_F + { + cse_bipod = 1; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_equipment/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..e1ae338102 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/Combat_Space_Enhancement.h @@ -0,0 +1,87 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class EventHandlers { + class PostInit_EventHandlers { + class cse_sys_equipment { + // init = " call compile preprocessFile 'cse\cse_sys_equipment\init_sys_equipment.sqf';"; + }; + }; + }; + class cfgModules { + class cse_sys_equipment { + init = "call compile preprocessFile 'cse\cse_sys_equipment\init_sys_equipment.sqf';"; + name = "Equipment Module"; + class EventHandlers { + class AllVehicles { + GetOut = "if (CSE_HIDE_AMMO_COUNTERS_EQ> 0) then { if (_this select 2 == player) then {0 = [] spawn { waituntil {vehicle player == player}; [true] call cse_fnc_hidEUnitInfoAmmo_EQ;};};};"; + }; + }; + }; + + // BACKWARDS COMPATABILITY MODULES + // Have to stay put, as cse_sys_equipment will make use of them. + // The modules themselves will be hidden. + class cse_sys_magazineRepack { + init = "call compile preprocessFile 'cse\cse_sys_equipment\scripts\register_magazine_repack_actions.sqf';"; + name = "Magazine Repack"; + disableConfigExecution = 1; + }; + class cse_sys_attachableItems { + init = "call compile preprocessFile 'cse\cse_sys_equipment\scripts\register_attachable_items_actions.sqf';"; + name = "Attachable Items"; + disableConfigExecution = 1; + }; + + class cse_sys_weaponrest { + init = "call compile preprocessFile 'cse\cse_sys_equipment\weaponresting\init_sys_weaponrest.sqf';"; + name = "Weapon Resting & Bipods"; + disableConfigExecution = 1; + class Configurations { + class cse_sys_weaponRestAction { + type = ACTION_KEYBINDING; + title = $STR_DEPLOY_WEAPON_REST_TTTLE; + description = $STR_DEPLOY_WEAPON_REST_DESC; + value[] = {56,1,2,2}; + onPressed = "[] call cse_fnc_keyPressed_WR;"; + }; + class cse_sys_weaponUnrestAction { + type = ACTION_KEYBINDING; + title = $STR_DEPLOY_WEAPON_UNREST_TTTLE; + description = $STR_DEPLOY_WEAPON_UNREST_DESC; + value[] = {0,0,0,0}; + onPressed = "[] call cse_fnc_actionReleaseWeapon_WR;"; + }; + }; + }; + class cse_sys_weaponsafety { + init = "call compile preprocessFile 'cse\cse_sys_equipment\weaponsafety\init_sys_weaponsafety.sqf';"; + name = "Weapon Safety"; + disableConfigExecution = 1; + }; + class cse_sys_nightvision { + init = "call compile preprocessFile 'cse\cse_sys_equipment\nvg\init_sys_nightvision.sqf';"; + name = "Night Vision"; + disableConfigExecution = 1; + class Configurations { + class cse_sys_nvgAdjustBrightness_UP { + type = ACTION_KEYBINDING; + title = $STR_INCREASE_NVG_BIRGHTNESS_TITLE; + description = $STR_INCREASE_NVG_BIRGHTNESS_DESC; + value[] = {201,0,0,1}; + onPressed = "[player,0.1] call cse_fnc_adjustBrightness_NVG;"; + }; + class cse_sys_nvgAdjustBrightness_DOWN { + type = ACTION_KEYBINDING; + title = $STR_DECREASE_NVG_BIRGHTNESS_TITLE; + description = $STR_DECREASE_NVG_BIRGHTNESS_DESC; + value[] = {209,0,0,1}; + onPressed = "[player,-0.1] call cse_fnc_adjustBrightness_NVG;"; + }; + }; + }; + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/UI.h b/TO_MERGE/cse/sys_equipment/UI.h new file mode 100644 index 0000000000..11255d108c --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/UI.h @@ -0,0 +1 @@ +#include "ui\rscTitles.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/config.cpp b/TO_MERGE/cse/sys_equipment/config.cpp new file mode 100644 index 0000000000..106d0e6b37 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/config.cpp @@ -0,0 +1,59 @@ +class CfgPatches { + class cse_sys_equipment { + units[] = {"cse_moduleGroundFlare_White", "cse_moduleGroundFlare_Red","cse_moduleGroundFlare_Green","cse_moduleGroundFlare_Yellow"}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"A3_Modules_F", "A3_UI_F", "cse_main", "cse_gui", "cse_f_eh"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + website = "csemod.com"; + }; + class cse_sys_magazineRepack { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main"}; + versionDesc = "CSE Magazine Repack"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; + class cse_sys_weaponrest { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main", "A3_Weapons_F", "A3_Weapons_F_Rifles_MX"}; + versionDesc = "CSE Weapon Resting"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement", "Tupolov", "Glowbal"}; + authorUrl = "http://csemod.com"; + }; + class cse_sys_nightvision { + units[] = {}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main"}; + versionDesc = "CSE Night Vision"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class CfgAddons { + class PreloadAddons { + class cse_sys_equipment { + list[] = {"cse_sys_equipment", "cse_sys_magazineRepack", "cse_sys_weaponrest", "cse_sys_nightvision"}; + }; + }; +}; +#include "Combat_Space_Enhancement.h" +#include "CfgFactionClasses.h" +#include "CfgVehicles.h" +#include "CfgFunctions.h" +#include "CfgSounds.h" +#include "CfgAmmo.h" +#include "CfgWeapons.h" +#include "CfgMovesBasic.h" +#include "CfgMovesMaleSdr.h" +#include "UI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_areEquipmentOptionsAvailable_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_areEquipmentOptionsAvailable_EQ.sqf new file mode 100644 index 0000000000..4a805582ce --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_areEquipmentOptionsAvailable_EQ.sqf @@ -0,0 +1,19 @@ +/** + * fn_areEquipmentOptionsAvailable_EQ.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return","_equipOpt"]; +_return = false; +_equipOpt = ([] call cse_fnc_getAllEquipmentOptions_EQ); +{ + if (_this call (_x select 1)) exitwith { + _return = true; + }; +}foreach _equipOpt; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_attachItem_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_attachItem_EQ.sqf new file mode 100644 index 0000000000..570bc37d33 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_attachItem_EQ.sqf @@ -0,0 +1,55 @@ +/** + * fn_attachItem_EQ.sqf + * @Descr: Attach an item of given classname. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, item STRING (Classname of magazine item)] + * @Return: nil + * @PublicAPI: true + */ + +private ["_unit","_chemlight","_isStrobeLight", "_light"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_item = [_this, 1, "", [""]] call BIS_fnc_Param; + +[format["Attach item: %1",_this]] call cse_fnc_debug; + +if (!isNull(_unit getvariable ["cse_attachedItem_EQ",objNull])) exitwith {}; +if !([_unit,_item] call cse_fnc_hasMagazine) exitwith{}; +if !([_item] call cse_fnc_isAttachableItem_EQ) exitwith{}; + +_unit setvariable ["cse_attachedItemClassName_EQ", _item]; + +_isStrobeLight = switch (_item) do { + case "B_IR_Grenade": {true}; + case "I_IR_Grenade": {true}; + case "O_IR_Grenade": {true}; + default {false}; +}; +if (_isStrobeLight) then { + _light = (toString [(toArray _item) select 0] + "_IRStrobe") createVehicle (getPos _unit); +} else { + _light = _item createVehicle (getPos _unit); +}; + +if (!isNull _light) then { + [_unit,_item] call cse_fnc_useMagazine; + _light attachTo [_unit,[0.1,-0.1,-0.1],"head"]; + _unit setvariable["cse_attachedItem_EQ",_light,true]; +}; + + + +[_unit, _light] spawn { + _unit = _this select 0; + _light = _this select 1; + while {((alive _light) && !isNull(_unit getvariable ["cse_attachedItem_EQ",objNull]) && alive _unit)} do { + if (vehicle _unit != _unit) then { + _positionInWorld = _unit modelToWorld (_unit selectionPosition "head"); + _vehPos = (vehicle _unit) worldToModel _positionInWorld; + _light attachTo [(vehicle _unit),_vehPos]; + } else { + _light attachTo [_unit,[0.1,-0.1,-0.1],"head"]; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_detachItem_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_detachItem_EQ.sqf new file mode 100644 index 0000000000..e962f9b2ea --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_detachItem_EQ.sqf @@ -0,0 +1,49 @@ +/** + * fn_detachItem_EQ.sqf + * @Descr: Detach current attached item and add it back to the magazines list of the unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL True if succesful. + * @PublicAPI: true + */ + +private ["_unit","_chemlight","_isStrobeLight", "_light","_item", "_originalCount"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; + +_item = _unit getvariable ["cse_attachedItem_EQ",objNull]; +_unit setvariable["cse_attachedItem_EQ",nil,true]; + +if (isNull _item) exitwith {true}; +_isStrobeLight = switch (typeOf _item) do { + case "B_IRStrobe": {true}; + case "I_IRStrobe": {true}; + case "O_IRStrobe": {true}; + default {false}; +}; +if (_isStrobeLight) then { + _light = switch (typeOf _item) do { + case "B_IRStrobe": {"B_IR_Grenade"}; + case "I_IRStrobe": {"I_IR_Grenade"}; + case "O_IRStrobe": {"O_IR_Grenade"}; + }; +} else { + _light = typeOf _item; +}; +[format ["Detaching %1 %2", _unit, _light]] call cse_fnc_debug; + _originalCount = ({_x == _light} count magazines _unit); + +_unit addMagazine [_light, 1]; +if ((_originalCount + 1) < ({_x == _light} count magazines _unit)) then { + _unit removeMagazine _light; +}; +detach _item; + +if (_isStrobeLight) then { + _item setPos [-10000,-10000,-10000]; + + // sleeping to ensure the IR strobe effect is properly gone before we delete the source. + sleep 5; +}; +deleteVehicle _item; +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_dropFlare_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_dropFlare_EQ.sqf new file mode 100644 index 0000000000..b7e94e91f0 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_dropFlare_EQ.sqf @@ -0,0 +1,32 @@ +/** + * fn_dropFlare_EQ.sqf + * @Descr: Drop a flare object + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, flare STRING (Classname of the flare or fusee)] + * @Return: OBJECT The created flare. Objnull if failure. + * @PublicAPI: true + */ + +private ["_unit", "_item", "_flareObj"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_item = [_this, 1, "", [""]] call BIS_fnc_Param; + +_continue = switch (_item) do { + case "CSE_FlareWhite": {true}; + case "CSE_FlareRed": {true}; + case "CSE_FlareGreen": {true}; + case "CSE_FlareYellow": {true}; + case "CSE_RoadFlareWhite": {true}; + case "CSE_RoadFlareRed": {true}; + case "CSE_RoadFlareGreen": {true}; + case "CSE_RoadFlareYellow": {true}; + default {false}; +}; +if (!_continue) exitwith {objNull}; +if (_unit isKindof "CAManBAse") then { + [_unit, _item] call cse_fnc_useMagazine; +}; +_flareObj = _item createVehicle getPos _unit; + +_flareObj \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_getAllEquipmentOptions_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_getAllEquipmentOptions_EQ.sqf new file mode 100644 index 0000000000..ad4d42b68e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_getAllEquipmentOptions_EQ.sqf @@ -0,0 +1,22 @@ +/** + * fn_getAllEquipmentOptions_EQ.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private["_return"]; +_return = []; +if (isnil "CSE_EQUIPMENT_OPTIONS_EQ") then { + CSE_EQUIPMENT_OPTIONS_EQ = _return; +}; +/* +{ + _return set [count _return, _x]; +}foreach CSE_EQUIPMENT_OPTIONS_EQ; +*/ +_return = + CSE_EQUIPMENT_OPTIONS_EQ; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_getPercentageAmmoMagazine_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_getPercentageAmmoMagazine_EQ.sqf new file mode 100644 index 0000000000..46455c4066 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_getPercentageAmmoMagazine_EQ.sqf @@ -0,0 +1,27 @@ +/** + * fn_getPercentageAmmoMagazine_EQ.sqf + * @Descr: Get percentage of ammo in currentMagazine left. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: NUMBER A number between 100 and 0, with 100 being a full magazine and 0 being empty (No ammo left). + * @PublicAPI: true + */ + +private ["_unit", "_percentage", "_maxAmmoCount", "_currentAmmoCount"]; +_unit = _this select 0; +_percentage = 0; + +if (currentWeapon _unit != "") then { + { + if (_x select 4 == currentMuzzle _unit) exitWith { + _currentAmmoCount = _x select 1; + _maxAmmoCount = getNumber(configFile >> "CfgMagazines" >> (_x select 0) >> "count"); + if (_maxAmmoCount > 0) then { + _percentage = (_currentAmmoCount / _maxAmmoCount) * 100; + }; + }; + } forEach (magazinesAmmoFull _unit); +}; + +_percentage diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_hasAttachableItem_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_hasAttachableItem_EQ.sqf new file mode 100644 index 0000000000..a130e32ef6 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_hasAttachableItem_EQ.sqf @@ -0,0 +1,20 @@ +/** + * fn_hasAttachableItem_EQ.sqf + * @Descr: Check if unit has an attachable Item. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_unit","_return"]; +_unit = _this select 0; +_return = false; +{ + if ([_x] call cse_fnc_isAttachableItem_EQ) exitwith { + _return = true; + }; +}foreach (magazines _unit); + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_hasFlare_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_hasFlare_EQ.sqf new file mode 100644 index 0000000000..f8579d2f97 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_hasFlare_EQ.sqf @@ -0,0 +1,19 @@ +/** + * fn_hasFlare_EQ.sqf + * @Descr: Check if given unit has a flare. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private[ "_unit", "_return"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +if !(_unit isKindof "CAManBase") exitwith {false}; +_return = false; +{ + if ([_x] call cse_fnc_isFlare_EQ) exitwith {_return = true;}; +}foreach (magazines _unit); + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_hasItemAttached_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_hasItemAttached_EQ.sqf new file mode 100644 index 0000000000..2a32cd4d8a --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_hasItemAttached_EQ.sqf @@ -0,0 +1,15 @@ +/** + * fn_hasItemAttached_EQ.sqf + * @Descr: Check if unit has an item attached + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_unit", "_item"]; +_unit = _this select 0; +_item = _unit getvariable ["cse_attachedItem_EQ",objNull]; + +(!isNull _item); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_hideUnitInfoAmmo_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_hideUnitInfoAmmo_EQ.sqf new file mode 100644 index 0000000000..233709a562 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_hideUnitInfoAmmo_EQ.sqf @@ -0,0 +1,39 @@ +/** + * fn_hideUnitInfoAmmo_EQ.sqf + * @Descr: Hide the unitInfo ammo related parts. Credits Vladimir Hynek (BI Dev) for original code from BIS_fnc_showUnitInfo + * @Author: Glowbal + * + * @Arguments: [hide BOOL] + * @Return: nil + * @PublicAPI: true + */ + +private ["_hide"]; +_hide = [_this, 0, true, [true]] call BIS_fnc_param; +[format["Hiding unitAmmoInfo %1", _hide]] call cse_fnc_debug; +disableSerialization; +{ + if((ctrlIDD _x) == 300) then + { + private ["_unitInfoDisplay"]; + _unitInfoDisplay = _x; + + { + if (_x in [184, 185, 151]) then { + private ["_ctrl"]; + _ctrl = _unitInfoDisplay displayCtrl _x; + + if(_hide) then + { + _ctrl ctrlSetFade 1; + } + else + { + _ctrl ctrlSetFade 0; + }; + + _ctrl ctrlCommit 0; + }; + } foreach ([(configfile >> "RscInGameUI" >> "RscUnitInfo"), 0] call bis_fnc_displaycontrols); + }; +} foreach (uinamespace getvariable "IGUI_displays"); //RscUnitInfo can be present several times for some reason diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_isAttachableItem_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_isAttachableItem_EQ.sqf new file mode 100644 index 0000000000..74bb063199 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_isAttachableItem_EQ.sqf @@ -0,0 +1,23 @@ +/** + * fn_isAttachableItem_EQ.sqf + * @Descr: Check if item is an attachable Item. + * @Author: Glowbal + * + * @Arguments: [item STRING (Classname of item)] + * @Return: BOOL + * @PublicAPI: false + */ + +private ["_chemlight","_return"]; +_chemlight = _this select 0; +_return = switch (_chemlight) do { + case "Chemlight_blue": {true}; + case "Chemlight_red": {true}; + case "Chemlight_green": {true}; + case "Chemlight_yellow": {true}; + case "B_IR_Grenade": {true}; + case "I_IR_Grenade": {true}; + case "O_IR_Grenade": {true}; + default {false}; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_isFlare_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_isFlare_EQ.sqf new file mode 100644 index 0000000000..5445e191be --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_isFlare_EQ.sqf @@ -0,0 +1,25 @@ +/** + * fn_isFlare_EQ.sqf + * @Descr: Check if given classname is a CSE Flare + * @Author: Glowbal + * + * @Arguments: [classname STRING (Magazine classname to check)] + * @Return: BOOL True if classname is a flare. + * @PublicAPI: true + */ + +private ["_classname", "_return"]; +_classname = [_this, 0, "", [""]] call BIS_fnc_Param; +_return = switch (_classname) do { + case "CSE_FlareWhite": {true}; + case "CSE_FlareRed": {true}; + case "CSE_FlareGreen": {true}; + case "CSE_FlareYellow": {true}; + case "CSE_RoadFlareWhite": {true}; + case "CSE_RoadFlareRed": {true}; + case "CSE_RoadFlareGreen": {true}; + case "CSE_RoadFlareYellow": {true}; + default {false}; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_moduleFlare_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_moduleFlare_EQ.sqf new file mode 100644 index 0000000000..82a43966ee --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_moduleFlare_EQ.sqf @@ -0,0 +1,39 @@ +/** + * fn_moduleFlare_EQ.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic", "_className", "_cfg", "_ammo", "_flare"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + +if (!isNull _logic) then { + _className = typeOf _logic; + _cfg = (ConfigFile >> "CfgVehicles" >> _className); + _ammo = getText(_cfg >> "ammo"); + if (_ammo != "") then { + _flare = [_logic, _ammo] call cse_fnc_dropFlare_EQ; + if (isnull _flare) then { + deleteVehicle _logic; + deleteVehicle _flare; + } else { + _logic setvariable ["cse_droppedFlare", _flare]; + + { + if !(_x getvariable ["CSE_CURATOR_ADDITIONAL_EQ", false]) then { + _x setvariable ["CSE_CURATOR_ADDITIONAL_EQ", true]; + _X addEventHandler["CuratorObjectDeleted", { + _obj = _this select 1; + if !(isNull (_obj getvariable ["cse_droppedFlare", objNull])) then { + deleteVehicle (_obj getvariable ["cse_droppedFlare", objNull]); + }; + }]; + }; + }foreach objectCurators _logic; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_putWeaponOnBack_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_putWeaponOnBack_EQ.sqf new file mode 100644 index 0000000000..63d1af890b --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_putWeaponOnBack_EQ.sqf @@ -0,0 +1,17 @@ +/** + * fn_putWeaponOnBack_EQ.sqf + * @Descr: Put unit weapon on the back. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +#define MUZZLE_INDEX 100 + +private ["_unit"]; +_unit = _this select 0; +_unit action ["SwitchWeapon", _unit, _unit, MUZZLE_INDEX]; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/functions/fn_registerNewEquipmentOption_EQ.sqf b/TO_MERGE/cse/sys_equipment/functions/fn_registerNewEquipmentOption_EQ.sqf new file mode 100644 index 0000000000..8754bbdc24 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/functions/fn_registerNewEquipmentOption_EQ.sqf @@ -0,0 +1,30 @@ +/** + * fn_registerNewEquipmentOption_EQ.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_name","_condition","_code"]; +_name = _this select 0; +_condition = _this select 1; +_code = _this select 2; + +if (typeName _name != typeName "" || typeName _condition != typeName {} || typeName _code != typeName{}) exitwith {}; + +if (isnil "CSE_REGISTERING_EQUIPMENT_OPTION") then { + CSE_REGISTERING_EQUIPMENT_OPTION = false; +}; +sleep (random(0.5)); +waituntil {!CSE_REGISTERING_EQUIPMENT_OPTION}; +CSE_REGISTERING_EQUIPMENT_OPTION = true; + +if (isnil "CSE_EQUIPMENT_OPTIONS_EQ") then { + CSE_EQUIPMENT_OPTIONS_EQ = []; +}; +CSE_EQUIPMENT_OPTIONS_EQ pushback [_name,_condition,_code]; + +CSE_REGISTERING_EQUIPMENT_OPTION = false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/init_sys_equipment.sqf b/TO_MERGE/cse/sys_equipment/init_sys_equipment.sqf new file mode 100644 index 0000000000..a5687141eb --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/init_sys_equipment.sqf @@ -0,0 +1,88 @@ +/* + NAME: init + USAGE: + AUTHOR: Glowbal + RETURN: void + +*/ + +waituntil{!isnil "cse_gui"}; +cse_equip_module = true; +_allowMagazineRepack = true; +_haveAttachableItems = true; +_allowWeaponRest = false; +_allowWeaponSafety = false; +_nvgBrightness = false; +_allowSelectWeaponKeybindings = false; +_allowCheckAmmoKeybindings = false; +CSE_HIDE_AMMO_COUNTERS_EQ = 0; + +_args = _this; +{ + _value = _x select 1; + if (!isnil "_value") then { + _name = _x select 0; + if (_name == "magazineRepack") exitwith { + _allowMagazineRepack = _value; + }; + if (_name == "attachableItems") exitwith { + _haveAttachableItems = _value; + }; + if (_name == "weaponResting") exitwith { + _allowWeaponRest = _value; + }; + if (_name == "weaponSafety") exitwith { + _allowWeaponSafety = _value; + }; + if (_name == "adjustableNVG") exitwith { + _nvgBrightness = _value; + }; + if (_name == "allowWeaponSelect") exitwith { + _allowSelectWeaponKeybindings = _value; + }; + if (_name == "allowAmmoChecking") exitwith { + _allowCheckAmmoKeybindings = _value; + }; + if (_name == "hideAmmoValues") exitwith { + CSE_HIDE_AMMO_COUNTERS_EQ = _value; + }; + }; +}foreach _args; + +if (_allowSelectWeaponKeybindings) then { + #include "scripts\select_weapon_keybindings.sqf" +}; + +if (_allowCheckAmmoKeybindings) then { + #include "scripts\check_ammo_keybindings.sqf" +}; + +if (_haveAttachableItems) then { + #include "scripts\register_attachable_items_actions.sqf" +}; + +if (_allowMagazineRepack) then { + #include "scripts\register_magazine_repack_actions.sqf" +}; + +if (_allowWeaponSafety) then { + ["cse_sys_weaponsafety", []] call cse_fnc_enableModule_f; +}; + +if (_allowWeaponRest) then { + ["cse_sys_weaponrest", []] call cse_fnc_enableModule_f; +}; + +if (_nvgBrightness) then { + ["cse_sys_nightvision", []] call cse_fnc_enableModule_f; +}; + +[format["EQUIP - EQUIPMENT module initialised"],2] call cse_fnc_debug; + +if (CSE_HIDE_AMMO_COUNTERS_EQ > 0) then { + waituntil {!isnil "cse_gui"}; + sleep 0.5; + if (vehicle player == player) then { + [true] call cse_fnc_hideUnitInfoAmmo_EQ; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazines.sqf b/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazines.sqf new file mode 100644 index 0000000000..24224a01c7 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazines.sqf @@ -0,0 +1,105 @@ +/** + * fn_repackMagazines.sqf + * @Descr: Repacks all magazines of given type for a unit + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, classname STRING] + * @Return: + * @PublicAPI: true + */ + +#define MAGAZINE_ACCESS_DELAY 3.0 +#define AMMO_REPACK_DELAY 2.0 + +private ["_unit", "_className", "_magazineCapacity", "_magazines", "_repackableAmmoCount", "_repackableMagazinesCount", "_repackableMagazinesAmmoCounts", "_magazineClassName", "_magazineAmmoCount", "_amountOfFillableMagazines", "_workLoad", "_totalRepackTime", "_firstIndex", "_lastIndex", "_startTime", "_greatestAmmoCount", "_smallestAmmoCount"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_className = [_this, 1, "", [""]] call bis_fnc_param; + +if (isNull _unit || _className == "") exitwith {}; +if (vehicle _unit != _unit && {driver (vehicle _unit) == _unit || commander (vehicle _unit) == _unit || gunner (vehicle _unit) == _unit}) exitWith {}; + +if (vehicle _unit == _unit && currentWeapon _unit != "" && !(weaponLowered _unit) && (stance player != "PRONE")) then { + _unit action ["WeaponOnBack", _unit]; + waitUntil { weaponLowered _unit }; // probably evil +}; + +_magazineCapacity = getNumber(configFile >> "CfgMagazines" >> _className >> "count"); + +_magazines = magazinesAmmo _unit; +_repackableAmmoCount = 0; +_repackableMagazinesCount = 0; +_repackableMagazinesAmmoCounts = []; +{ + _magazineClassName = (_x select 0); + _magazineAmmoCount = (_x select 1); + if (_magazineClassName == _className && _magazineAmmoCount < _magazineCapacity) then { + // sums the amount of remaining ammo in all used magazines + _repackableAmmoCount = _repackableAmmoCount + _magazineAmmoCount; + _repackableMagazinesCount = _repackableMagazinesCount + 1; + _repackableMagazinesAmmoCounts pushBack _magazineAmmoCount; + }; +} forEach _magazines; + +if (_repackableMagazinesCount < 2) exitWith {}; + +[getText(configFile >> "CfgMagazines" >> _className >> "displayName"), ["Starting magazine repack"], 0] call cse_fnc_gui_displayInformation; + +_amountOfFillableMagazines = floor(_repackableAmmoCount / _magazineCapacity); + +_repackableMagazinesAmmoCounts = [_repackableMagazinesAmmoCounts, false] call cse_fnc_insertionSort; + +_workLoad = 0; // amount of ammo that needs to be repacked +for "_i" from 0 to _amountOfFillableMagazines - 1 do { + _workLoad = _workLoad + (_magazineCapacity - (_repackableMagazinesAmmoCounts select _i)); +}; + +CSE_ORIGINAL_POSITION_MAG_REPACK_EQ = getPos _unit; +CSE_CONDITION_MAG_REPACK_EQ = {((vehicle player != player && driver (vehicle player) != player && commander (vehicle player) != player && gunner (vehicle player) != player) || (((getPos player) distance CSE_ORIGINAL_POSITION_MAG_REPACK_EQ) < 1 && (weaponLowered player) || (stance player == "PRONE")))}; +CSE_RUNNING_MAG_REPACK_EQ = true; +_totalRepackTime = MAGAZINE_ACCESS_DELAY * (count _repackableMagazinesAmmoCounts) + AMMO_REPACK_DELAY * _workLoad; +_totalRepackTime spawn { + CSE_RUNNING_MAG_REPACK_EQ = [_this, CSE_CONDITION_MAG_REPACK_EQ] call cse_fnc_gui_loadingBar; +}; + +_startTime = diag_tickTime; waitUntil {diag_tickTime - _startTime > MAGAZINE_ACCESS_DELAY}; +_firstIndex = 0; +_lastIndex = _repackableMagazinesCount - 1; +while {CSE_RUNNING_MAG_REPACK_EQ && _lastIndex > _firstIndex} do { + _greatestAmmoCount = _repackableMagazinesAmmoCounts select _firstIndex; + _smallestAmmoCount = _repackableMagazinesAmmoCounts select _lastIndex; + + _startTime = diag_tickTime; waitUntil {diag_tickTime - _startTime > AMMO_REPACK_DELAY / 2.0}; + if (!CSE_RUNNING_MAG_REPACK_EQ) exitWith {}; + playSound "cse_magrepack_single"; + _repackableMagazinesAmmoCounts set [_lastIndex, _smallestAmmoCount - 1]; + _startTime = diag_tickTime; waitUntil {diag_tickTime - _startTime > AMMO_REPACK_DELAY / 2.0}; + if (!CSE_RUNNING_MAG_REPACK_EQ) exitWith {}; + playSound "cse_magrepack_finished"; + _repackableMagazinesAmmoCounts set [_firstIndex, _greatestAmmoCount + 1]; + + // Skip full magazines + if (_repackableMagazinesAmmoCounts select _firstIndex == _magazineCapacity) then { + _startTime = diag_tickTime; waitUntil {diag_tickTime - _startTime > MAGAZINE_ACCESS_DELAY}; + _firstIndex = _firstIndex + 1; + [getText(configFile >> "CfgMagazines" >> _className >> "displayName"), [format["Finished repacking (%1/%2) magazines", _firstIndex, _amountOfFillableMagazines]], 0] call cse_fnc_gui_displayInformation; + }; + // Skip empty magazines + if (_repackableMagazinesAmmoCounts select _lastIndex == 0) then { + _startTime = diag_tickTime; waitUntil {diag_tickTime - _startTime > MAGAZINE_ACCESS_DELAY}; + _lastIndex = _lastIndex - 1; + }; +}; + +// Apply changes +for "_i" from 1 to _repackableMagazinesCount do { + _unit removeMagazine _className; +}; +for "_i" from 0 to _lastIndex do { + _unit addMagazine [_className, _repackableMagazinesAmmoCounts select _i]; +}; + +if (_firstIndex >= _lastIndex) then { + [getText(configFile >> "CfgMagazines" >> _className >> "displayName"), ["Completed magazine repack"], 0] call cse_fnc_gui_displayInformation; +} else { + [getText(configFile >> "CfgMagazines" >> _className >> "displayName"), ["Aborted magazine repack"], 0] call cse_fnc_gui_displayInformation; +}; diff --git a/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazinesAll.sqf b/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazinesAll.sqf new file mode 100644 index 0000000000..5de419f683 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/magazineRepack/functions/fn_repackMagazinesAll.sqf @@ -0,0 +1,20 @@ +/** + * fn_repackMagazinesAll.sqf + * @Descr: Repacks all magazines of a unit + * @Author: Glowbal, Ruthberg + * + * @Arguments: [unit OBJECT] + * @Return: nil + * @PublicAPI: true + */ + +private ["_unit", "_passedMags"]; +_unit = _this select 0; + +_passedMags = []; +{ + if (!((_x select 0) in _passedMags)) then { + _passedMags pushback (_x select 0); + [_unit, (_x select 0)] call cse_fnc_repackMagazines; + }; +} forEach (magazinesAmmo _unit); diff --git a/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_finished.wav b/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_finished.wav new file mode 100644 index 0000000000..ab73615a55 Binary files /dev/null and b/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_finished.wav differ diff --git a/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_single.wav b/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_single.wav new file mode 100644 index 0000000000..5d94e215fd Binary files /dev/null and b/TO_MERGE/cse/sys_equipment/magazineRepack/sound/magrepack_single.wav differ diff --git a/TO_MERGE/cse/sys_equipment/nvg/functions/fn_adjustBrightness_NVG.sqf b/TO_MERGE/cse/sys_equipment/nvg/functions/fn_adjustBrightness_NVG.sqf new file mode 100644 index 0000000000..f75fd52c9f --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/nvg/functions/fn_adjustBrightness_NVG.sqf @@ -0,0 +1,32 @@ +/** + * fn_adjustBrightness_NVG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_increase","_currentBrightness","_newBrightness"]; +_unit = [_this,0,ObjNull,[ObjNUll]] call BIS_fnc_Param; +_increase = [_this, 1, 0,[0]] call BIS_fnc_Param; +_currentBrightness = _unit getVariable ["cse_sys_nightvision_brightness", 1]; + +_newBrightness = _currentBrightness + _increase; +if (_newBrightness < -0.1) then { + _newBrightness = -0.1; +} else { + if (_newBrightness > 2) then { + _newBrightness = 2; + }; +}; +_unit setVariable ["cse_sys_nightvision_brightness", _newBrightness]; + +if (_newBrightness != _currentBrightness) then { + if (_increase > 0) then { + hintSilent "Increased NVG Brightness"; + } else { + hintSilent "decreased NVG Brightness"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/nvg/init_sys_nightvision.sqf b/TO_MERGE/cse/sys_equipment/nvg/init_sys_nightvision.sqf new file mode 100644 index 0000000000..9df0185f27 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/nvg/init_sys_nightvision.sqf @@ -0,0 +1,51 @@ +#define PP_EFFECT_GRAIN_INTENSITVE 0.25 // 0 to 1 +#define PP_EFFECT_GRAIN_SHARPNESS 1 // 0 to 20 +#define PP_EFFECT_GRAIN_SIZE 2.5 // 1 to 8 +#define PP_EFFECT_GRAIN_INTENSITY_X0 0.2 // float, No range +#define PP_EFFECT_GRAIN_INTENSITY_X1 0.2 // float, No range +#define PP_EFFECT_GRAIN_MONOCHROMATIC false // bool + + +if (!hasInterface) exitwith {}; +CSE_SYS_NVG_GRAIN_EFFECT_DISPLAY = false; +// need to add some key handlers + + waituntil{!isnil "cse_gui" && !isnil "cse_main"}; + ["Enabling CSE NVG systems",2] call cse_fnc_debug; + _ppEffect_NVGAdjustBrightness = ppEffectCreate ["ColorCorrections", 1587]; + _ppEffect_NVGAdjustBrightness ppEffectForceInNVG true; + _ppEffect_NVGAdjustBrightness ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; + _ppEffect_NVGAdjustBrightness ppEffectCommit 0; + + + _ppEffect_NVGAdjustEffect = ppEffectCreate ["FilmGrain", 2451]; + _ppEffect_NVGAdjustEffect ppEffectForceInNVG true; + _ppEffect_NVGAdjustEffect ppEffectAdjust [PP_EFFECT_GRAIN_INTENSITVE, PP_EFFECT_GRAIN_SHARPNESS, PP_EFFECT_GRAIN_SIZE, PP_EFFECT_GRAIN_INTENSITY_X0, PP_EFFECT_GRAIN_INTENSITY_X1, PP_EFFECT_GRAIN_MONOCHROMATIC]; + _ppEffect_NVGAdjustEffect ppEffectCommit 0; + + + // Refactor this + ["cse_sys_nightvision", [_ppEffect_NVGAdjustBrightness, _ppEffect_NVGAdjustEffect], { + _ppEffect_NVGAdjustBrightness = _this select 0; + _ppEffect_NVGAdjustEffect = _this select 1; + + if (((currentVisionMode player == 1) || (currentVisionMode (vehicle player) == 1))&& !isNull(findDisplay 46)) then { + _ppEffect_NVGAdjustBrightness ppEffectEnable true; + _newBrightness = player getvariable ["cse_sys_nightvision_brightness", 1]; + _ppEffect_NVGAdjustBrightness ppEffectAdjust [1, _newBrightness, 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; + _ppEffect_NVGAdjustBrightness ppEffectCommit 0; + if (CSE_SYS_NVG_GRAIN_EFFECT_DISPLAY) then { + _ppEffect_NVGAdjustEffect ppEffectEnable true; + }; + } else { + _ppEffect_NVGAdjustBrightness ppEffectEnable false; + _ppEffect_NVGAdjustEffect ppEffectEnable false; + }; + + }] call cse_fnc_addTaskToPool_f; + +["cse_sys_nightvision_grain_effect_display", ["Enable", "Disable"], (["cse_sys_nightvision_grain_effect_display", 0] call cse_fnc_getClientSideOptionFromProfile_F), { + CSE_SYS_NVG_GRAIN_EFFECT_DISPLAY = (_this select 1) == 0; +}] call cse_fnc_addClientSideOptions_f; + +["cse_sys_nightvision_grain_effect_display","option","Use Grain effect","Use grain effect for nightvision"] call cse_fnc_settingsDefineDetails_F; diff --git a/TO_MERGE/cse/sys_equipment/scripts/check_ammo_keybindings.sqf b/TO_MERGE/cse/sys_equipment/scripts/check_ammo_keybindings.sqf new file mode 100644 index 0000000000..86483ca444 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/scripts/check_ammo_keybindings.sqf @@ -0,0 +1,17 @@ +["check_current_magazine_count_eq", (["check_current_magazine_count_eq","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + private ["_percentage", "_text"]; + + if (currentWeapon player != "" && currentMagazine player != "") then { + _percentage = [player] call cse_fnc_getPercentageAmmoMagazine_EQ; + _text = switch true do { + case (_percentage >= 75) : { "Heavy weight" }; + case (_percentage >= 35) : { "Medium weight" }; + case (_percentage >= 15) : { "Light weight" }; + case (_percentage >= 0 ) : { "Very light weight" }; + default { "Unknown" }; + }; + ["Magazine weight", [_text], 0] call cse_fnc_gui_displayInformation; + }; + +}] call cse_fnc_addKeyBindingForAction_F; +["check_current_magazine_count_eq","action","Check Ammo","Check your current ammo count"] call cse_fnc_settingsDefineDetails_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/scripts/register_attachable_items_actions.sqf b/TO_MERGE/cse/sys_equipment/scripts/register_attachable_items_actions.sqf new file mode 100644 index 0000000000..c94f70758e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/scripts/register_attachable_items_actions.sqf @@ -0,0 +1,45 @@ +if (isDedicated) exitwith{}; +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; + +cse_attachMagazinesDisplaySubMenu = { + [_this] call cse_fnc_Debug; + private ["_subMenus","_passedMags","_magsAmmo"]; + _subMenus = []; + _passedMags = []; + _magsAmmo = magazinesAmmo player; + if ([player] call cse_fnc_hasItemAttached_EQ) then { + _subMenus set [ count _subMenus, + call compile format['["Detach", getText(configFile >> "CfgMagazines" >> "%1" >> "picture"), + { + closeDialog 0; + [player,"%1",20] spawn cse_fnc_detachItem_EQ; + }, true, "Detach " + getText(configFile >> "CfgMagazines" >> "%1" >> "displayName") + ]', player getvariable ["cse_attachedItemClassName_EQ", ""]] + ]; + } else { + { + if (!((_x select 0) in _passedMags)) then { + _passedMags set [ count _passedMags, (_x select 0)]; + if ([_x select 0] call cse_fnc_isAttachableItem_EQ) then + { + _subMenus set [ count _subMenus, + call compile format['[getText(configFile >> "CfgMagazines" >> "%1" >> "displayName"), getText(configFile >> "CfgMagazines" >> "%1" >> "picture"), + { + closeDialog 0; + [player, "%1"] call cse_fnc_attachItem_EQ; + }, true, "Attach " + getText(configFile >> "CfgMagazines" >> "%1" >> "displayName") + ]',(_x select 0)] + ]; + }; + }; + }foreach _magsAmmo; + }; + + [ _this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; +}; + + +_entries = [ + ["Attach", {(([player] call cse_fnc_hasItemAttached_EQ) || [player] call cse_fnc_hasAttachableItem_EQ)}, CSE_ICON_PATH + "icon_magazines.paa", cse_attachMagazinesDisplaySubMenu, "Attach Item(s)"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/scripts/register_magazine_repack_actions.sqf b/TO_MERGE/cse/sys_equipment/scripts/register_magazine_repack_actions.sqf new file mode 100644 index 0000000000..73b2d8ef09 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/scripts/register_magazine_repack_actions.sqf @@ -0,0 +1,59 @@ +if (isDedicated) exitwith{}; +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; + +cse_fnc_repackableMagazineTypes = { + private ["_magazines", "_repackableMagazines", "_repackableMagazineTypes", "_className", "_magazineAmmoCount", "_magazineCapacity", "_repackableMagazinesOfTypeX", "_result"]; + _magazines = magazinesAmmo player; + _result = []; + _repackableMagazines = []; + _repackableMagazineTypes = []; + { + _className = _x select 0; + _magazineAmmoCount = _x select 1; + _magazineCapacity = getNumber(configFile >> "CfgMagazines" >> _className >> "count"); + if (_magazineCapacity - _magazineAmmoCount > 0) then { + _repackableMagazines pushBack _x; + if (!(_className in _repackableMagazineTypes)) then { + _repackableMagazineTypes pushBack _className; + }; + }; + } forEach _magazines; + + { + _magazineType = _x; + _repackableMagazinesOfTypeX = {_magazineType == (_x select 0)} count _repackableMagazines; + if (_repackableMagazinesOfTypeX > 1) then { + _result pushBack _magazineType; + }; + } forEach _repackableMagazineTypes; + + _result +}; + +cse_repackMagazinesDisplaySubMenu = { + [_this] call cse_fnc_Debug; + + private ["_subMenus", "_repackableMagazineTypes"]; + _subMenus = []; + _repackableMagazineTypes = call cse_fnc_repackableMagazineTypes; + + { + _subMenus pushBack + call compile format['[getText(configFile >> "CfgMagazines" >> "%1" >> "displayName"), getText(configFile >> "CfgMagazines" >> "%1" >> "picture"), + { + closeDialog 0; + [player,"%1",20] spawn cse_fnc_repackMagazines; + }, true, "Repack " + getText(configFile >> "CfgMagazines" >> "%1" >> "displayName") + ]', _x]; + } forEach _repackableMagazineTypes; + + [_this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; +}; + + +_entries = [ + ["Repack", {count (call cse_fnc_repackableMagazineTypes) > 0}, CSE_ICON_PATH + "icon_magazines.paa", cse_repackMagazinesDisplaySubMenu, "Show magazines that can be repacked"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + diff --git a/TO_MERGE/cse/sys_equipment/scripts/select_weapon_keybindings.sqf b/TO_MERGE/cse/sys_equipment/scripts/select_weapon_keybindings.sqf new file mode 100644 index 0000000000..2cb89a7c38 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/scripts/select_weapon_keybindings.sqf @@ -0,0 +1,28 @@ + +["place_Weapon_onBack", (["place_Weapon_onBack","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + if (currentWeapon player != "") then { + [player] call cse_fnc_putWeaponOnBack_EQ; + }; +}] call cse_fnc_addKeyBindingForAction_F; +["place_Weapon_onBack","action","Weapon on Back","Place rifle on back or holster pistol"] call cse_fnc_settingsDefineDetails_F; + +["select_primairy_weapon", (["select_primairy_weapon","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + if (primaryWeapon player != "") then { + player selectWeapon primaryWeapon player; + }; +}] call cse_fnc_addKeyBindingForAction_F; +["select_primairy_weapon","action","Select Primairy weapon","Select your primary weapon."] call cse_fnc_settingsDefineDetails_F; + +["select_secondairy_weapon", (["select_secondairy_weapon","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + if (secondaryWeapon player != "") then { + player selectWeapon secondaryWeapon player; + }; +}] call cse_fnc_addKeyBindingForAction_F; +["select_secondairy_weapon","action","Select Secondairy Weapon","Select your secondairy weapon."] call cse_fnc_settingsDefineDetails_F; + +["select_handgun_weapon", (["select_handgun_weapon","action",[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + if (handgunWeapon player != "") then { + player selectWeapon handgunWeapon player; + }; +}] call cse_fnc_addKeyBindingForAction_F; +["select_handgun_weapon","action","Select handgun","Select your pistol."] call cse_fnc_settingsDefineDetails_F; diff --git a/TO_MERGE/cse/sys_equipment/stringtable.xml b/TO_MERGE/cse/sys_equipment/stringtable.xml new file mode 100644 index 0000000000..dd082b5b55 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/stringtable.xml @@ -0,0 +1,91 @@ + + + + + + + White Flare + Bengala Blanca + + + Red Flare + Bengala Roja + + + Yellow Flare + Bengala Amarilla + + + Green Flare + Bengala Verde + + + + + White Road Flare + Bengala de Carretera Blanca + + + Red Road Flare + Bengala de Carretera Roja + + + Yellow Road Flare + Bengala de Carretera Amarilla + + + Green Road Flare + Bengala de Carretera Verde + + + + + + + Rest Weapon/Deploy Bipod + Oprzyj broÅ„ / rozÅ‚Ă³Å¼ dwĂ³jnĂ³g + Apoyar Arma/Desplegar BĂ­pode + + + Unrest Weapon/Undeploy Bipod + Levantar Arma/Plegar BĂ­pode + + + Lets the player rest his weapon / deploy the bipod. This is part of the 'Weapon Rest [CSE]' module. + Pozwala graczowi oprzeć swojÄ… broÅ„ / rozÅ‚ożyć dwĂ³jnĂ³g. Jest to część moduÅ‚u 'Podpieranie broni [CSE]'. + Permite apoyar el arma / desplegar el bĂ­pode. Es parte del mĂ³dulo "Weapon Rest [CSE]". + + + Lets the player unrest his weapon / undeploy the bipod. This is part of the 'Weapon Rest [CSE]' module. + Permite levantar el arma / plegar el bĂ­pode. Es parte del mĂ³dulo "Weapon Rest [CSE]". + + + + + + + + + Increase NVG Brightness + ZwiÄ™ksz czuÅ‚ość NVG + Aumentar el brillo de la VisiĂ³n Nocturna + + + Allows the player to increase the NVG brightness. + Pozwala graczowi zwiÄ™kszyć czuÅ‚ość noktowizji. + Permite al jugador aumentar el brillo de la VisiĂ³n Nocturna + + + Decrease NVG Brightness + Zmniejsz czuÅ‚ość NVG + Disminuir el brillo de la VisiĂ³n Nocturna + + + Allows the player to decrease the NVG brightness. + Pozwala graczowi zmniejszyć czuÅ‚ość noktowizji. + Permite al jugador disminuir el brillo de la VisiĂ³n Nocturna + + + + + diff --git a/TO_MERGE/cse/sys_equipment/ui/rscTitles.h b/TO_MERGE/cse/sys_equipment/ui/rscTitles.h new file mode 100644 index 0000000000..77fe626e84 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/ui/rscTitles.h @@ -0,0 +1,51 @@ +class RscControlsGroup; +class RscText; +/* +class RscInGameUI +{ + class RscUnitInfo + { + class WeaponInfoControlsGroupLeft: RscControlsGroup + { + class controls + { + class CA_AmmoCount: RscText + { + sizeEx = 0; + }; + class CA_MagCount: RscText + { + sizeEx = 0; + }; + class GrenadeCount: RscText + { + sizeEx = 0; + }; + }; + }; + }; +};*/ +/* + class RscUnitInfo { + idd = 300; + class WeaponInfoControlsGroupLeft: RscControlsGroup + { + idc = 2302; + class controls + { + class CA_AmmoCount: RscText + { + idc = 184; + }; + class CA_MagCount: RscText + { + idc = 185; + }; + class CA_GrenadeCount: RscText + { + idc = 151; + }; + }; + }; + }; +*/ diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/data/icons/icon_bipod.paa b/TO_MERGE/cse/sys_equipment/weaponresting/data/icons/icon_bipod.paa new file mode 100644 index 0000000000..c2b6a2fb3e Binary files /dev/null and b/TO_MERGE/cse/sys_equipment/weaponresting/data/icons/icon_bipod.paa differ diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_actionReleaseWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_actionReleaseWeapon_WR.sqf new file mode 100644 index 0000000000..08fd122ee3 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_actionReleaseWeapon_WR.sqf @@ -0,0 +1,13 @@ +/** + * fn_actionReleaseWeapon_WR.sqf + * @Descr: Force unrest/undeploy of the weapon + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +player setVariable ["cse_isWeaponRested_WR", false, false]; +player setVariable ["cse_isWeaponDeployed_WR", false, false]; diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canDeployBipod_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canDeployBipod_WR.sqf new file mode 100644 index 0000000000..06d5abf56e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canDeployBipod_WR.sqf @@ -0,0 +1,46 @@ +/** + * fn_canDeployBipod_WR.sqf + * @Descr: Check if player can deploy a bipod. + * @Author: Glowbal, Ruthberg + * + * @Arguments: [] + * @Return: [BOOL, PositionASL] + * @PublicAPI: true + */ + + +#define LEFT_HAND_BIPOD_DISTANCE_LONG_RIFLE 0.3 +#define LEFT_HAND_BIPOD_DISTANCE_RIFLE 0.15 +#define BIPOD_HEIGHT 0.40 +#define ALLOWED_ANIMATION_STATES ["amovpercmstpsraswrfldnon","aadjpercmstpsraswrfldup","aadjpercmstpsraswrflddown","aadjpknlmstpsraswrfldup","amovpknlmstpsraswrfldnon","aadjpknlmstpsraswrflddown","aadjppnemstpsraswrfldup","amovppnemstpsraswrfldnon","aadjpknlmstpsraswrfldright","aadjpknlmstpsraswrfldleft","aadjpercmstpsraswrfldright","aadjpercmstpsraswrfldleft"] + +private ["_weapon", "_playerAnimationState", "_canDeployBipod", "_weaponDirection", "_leftHandPosition", "_leftHandBipodDistance", "_isLongRifle", "_azimut", "_elevation", "_bipodTop", "_bipodBottom"]; +_weapon = currentWeapon player; +_playerAnimationState = (([animationState player, "_"] call BIS_fnc_splitString) select 0); +_canDeployBipod = [false, [0, 0, 0]]; + +if ((call cse_fnc_hasBipod_WR) && _weapon == primaryWeapon player && !(weaponLowered player) && _playerAnimationState in ALLOWED_ANIMATION_STATES) then { + _weaponDirection = player weaponDirection _weapon; + + _leftHandPosition = ATLtoASL (player modelToWorld (player selectionPosition "LeftHand")); + + _leftHandBipodDistance = LEFT_HAND_BIPOD_DISTANCE_RIFLE; + _isLongRifle = [configFile >> "CfgWeapons" >> _weapon, "Rifle_Long_Base_F"] call cse_fnc_inheritsFrom; + if (_isLongRifle) then { + _leftHandBipodDistance = LEFT_HAND_BIPOD_DISTANCE_LONG_RIFLE; + }; + + _azimut = (_weaponDirection select 0) atan2 (_weaponDirection select 1); + _elevation = asin(_weaponDirection select 2); + + _bipodTop = _leftHandPosition vectorAdd (_weaponDirection vectorMultiply _leftHandBipodDistance); + _bipodBottom = _bipodTop vectorAdd [sin(_azimut) * sin(_elevation) * BIPOD_HEIGHT, cos(_azimut) * sin(_elevation) * BIPOD_HEIGHT, cos(_elevation) * -BIPOD_HEIGHT]; + + // Bipods can be deployed on ground or objects. + _canDeployBipod = [_bipodTop, _bipodBottom, 0.05] call cse_fnc_getFirstObjectIntersection; + if (_canDeployBipod select 0) exitWith {}; + _canDeployBipod = [_bipodTop, _bipodBottom, 0.05] call cse_fnc_getFirstTerrainIntersection; + if (_canDeployBipod select 0) exitWith {}; +}; + +_canDeployBipod diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canRestWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canRestWeapon_WR.sqf new file mode 100644 index 0000000000..fa5c751d79 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_canRestWeapon_WR.sqf @@ -0,0 +1,60 @@ +/** + * fn_canRestWeapon_WR.sqf + * @Descr: Check if player can rest weapon. + * @Author: Glowbal, Ruthberg + * + * @Arguments: [] + * @Return: BOOL Can rest weapon. + * @PublicAPI: true + */ + + +#define ALLOWED_ANIMATION_STATES ["amovpercmstpsraswrfldnon","aadjpercmstpsraswrfldup","aadjpercmstpsraswrflddown","aadjpknlmstpsraswrfldup","amovpknlmstpsraswrfldnon","aadjpknlmstpsraswrflddown","aadjppnemstpsraswrfldup","amovppnemstpsraswrfldnon","aadjpknlmstpsraswrfldright","aadjpknlmstpsraswrfldleft","aadjpercmstpsraswrfldright","aadjpercmstpsraswrfldleft","aadjppnemstpsraswrfldright","aadjppnemstpsraswrfldleft","aadjppnemstpsraswrflddown"] +#define MAX_REST_DISTANCE_FORWARD 0.30 +#define MAX_REST_DISTANCE_LEFT 0.40 +#define MAX_REST_DISTANCE_RIGHT 0.30 +#define MAX_REST_DISTANCE_BOTTOM 0.50 +#define MAX_REST_ANGLE 45 + +private ["_weapon", "_canRestWeapon", "_playerAnimationState", "_weaponDirection", "_leftHandPosition", "_rightHandPosition"]; +_weapon = currentWeapon player; +_canRestWeapon = false; +_playerAnimationState = (([animationState player, "_"] call BIS_fnc_splitString) select 0); + +if (_weapon == primaryWeapon player && !(weaponLowered player) && _playerAnimationState in ALLOWED_ANIMATION_STATES) then { + _weaponDirection = player weaponDirection _weapon; + + _leftHandPosition = ATLtoASL (player modelToWorld (player selectionPosition "LeftHand")); + _rightHandPosition = ATLtoASL (player modelToWorld (player selectionPosition "RightHand")); + + // calculate direction for side checks. + _direction = (_weaponDirection select 0) atan2 (_weaponDirection select 1); + + // check left + if (lineIntersects [_rightHandPosition, _rightHandPosition vectorAdd [ + MAX_REST_DISTANCE_LEFT * sin ((_direction) - MAX_REST_ANGLE), + MAX_REST_DISTANCE_LEFT * cos ((_direction) - MAX_REST_ANGLE), + MAX_REST_DISTANCE_LEFT * 0.5 * (_weaponDirection select 2) + ]]) exitWith { _canRestWeapon = true }; + + // check right + if (lineIntersects [_rightHandPosition, _rightHandPosition vectorAdd [ + MAX_REST_DISTANCE_RIGHT * sin ((_direction) + MAX_REST_ANGLE), + MAX_REST_DISTANCE_RIGHT * cos ((_direction) + MAX_REST_ANGLE), + MAX_REST_DISTANCE_RIGHT * 0.5 * (_weaponDirection select 2) + ]]) exitWith { _canRestWeapon = true }; + + // check bottom (object) + if (lineIntersects [ + _rightHandPosition vectorDiff [0, 0, MAX_REST_DISTANCE_BOTTOM], + _leftHandPosition vectorDiff [0, 0, MAX_REST_DISTANCE_BOTTOM] vectorAdd (_weaponDirection vectorMultiply MAX_REST_DISTANCE_FORWARD)] + ) exitWith { _canRestWeapon = true }; + + // check bottom (ground) + if (terrainIntersectASL [ + _rightHandPosition vectorDiff [0, 0, MAX_REST_DISTANCE_BOTTOM], + _leftHandPosition vectorDiff [0, 0, MAX_REST_DISTANCE_BOTTOM] vectorAdd (_weaponDirection vectorMultiply MAX_REST_DISTANCE_FORWARD)] + ) exitWith { _canRestWeapon = true }; +}; + +_canRestWeapon diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_deployWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_deployWeapon_WR.sqf new file mode 100644 index 0000000000..f33aab832b --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_deployWeapon_WR.sqf @@ -0,0 +1,39 @@ +/** + * fn_deployWeapon_WR.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [pivotPosition PositionASL] + * @Return: nil + * @PublicAPI: false + */ + + +#define DEPLOYED_RECOIL 0.5 +#define CAM_SHAKE [1.0, 0.5, 6.0] + +private ["_pivotPosition", "_playerAnimationState"]; +_pivotPosition = _this; + +player setVariable ["cse_isWeaponDeployed_WR", true, false]; + +playSound "cse_weaponrest_rest"; +addCamShake CAM_SHAKE; +["cse_bipodDeployed", true, "cse\cse_sys_equipment\weaponresting\data\icons\icon_bipod.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + +_playerAnimationState = animationState player; +player switchMove format["%1_cse_deployed", _playerAnimationState]; +player setUnitRecoilCoefficient DEPLOYED_RECOIL; + +// Watcher that undeploys if we rotate/move too much +[_pivotPosition] spawn { + private ["_pivotPosition", "_canDeployBipod"]; + _pivotPosition = _this select 0; + while {player getVariable ["cse_isWeaponDeployed_WR", false]} do { + _canDeployBipod = call cse_fnc_canDeployBipod_WR; + if !(_canDeployBipod select 0) exitWith {}; + if ((_canDeployBipod select 1) vectorDistance _pivotPosition > 0.30) exitWith {}; + sleep 0.1; + }; + call cse_fnc_undeployWeapon_WR; +}; diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_hasBipod_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_hasBipod_WR.sqf new file mode 100644 index 0000000000..1244cad29e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_hasBipod_WR.sqf @@ -0,0 +1,17 @@ +/** + * fn_hasBipod_WR.sqf + * @Descr: Check if the current weapon has a bipod. + * @Author: Glowbal, Ruthberg + * + * @Arguments: [] + * @Return: BOOL weapon has bipod. + * @PublicAPI: true + */ + + +_cseBipod = getNumber(configFile >> "CfgWeapons" >> primaryWeapon player >> "cse_bipod") == 1; +_weaponModeBipod = ["bipod", currentWeaponMode player, false] call BIS_fnc_inString || ["bp", currentWeaponMode player, false] call BIS_fnc_inString; + +// TODO: Also check for asdg and kao bipods + +_cseBipod || _weaponModeBipod diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_keyPressed_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_keyPressed_WR.sqf new file mode 100644 index 0000000000..f09559f08a --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_keyPressed_WR.sqf @@ -0,0 +1,37 @@ +/** + * fn_keyPressed_WR.sqf + * @Descr: N/A + * @Author: Glowbal, Ruthberg + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +#define ALLOWED_ANIMATION_STATES ["amovpercmstpsraswrfldnon","aadjpercmstpsraswrfldup","aadjpercmstpsraswrflddown","aadjpknlmstpsraswrfldup","amovpknlmstpsraswrfldnon","aadjpknlmstpsraswrflddown","aadjppnemstpsraswrfldup","amovppnemstpsraswrfldnon","aadjpknlmstpsraswrfldright","aadjpknlmstpsraswrfldleft","aadjpercmstpsraswrfldright","aadjpercmstpsraswrfldleft","aadjppnemstpsraswrfldright","aadjppnemstpsraswrfldleft","aadjppnemstpsraswrflddown"] + +private ["_playerAnimationState", "_canDeployBipod"]; + +if (weaponLowered player) exitWith {}; +if (!([player] call cse_fnc_canInteract)) exitWith {}; +if (player getVariable ["cse_isWeaponDeployed_WR", false]) exitWith {}; + +_playerAnimationState = (([animationState player, "_"] call BIS_fnc_splitString) select 0); +if (!(_playerAnimationState in ALLOWED_ANIMATION_STATES)) exitWith {}; + +// not deployed -> try to deploy now +_canDeployBipod = call cse_fnc_canDeployBipod_WR; +if (_canDeployBipod select 0) then { + if (player getVariable ["cse_isWeaponRested_WR", false]) then { + call cse_fnc_unrestWeapon_WR; + }; + (_canDeployBipod select 1) call cse_fnc_deployWeapon_WR; +}; + +if (!(player getVariable ["cse_isWeaponRested_WR", false]) && !(player getVariable ["cse_isWeaponDeployed_WR", false])) then { + // not deployed and not rested -> try to rest now + if (call cse_fnc_canRestWeapon_WR) then { + call cse_fnc_restWeapon_WR; + }; +}; diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_restWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_restWeapon_WR.sqf new file mode 100644 index 0000000000..153247076a --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_restWeapon_WR.sqf @@ -0,0 +1,35 @@ +/** + * fn_restWeapon_WR.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +#define RESTED_RECOIL 0.8 +#define CAM_SHAKE [1.0, 0.5, 6.0] + +private ["_playerAnimationState"]; + + +player setVariable ["cse_isWeaponRested_WR", true, false]; + +playSound "cse_weaponrest_rest"; +addCamShake CAM_SHAKE; +["cse_bipodDeployed", true, "cse\cse_sys_equipment\weaponresting\data\icons\icon_bipod.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; // TODO: Make a separate icon for weapon resting + +_playerAnimationState = animationState player; +player switchMove format["%1_cse_rested", _playerAnimationState]; +player setUnitRecoilCoefficient RESTED_RECOIL; + +// Watcher that unrests if we rotate/move too much +[] spawn { + while {player getVariable ["cse_isWeaponRested_WR", false]} do { + if !(call cse_fnc_canRestWeapon_WR) exitWith {}; + sleep 0.1; + }; + call cse_fnc_unrestWeapon_WR; +}; diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_undeployWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_undeployWeapon_WR.sqf new file mode 100644 index 0000000000..b953d49792 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_undeployWeapon_WR.sqf @@ -0,0 +1,21 @@ +/** + * fn_undeployWeapon_WR.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +private ["_playerAnimationState"]; + +_playerAnimationState = animationState player; +player switchMove (([_playerAnimationState, "_"] call BIS_fnc_splitString) select 0); +player setUnitRecoilCoefficient 1; + +player setVariable ["cse_isWeaponDeployed_WR", false, false]; + +playSound "cse_weaponrest_unrest"; +["cse_bipodDeployed", false, "cse\cse_sys_equipment\weaponresting\data\icons\icon_bipod.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_unrestWeapon_WR.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_unrestWeapon_WR.sqf new file mode 100644 index 0000000000..ca31eec04e --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/functions/fn_unrestWeapon_WR.sqf @@ -0,0 +1,21 @@ +/** + * fn_unrestWeapon_WR.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: nil + * @PublicAPI: false + */ + + +private ["_playerAnimationState"]; + +_playerAnimationState = animationState player; +player switchMove (([_playerAnimationState, "_"] call BIS_fnc_splitString) select 0); +player setUnitRecoilCoefficient 1; + +player setVariable ["cse_isWeaponRested_WR", false, false]; + +playSound "cse_weaponrest_unrest"; +["cse_bipodDeployed", false, "cse\cse_sys_equipment\weaponresting\data\icons\icon_bipod.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/init_sys_weaponrest.sqf b/TO_MERGE/cse/sys_equipment/weaponresting/init_sys_weaponrest.sqf new file mode 100644 index 0000000000..7137b8cbd7 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponresting/init_sys_weaponrest.sqf @@ -0,0 +1,9 @@ +if (!hasInterface) exitwith {}; +waituntil{!isnil "cse_gui" && !isnil "cse_main"}; + +waitUntil {!isNull player}; + +["cse_isWeaponRested_WR" , false, false, "wr"] call cse_fnc_defineVariable; +["cse_isWeaponDeployed_WR", false, false, "wr"] call cse_fnc_defineVariable; + +cse_sys_weaponRest = true; diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_rest.wav b/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_rest.wav new file mode 100644 index 0000000000..fce6386425 Binary files /dev/null and b/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_rest.wav differ diff --git a/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_unrest.wav b/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_unrest.wav new file mode 100644 index 0000000000..72518ddbbf Binary files /dev/null and b/TO_MERGE/cse/sys_equipment/weaponresting/sound/weaponrest_unrest.wav differ diff --git a/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOff_ws.sqf b/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOff_ws.sqf new file mode 100644 index 0000000000..4f81fe8626 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOff_ws.sqf @@ -0,0 +1,18 @@ +/** + * fn_safetyOff_ws.sqf + * @Descr: Puts the given unit/weapon/muzzle combination on fire + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: nil + * @PublicAPI: true + */ + + +private ["_unit", "_weapon", "_muzzle"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +_unit setVariable [format["CSE_WeaponSafety_%1_%2", _weapon, _muzzle], false, false]; +playSound "click"; diff --git a/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOn_ws.sqf b/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOn_ws.sqf new file mode 100644 index 0000000000..3c6e094351 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponsafety/functions/fn_safetyOn_ws.sqf @@ -0,0 +1,37 @@ +/** + * fn_safetyOn_ws.sqf + * @Descr: Puts the given unit/weapon/muzzle combination on safe + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: nil + * @PublicAPI: true + */ + + +private ["_unit", "_weapon", "_muzzle", "_ID"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +_unit setVariable[format["CSE_WeaponSafety_%1_%2", _weapon, _muzzle], true, false]; +playSound "click"; + +_ID = format["CSE_WeaponSafety_ID_%1_%2_%3", _unit, _weapon, _muzzle]; + +[_ID, "onEachFrame", { + private ["_unit", "_weapon", "_muzzle", "_ID"]; + _unit = _this select 0; + _weapon = _this select 1; + _muzzle = _this select 2; + _ID = _this select 3; + + if (!(_unit getVariable[format["CSE_WeaponSafety_%1_%2", _weapon, _muzzle], false]) || !(_weapon in (weapons (vehicle _unit)))) exitWith { + [_ID, "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + if (currentWeapon _unit == _weapon && currentMuzzle _unit == _muzzle) then { + (vehicle _unit) setWeaponReloadingTime [_unit, _muzzle, 1]; + }; + +}, [_unit, _weapon, _muzzle, _ID]] call BIS_fnc_addStackedEventHandler; diff --git a/TO_MERGE/cse/sys_equipment/weaponsafety/init_sys_weaponsafety.sqf b/TO_MERGE/cse/sys_equipment/weaponsafety/init_sys_weaponsafety.sqf new file mode 100644 index 0000000000..d2f27293f2 --- /dev/null +++ b/TO_MERGE/cse/sys_equipment/weaponsafety/init_sys_weaponsafety.sqf @@ -0,0 +1,20 @@ +if (!hasInterface) exitwith {}; +waituntil{!isnil "cse_gui" && !isnil "cse_main"}; + +waitUntil {!isNull player}; + +["put_safety_on", (["put_safety_on","action",[126,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + // TODO: Find a way to implement weapon safety without the slide of a pistol being locked back + if (currentWeapon player != "" && (currentWeapon player == primaryWeapon player || currentWeapon player == secondaryWeapon player)) then { + [player, currentWeapon player, currentMuzzle player] call cse_fnc_safetyOn_ws; + }; +}] call cse_fnc_addKeyBindingForAction_F; +["put_safety_on","action","Safety on","Put weapon on safe."] call cse_fnc_settingsDefineDetails_F; + +["put_safety_off", (["put_safety_off","action",[126,1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { + [player, currentWeapon player, currentMuzzle player] call cse_fnc_safetyOff_ws; +}] call cse_fnc_addKeyBindingForAction_F; +["put_safety_off","action","Safety off","Put weapon on fire."] call cse_fnc_settingsDefineDetails_F; + + +cse_sys_weaponSafety = true; diff --git a/TO_MERGE/cse/sys_field_rations/CfgFunctions.h b/TO_MERGE/cse/sys_field_rations/CfgFunctions.h new file mode 100644 index 0000000000..9c8df9f7c8 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/CfgFunctions.h @@ -0,0 +1,33 @@ +class CfgFunctions { + class CSE { + class FieldRations { + file = "cse\cse_sys_field_rations\functions"; + class reduceLevels_FR { recompile = 1; }; + class updateFieldRations_FR { recompile = 1; }; + class updateUIStatus_FR { recompile = 1; }; + + class actionEat_FR { recompile = 1; }; + class canEat_FR { recompile = 1; }; + class getEatableValue_FR { recompile = 1; }; + class itemIsEatable_FR { recompile = 1; }; + class hasEatableItem_FR { recompile = 1; }; + class actionDrink_FR { recompile = 1; }; + class canDrink_FR { recompile = 1; }; + class getDrinkableValue_FR { recompile = 1; }; + class itemIsDrinkable_FR { recompile = 1; }; + class hasDrinkableItem_FR { recompile = 1; }; + + class canRefill_FR { recompile = 1; }; + class itemIsRefillable_FR { recompile = 1; }; + class hasRefillableItem_FR { recompile = 1; }; + class actionRefill_FR { recompile = 1; }; + + class actionRefillCamelbak_FR; + class hasCamelbak_FR; + class isCamelbak_FR; + class getMaxContent_Camelbak_FR; + class getInitialContent_Camelbak_FR; + class canRefillCamelbak_FR; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/CfgMagazines.h b/TO_MERGE/cse/sys_field_rations/CfgMagazines.h new file mode 100644 index 0000000000..48bc356ee5 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/CfgMagazines.h @@ -0,0 +1,412 @@ +class CfgMagazines { + class Default; + class CA_magazine: Default {}; + class cse_backwardsCompatMagazineBase_FR: CA_magazine {}; + class cse_waterbottle: cse_backwardsCompatMagazineBase_FR { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Water Bottle"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle.paa"; + model = "\A3\Structures_F_EPA\Items\Food\BottlePlastic_V2_F.p3d"; + descriptionShort = "A waterbottle"; + mass = 5; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_waterbottle_half"; + }; + class cse_canteen: cse_backwardsCompatMagazineBase_FR { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Water)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water"; + mass = 5; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_canteen_half"; + }; + class cse_canteen_half: cse_canteen { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Half)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water (Half)"; + mass = 5; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_canteen_empty"; + cse_onRefill = "cse_canteen"; + }; + class cse_canteen_empty: cse_canteen { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Empty)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water (Half)"; + mass = 5; + cse_isDrinkable = 0; + cse_onDrink = ""; + cse_onRefill = "cse_canteen"; + }; + + + class cse_waterbottle_half: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Water Bottle 1/2"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle.paa"; + model ="\cse\cse_sys_field_rations\waterbottle.p3d"; + descriptionShort = "Half full waterbottle"; + cse_onDrink = "cse_waterbottle_empty"; + cse_isDrinkable = 3.75; + se_onRefill = "cse_waterbottle"; + }; + + + class cse_waterbottle_empty: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Empty Water Bottle"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle_empty.paa"; + model ="\cse\cse_sys_field_rations\waterbottle.p3d"; + descriptionShort = "An empty waterbottle"; + cse_isDrinkable = 0; + cse_onRefill = "cse_waterbottle"; + cse_onDrink = ""; + }; + + class cse_MRE_BASE: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE.paa"; + model ="\cse\cse_sys_field_rations\mre_type1.p3d"; + descriptionShort = "A Meal Ready to Eat, unprepared"; + mass = 3; + cse_isEatable = 10; + cse_isDrinkable = 0; + }; + + class cse_MRE_LambC: cse_MRE_BASE { + displayName = "MRE Lamb Curry"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + model ="\cse\cse_sys_field_rations\mre_type1.p3d"; + descriptionShort = "An MRE containing Lamb Curry. Heat for best effect"; + }; + class cse_MRE_LambC_prepared: cse_MRE_LambC { + displayName = "MRE Lamb Curry (Heated)"; + }; + + class cse_MRE_Rice: cse_MRE_BASE { + displayName = "MRE Rice"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type2.paa"; + model ="\cse\cse_sys_field_rations\mre_type2.p3d"; + descriptionShort = "An MRE Containing Rice. Heat for best effect"; + }; + class cse_MRE_Rice_prepared: cse_MRE_Rice { + displayName = "MRE Rice (Heated)"; + }; + + class cse_MRE_CreamTomatoSoup: cse_MRE_BASE { + displayName = "MRE Cream Tomato Soup"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type3.paa"; + model ="\cse\cse_sys_field_rations\mre_type3.p3d"; + descriptionShort = "An MRE Containing Tomato Soup cream. Mix with water and heat for best effect"; + }; + class cse_MRE_CreamTomatoSoup_prepared: cse_MRE_CreamTomatoSoup { + displayName = "MRE Cream Tomato Soup (Heated)"; + }; + + class cse_MRE_CreamChickenSoup: cse_MRE_BASE { + displayName = "MRE Cream Chicken Soup"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type3.paa"; + model ="\cse\cse_sys_field_rations\mre_type3.p3d"; + descriptionShort = "An MRE Containing Chicken Soup. Mix with water and heat for best effect"; + }; + class cse_MRE_CreamChickenSoup_prepared: cse_MRE_CreamChickenSoup { + displayName = "MRE Cream Chicken Soup (Heated)"; + }; + + class cse_MRE_ChickenTikkaMassala: cse_MRE_BASE { + displayName = "MRE Chicken Tikka Massala"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type4.paa"; + model = "\cse\cse_sys_field_rations\mre_type4.p3d"; + descriptionShort = "An MRE with Chicken Tikka Massala. Heat for best effect"; + }; + class cse_MRE_ChickenTikkaMassala_prepared: cse_MRE_ChickenTikkaMassala { + displayName = "MRE Chicken Tikka Massala (Heated)"; + }; + + class cse_MRE_SteakVegetables: cse_MRE_BASE { + displayName = "MRE Steak & Vegetables"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type5.paa"; + model ="\cse\cse_sys_field_rations\mre_type5.p3d"; + descriptionShort = "An MRE Containing Steak & Vegetables. Heat for best effect"; + }; + class cse_MRE_SteakVegetables_prepared: cse_MRE_SteakVegetables { + displayName = "MRE Steak & Vegetables (Heated)"; + }; + + class cse_MRE_MeatballsPasta: cse_MRE_BASE { + displayName = "MRE Meatballs & Pasta"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type6.paa"; + model ="\cse\cse_sys_field_rations\mre_type6.p3d"; + descriptionShort = "An MRE Containing Meatballs & Pasta. Heat for best effect"; + }; + class cse_MRE_MeatballsPasta_prepared: cse_MRE_MeatballsPasta { + displayName = "MRE Meatballs & Pastas (Heated)"; + }; + + class cse_MRE_ChickenHerbDumplings: cse_MRE_BASE { + displayName = "MRE Chicken with Herb Dumplings"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type6.paa"; + model ="\cse\cse_sys_field_rations\mre_type6.p3d"; + descriptionShort = "An MRE Containing Chicken with Herb Dumplings. Heat for best effect"; + }; + class cse_MRE_ChickenHerbDumplings_prepared: cse_MRE_ChickenHerbDumplings { + displayName = "MRE Chicken with Herb Dumplings (Heated)"; + }; + + class cse_Humanitarian_Ration: cse_MRE_BASE { + displayName = "Humanitarian Ration"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_human.paa"; + model ="\cse\cse_sys_field_rations\mre_human.p3d"; + descriptionShort = "An Humanitarian Ration, for handing out to the local population"; + }; + + class cse_US_MRE_ChiliBeans: cse_MRE_BASE { + displayName = "Chile with Beans MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chili with Beans"; + }; + class cse_US_MRE_ChiliBeans_prepared: cse_US_MRE_ChiliBeans { + displayName = "Chile with Beans MRE (Heated)"; + }; + class cse_US_MRE_ChickenFajita: cse_MRE_BASE { + displayName = "Chicken Fajita MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "A Chicken Fajita MRE"; + }; + class cse_US_MRE_ChickenFajita_prepared: cse_US_MRE_ChickenFajita { + displayName = "Chicken Fajita MRE (Heated)"; + }; + + class cse_US_MRE_ChickenNoodles: cse_MRE_BASE { + displayName = "Chicken with Noodles MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chicken with Noodles"; + }; + class cse_US_MRE_ChickenNoodles_prepared: cse_US_MRE_ChickenNoodles { + displayName = "Chicken Fajita MRE(Heated)"; + }; + + class cse_US_MRE_PorkSausageGravy: cse_MRE_BASE { + displayName = "Pork Sausage with Gravy MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Pork Sausage with Gravy"; + }; + class cse_US_MRE_PorkSausageGravy_prepared: cse_US_MRE_PorkSausageGravy { + displayName = "Pork Sausage Gravy MRE(Heated)"; + }; + + class cse_US_MRE_MedChicen: cse_MRE_BASE { + displayName = "Mediterranean Chicken MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Mediterranean Chicken"; + }; + class cse_US_MRE_MedChicken_prepared: cse_US_MRE_MedChicen { + displayName = "Mediterranean Chicken MRE(Heated)"; + }; + + class cse_US_MRE_BeefRoastVeggies: cse_MRE_BASE { + displayName = "Beef Roast with Veggies MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Roast with Veggies"; + }; + class cse_US_MRE_BeefRoastVeggies_prepared: cse_US_MRE_BeefRoastVeggies { + displayName = "Beef Roast Veg MRE(Heated)"; + }; + + class cse_US_MRE_BeefBrisket: cse_MRE_BASE { + displayName = "Beef Brisket MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Brisket"; + }; + class cse_US_MRE_BeefBrisket_prepared: cse_US_MRE_BeefBrisket { + displayName = "Beef Brisket MRE(Heated)"; + }; + + class cse_US_MRE_MeatballMarinara: cse_MRE_BASE { + displayName = "Meatball Marinara MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Meatballs with Marinara Sauce"; + }; + class cse_US_MRE_MeatballMarinara_prepared: cse_US_MRE_MeatballMarinara { + displayName = "Meatball Marinara(Heated)"; + }; + + class cse_US_MRE_BeefStew: cse_MRE_BASE { + displayName = "Beef Stew MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Stew"; + }; + class cse_US_MRE_BeefStew_prepared: cse_US_MRE_BeefStew { + displayName = "Beef Stew MRE(Heated)"; + }; + + class cse_US_MRE_ChiliMacaroni: cse_MRE_BASE { + displayName = "Chile Macaroni MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chile Macaroni"; + }; + class cse_US_MRE_ChileMacaroni_prepared: cse_US_MRE_ChiliMacaroni { + displayName = "Chile Macaroni MRE(Heated)"; + }; + + class cse_US_MRE_VegetableLasagna: cse_MRE_BASE { + displayName = "Vegetable Lasagna MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Vegetable Lasagna"; + }; + class cse_US_MRE_VegetableLasagna_prepared: cse_US_MRE_VegetableLasagna { + displayName = "Vegetable Lasagna MRE(Heated)"; + }; + + class cse_US_MRE_SpicyPennePasta: cse_MRE_BASE { + displayName = "Spicy Penne Pasta MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Spicy Penne Pasta"; + }; + class cse_US_MRE_SpicyPennePasta_prepared: cse_US_MRE_SpicyPennePasta { + displayName = "Spicy Penne Pasta MRE(Heated)"; + }; + + class cse_US_MRE_CheeseTortellini: cse_MRE_BASE { + displayName = "Cheese Tortellini MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing CheeseTortellini"; + }; + class cse_US_MRE_CheeseTortellini_prepared: cse_US_MRE_CheeseTortellini { + displayName = "Cheese Tortellini MRE(Heated)"; + }; + + class cse_US_MRE_Ratatouille: cse_MRE_BASE { + displayName = "Ratatouille MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Ratatouille"; + }; + class cse_US_MRE_Ratatouille_prepared: cse_US_MRE_Ratatouille { + displayName = "Ratatouille MRE (Heated)"; + }; + + class cse_US_MRE_MexicanStyleChickenStew: cse_MRE_BASE { + displayName = "Mexican Style Chicken Stew MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Mexican Style Chicken Stew"; + }; + class cse_US_MRE_MexicanStyleChickenStew_prepared: cse_US_MRE_MexicanStyleChickenStew { + displayName = "Mexican Style Chicken Stew MRE (Heated)"; + }; + + class cse_US_MRE_PorkRib: cse_MRE_BASE { + displayName = "Pork Rib MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Pork Rib"; + }; + class cse_US_MRE_PorkRib_prepared: cse_US_MRE_PorkRib { + displayName = "Pork Rib MRE (Heated)"; + }; + + class cse_US_MRE_MapleSausage: cse_MRE_BASE { + displayName = "Maple Sausage MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Maple Sausage"; + }; + class cse_US_MRE_MapleSausage_prepared: cse_US_MRE_MapleSausage { + displayName = "Maple Sausage MRE (Heated)"; + }; + + class cse_US_MRE_BeefRavioli: cse_MRE_BASE { + displayName = "Beef Ravioli MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Beef Ravioli"; + }; + class cse_US_MRE_BeefRavioli_prepared: cse_US_MRE_BeefRavioli { + displayName = "Beef Ravioli MRE (Heated)"; + }; + + class cse_US_MRE_SloppyJoe: cse_MRE_BASE { + displayName = "Sloppy Joe MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing a Sloppy Joe"; + }; + class cse_US_MRE_SloppyJoe_prepared: cse_US_MRE_SloppyJoe { + displayName = "Sloppy Joe MRE (Heated)"; + }; + + class cse_US_MRE_SpaghettiMeatSauce: cse_MRE_BASE { + displayName = "Spaghetti with Meat Sauce MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Spaghetti with Meat Sauce"; + }; + class cse_US_MRE_SpaghettiMeatSauce_prepared: cse_US_MRE_SpaghettiMeatSauce { + displayName = "Spaghetti with Meat Sauce MRE (Heated)"; + }; + + class cse_US_MRE_LemonPepperTuna: cse_MRE_BASE { + displayName = " Lemon Pepper Tuna MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Lemon Pepper Tuna"; + }; + class cse_US_MRE_LemonPepperTuna_prepared: cse_US_MRE_LemonPepperTuna { + displayName = "Lemon Pepper Tuna MRE (Heated)"; + }; + + class cse_US_MRE_AsianBeefStrips: cse_MRE_BASE { + displayName = "Asian Beef Strips MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Asian Beef Strips"; + }; + class cse_US_MRE_AsianBeefStrips_prepared: cse_US_MRE_AsianBeefStrips { + displayName = "Asian Beef Strips MRE (Heated)"; + }; + + class cse_US_MRE_ChickenPestoPasta: cse_MRE_BASE { + displayName = "Chicken Pesto Pasta MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Chicken Pesto Pasta"; + }; + class cse_US_MRE_ChickenPestoPasta_prepared: cse_US_MRE_ChickenPestoPasta { + displayName = "Chicken Pesto Pasta (Heated)"; + }; + + class cse_US_MRE_SouthwestStyleBeefBlackBeans: cse_MRE_BASE { + displayName = "Southwest Style Beef & Black Beans"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Southwest Style Beef & Black Beans"; + }; + class cse_US_MRE_SouthwestStyleBeefBlackBeans_prepared: cse_US_MRE_SouthwestStyleBeefBlackBeans { + displayName = "Southwest Style Beef & Black Beans (Heated)"; + }; + + class cse_mre_c_ration: cse_MRE_BASE { + displayName = "C Ration"; + picture = "\cse\cse_sys_field_rations\data\pictures\gbl_mre_c_ration.paa"; + descriptionShort = "C ration"; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/CfgSounds.h b/TO_MERGE/cse/sys_field_rations/CfgSounds.h new file mode 100644 index 0000000000..238bc7024a --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/CfgSounds.h @@ -0,0 +1,7 @@ +class CfgSounds { + class cse_drinking { + name = "cse_drinking"; + sound[] = {"cse\cse_sys_field_rations\sounds\drinkingSound.ogg","db-1",1.0}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/CfgVehicles.h b/TO_MERGE/cse/sys_field_rations/CfgVehicles.h new file mode 100644 index 0000000000..b0f1b82c9f --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/CfgVehicles.h @@ -0,0 +1,201 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits {}; + }; + class cse_sys_field_rations: Module_F { + scope = 2; + displayName = "Field Rations [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class timeWithoutWater { + displayName = "Time without water"; + description = "How long should a unit be able to go without water"; + typeName = "NUMBER"; + class values { + class Twodays {name="48 hours"; value= 0.5; }; + class 32Hours {name="32 hours"; value= 0.75; }; + class oneDay {name="24 hours"; value=1; default=1; }; + class halfDay {name="12 hours"; value=2; }; + class quarterDay {name="6 hours"; value=4; }; + class eightDay {name="3 hours"; value=8; }; + class oneHour {name="1 hour"; value=24; }; + }; + }; + class timeWithoutFood { + displayName = "Time without food"; + description = "How long should a unit be able to go without food"; + typeName = "NUMBER"; + class values { + class Twodays {name="48 hours"; value= 0.5; }; + class 32Hours {name="32 hours"; value= 0.75; default=1;}; + class oneDay {name="24 hours"; value=1; }; + class halfDay {name="12 hours"; value=2; }; + class quarterDay {name="6 hours"; value=4; }; + class eightDay {name="3 hours"; value=8; }; + class oneHour {name="1 hour"; value=24; }; + }; + }; + }; + }; + + class NATO_Box_Base; + class cse_field_rations_all : NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "Field Rations [All] (CSE)"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + author = "Combat Space Enhancement"; + class TransportWeapons { + class cse_waterbottle { + weapon = "cse_waterbottle"; + count = 20; + }; + class _xx_cse_canteen { + weapon = "cse_canteen"; + count = 20; + }; + class _xx_cse_MRE_LambC { + weapon = "cse_MRE_LambC"; + count = 10; + }; + class _xx_cse_MRE_Rice { + weapon = "cse_MRE_Rice"; + count = 10; + }; + class _xx_cse_MRE_CreamTomatoSoup { + weapon = "cse_MRE_CreamTomatoSoup"; + count = 10; + }; + class _xx_cse_MRE_CreamChickenSoup { + weapon = "cse_MRE_CreamChickenSoup"; + count = 10; + }; + class _xx_cse_MRE_ChickenTikkaMassala { + weapon = "cse_MRE_ChickenTikkaMassala"; + count = 10; + }; + class _xx_cse_MRE_SteakVegetables { + weapon = "cse_MRE_SteakVegetables"; + count = 10; + }; + class _xx_cse_MRE_MeatballsPasta { + weapon = "cse_MRE_MeatballsPasta"; + count = 10; + }; + class _xx_cse_MRE_ChickenHerbDumplings { + weapon = "cse_MRE_ChickenHerbDumplings"; + count = 10; + }; + class _xx_cse_Humanitarian_Ration { + weapon = "cse_Humanitarian_Ration"; + count = 10; + }; + class _xx_cse_US_MRE_ChiliBeans { + weapon = "cse_US_MRE_ChiliBeans"; + count = 10; + }; + class _xx_cse_US_MRE_ChickenFajita { + weapon = "cse_US_MRE_ChickenFajita"; + count = 10; + }; + class _xx_cse_US_MRE_ChickenNoodles { + weapon = "cse_US_MRE_ChickenNoodles"; + count = 10; + }; + class _xx_cse_US_MRE_PorkSausageGravy { + weapon = "cse_US_MRE_PorkSausageGravy"; + count = 10; + }; + class _xx_cse_US_MRE_MedChicen { + weapon = "cse_US_MRE_MedChicen"; + count = 10; + }; + class _xx_cse_US_MRE_BeefRoastVeggies { + weapon = "cse_US_MRE_BeefRoastVeggies"; + count = 10; + }; + class _xx_cse_US_MRE_BeefBrisket { + weapon = "cse_US_MRE_BeefBrisket"; + count = 10; + }; + class _xx_cse_US_MRE_MeatballMarinara { + weapon = "cse_US_MRE_MeatballMarinara"; + count = 10; + }; + class _xx_cse_US_MRE_BeefStew { + weapon = "cse_US_MRE_BeefStew"; + count = 10; + }; + class _xx_cse_US_MRE_ChiliMacaroni { + weapon = "cse_US_MRE_ChiliMacaroni"; + count = 10; + }; + class _xx_cse_US_MRE_VegetableLasagna { + weapon = "cse_US_MRE_VegetableLasagna"; + count = 10; + }; + class _xx_cse_US_MRE_SpicyPennePasta { + weapon = "cse_US_MRE_SpicyPennePasta"; + count = 10; + }; + class _xx_cse_US_MRE_CheeseTortellini { + weapon = "cse_US_MRE_CheeseTortellini"; + count = 10; + }; + class _xx_cse_US_MRE_Ratatouille { + weapon = "cse_US_MRE_Ratatouille"; + count = 10; + }; + class _xx_cse_US_MRE_MexicanStyleChickenStew { + weapon = "cse_US_MRE_MexicanStyleChickenStew"; + count = 10; + }; + class _xx_cse_US_MRE_PorkRib { + weapon = "cse_US_MRE_PorkRib"; + count = 10; + }; + class _xx_cse_US_MRE_MapleSausage { + weapon = "cse_US_MRE_MapleSausage"; + count = 10; + }; + class _xx_cse_US_MRE_BeefRavioli { + weapon = "cse_US_MRE_BeefRavioli"; + count = 10; + }; + class _xx_cse_US_MRE_SloppyJoe { + weapon = "cse_US_MRE_SloppyJoe"; + count = 10; + }; + class _xx_cse_US_MRE_SpaghettiMeatSauce { + weapon = "cse_US_MRE_SpaghettiMeatSauce"; + count = 10; + }; + class _xx_cse_US_MRE_LemonPepperTuna { + weapon = "cse_US_MRE_LemonPepperTuna"; + count = 10; + }; + class _xx_cse_US_MRE_AsianBeefStrips { + weapon = "cse_US_MRE_AsianBeefStrips"; + count = 10; + }; + class _xx_cse_US_MRE_ChickenPestoPasta { + weapon = "cse_US_MRE_ChickenPestoPasta"; + count = 10; + }; + class _xx_cse_US_MRE_SouthwestStyleBeefBlackBeans { + weapon = "cse_US_MRE_SouthwestStyleBeefBlackBeans"; + count = 10; + }; + class _xx_cse_mre_c_ration { + weapon = "cse_mre_c_ration"; + count = 10; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/CfgWeapons.h b/TO_MERGE/cse/sys_field_rations/CfgWeapons.h new file mode 100644 index 0000000000..06efed1750 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/CfgWeapons.h @@ -0,0 +1,431 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class cse_waterbottle: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Water Bottle"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle.paa"; + model = "\A3\Structures_F_EPA\Items\Food\BottlePlastic_V2_F.p3d"; + descriptionShort = "A waterbottle"; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type= 201; + }; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_waterbottle_half"; + }; + class cse_canteen: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Water)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water"; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type= 201; + }; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_canteen_half"; + }; + class cse_canteen_half: cse_canteen { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Half)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water (Half)"; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type= 201; + }; + cse_isDrinkable = 3.75; + cse_onDrink = "cse_canteen_empty"; + cse_onRefill = "cse_canteen"; + }; + class cse_canteen_empty: cse_canteen { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Canteen (Empty)"; + picture = "\cse\cse_sys_field_rations\data\pictures\image_canteen.paa"; + model = "\A3\Structures_F_EPA\Items\Food\Canteen_F.p3d"; + descriptionShort = "A Canteen containing water (Half)"; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type= 201; + }; + cse_isDrinkable = 0; + cse_onDrink = ""; + cse_onRefill = "cse_canteen"; + }; + + + class cse_waterbottle_half: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Water Bottle 1/2"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle.paa"; + model ="\cse\cse_sys_field_rations\waterbottle.p3d"; + descriptionShort = "Half full waterbottle"; + cse_onDrink = "cse_waterbottle_empty"; + cse_isDrinkable = 3.75; + se_onRefill = "cse_waterbottle"; + }; + + + class cse_waterbottle_empty: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "Empty Water Bottle"; + picture = "\cse\cse_sys_field_rations\data\pictures\waterbottle_empty.paa"; + model ="\cse\cse_sys_field_rations\waterbottle.p3d"; + descriptionShort = "An empty waterbottle"; + cse_isDrinkable = 0; + cse_onRefill = "cse_waterbottle"; + cse_onDrink = ""; + }; + + class cse_MRE_BASE: cse_waterbottle { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = "MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE.paa"; + model ="\cse\cse_sys_field_rations\mre_type1.p3d"; + descriptionShort = "A Meal Ready to Eat, unprepared"; + class ItemInfo: InventoryItem_Base_F + { + mass= 2; + type= 201; + }; + cse_isEatable = 10; + cse_isDrinkable = 0; + }; + + class cse_MRE_LambC: cse_MRE_BASE { + displayName = "MRE Lamb Curry"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + model ="\cse\cse_sys_field_rations\mre_type1.p3d"; + descriptionShort = "An MRE containing Lamb Curry. Heat for best effect"; + }; + class cse_MRE_LambC_prepared: cse_MRE_LambC { + displayName = "MRE Lamb Curry (Heated)"; + }; + + class cse_MRE_Rice: cse_MRE_BASE { + displayName = "MRE Rice"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type2.paa"; + model ="\cse\cse_sys_field_rations\mre_type2.p3d"; + descriptionShort = "An MRE Containing Rice. Heat for best effect"; + }; + class cse_MRE_Rice_prepared: cse_MRE_Rice { + displayName = "MRE Rice (Heated)"; + }; + + class cse_MRE_CreamTomatoSoup: cse_MRE_BASE { + displayName = "MRE Cream Tomato Soup"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type3.paa"; + model ="\cse\cse_sys_field_rations\mre_type3.p3d"; + descriptionShort = "An MRE Containing Tomato Soup cream. Mix with water and heat for best effect"; + }; + class cse_MRE_CreamTomatoSoup_prepared: cse_MRE_CreamTomatoSoup { + displayName = "MRE Cream Tomato Soup (Heated)"; + }; + + class cse_MRE_CreamChickenSoup: cse_MRE_BASE { + displayName = "MRE Cream Chicken Soup"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type3.paa"; + model ="\cse\cse_sys_field_rations\mre_type3.p3d"; + descriptionShort = "An MRE Containing Chicken Soup. Mix with water and heat for best effect"; + }; + class cse_MRE_CreamChickenSoup_prepared: cse_MRE_CreamChickenSoup { + displayName = "MRE Cream Chicken Soup (Heated)"; + }; + + class cse_MRE_ChickenTikkaMassala: cse_MRE_BASE { + displayName = "MRE Chicken Tikka Massala"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type4.paa"; + model = "\cse\cse_sys_field_rations\mre_type4.p3d"; + descriptionShort = "An MRE with Chicken Tikka Massala. Heat for best effect"; + }; + class cse_MRE_ChickenTikkaMassala_prepared: cse_MRE_ChickenTikkaMassala { + displayName = "MRE Chicken Tikka Massala (Heated)"; + }; + + class cse_MRE_SteakVegetables: cse_MRE_BASE { + displayName = "MRE Steak & Vegetables"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type5.paa"; + model ="\cse\cse_sys_field_rations\mre_type5.p3d"; + descriptionShort = "An MRE Containing Steak & Vegetables. Heat for best effect"; + }; + class cse_MRE_SteakVegetables_prepared: cse_MRE_SteakVegetables { + displayName = "MRE Steak & Vegetables (Heated)"; + }; + + class cse_MRE_MeatballsPasta: cse_MRE_BASE { + displayName = "MRE Meatballs & Pasta"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type6.paa"; + model ="\cse\cse_sys_field_rations\mre_type6.p3d"; + descriptionShort = "An MRE Containing Meatballs & Pasta. Heat for best effect"; + }; + class cse_MRE_MeatballsPasta_prepared: cse_MRE_MeatballsPasta { + displayName = "MRE Meatballs & Pastas (Heated)"; + }; + + class cse_MRE_ChickenHerbDumplings: cse_MRE_BASE { + displayName = "MRE Chicken with Herb Dumplings"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type6.paa"; + model ="\cse\cse_sys_field_rations\mre_type6.p3d"; + descriptionShort = "An MRE Containing Chicken with Herb Dumplings. Heat for best effect"; + }; + class cse_MRE_ChickenHerbDumplings_prepared: cse_MRE_ChickenHerbDumplings { + displayName = "MRE Chicken with Herb Dumplings (Heated)"; + }; + + class cse_Humanitarian_Ration: cse_MRE_BASE { + displayName = "Humanitarian Ration"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_human.paa"; + model ="\cse\cse_sys_field_rations\mre_human.p3d"; + descriptionShort = "An Humanitarian Ration, for handing out to the local population"; + }; + + class cse_US_MRE_ChiliBeans: cse_MRE_BASE { + displayName = "Chile with Beans MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chili with Beans"; + }; + class cse_US_MRE_ChiliBeans_prepared: cse_US_MRE_ChiliBeans { + displayName = "Chile with Beans MRE (Heated)"; + }; + class cse_US_MRE_ChickenFajita: cse_MRE_BASE { + displayName = "Chicken Fajita MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "A Chicken Fajita MRE"; + }; + class cse_US_MRE_ChickenFajita_prepared: cse_US_MRE_ChickenFajita { + displayName = "Chicken Fajita MRE (Heated)"; + }; + + class cse_US_MRE_ChickenNoodles: cse_MRE_BASE { + displayName = "Chicken with Noodles MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chicken with Noodles"; + }; + class cse_US_MRE_ChickenNoodles_prepared: cse_US_MRE_ChickenNoodles { + displayName = "Chicken Fajita MRE(Heated)"; + }; + + class cse_US_MRE_PorkSausageGravy: cse_MRE_BASE { + displayName = "Pork Sausage with Gravy MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Pork Sausage with Gravy"; + }; + class cse_US_MRE_PorkSausageGravy_prepared: cse_US_MRE_PorkSausageGravy { + displayName = "Pork Sausage Gravy MRE(Heated)"; + }; + + class cse_US_MRE_MedChicen: cse_MRE_BASE { + displayName = "Mediterranean Chicken MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Mediterranean Chicken"; + }; + class cse_US_MRE_MedChicken_prepared: cse_US_MRE_MedChicen { + displayName = "Mediterranean Chicken MRE(Heated)"; + }; + + class cse_US_MRE_BeefRoastVeggies: cse_MRE_BASE { + displayName = "Beef Roast with Veggies MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Roast with Veggies"; + }; + class cse_US_MRE_BeefRoastVeggies_prepared: cse_US_MRE_BeefRoastVeggies { + displayName = "Beef Roast Veg MRE(Heated)"; + }; + + class cse_US_MRE_BeefBrisket: cse_MRE_BASE { + displayName = "Beef Brisket MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Brisket"; + }; + class cse_US_MRE_BeefBrisket_prepared: cse_US_MRE_BeefBrisket { + displayName = "Beef Brisket MRE(Heated)"; + }; + + class cse_US_MRE_MeatballMarinara: cse_MRE_BASE { + displayName = "Meatball Marinara MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Meatballs with Marinara Sauce"; + }; + class cse_US_MRE_MeatballMarinara_prepared: cse_US_MRE_MeatballMarinara { + displayName = "Meatball Marinara(Heated)"; + }; + + class cse_US_MRE_BeefStew: cse_MRE_BASE { + displayName = "Beef Stew MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Beef Stew"; + }; + class cse_US_MRE_BeefStew_prepared: cse_US_MRE_BeefStew { + displayName = "Beef Stew MRE(Heated)"; + }; + + class cse_US_MRE_ChiliMacaroni: cse_MRE_BASE { + displayName = "Chile Macaroni MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Chile Macaroni"; + }; + class cse_US_MRE_ChileMacaroni_prepared: cse_US_MRE_ChiliMacaroni { + displayName = "Chile Macaroni MRE(Heated)"; + }; + + class cse_US_MRE_VegetableLasagna: cse_MRE_BASE { + displayName = "Vegetable Lasagna MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Vegetable Lasagna"; + }; + class cse_US_MRE_VegetableLasagna_prepared: cse_US_MRE_VegetableLasagna { + displayName = "Vegetable Lasagna MRE(Heated)"; + }; + + class cse_US_MRE_SpicyPennePasta: cse_MRE_BASE { + displayName = "Spicy Penne Pasta MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Spicy Penne Pasta"; + }; + class cse_US_MRE_SpicyPennePasta_prepared: cse_US_MRE_SpicyPennePasta { + displayName = "Spicy Penne Pasta MRE(Heated)"; + }; + + class cse_US_MRE_CheeseTortellini: cse_MRE_BASE { + displayName = "Cheese Tortellini MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing CheeseTortellini"; + }; + class cse_US_MRE_CheeseTortellini_prepared: cse_US_MRE_CheeseTortellini { + displayName = "Cheese Tortellini MRE(Heated)"; + }; + + class cse_US_MRE_Ratatouille: cse_MRE_BASE { + displayName = "Ratatouille MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Ratatouille"; + }; + class cse_US_MRE_Ratatouille_prepared: cse_US_MRE_Ratatouille { + displayName = "Ratatouille MRE (Heated)"; + }; + + class cse_US_MRE_MexicanStyleChickenStew: cse_MRE_BASE { + displayName = "Mexican Style Chicken Stew MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE containing Mexican Style Chicken Stew"; + }; + class cse_US_MRE_MexicanStyleChickenStew_prepared: cse_US_MRE_MexicanStyleChickenStew { + displayName = "Mexican Style Chicken Stew MRE (Heated)"; + }; + + class cse_US_MRE_PorkRib: cse_MRE_BASE { + displayName = "Pork Rib MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Pork Rib"; + }; + class cse_US_MRE_PorkRib_prepared: cse_US_MRE_PorkRib { + displayName = "Pork Rib MRE (Heated)"; + }; + + class cse_US_MRE_MapleSausage: cse_MRE_BASE { + displayName = "Maple Sausage MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Maple Sausage"; + }; + class cse_US_MRE_MapleSausage_prepared: cse_US_MRE_MapleSausage { + displayName = "Maple Sausage MRE (Heated)"; + }; + + class cse_US_MRE_BeefRavioli: cse_MRE_BASE { + displayName = "Beef Ravioli MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Beef Ravioli"; + }; + class cse_US_MRE_BeefRavioli_prepared: cse_US_MRE_BeefRavioli { + displayName = "Beef Ravioli MRE (Heated)"; + }; + + class cse_US_MRE_SloppyJoe: cse_MRE_BASE { + displayName = "Sloppy Joe MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing a Sloppy Joe"; + }; + class cse_US_MRE_SloppyJoe_prepared: cse_US_MRE_SloppyJoe { + displayName = "Sloppy Joe MRE (Heated)"; + }; + + class cse_US_MRE_SpaghettiMeatSauce: cse_MRE_BASE { + displayName = "Spaghetti with Meat Sauce MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Spaghetti with Meat Sauce"; + }; + class cse_US_MRE_SpaghettiMeatSauce_prepared: cse_US_MRE_SpaghettiMeatSauce { + displayName = "Spaghetti with Meat Sauce MRE (Heated)"; + }; + + class cse_US_MRE_LemonPepperTuna: cse_MRE_BASE { + displayName = " Lemon Pepper Tuna MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Lemon Pepper Tuna"; + }; + class cse_US_MRE_LemonPepperTuna_prepared: cse_US_MRE_LemonPepperTuna { + displayName = "Lemon Pepper Tuna MRE (Heated)"; + }; + + class cse_US_MRE_AsianBeefStrips: cse_MRE_BASE { + displayName = "Asian Beef Strips MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Asian Beef Strips"; + }; + class cse_US_MRE_AsianBeefStrips_prepared: cse_US_MRE_AsianBeefStrips { + displayName = "Asian Beef Strips MRE (Heated)"; + }; + + class cse_US_MRE_ChickenPestoPasta: cse_MRE_BASE { + displayName = "Chicken Pesto Pasta MRE"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Chicken Pesto Pasta"; + }; + class cse_US_MRE_ChickenPestoPasta_prepared: cse_US_MRE_ChickenPestoPasta { + displayName = "Chicken Pesto Pasta (Heated)"; + }; + + class cse_US_MRE_SouthwestStyleBeefBlackBeans: cse_MRE_BASE { + displayName = "Southwest Style Beef & Black Beans"; + picture = "\cse\cse_sys_field_rations\data\pictures\MRE_type1.paa"; + descriptionShort = "An MRE Containing Southwest Style Beef & Black Beans"; + }; + class cse_US_MRE_SouthwestStyleBeefBlackBeans_prepared: cse_US_MRE_SouthwestStyleBeefBlackBeans { + displayName = "Southwest Style Beef & Black Beans (Heated)"; + }; + + class cse_mre_c_ration: cse_MRE_BASE { + displayName = "C Ration"; + picture = "\cse\cse_sys_field_rations\data\pictures\gbl_mre_c_ration.paa"; + descriptionShort = "C ration"; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_field_rations/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..674ed4195d --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/Combat_Space_Enhancement.h @@ -0,0 +1,8 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_field_rations { + init = "call compile preprocessFile 'cse\cse_sys_field_rations\init_sys_field_rations.sqf';"; + name = "Field Rations"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/GUI.h b/TO_MERGE/cse/sys_field_rations/GUI.h new file mode 100644 index 0000000000..fa22af3773 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/GUI.h @@ -0,0 +1,3 @@ + + #include "gui\define.h" + #include "gui\dialog_menu.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/config.cpp b/TO_MERGE/cse/sys_field_rations/config.cpp new file mode 100644 index 0000000000..3feec5fde7 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/config.cpp @@ -0,0 +1,31 @@ +#define _ARMA_ +class CfgPatches { + class cse_sys_field_rations { + units[] = {"cse_field_rations_all"}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui", "cse_main", "cse_f_eh", "cse_f_configuration", "cse_f_modules", "cse_f_states"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class CfgAddons { + class PreloadAddons { + class cse_sys_field_rations { + list[] = {"cse_sys_field_rations"}; + }; + }; +}; + +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" +#include "CfgVehicles.h" + +// Here for backwards compatabilty. +// #include "CfgMagazines.h" + +#include "CfgWeapons.h" +#include "CfgSounds.h" +#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/data/Humanitarian_Ration.paa b/TO_MERGE/cse/sys_field_rations/data/Humanitarian_Ration.paa new file mode 100644 index 0000000000..349a133b9a Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/Humanitarian_Ration.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/MRE_nohq.paa b/TO_MERGE/cse/sys_field_rations/data/MRE_nohq.paa new file mode 100644 index 0000000000..6972636a3d Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/MRE_nohq.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/MRE_smdi.paa b/TO_MERGE/cse/sys_field_rations/data/MRE_smdi.paa new file mode 100644 index 0000000000..f450605958 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/MRE_smdi.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/Thumbs.db b/TO_MERGE/cse/sys_field_rations/data/Thumbs.db new file mode 100644 index 0000000000..ae0aed9c59 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/Thumbs.db differ diff --git a/TO_MERGE/cse/sys_field_rations/data/hud_camelbak.paa b/TO_MERGE/cse/sys_field_rations/data/hud_camelbak.paa new file mode 100644 index 0000000000..35dfe4b273 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/hud_camelbak.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus.paa b/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus.paa new file mode 100644 index 0000000000..99f0195871 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus2.paa b/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus2.paa new file mode 100644 index 0000000000..9a6801c1da Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/hud_drinkstatus2.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus.paa b/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus.paa new file mode 100644 index 0000000000..a7263b22af Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus2.paa b/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus2.paa new file mode 100644 index 0000000000..1c23460c77 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/hud_foodstatus2.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/human.rvmat b/TO_MERGE/cse/sys_field_rations/data/human.rvmat new file mode 100644 index 0000000000..fde5e41869 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/data/human.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=17; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_field_rations\data\MRE_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_field_rations\data\MRE_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_field_rations/data/human_co.paa b/TO_MERGE/cse/sys_field_rations/data/human_co.paa new file mode 100644 index 0000000000..e713006bb3 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/human_co.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/igui_background_dialog.paa b/TO_MERGE/cse/sys_field_rations/data/igui_background_dialog.paa new file mode 100644 index 0000000000..ed3ef5d002 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/igui_background_dialog.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/mre-type125_co.paa b/TO_MERGE/cse/sys_field_rations/data/mre-type125_co.paa new file mode 100644 index 0000000000..27c94eaf2b Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/mre-type125_co.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/mre-type3_co.paa b/TO_MERGE/cse/sys_field_rations/data/mre-type3_co.paa new file mode 100644 index 0000000000..367f7e7c9e Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/mre-type3_co.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE.paa new file mode 100644 index 0000000000..5a941e7edf Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Heaterpackage.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Heaterpackage.paa new file mode 100644 index 0000000000..5083552df5 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Heaterpackage.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type1.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type1.paa new file mode 100644 index 0000000000..ec397cea4c Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type1.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type2.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type2.paa new file mode 100644 index 0000000000..3c75c24f2c Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type2.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type3.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type3.paa new file mode 100644 index 0000000000..5a941e7edf Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type3.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type4.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type4.paa new file mode 100644 index 0000000000..f90514a1c1 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type4.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type5.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type5.paa new file mode 100644 index 0000000000..08fde02f9a Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type5.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type6.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type6.paa new file mode 100644 index 0000000000..267b8a9b6e Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_Type6.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_human.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_human.paa new file mode 100644 index 0000000000..349a133b9a Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/MRE_human.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/britisharmy_waterbottle.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/britisharmy_waterbottle.paa new file mode 100644 index 0000000000..f7c940b823 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/britisharmy_waterbottle.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak.paa new file mode 100644 index 0000000000..fa9d24b7c9 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak_empty.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak_empty.paa new file mode 100644 index 0000000000..40ad5e02a8 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/camelbak_empty.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/gbl_mre_c_ration.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/gbl_mre_c_ration.paa new file mode 100644 index 0000000000..c2ed77897e Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/gbl_mre_c_ration.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/image_canteen.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/image_canteen.paa new file mode 100644 index 0000000000..f9b6ad6887 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/image_canteen.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/rationpack.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/rationpack.paa new file mode 100644 index 0000000000..f90514a1c1 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/rationpack.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle.paa new file mode 100644 index 0000000000..d9f49d2596 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle_empty.paa b/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle_empty.paa new file mode 100644 index 0000000000..ff29021140 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/pictures/waterbottle_empty.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/type46.rvmat b/TO_MERGE/cse/sys_field_rations/data/type46.rvmat new file mode 100644 index 0000000000..fde5e41869 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/data/type46.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=17; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_field_rations\data\MRE_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_field_rations\data\MRE_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_field_rations/data/type46_nohq.paa b/TO_MERGE/cse/sys_field_rations/data/type46_nohq.paa new file mode 100644 index 0000000000..ab85da35e9 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/type46_nohq.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/type4_co.paa b/TO_MERGE/cse/sys_field_rations/data/type4_co.paa new file mode 100644 index 0000000000..34a674c4c0 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/type4_co.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/type6_co.paa b/TO_MERGE/cse/sys_field_rations/data/type6_co.paa new file mode 100644 index 0000000000..87e97ea62f Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/type6_co.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/uk-bottle.paa b/TO_MERGE/cse/sys_field_rations/data/uk-bottle.paa new file mode 100644 index 0000000000..ea80e5d567 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/uk-bottle.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/waterbottle.paa b/TO_MERGE/cse/sys_field_rations/data/waterbottle.paa new file mode 100644 index 0000000000..591f414142 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/waterbottle.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/data/waterbottle_2.paa b/TO_MERGE/cse/sys_field_rations/data/waterbottle_2.paa new file mode 100644 index 0000000000..ca04325513 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/data/waterbottle_2.paa differ diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_actionDrink_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_actionDrink_FR.sqf new file mode 100644 index 0000000000..ea6caaa728 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_actionDrink_FR.sqf @@ -0,0 +1,39 @@ +/** + * fn_actionDrink_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_item", "_time", "_res"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_item = [_this, 1, "", [""]] call BIS_fnc_param; +_time = [_this, 2, 0, [0]] call BIS_fnc_param; + + +["cse_fieldRations_actionConsuming", true, "cse\cse_sys_field_rations\data\icons\icon_drinking.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + +CSE_ORIGINAL_POSITION_PLAYER = getPos _unit; +playsound "cse_drinking"; +_res = [_time,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar; + +["cse_fieldRations_actionConsuming", false, "cse\cse_sys_field_rations\data\icons\icon_drinking.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + + +if ([_item] call cse_fnc_itemIsDrinkable_FR && _res) then { + _unit removeItem _item; + _unit setvariable ["cse_drink_status_fr", ((_unit getvariable ["cse_drink_status_fr", 100]) + ([_item] call cse_fnc_getDrinkableValue_FR)) min 100]; + + _onDrink = getText(ConfigFile >> "CfgWeapons" >> _item >> "cse_onDrink"); + if (_onDrink != "") then { + _unit addItem _onDrink; + }; + + [format["ACTION DRINK: %1 FOUND %2",_unit, _item]] call cse_fnc_debug; + if ((_unit getvariable ["cse_drink_status_fr", 100]) >= 100) then { + hint "You feel stuffed.."; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_actionEat_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_actionEat_FR.sqf new file mode 100644 index 0000000000..b568d6bac3 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_actionEat_FR.sqf @@ -0,0 +1,33 @@ +/** + * fn_actionEat_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_item", "_time", "_res"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_item = [_this, 1, "", [""]] call BIS_fnc_param; +_time = [_this, 2, 0, [0]] call BIS_fnc_param; + + +["cse_fieldRations_actionConsuming", true, CSE_ICON_PATH + "icon_survival.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + +CSE_ORIGINAL_POSITION_PLAYER = getPos _unit; +_res = [_time,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar; + +["cse_fieldRations_actionConsuming", false, "cse\cse_sys_field_rations\data\icons\icon_drinking.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + + +if ([_item] call cse_fnc_itemIsEatable_FR && _res) then { + _unit removeItem _item; + _unit setvariable ["cse_food_status_fr", ((_unit getvariable ["cse_food_status_fr", 100]) + ([_item] call cse_fnc_getEatableValue_FR)) min 100]; + + [format["ACTIONEAT: %1 FOUND %2",_unit, _item]] call cse_fnc_debug; + if ((_unit getvariable ["cse_food_status_fr", 100]) >= 100) then { + hint "You feel stuffed.."; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefillCamelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefillCamelbak_FR.sqf new file mode 100644 index 0000000000..63edf83d0d --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefillCamelbak_FR.sqf @@ -0,0 +1,26 @@ +/** + * fn_actionRefillCamelbak_FR.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit", "_item", "_onRefill", "_time", "_res"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_time = [_this, 1, 0, [0]] call BIS_fnc_param; + + +CSE_ORIGINAL_POSITION_PLAYER = getPos _unit; +_res = [_time,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar; + + +if ([uniformContainer _unit] call cse_fnc_isCamelbak_FR && _res) then { + _maxValue = getNumber(ConfigFile >> "cfgWeapons" >> typeOf (uniformContainer _unit) >> "cse_camelbak_maxContent"); + if (_maxValue > 0) then { + _uniform = uniformContainer _unit; + _uniform setvariable ["cse_camelbak_status_fr", _maxValue]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefill_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefill_FR.sqf new file mode 100644 index 0000000000..f95e18753b --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_actionRefill_FR.sqf @@ -0,0 +1,28 @@ +/** + * fn_actionRefill_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_item", "_onRefill", "_time", "_res"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_item = [_this, 1, "", [""]] call BIS_fnc_param; +_time = [_this, 2, 0, [0]] call BIS_fnc_param; + + +CSE_ORIGINAL_POSITION_PLAYER = getPos _unit; +_res = [_time,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar; + + +if ([_item] call cse_fnc_itemIsRefillable_FR && _res) then { + _unit removeItem _item; + _onRefill = getText(ConfigFile >> "CfgWeapons" >> _item >> "cse_onRefill"); + if (_onRefill != "") then { + _unit addItem _onRefill; + }; + [format["ACTION REFILL: %1 FOUND %2 %3",_unit, _item, _onRefill]] call cse_fnc_debug; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_canDrink_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_canDrink_FR.sqf new file mode 100644 index 0000000000..70d6539a8a --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_canDrink_FR.sqf @@ -0,0 +1,11 @@ +/** + * fn_canDrink_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +(((_this select 0) getvariable ["cse_drink_status_fr", 100]) < 101) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_canEat_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_canEat_FR.sqf new file mode 100644 index 0000000000..69c412f41b --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_canEat_FR.sqf @@ -0,0 +1,14 @@ +/** + * fn_canEat_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; + +((_unit getvariable ["cse_food_status_fr", 100]) < 101) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_canRefillCamelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_canRefillCamelbak_FR.sqf new file mode 100644 index 0000000000..e374d111b2 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_canRefillCamelbak_FR.sqf @@ -0,0 +1,6 @@ +private ["_unit", "_target"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_target = [_this, 1, objNull, [objNull]] call bis_fnc_param; + + +([_unit,_target] call cse_fnc_canRefill_FR); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_canRefill_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_canRefill_FR.sqf new file mode 100644 index 0000000000..e2a02af147 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_canRefill_FR.sqf @@ -0,0 +1,16 @@ +/** + * fn_canRefill_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_target"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_target = [_this, 1, objNull, [objNull]] call bis_fnc_param; + + +(((_target getvariable ["cse_isRefillObject_FR", false]) || (_target iskindof "Land_Misc_Well_C_EP1") || (_target iskindof "Land_Misc_Well_L_EP1") || (_target iskindof "Land_Barrel_water") || (_target iskindof "Land_stand_waterl_EP1") || (_target iskindof "Land_Reservoir_EP1")) && (_target distance _unit < 5)) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_getDrinkableValue_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_getDrinkableValue_FR.sqf new file mode 100644 index 0000000000..57e2f2b0a2 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_getDrinkableValue_FR.sqf @@ -0,0 +1,18 @@ +/** + * fn_getDrinkableValue_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_item", "_return"]; +_item = [_this, 0, "", [""]] call bis_fnc_param; +_return = 0; + +if ([_item] call cse_fnc_itemIsDrinkable_FR) then { + _return = getNumber(ConfigFile >> "CfgWeapons" >> _item >> "cse_isDrinkable"); +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_getEatableValue_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_getEatableValue_FR.sqf new file mode 100644 index 0000000000..5619f7cb05 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_getEatableValue_FR.sqf @@ -0,0 +1,18 @@ +/** + * fn_getEatableValue_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_item", "_return"]; +_item = [_this, 0, "", [""]] call bis_fnc_param; +_return = 0; + +if ([_item] call cse_fnc_itemIsEatable_FR) then { + _return = getNumber(ConfigFile >> "CfgWeapons" >> _item >> "cse_isEatable"); +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_getInitialContent_Camelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_getInitialContent_Camelbak_FR.sqf new file mode 100644 index 0000000000..48d1e29d74 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_getInitialContent_Camelbak_FR.sqf @@ -0,0 +1,13 @@ +/** + * fn_getStartContent_Camelbak_FR.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_camelbak"]; +_camelbak = [_this, 0, objNull, [objNull]] call bis_fnc_param; +(getNumber(ConfigFile >> "cfgWeapons" >> typeOf _camelbak >> "cse_camelbak_initialContent") min ([_camelbak] call cse_fnc_getMaxContent_Camelbak_FR)); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_getMaxContent_Camelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_getMaxContent_Camelbak_FR.sqf new file mode 100644 index 0000000000..a41de4f97c --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_getMaxContent_Camelbak_FR.sqf @@ -0,0 +1,13 @@ +/** + * fn_getMaxContent_Camelbak_FR.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_camelbak"]; +_camelbak = [_this, 0, objNull, [objNull]] call bis_fnc_param; +getNumber(ConfigFile >> "cfgWeapons" >> typeOf _camelbak >> "cse_camelbak_maxContent"); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_hasCamelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_hasCamelbak_FR.sqf new file mode 100644 index 0000000000..d1315cd654 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_hasCamelbak_FR.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasCamelbak_FR.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + + +private ["_unit"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; + +if !(_unit isKindOf "CAManBase") exitwith {false}; +([uniformContainer _unit] call cse_fnc_isCamelbak_FR); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_hasDrinkableItem_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_hasDrinkableItem_FR.sqf new file mode 100644 index 0000000000..dcfe758649 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_hasDrinkableItem_FR.sqf @@ -0,0 +1,22 @@ +/** + * fn_hasDrinkableItem_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_return", "_magazines"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_return = false; + +_magazines = items _unit; +{ + if ([_x] call cse_fnc_itemIsDrinkable_FR) exitwith { + _return = true; + }; +}foreach _magazines; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_hasEatableItem_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_hasEatableItem_FR.sqf new file mode 100644 index 0000000000..e643ed182f --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_hasEatableItem_FR.sqf @@ -0,0 +1,22 @@ +/** + * fn_hasEatableItem_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_return", "_magazines"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_return = false; + +_magazines = items _unit; +{ + if ([_x] call cse_fnc_itemIsEatable_FR) exitwith { + _return = true; + }; +}foreach _magazines; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_hasRefillableItem_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_hasRefillableItem_FR.sqf new file mode 100644 index 0000000000..7f6fe27261 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_hasRefillableItem_FR.sqf @@ -0,0 +1,22 @@ +/** + * fn_hasRefillableItem_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_return", "_magazines"]; +_unit = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_return = false; + +_magazines = items _unit; +{ + if ([_x] call cse_fnc_itemIsRefillable_FR) exitwith { + _return = true; + }; +}foreach _magazines; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_isCamelbak_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_isCamelbak_FR.sqf new file mode 100644 index 0000000000..be3f57b975 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_isCamelbak_FR.sqf @@ -0,0 +1,17 @@ +/** + * fn_isCamelbak_FR.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_return", "_object"]; +_object = [_this, 0, objNull, [objNull]] call bis_fnc_param; +_return = false; +if (isClass (ConfigFile >> "cfgWeapons" >> typeOf _object)) then { + _return = getNumber(ConfigFile >> "cfgWeapons" >> typeOf _object >> "cse_camelbak_maxContent") > 0; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsDrinkable_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsDrinkable_FR.sqf new file mode 100644 index 0000000000..026f51568d --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsDrinkable_FR.sqf @@ -0,0 +1,20 @@ +/** + * fn_itemIsDrinkable_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_item", "_return", "_cfg"]; +_item = [_this, 0, "", [""]] call bis_fnc_param; +_return = false; + +_cfg = (ConfigFile >> "CfgWeapons" >> _item); +if (isClass _cfg) then { + _return = (getNumber (_cfg >> "cse_isDrinkable") > 0); +}; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsEatable_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsEatable_FR.sqf new file mode 100644 index 0000000000..ed2df08bce --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsEatable_FR.sqf @@ -0,0 +1,20 @@ +/** + * fn_itemIsEatable_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_item", "_return", "_cfg"]; +_item = [_this, 0, "", [""]] call bis_fnc_param; +_return = false; + +_cfg = (ConfigFile >> "CfgWeapons" >> _item); +if (isClass _cfg) then { + _return = (getNumber (_cfg >> "cse_isEatable") > 0); +}; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsRefillable_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsRefillable_FR.sqf new file mode 100644 index 0000000000..3545eafbbd --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_itemIsRefillable_FR.sqf @@ -0,0 +1,20 @@ +/** + * fn_itemIsRefillable_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_item", "_return", "_cfg"]; +_item = [_this, 0, "", [""]] call bis_fnc_param; +_return = false; + +_cfg = (ConfigFile >> "CfgWeapons" >> _item); +if (isClass _cfg) then { + _return = (getText(_cfg >> "cse_onRefill") != ""); +}; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_reduceLevels_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_reduceLevels_FR.sqf new file mode 100644 index 0000000000..e577a9147e --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_reduceLevels_FR.sqf @@ -0,0 +1,40 @@ +/** + * fn_reduceLevels_FR.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_absSpeed", "_camelbak_state","_decentWater","_decentFood", "_unit"]; +_unit = _this select 0; + +_drinkStatus = _unit getvariable ["cse_drink_status_fr", 100]; +_foodStatus = _unit getvariable ["cse_food_status_fr", 100]; + +_absSpeed = abs(speed _unit); + +_decentWater = CSE_DESCENT_RATE_WATER_FR; +_decentFood = CSE_DESCENT_RATE_FOOD_FR; + +// TODO add in weight calculation and effect +// If _unit is inside a vehicle, adjust waterlevels +if (vehicle _unit == _unit) then { + if (_absSpeed > 1) then { + _decentWater = _decentWater + (_absSpeed / 400); + _decentFood = _decentFood + (_absSpeed / 1200); + }; +}; +if ([_unit] call cse_fnc_hasCamelbak_FR) then { + _camelbak_state = (uniformContainer _unit) getvariable ["cse_camelbak_status_fr", [(uniformContainer _unit)] call cse_fnc_getInitialContent_Camelbak_FR]; + if (_camelbak_state > 0) then { + (uniformContainer _unit) setvariable ["cse_camelbak_status_fr", _camelbak_state - _decentWater]; + } else { + _unit setvariable ["cse_drink_status_fr", _drinkStatus - _decentWater]; + }; +} else { + _unit setvariable ["cse_drink_status_fr", _drinkStatus - _decentWater]; +}; +_unit setvariable ["cse_food_status_fr", _foodStatus - _decentFood]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_updateFieldRations_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_updateFieldRations_FR.sqf new file mode 100644 index 0000000000..ee676456f9 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_updateFieldRations_FR.sqf @@ -0,0 +1,53 @@ +/** + * fn_updateFieldRations_FR.sqf + * @Descr: Updates the hydration and hunger levels for given unit and if the unit is the player, it will also give a call to the UI icons from Field Rations. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit that will have the levels updated)] + * @Return: void + * @PublicAPI: false + */ + +private ["_unit", "_drinkStatus","_foodStatus","_camelbakStatus", "_animState", "_aniMStateChars", "_animP"]; +_unit = _this select 0; +[_unit] call cse_fnc_reduceLevels_FR; +_drinkStatus = _unit getvariable ["cse_drink_status_fr", 100]; +_foodStatus = _unit getvariable ["cse_food_status_fr", 100]; +_camelbakStatus = _unit getvariable ["cse_camelbak_status_fr", 0]; +//[format["drink: %1 Food: %2 Camelbak: %3 - %4", _drinkStatus, _foodStatus, _camelbakStatus, _unit]] call cse_fnc_debug; + +[] call cse_fnc_updateUIStatus_FR; +if (_drinkStatus < 25 || _foodStatus < 25) then { + if (speed _unit > 12 && vehicle _unit == _unit) then { + _unit playMove "amovppnemstpsraswrfldnon"; + }; +}; + +if (_drinkStatus < 30 || _foodStatus < 30) then { + CSE_SHOW_UI_ICONS_FR = true; +} else { + CSE_SHOW_UI_ICONS_FR = false; +}; + +if (_drinkStatus < 20 || _foodStatus < 20) then { + if (random(1) > 0.8) then { + [_unit] call cse_fnc_setUnconsciousState; + }; +}; + +_animState = animationState _unit; +_animStateChars = toArray _animState; +_animP = toString [_animStateChars select 5,_animStateChars select 6,_aniMStateChars select 7]; + + +if (_drinkStatus < 7 || _foodStatus < 7) then { + if (speed _unit > 1 && vehicle _unit == _unit && (_animP != "pne")) then { + _unit playMove "amovppnemstpsraswrfldnon"; + }; +}; + +if (_drinkStatus < 1 || _foodStatus < 1) then { + if (random(1) > 0.2) then { + [_unit] call cse_fnc_setDead; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/functions/fn_updateUIStatus_FR.sqf b/TO_MERGE/cse/sys_field_rations/functions/fn_updateUIStatus_FR.sqf new file mode 100644 index 0000000000..b3ac2bb126 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/functions/fn_updateUIStatus_FR.sqf @@ -0,0 +1,60 @@ +/** + * fn_updateUIStatus_FR.sqf + * @Descr: Updates the UI icons for field rations, based on player stats. + * @Author: Glowbal + * + * @Arguments: [skipCheck BOOL (Whatever or not checks for display should be skipped. True will force display)] + * @Return: void + * @PublicAPI: true + */ + +#define DEFAULT_ALPHA_LEVEL 0.4 + +private ["_unit","_PlayerStatusUI","_ctrlPlayerStatusDrink", "_ctrlPlayerStatusFood", "_ctrlCamelBakStatus", "_alphaCamelBak", "_drinkStatus","_foodStatus","_camelbakStatus", "_greenCamelBak", "_greenDrink", "_greenFood", "_yellowFood","_yellowDrink","_yellowCamelBak", "_redFood", "_redDrink", "_redCamelBak"]; + +_skipChecks = [_this, 0, false, [false]] call BIS_fnc_Param; + +if !(hasInterface) exitwith {}; +_unit = player; +disableSerialization; +_PlayerStatusUI = uiNamespace getVariable "CSE_sys_field_rations_PlayerStatusUI"; +if (!isnil "_PlayerStatusUI") then { + _ctrlPlayerStatusDrink = _PlayerStatusUI displayCtrl 11113; + _ctrlPlayerStatusFood = _PlayerStatusUI displayCtrl 11112; + _ctrlCamelBakStatus = _PlayerStatusUI displayCtrl 11114; + + _drinkStatus = _unit getvariable ["cse_drink_status_fr", 100]; + _foodStatus = _unit getvariable ["cse_food_status_fr", 100]; + _camelbakStatus = _unit getvariable ["cse_camelbak_status_fr", 0]; + + if (CSE_SHOW_UI_ICONS_FR || CSE_SHOW_UI_ICONS_ONACTION_FR || CSE_SHOW_UI_ICONS_SETTING_FR || ((_drinkStatus < 30) || (_foodStatus < 30))) then { + _alphaCamelBak = 0; + if ([_unit] call cse_fnc_hasCamelbak_FR) then { + _alphaCamelBak = DEFAULT_ALPHA_LEVEL; + }; + + _greenCamelBak = _camelbakStatus/100; + _redCamelBak = 1.0 - _greenCamelBak; + _yellowCamelBak = 0; + _ctrlCamelBakStatus ctrlSetTextColor [_redCamelBak,_greenCamelBak,_yellowCamelBak, _alphaCamelBak]; + + _greenFood = _foodStatus/100; + _redFood = 1.0 - _greenFood; + _yellowFood = 0; + _ctrlPlayerStatusFood ctrlSetTextColor [_redFood,_greenFood,_yellowFood, DEFAULT_ALPHA_LEVEL]; + + _greenDrink = _drinkStatus/100; + _redDrink = 1.0 - _greenDrink; + _yellowDrink = 0; + _ctrlPlayerStatusDrink ctrlSetTextColor [_redDrink,_greenDrink,_yellowDrink, DEFAULT_ALPHA_LEVEL]; + } else { + _ctrlCamelBakStatus ctrlSetTextColor [0, 0, 0, 0]; + _ctrlPlayerStatusFood ctrlSetTextColor [0, 0, 0, 0]; + _ctrlPlayerStatusDrink ctrlSetTextColor [0, 0, 0, 0]; + }; + if (!_skipChecks) then { + if (CSE_SHOW_UI_ICONS_ONACTION_FR) then { + CSE_SHOW_UI_ICONS_ONACTION_FR = false; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/gui/define.h b/TO_MERGE/cse/sys_field_rations/gui/define.h new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/gui/define.h @@ -0,0 +1,797 @@ + +#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/sys_field_rations/gui/dialog_menu.h b/TO_MERGE/cse/sys_field_rations/gui/dialog_menu.h new file mode 100644 index 0000000000..6db9dc28e3 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/gui/dialog_menu.h @@ -0,0 +1,172 @@ +class cse_dialog_menu_frm { + idd = 54328; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_dialog_menu_frm', _this select 0];"; + onUnload = "uiNamespace setVariable ['cse_dialog_menu_frm', nil];"; + class controlsBackground { + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class LeftBackground: CenterBackground { + y = "4.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "12.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "25 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class RightBackground: LeftBackground { + x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + w = "12.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "Dialog with Person"; + }; + + class labelShow : cse_gui_staticBase { + idc = 12; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.3 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Name:"; + }; + class labelShow2: cse_gui_staticBase { + idc = 13; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.4 * ((((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 = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "State:"; + }; + + class actionClose : cse_gui_buttonBase { + idc = 10; + text = "Close"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((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)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "closedialog 0;"; + }; + + class listboxConversationOverView: cse_gui_listNBox { + idc = 200; + x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.25}; + }; + + class labelTitle: cse_gui_staticBase { + idc = 250; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "Conversation Selection"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + + + class actionListBox1: cse_gui_listBoxBase { + idc = 400; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "7.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0, 0.9}; + colorSelectBackground[] = {0,0,0, 0.9}; + colorSelectBackground2[] = { 0.9, 0.9, 0.9, 0.9}; + color[] = {1, 1, 1, 1}; + colorText[] = {1, 1, 1, 1}; + colorSelect[] = {1, 1, 1, 1}; + colorSelect2[] = {0,0,0, 1}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.75)"; + rowHeight = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.75)"; + }; + + class labelKey: cse_gui_staticBase { + idc = 300; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "6.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + }; + + + class actionPerformAction: actionClose { + idc = 30; + text = "Say selected line type"; + x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)"; + action = "[CSE_AIM_DIALOG_INTERACTION_TARGET_AIM, player] call cse_fnc_playerSpeaksLine_AIM; "; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {0,0,0, 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}; + }; + + + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/gui/player_hud.h b/TO_MERGE/cse/sys_field_rations/gui/player_hud.h new file mode 100644 index 0000000000..76fd93508d --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/gui/player_hud.h @@ -0,0 +1,48 @@ + +#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 BOTTOM_SIDE - (0.1 * ICON_WIDTH) +#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH) + +class RscTitles { + 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 = X_POS_ICONS; + y = Y_POS_ICONS; + w = ICON_WIDTH; + h = ICON_WIDTH; + }; + class drinkStatus: cse_gui_backgroundBase { + text = "cse\cse_sys_field_rations\data\icons\icon_drinking.paa"; + colorText[] = {0.0,1.0,0.0,0.4}; + idc = 11113; + x = X_POS_ICONS; + y = Y_POS_ICONS - DIFFERENCE_ICONS; + w = ICON_WIDTH; + h = ICON_WIDTH; + }; + /* 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; + };*/ + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/hud.hpp b/TO_MERGE/cse/sys_field_rations/hud.hpp new file mode 100644 index 0000000000..d9ceda8332 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/hud.hpp @@ -0,0 +1,36 @@ +// CSE FRM HUD +// by Glowbal + +class RscTitles{ + class RscCSEPlayerStatus { + duration = 10000000000; + idd = 1111; + movingenable = 0; + onLoad = "uiNamespace setVariable ['CSEFRMStatusUI', _this select 0];"; + + class controlsBackground { + class cse_FoodStatus: cse_backgroundBase { + text = "cse\cse_sys_field_rations\data\hud_foodstatus2.paa"; + colorText[] = {0.0, 1.0, 0.0, 0.9}; + idc = 11112; + x = "0.955313 * safezoneW + safezoneX"; + y = "0.90 * safezoneH + safezoneY"; + w = "0.04 * safezoneW"; + h = "0.05 * safezoneH"; + }; + + class cse_drinkStatus: cse_FoodStatus { + text = "cse\cse_sys_field_rations\data\hud_drinkstatus2.paa"; + idc = 11113; + y = "0.85 * safezoneH + safezoneY"; + + }; + + class cse_CamelBak: cse_FoodStatus { + text = "cse\cse_sys_field_rations\data\hud_camelbak.paa"; + idc = 11114; + y = "0.80 * safezoneH + safezoneY"; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/init_sys_field_rations.sqf b/TO_MERGE/cse/sys_field_rations/init_sys_field_rations.sqf new file mode 100644 index 0000000000..cece0f7706 --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/init_sys_field_rations.sqf @@ -0,0 +1,156 @@ +/** + * init_sys_field_rations.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +/* + 24 hours: + - 86400 seconds total + + Run every 10 seconds so: + - 8640 iterations in 24 hours + + If we want to lower the decent rate from 100% to 0 in 24 hours: + 100% / 8640 = 0.011574% per iteration. + + To increase it, decrease the modifier. + To decease it, increase the modifier. +*/ +#define DEFAULT_DECENT_RATE 0.011574 + +private ["_args", "_entries"]; +CSE_DESCENT_RATE_WATER_FR = DEFAULT_DECENT_RATE; +CSE_DESCENT_RATE_FOOD_FR = DEFAULT_DECENT_RATE; +CSE_SHOW_UI_ICONS_FR = false; +CSE_SHOW_UI_ICONS_ONACTION_FR = false; +CSE_SHOW_UI_ICONS_SETTING_FR = true; + +["cse_drink_status_fr",100,false,"frm", false] call cse_fnc_defineVariable; +["cse_food_status_fr",100,false,"frm", false] call cse_fnc_defineVariable; + +if (!hasInterface) exitwith {}; // only want to run this on clients + +_args = _this; +{ + if (_x select 0 == "timeWithoutWater") then { + CSE_DESCENT_RATE_WATER_FR = DEFAULT_DECENT_RATE * (_X select 1); + }; + if (_x select 0 == "timeWithoutFood") then { + CSE_DESCENT_RATE_FOOD_FR = DEFAULT_DECENT_RATE * (_X select 1); + }; +}foreach _args; +waituntil{!isnil "cse_gui"}; +[format["FRM - Field Rations Module initialised"],2] call cse_fnc_debug; + +["itemAdd", ["cse_sys_field_rations_task_loop_CMS", { + if (alive player) then { + [player] call cse_fnc_updateFieldRations_FR; + }; +}, 10]] call BIS_fnc_loop; + +sleep 1; +101 cutRsc ["CSE_sys_field_rations_PlayerStatusUI","PLAIN"]; +[] call cse_fnc_updateUIStatus_FR; + +waituntil {!isnil "cse_gui"}; + +cse_displayEntries_Eat_FRM = { + private ["_subMenus", "_passedMags", "_magazines"]; + _subMenus = []; + _passedMags = []; + _magazines = items player; + { + if (!((_x) in _passedMags)) then { + _passedMags pushback _x; + if ([(_x)] call cse_fnc_itemIsEatable_FR) then { + _subMenus set [ count _subMenus, + call compile format['[getText(configFile >> "CfgWeapons" >> "%1" >> "displayName"),getText(configFile >> "CfgWeapons" >> "%1" >> "picture"), { + closeDialog 0; + [player,"%1",10] spawn cse_fnc_actionEat_FR; CSE_SHOW_UI_ICONS_ONACTION_FR = true; [true] call cse_fnc_updateUIStatus_FR; + }, true, "Eat " + getText(configFile >> "CfgWeapons" >> "%1" >> "displayName")]',(_x)] + ]; + }; + }; + }foreach _magazines; + [_subMenus] call cse_fnc_debug; + [ _this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; + CSE_SHOW_UI_ICONS_ONACTION_FR = true; [true] call cse_fnc_updateUIStatus_FR; +}; + + +cse_displayEntries_Drink_FRM = { + private ["_subMenus", "_passedMags", "_magazines"]; + _subMenus = []; + _passedMags = []; + _magazines = items player; + { + if (!(_x in _passedMags)) then { + _passedMags pushback _x; + if ([_x] call cse_fnc_itemIsDrinkable_FR) then { + _subMenus set [ count _subMenus, + call compile format['[getText(configFile >> "CfgWeapons" >> "%1" >> "displayName"),getText(configFile >> "CfgWeapons" >> "%1" >> "picture"), { + closeDialog 0; + [player,"%1", 4.5] spawn cse_fnc_actionDrink_FR; CSE_SHOW_UI_ICONS_ONACTION_FR = true; [true] call cse_fnc_updateUIStatus_FR; + }, true, "Drink " + getText(configFile >> "CfgWeapons" >> "%1" >> "displayName")]',_x] + ]; + }; + }; + }foreach _magazines; + [ _this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; + CSE_SHOW_UI_ICONS_ONACTION_FR = true; + [true] call cse_fnc_updateUIStatus_FR; +}; + +cse_displayEntries_Refill_FRM = { + private ["_subMenus", "_passedMags", "_magazines"]; + _subMenus = []; + _passedMags = []; + _magazines = items player; + { + if (!(_x in _passedMags)) then { + _passedMags pushback _x; + if ([_x] call cse_fnc_itemIsRefillable_FR) then { + _subMenus set [ count _subMenus, + call compile format['[getText(configFile >> "CfgWeapons" >> "%1" >> "displayName"),getText(configFile >> "CfgWeapons" >> "%1" >> "picture"), { + closeDialog 0; + [player,"%1",6] spawn cse_fnc_actionRefill_FR; CSE_SHOW_UI_ICONS_ONACTION_FR = true; [true] call cse_fnc_updateUIStatus_FR; + }, true, "Refill " + getText(configFile >> "CfgWeapons" >> "%1" >> "displayName")]',_x] + ]; + }; + }; + }foreach _magazines; + [_subMenus] call cse_fnc_debug; + [ _this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; + CSE_SHOW_UI_ICONS_ONACTION_FR = true; + [true] call cse_fnc_updateUIStatus_FR; +}; + +_entries = [ + ["Eat", {(([player] call cse_fnc_canEat_FR) && ([player] call cse_fnc_hasEatableItem_FR))}, CSE_ICON_PATH + "icon_survival.paa", cse_displayEntries_Eat_FRM, "Show consume options"], + ["Drink", {(([player] call cse_fnc_canDrink_FR) && ([player] call cse_fnc_hasDrinkableItem_FR))}, "cse\cse_sys_field_rations\data\icons\icon_drinking.paa", cse_displayEntries_Drink_FRM, "Show drink options"], + ["Refill", {(([player, _this select 1] call cse_fnc_canRefill_FR) && ([player] call cse_fnc_hasRefillableItem_FR))}, "cse\cse_sys_field_rations\data\hud_drinkstatus.paa", cse_displayEntries_Refill_FRM, "Show refill actions"], + ["Camelbak", {(([player, _this select 1] call cse_fnc_canRefillCamelbak_FR) && ([player] call cse_fnc_hasCamelbak_FR))}, "cse\cse_sys_field_rations\data\hud_drinkstatus.paa", {[player,10] spawn cse_fnc_actionRefillCamelbak_FR;}, "Refill camelbak"] + ]; +["ActionMenu","survival", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +// This is here for backwards compatability. This code will be removed in the near future. +_showError = false; +{ + _configEntry = (configFile >> "CfgMagazines" >> _x); + if([_configEntry, "cse_backwardsCompatMagazineBase_FR"] call cse_fnc_inheritsFrom) then { + player removeMagazine _x; + player addItem _x; + diag_log format["WARNING: Outdated Field Rations magazine classname %1 found. Please replace magazine by item variant. Future versions will not support this anymore.", _x]; + _showError = true; + }; +}foreach (magazines player); +if (_showError) then { + ["Outdated Field Rations Classnames have been found. Please replace magazine classname by item variant. Future versions will not support magazine variant"] call BIS_fnc_error; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/mre_human.p3d b/TO_MERGE/cse/sys_field_rations/mre_human.p3d new file mode 100644 index 0000000000..e4830bdda6 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_human.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type1.p3d b/TO_MERGE/cse/sys_field_rations/mre_type1.p3d new file mode 100644 index 0000000000..17c5cf815b Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type1.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type2.p3d b/TO_MERGE/cse/sys_field_rations/mre_type2.p3d new file mode 100644 index 0000000000..b049bd2e10 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type2.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type3.p3d b/TO_MERGE/cse/sys_field_rations/mre_type3.p3d new file mode 100644 index 0000000000..f8123720bd Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type3.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type4.p3d b/TO_MERGE/cse/sys_field_rations/mre_type4.p3d new file mode 100644 index 0000000000..96c835eb76 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type4.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type5.p3d b/TO_MERGE/cse/sys_field_rations/mre_type5.p3d new file mode 100644 index 0000000000..1c0419c8e6 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type5.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/mre_type6.p3d b/TO_MERGE/cse/sys_field_rations/mre_type6.p3d new file mode 100644 index 0000000000..7b0619b685 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/mre_type6.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/sounds/drinkingSound.ogg b/TO_MERGE/cse/sys_field_rations/sounds/drinkingSound.ogg new file mode 100644 index 0000000000..7e048ed4f0 Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/sounds/drinkingSound.ogg differ diff --git a/TO_MERGE/cse/sys_field_rations/stringtable.xml b/TO_MERGE/cse/sys_field_rations/stringtable.xml new file mode 100644 index 0000000000..643a54ef7e --- /dev/null +++ b/TO_MERGE/cse/sys_field_rations/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_field_rations/uk_bottle.p3d b/TO_MERGE/cse/sys_field_rations/uk_bottle.p3d new file mode 100644 index 0000000000..b561ebd6cc Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/uk_bottle.p3d differ diff --git a/TO_MERGE/cse/sys_field_rations/waterbottle.p3d b/TO_MERGE/cse/sys_field_rations/waterbottle.p3d new file mode 100644 index 0000000000..55a3a92bbe Binary files /dev/null and b/TO_MERGE/cse/sys_field_rations/waterbottle.p3d differ diff --git a/TO_MERGE/cse/sys_gestures/CfgAddons.h b/TO_MERGE/cse/sys_gestures/CfgAddons.h new file mode 100644 index 0000000000..e802565741 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/CfgAddons.h @@ -0,0 +1,7 @@ +class CfgAddons { + class PreloadAddons { + class cse_sys_gestures { + list[] = {"cse_sys_gestures"}; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_gestures/CfgFunctions.h b/TO_MERGE/cse/sys_gestures/CfgFunctions.h new file mode 100644 index 0000000000..24b113642b --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/CfgFunctions.h @@ -0,0 +1,8 @@ +class CfgFunctions { + class CSE { + class Gestures { + file = "cse\cse_sys_gestures\functions"; + class playGesture { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_gestures/CfgVehicles.h b/TO_MERGE/cse/sys_gestures/CfgVehicles.h new file mode 100644 index 0000000000..bf8da07323 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/CfgVehicles.h @@ -0,0 +1,29 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_gestures: Module_F { + scope = 2; + displayName = "Gestures [CSE]"; + icon = "\cse\cse_main\data\cse_groups_module.paa"; + category = "cseMisc"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class allowAIControl { + displayName = "Allow AI Control"; + description = "Allow Group leaders to issue basic orders through gestures"; + typeName = "BOOL"; + defaultValue = true; + }; + }; + class ModuleDescription { + description = "Enables the CSE Gesture actions."; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_gestures/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_gestures/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..0de3163760 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/Combat_Space_Enhancement.h @@ -0,0 +1,61 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_gestures { + init = "call compile preprocessFile 'cse\cse_sys_gestures\init_sys_gestures.sqf';"; + name = "Gestures"; + + /*class Configurations { + class playGesture_Freeze { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_FREEZE_TOOLTIP; + description = $STR_CSE_GESTURE_FREEZE_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gestureFreeze'] call cse_fnc_playGesture"; + }; + + class playGesture_Follow { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_FOLLOW_TOOLTIP; + description = $STR_CSE_GESTURE_FOLLOW_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gestureFollow'] call cse_fnc_playGesture"; + }; + + class playGesture_CEASEFIRE { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_CEASEFIRE_TOOLTIP; + description = $STR_CSE_GESTURE_CEASEFIRE_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gestureCeaseFire'] call cse_fnc_playGesture"; + }; + + class playGesture_COVER { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_COVER_TOOLTIP; + description = $STR_CSE_GESTURE_COVER_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gestureCover'] call cse_fnc_playGesture"; + }; + + class playGesture_Go { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_GO_TOOLTIP; + description = $STR_CSE_GESTURE_GO_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gestureGo'] call cse_fnc_playGesture"; + }; + class playGesture_Point { + type = ACTION_KEYBINDING; + title = $STR_CSE_GESTURE_POINT_TOOLTIP; + description = $STR_CSE_GESTURE_POINT_TOOLTIP; + value[] = {0,0,0,0}; + onPressed = "[player, 'gesturePoint'] call cse_fnc_playGesture"; + }; + };*/ + }; + }; +}; diff --git a/TO_MERGE/cse/sys_gestures/config.cpp b/TO_MERGE/cse/sys_gestures/config.cpp new file mode 100644 index 0000000000..261dcff887 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/config.cpp @@ -0,0 +1,17 @@ +#define _ARMA_ +class CfgPatches { + class cse_sys_gestures { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_f_eh","cse_main", "cse_gui"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +#include "CfgAddOns.h" +#include "CfgFunctions.h" +#include "CfgVehicles.h" +#include "Combat_Space_Enhancement.h" diff --git a/TO_MERGE/cse/sys_gestures/functions/fn_playGesture.sqf b/TO_MERGE/cse/sys_gestures/functions/fn_playGesture.sqf new file mode 100644 index 0000000000..8e3e53ca63 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/functions/fn_playGesture.sqf @@ -0,0 +1,47 @@ +/** + * fn_playGesture.sqf + * @Descr: Plays a gesture and executes orders for group AI, if setting has been enabled. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit that plays the gesture), gesture STRING (Classname of the gesture animation being played)] + * @Return: void + * @PublicAPI: true + */ + + +private ["_unit", "_gesture", "_groupUnits"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_gesture = [_this, 1, "", [""]] call BIS_fnc_Param; + + +_unit playactionnow _gesture; +_groupUnits = units group _unit; + +if (leader (group _unit) == _unit && CSE_SYS_GESTURES_ALLOW_AI_CONTROL) then { + switch (_gesture) do { + case ("gestureCeaseFire"): { + }; + case ("gestureCover"): { + }; + case ("gestureFreeze"): { + {_x stop true;} count _groupUnits; + }; + case ("gestureFollow"): { + {_x dofollow _unit;} count _groupUnits; + }; + case ("gestureGo"): { + {_x stop false;} count _groupUnits; + }; + case ("gesturePoint"): { + }; + }; +}; +/* +_unit setvariable ["cse_playGesture_GRP", _gesture, true]; +_handle = _this spawn { + uisleep 3; + if (((_this select 0) getvariable ["cse_playGesture_GRP", ""]) == (_this select 1)) then { + (_this select 0) setvariable ["cse_playGesture_GRP", nil, true]; + }; +}; +*/ \ No newline at end of file diff --git a/TO_MERGE/cse/sys_gestures/init_sys_gestures.sqf b/TO_MERGE/cse/sys_gestures/init_sys_gestures.sqf new file mode 100644 index 0000000000..7651e06b4f --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/init_sys_gestures.sqf @@ -0,0 +1,66 @@ + +private ["_args", "_entries"]; +_args = _this; +CSE_SYS_GESTURES_ALLOW_AI_CONTROL = false; +{ + if (_x select 0 == "allowAIControl") then { + CSE_SYS_GESTURES_ALLOW_AI_CONTROL = (_x select 1); + }; +}foreach _args; +waituntil {!isnil "cse_gui"}; + +cse_displayGestureActions_GroupMenu_GESTURES = { + [ _this select 3, + [ + [localize "STR_CSE_GESTURE_FREEZE_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureFreeze"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_FREEZE_TOOLTIP"], + [localize "STR_CSE_GESTURE_FOLLOW_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureFollow"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_FOLLOW_TOOLTIP"], + [localize "STR_CSE_GESTURE_CEASEFIRE_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureCeaseFire"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_CEASEFIRE_TOOLTIP"], + [localize "STR_CSE_GESTURE_COVER_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureCover"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_COVER_TOOLTIP"], + [localize "STR_CSE_GESTURE_GO_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureGo"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_GO_TOOLTIP"], + [localize "STR_CSE_GESTURE_POINT_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gesturePoint"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_POINT_TOOLTIP"] + ], + _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true + ] call cse_fnc_openRadialSecondRing_GUI; +}; + +_entries = [ + [localize "STR_CSE_GESTURE_GESTUREACTION_SHORT", {([player] call cse_fnc_canInteract)}, "cse\cse_sys_gestures\data\icons\icon_hand.paa", cse_displayGestureActions_GroupMenu_GESTURES, localize "STR_CSE_GESTURE_GESTUREACTION_TOOLTIP"] +]; + +["ActionMenu","group_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +_playCondition = { + (((_this select 0) getvariable ["cse_playGesture_GRP", ""]) != ""); +}; + +_playOnDraw = { + _var = (_this select 0) getvariable ["cse_playGesture_GRP", ""]; + + switch (_gesture) do { + case ("gestureCeaseFire"): { + + }; + case ("gestureCover"): { + + }; + case ("gestureFreeze"): { + + }; + case ("gestureFollow"): { + + }; + case ("gestureGo"): { + + }; + case ("gesturePoint"): { + + }; + }; + + ["cse\cse_sys_gestures\data\icons\icon_hand.paa", [1,1,1,1]]; +}; + +if (["cse_sys_tags"] call cse_fnc_isModLoaded_f) then { + [_playCondition, _playOnDraw, 1] call cse_fnc_registerIconSet_TAGS; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_gestures/stringtable.xml b/TO_MERGE/cse/sys_gestures/stringtable.xml new file mode 100644 index 0000000000..845eda59e8 --- /dev/null +++ b/TO_MERGE/cse/sys_gestures/stringtable.xml @@ -0,0 +1,106 @@ + + + + + + Freeze! + Freeze! + Halt! + StĂ³j! + Alto¡ + + + Follow! + Follow! + Mitkommen! + Za mnÄ…! + Seguidme¡ + + + Cease Fire! + Cease Fire! + Feuer einstellen! + Wstrzymać ogieÅ„! + Alto el fuego¡ + + + Cover! + Cover! + In Deckung! + Do osÅ‚on! + A cobertura¡ + + + Go! + Go! + Los, Los, Los! + NaprzĂ³d! + Vamos¡ + + + Point! + Point! + Fingerzeig. + Wskaż palcem! + Señalar + + + Play Gesture Freeze + Play Gesture Freeze + Halt! Geste ausfĂ¼hren + Pokazuje gest StĂ³j! + Ejecutar gesto Alto¡ + + + Play Gesture Follow + Play Gesture Follow + Mitkommen! Geste ausfĂ¼hren + Pokazuje gest Za mnÄ…! + Ejecutar gesto Seguidme¡ + + + Play Gesture Cease Fire + Play Gesture Cease Fire + Feuer einstellen! Geste ausfĂ¼hren + Pokazuje gest Wstrzymać ogieÅ„! + Ejecutar gesto Alto el fuego¡ + + + Play Gesture Cover + Play Gesture Cover + In Deckung! Geste ausfĂ¼hren + Pokazuje gest Do osÅ‚on! + Ejecutar gesto A cobertura¡¡ + + + Play Gesture Go + Play Gesture Go + Los, Los, Los! Geste ausfĂ¼hren + Pokazuje gest NaprzĂ³d! + Ejecutar gesto Vamos¡ + + + Play Gesture Point + Play Gesture Point + Zeigt nach Vorne. + Pokazuje gest Wskaż palcem! + Ejecutar gesto Señalar¡ + + + + Gestures + Gestures + Gesten + Gesty + Gestos + + + Use Gesture + Use Gesture + Gesten ausfĂ¼hren + Pokaż gest + Usar Gestos + + + + diff --git a/TO_MERGE/cse/sys_groups/CfgAddons.h b/TO_MERGE/cse/sys_groups/CfgAddons.h new file mode 100644 index 0000000000..ecd27aa132 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/CfgAddons.h @@ -0,0 +1,7 @@ +class CfgAddons { + class PreloadAddons { + class cse_sys_groups { + list[] = {"cse_sys_groups"}; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_groups/CfgFunctions.h b/TO_MERGE/cse/sys_groups/CfgFunctions.h new file mode 100644 index 0000000000..df6e4cf65e --- /dev/null +++ b/TO_MERGE/cse/sys_groups/CfgFunctions.h @@ -0,0 +1,15 @@ +class CfgFunctions { + class CSE { + class Groups { + file = "cse\cse_sys_groups\functions"; + class unitJoinGroup_GRP { recompile = 1; }; + class unitLeaveGroup_GRP { recompile = 1; }; + class unitsInGroupLeft_GRP { recompile = 1; }; + class unitCanJoinTargetGroup_GRP { recompile = 1; }; + class setGroupFormation_GRP { recompile = 1; }; + class setUnitGroupLeader_GRP { recompile = 1; }; + class canTapShoulder_GRP; + class tapShoulder_GRP; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/CfgVehicles.h b/TO_MERGE/cse/sys_groups/CfgVehicles.h new file mode 100644 index 0000000000..d4b5f957f2 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/CfgVehicles.h @@ -0,0 +1,41 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_groups: Module_F { + scope = 2; + displayName = "Groups [CSE]"; + icon = "\cse\cse_main\data\cse_groups_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class allowGroupSwitch { + displayName = "Group switch"; + description = "Allow players to join and leave groups"; + typeName = "BOOL"; + defaultValue = true; + }; + class allowFormationSwitch { + displayName = "Formation actions"; + description = "Group leaders can order formation changes through the action menu"; + typeName = "BOOL"; + defaultValue = true; + }; + class allowShoulderTap { + displayName = "Shoulder Tap"; + description = "Allow usage of shoulder taps"; + typeName = "BOOL"; + defaultValue = false; + }; + }; + class ModuleDescription { + description = "Provides players a serie of actions to join or leave their group, as well as formation changes"; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_groups/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..4b342b3cad --- /dev/null +++ b/TO_MERGE/cse/sys_groups/Combat_Space_Enhancement.h @@ -0,0 +1,27 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_groups { + init = "call compile preprocessFile 'cse\cse_sys_groups\init_sys_groups.sqf';"; + name = "Groups"; + + class Configurations { + class actionTapShoulder_GRP { + type = ACTION_KEYBINDING; + title = $STR_CSE_SHOULDER_TAP_TITLE; + description = $STR_CS_SHOULDER_TAP_DESC; + value[] = {0,0,0,0}; + onPressed = "if ([player, cursorTarget] call cse_fnc_canTapShoulder_GRP) then {[player, cursorTarget] call cse_fnc_tapShoulder_GRP;};"; + }; + }; + }; + }; + + class CustomEventHandlers { + class shoulderTapped {}; // [_caller, _target] + class groupJoined {}; // [_unit, _targetUnit] + }; +}; diff --git a/TO_MERGE/cse/sys_groups/config.cpp b/TO_MERGE/cse/sys_groups/config.cpp new file mode 100644 index 0000000000..35c338f631 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/config.cpp @@ -0,0 +1,19 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_groups + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_f_eh","cse_main"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +#include "CfgAddOns.h" +#include "CfgFunctions.h" +#include "CfgVehicles.h" +#include "Combat_Space_Enhancement.h" diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_column.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_column.paa new file mode 100644 index 0000000000..e10bf80cd1 Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_column.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_diamond.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_diamond.paa new file mode 100644 index 0000000000..2e897357a1 Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_diamond.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_ech_l.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_ech_l.paa new file mode 100644 index 0000000000..c2dea17c6c Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_ech_l.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_ech_r.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_ech_r.paa new file mode 100644 index 0000000000..d968a7dbca Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_ech_r.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_group.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_group.paa new file mode 100644 index 0000000000..73108e5a98 Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_group.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_line.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_line.paa new file mode 100644 index 0000000000..3f9c0f466e Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_line.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_stag_column.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_stag_column.paa new file mode 100644 index 0000000000..cff3cb9b3e Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_stag_column.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_vee.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_vee.paa new file mode 100644 index 0000000000..16685ec314 Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_vee.paa differ diff --git a/TO_MERGE/cse/sys_groups/data/icons/icon_wedge.paa b/TO_MERGE/cse/sys_groups/data/icons/icon_wedge.paa new file mode 100644 index 0000000000..aec606b22e Binary files /dev/null and b/TO_MERGE/cse/sys_groups/data/icons/icon_wedge.paa differ diff --git a/TO_MERGE/cse/sys_groups/functions/fn_canTapShoulder_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_canTapShoulder_GRP.sqf new file mode 100644 index 0000000000..2b819ef863 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_canTapShoulder_GRP.sqf @@ -0,0 +1,21 @@ +/** + * fn_canTapShoulder_GRP.sqf + * @Descr: Check if caller can tap targets shoulder. + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, target OBJECT] + * @Return: BOOL true if caller can tab target shoulder + * @PublicAPI: true + */ + + +private ["_caller", "_target"]; +_caller = _this select 0; +_target = _this select 1; + +if (isnil "CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP") then { + CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP = false; +}; +if !(CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP) exitwith { false }; + +(_target isKindOf "CAManBase" && {[_target] call cse_fnc_isAwake} && {[_caller] call cse_fnc_canInteract} && {_caller distance _target < 3} && {_caller != _target}) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_setGroupFormation_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_setGroupFormation_GRP.sqf new file mode 100644 index 0000000000..7ac9f37882 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_setGroupFormation_GRP.sqf @@ -0,0 +1,21 @@ +/** + * fn_setGroupFormation_GRP.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_formation", "_groupUnits"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_formation = [_this, 1, "", [""]] call BIS_fnc_Param; + + +if (([_unit] call cse_fnc_canInteract) && (formationLeader _unit == _unit)) then { + (group _unit) setFormation _formation; + [format["Setting formation of group %1 to %2",group _unit, _formation]] call cse_fnc_debug; +} else { + [format["cant set formation of group %1 to %2 because: %3 %4",group _unit, _formation, ([_unit] call cse_fnc_canInteract), (formationLeader _unit == _unit)]] call cse_fnc_debug; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_setUnitGroupLeader_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_setUnitGroupLeader_GRP.sqf new file mode 100644 index 0000000000..436bc6b5c9 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_setUnitGroupLeader_GRP.sqf @@ -0,0 +1,28 @@ +/** + * fn_setUnitGroupLeader_GRP.sqf + * @Descr: Sets unit as the leader of units group. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit","_groupMembers"]; +_unit = _this select 0; +if !(_unit isKindOf "CAManBase") exitwith {}; + +_groupMembers = units group _unit; +{ + if (_x != _unit) then { + [_x] call cse_fnc_unitLeaveGroup_GRP; + }; +}foreach _groupMembers; + +{ + if (_x != _unit) then { + [_x, _unit] call cse_fnc_unitJoinGroup_GRP; + }; +}foreach _groupMembers; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_tapShoulder_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_tapShoulder_GRP.sqf new file mode 100644 index 0000000000..02a3a58bf6 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_tapShoulder_GRP.sqf @@ -0,0 +1,27 @@ +/** + * fn_tapShoulder_GRP.sqf + * @Descr: Tap units shoulder. + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, target OBJECT (Unit that will be tapped)] + * @Return: void + * @PublicAPI: true + */ + +private ["_caller", "_target"]; +_caller = _this select 0; +_target = _this select 1; + +// If the target isn't local, we need to execute this function on the targets locality. +if (!local _target) exitwith { + [[_caller, _target], "cse_fnc_tapShoulder_GRP", _target] call BIS_fnc_MP; +}; +[[_caller, _target],"shoulderTapped"] call cse_fnc_customEventHandler_F; + +// No need to execute this for non player units. We exit here for non player units, because we do want to execute the custom eventhandler. +if (!isPlayer _target) exitwith {}; + +// Display information for player to indicate that players should was tapped. +// This is done through a camShake and a display Message on the screen. +addCamShake [4, 0.5, 4]; +[_target,localize "STR_CS_SHOULDER_TAP_GRP",format[localize "STR_CSE_SHOULDER_TAPPED_GRP", [_caller] call cse_fnc_getName]] call cse_fnc_sendDisplayMessageTo; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_unitCanJoinTargetGroup_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_unitCanJoinTargetGroup_GRP.sqf new file mode 100644 index 0000000000..133da4f797 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_unitCanJoinTargetGroup_GRP.sqf @@ -0,0 +1,27 @@ +/** + * fn_unitCanJoinTargetGroup_GRP.sqf + * @Descr: Check if a unit can join the target group + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, target OBJECT] + * @Return: BOOL True if unit can join the targets group + * @PublicAPI: true + */ + +private ["_unit", "_targetUnit", "_currentGroup", "_targetGroup", "_return"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_targetUnit = [_this, 1, objNull, [objNull]] call BIS_fnc_Param; + +_return = false; +if (_unit != _targetUnit) then { + if (_unit iskindof "CaManBase" && (_targetUnit isKindOf "CAManBase")) then { + if (side _unit == side _targetUnit) then { + _currentGroup = group _unit; + _targetGroup = group _targetUnit; + if (_currentGroup != _targetGroup) then { + _return = true + }; + }; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_unitJoinGroup_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_unitJoinGroup_GRP.sqf new file mode 100644 index 0000000000..9e34fdd808 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_unitJoinGroup_GRP.sqf @@ -0,0 +1,27 @@ +/** + * fn_unitJoinGroup_GRP.sqf + * @Descr: unit joins target group and removes old group if no members are left. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, target OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit", "_targetUnit", "_currentGroup", "_targetGroup"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_targetUnit = [_this, 1, objNull, [objNull]] call BIS_fnc_Param; + +if ([_unit, _targetUnit] call cse_fnc_unitCanJoinTargetGroup_GRP) then { + _currentGroup = group _unit; + _targetGroup = group _targetUnit; + + if (_currentGroup != _targetGroup) then { + [_unit] joinSilent _targetGroup; + if (count (units _currentGroup) == 0) then { + deleteGroup _currentGroup; + }; + + [[_unit, _targetUnit],"groupJoined"] call cse_fnc_customEventHandler_F; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_unitLeaveGroup_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_unitLeaveGroup_GRP.sqf new file mode 100644 index 0000000000..71bc13cdf1 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_unitLeaveGroup_GRP.sqf @@ -0,0 +1,21 @@ +/** + * fn_unitLeaveGroup_GRP.sqf + * @Descr: unit leaves current group and joins an empty group. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit", "_currentGroup", "_newgroup"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +if (_unit iskindof "CaManBase" && [_unit] call cse_fnc_canInteract) then { + _currentGroup = group _unit; + _newgroup = createGroup (side _unit); + [_unit] joinSilent _newgroup; + + if (count (units _currentGroup) == 0) then { + deleteGroup _currentGroup; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/functions/fn_unitsInGroupLeft_GRP.sqf b/TO_MERGE/cse/sys_groups/functions/fn_unitsInGroupLeft_GRP.sqf new file mode 100644 index 0000000000..c8553495c4 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/functions/fn_unitsInGroupLeft_GRP.sqf @@ -0,0 +1,17 @@ +/** + * fn_unitsInGroupLeft_GRP.sqf + * @Descr: Check if the group has more as one member + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL Returns true if group of unit contains more units as 1 + * @PublicAPI: true + */ + +private ["_unit", "_currentGroup", "_newgroup"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +if (_unit iskindof "CaManBase") then { + (count (units (group _unit)) > 1) +} else { + false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/init_sys_groups.sqf b/TO_MERGE/cse/sys_groups/init_sys_groups.sqf new file mode 100644 index 0000000000..201d9867b8 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/init_sys_groups.sqf @@ -0,0 +1,80 @@ + +private ["_args", "_entries"]; +_args = _this; +if (!hasInterface) exitwith {}; +CSE_SYS_GROUPS_ALLOW_GROUPSWITCH_GRP = false; +CSE_SYS_GROUPS_ALLOW_FORMATIONSWITCH_GRP = false; +CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP = false; + +{ + if (_x select 0 == "allowGroupSwitch") then { + CSE_SYS_GROUPS_ALLOW_GROUPSWITCH_GRP = (_x select 1); + }; + if (_x select 0 == "allowFormationSwitch") then { + CSE_SYS_GROUPS_ALLOW_FORMATIONSWITCH_GRP = (_x select 1); + }; + if (_x select 0 == "allowShoulderTap") then { + CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP = (_x select 1); + }; +}foreach _args; +waituntil {!isnil "cse_gui"}; + +if (CSE_SYS_GROUPS_ALLOW_GROUPSWITCH_GRP) then { + _entries = [ + [localize "STR_CSE_GROUP_LEAVEGRP_SHORT", {([player] call cse_fnc_unitsInGroupLeft_GRP)}, "cse\cse_sys_groups\data\icons\icon_group.paa", {closeDialog 0; [player] call cse_fnc_unitLeaveGroup_GRP}, localize "STR_CSE_GROUP_LEAVEGRP_TOOLTIP"], + + [localize "STR_CSE_GROUP_REQUESTJOINGRP_SHORT", {(([_this select 0, _this select 1] call cse_fnc_unitCanJoinTargetGroup_GRP))}, "cse\cse_sys_groups\data\icons\icon_group.paa", { + closeDialog 0; + [player, _this select 1, "cse_sys_Groups_requestJoinGrp", "STR_CSE_GROUP_REQUESTJOINGRP_MESSAGE", "if !(_this select 2) exitwith {}; [player, _this select 1] call cse_fnc_unitJoinGroup_GRP;"] call cse_fnc_sendRequest_f; + }, localize "STR_CSE_GROUP_REQUESTJOINGRP_TOOLTIP"] + ]; + ["ActionMenu","group_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; + +if (CSE_SYS_GROUPS_ALLOW_GROUPSWITCH_GRP) then { + cse_displaygroupActions_switchFormationMenu_GRP = { + [ _this select 3, + [ + [localize "STR_CSE_GROUP_FORM_COLUMN_SHORT", "cse\cse_sys_groups\data\icons\icon_column.paa", {closeDialog 0; [player, "COLUMN"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_COLUMN_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_STAG_SHORT","cse\cse_sys_groups\data\icons\icon_stag_column.paa", {closeDialog 0; [player, "STAG COLUMN"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_STAG_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_WEDGE_SHORT", "cse\cse_sys_groups\data\icons\icon_wedge.paa", {closeDialog 0; [player, "WEDGE"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_WEDGE_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_ECHL_SHORT", "cse\cse_sys_groups\data\icons\icon_ech_l.paa", {closeDialog 0; [player, "ECH LEFT"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_ECHL_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_ECHR_SHORT", "cse\cse_sys_groups\data\icons\icon_ech_r.paa", {closeDialog 0; [player, "ECH RIGHT"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_ECHR_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_VEE_SHORT", "cse\cse_sys_groups\data\icons\icon_vee.paa", {closeDialog 0; [player, "VEE"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_VEE_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_LINE_SHORT", "cse\cse_sys_groups\data\icons\icon_line.paa", {closeDialog 0; [player, "LINE"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_LINE_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_FILE_SHORT", "cse\cse_sys_groups\data\icons\icon_column.paa", {closeDialog 0; [player, "FILE"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_FILE_TOOLTIP"], + [localize "STR_CSE_GROUP_FORM_DIAMOND_SHORT", "cse\cse_sys_groups\data\icons\icon_diamond.paa", {closeDialog 0; [player, "DIAMOND"] call CSE_fnc_setGroupFormation_GRP}, true, localize "STR_CSE_GROUP_FORM_DIAMOND_TOOLTIP"] + ], + _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true + ] call cse_fnc_openRadialSecondRing_GUI; + }; + + _entries = [ + [localize "STR_CSE_GROUP_SWITCHFORMATION_SHORT", {(([player] call cse_fnc_canInteract) && (formationLeader player == player))}, "cse\cse_sys_groups\data\icons\icon_group.paa", cse_displaygroupActions_switchFormationMenu_GRP, localize "STR_CSE_GROUP_SWITCHFORMATION_TOOLTIP"] + ]; + + ["ActionMenu","group_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + + _requestGroupLeader = { + closeDialog 0; + [player, leader (group player), "cse_sys_Groups_requestLeader", "STR_CSE_GROUP_REQUESTLEADER_MESSAGE", "if !(_this select 2) exitwith {}; + [player] call cse_fnc_setUnitGroupLeader_GRP; + "] call cse_fnc_sendRequest_f; + }; + + _entries = [ + [localize "STR_CSE_GROUP_REQUESTLEADER_SHORT", {(([player] call cse_fnc_canInteract) && (leader (group player) != player))}, "cse\cse_sys_groups\data\icons\icon_group.paa", _requestGroupLeader, localize "STR_CSE_GROUP_REQUESTLEADER_TOOLTIP"] + ]; + + ["ActionMenu","group_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; + +if (CSE_SYS_GROUPS_ALLOW_SHOULDER_TAPS_GRP) then { + + _entries = [ + [localize "STR_CSE_SHOULDER_TAP_TITLE", {(([player, _this select 1] call cse_fnc_canTapShoulder_GRP) && (isPlayer (_this select 1)))}, CSE_ICON_PATH + "icon_interact.paa", {closeDialog 0; [player, _this select 1] call cse_fnc_tapShoulder_GRP;}, localize "STR_CSE_SHOULDER_TAP_TITLE"] + ]; + + ["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_groups/stringtable.xml b/TO_MERGE/cse/sys_groups/stringtable.xml new file mode 100644 index 0000000000..cc4bc03ee8 --- /dev/null +++ b/TO_MERGE/cse/sys_groups/stringtable.xml @@ -0,0 +1,251 @@ + + + + + + Column + Column + Kolonne + Kolumna + Columna + + + Stag Column + Stag Column + Gest.Kolonne + Kolumna rozpr. + Columna Esc. + + + + Wedge + Wedge + Keil + Klin + Cuña + + + + Echelon L + Echelon L + Staffel L + Eszelon L + EscalĂ³n Izq. + + + + Echelon R + Echelon R + Staffel R + Eszelon P + Escalon Der. + + + + Vee + Vee + V-Form. + Formacja V + FormaciĂ³n V + + + + Line + Line + Linie + Tyraliera + LĂ­nea + + + + File + File + Komp.Kolonne + Plik + Hilera + + + Diamond + Diamond + Raute + Diament + Diamante + + + + Column + Column + Kolonnenformation + Formacja kolumna/Polish> + Columna + + + Staggered Column + Staggered Column + Gestaffelte Kolonne + Formacja rozproszona kolumna + Columna Escalonada + + + + Wedge formation + Wedge formation + Keilformation + Formacja klin + FormaciĂ³n Cuña + + + + Echelon Left + Echelon Left + Staffel Links + Formacja eszelon lewy + EscalĂ³n Izquierda + + + + Echelon Right + Echelon Right + Staffel Rechts + Formacja eszelon prawy + EscalĂ³n Derecha + + + + Vee formation + Vee formation + V-Formation + Formacja w ksztaÅ‚cie litery 'V' + FormaciĂ³n V + + + + Line formation + Line formation + Linienformation + Formacja linia + FormaciĂ³n LĂ­nea + + + + File formation + File formation + Kompakte Kolonnenformation + Formacja kompaktowa kolumna + FormaciĂ³n Hilera + + + Diamond formation + Diamond formation + Rautenformation + Formacja obrona okrężna + FormaciĂ³n Diamante + + + + + Formations + Formations + Formationen + Formacje + Formaciones + + + Order Formation + Order Formation + Formationsbefehl + ZmieÅ„ formacjÄ™ + Ordenar Formaciones + + + + + + Lead Group + Lead Group + Gruppe anfĂ¼hren + Przejmij dowodzenie + Grupo de cabeza + + + Request group leader to take over group leader + Request group leader to take over group leader + GruppenfĂ¼hrerschaft anfordern + PoproÅ› aktualnego dowĂ³dcÄ™ o przejÄ™cie roli dowodzenia + Requerir un lider para que tome el control del grupo + + + %1 requests to be leader of this group + %1 requests to be leader of this group + %1 bittet um GruppenfĂ¼hrerschaft + %1 prosi o przejÄ™cie dowodzenia nad tÄ… grupÄ… + %1 pide liderazgo de grupo + + + + + + Your shoulder was tapped! + Your shoulder was tapped! + Jemand hat dich angestupst! + ZostaÅ‚eÅ› klepniÄ™ty w ramiÄ™! + Te han tocado el hombro¡ + + + Shoulder Tap + Shoulder Tap + Schultergriff + Klepnij w ramiÄ™ + Toque en el hombro + + + + + + Shoulder Tap + Shoulder Tap + Schultergriff + Klepanie w ramiÄ™ + Toque en el hombro + + + When pressed, you tap the shoulder of the unit in front of you. This depends on the Shoulder Tap settings from the Groups Module. + When pressed, you tap the shoulder of the unit in front of you. This depends on the Shoulder Tap settings from the Groups Module. + Stupst die Einheit vor dir an der Schulter an. Dies hängt von den Schulter-Check Einstellungen im Gruppenmodul ab. + Przy użyciu klepniesz w ramiÄ™ osobÄ™ przed tobÄ…. Ta opcja zależna jest od ustawieÅ„ klepania w ramiÄ™ w module grupy. + Cuando se selecciona, tocas el hombro de la unidad que tengas en frente. Depende de la configuraciĂ³n del MĂ³dulo Grupos. + + + + + + Join Group + DoÅ‚Ä…cz do grupy + Unirse al Grupo + + + Join target Group + DoÅ‚Ä…czasz do wybranej grupy + Unirse al Grupo + + + %1 requests to join your group + %1 pragnie doÅ‚Ä…czyć do twojej grupy + %1 pide unirse a su grupo + + + + + Leave Group + Opuść grupÄ™ + Salir del Grupo + + + Leave Current Group + Opuszczasz aktualnÄ… grupÄ™ + Salir del Grupo + + + + + diff --git a/TO_MERGE/cse/sys_ieds/CfgAddons.h b/TO_MERGE/cse/sys_ieds/CfgAddons.h new file mode 100644 index 0000000000..8a11ab5c62 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/CfgAddons.h @@ -0,0 +1,7 @@ +class CfgAddons { + class PreloadAddons { + class cse_sys_ieds { + list[] = {"cse_sys_ieds"}; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ieds/CfgFunctions.h b/TO_MERGE/cse/sys_ieds/CfgFunctions.h new file mode 100644 index 0000000000..b6c117dbfb --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/CfgFunctions.h @@ -0,0 +1,24 @@ +class CfgFunctions { + class CSE { + class IEDS { + file = "cse\cse_sys_ieds\functions"; + class module_spawnIED { recompile = 1; }; + class createIEDObject_IEDS { recompile = 1; }; + class checkIEDActivated_IEDS { recompile = 1; }; + class checkPressurePlateActivated_IEDS { recompile = 1; }; + class checkRadioTriggered_IEDS { recompile = 1; }; + class monitorIEDS_IEDS { recompile = 1; }; + class onIEDActivated_IEDS { recompile = 1; }; + class thor3_detection_IEDS { recompile = 1; }; + class playThorIIISound_IEDS { recompile = 1; }; + class triggerManGotVisual_IEDS { recompile = 1; }; + class moduleTriggerMan_IEDS { recompile = 1; }; + class placeDownIED_IEDS { recompile = 1; }; + class monitorPlayerIEDs_IEDS { recompile = 1; }; + + class onCellPhoneOpened_IEDS { recompile = 1; }; + class cellphone_detonateIED_IEDS { recompile = 1; }; + class checkIfJammed_IEDS { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/CfgSounds.h b/TO_MERGE/cse/sys_ieds/CfgSounds.h new file mode 100644 index 0000000000..46e89a6090 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/CfgSounds.h @@ -0,0 +1,9 @@ +class CfgSounds +{ + class cse_thor3_beep1 + { + name = "cse_thor3_beep1"; + sound[] = {"cse\cse_sys_ieds\sounds\beeps\03_Dull_Short_Mid.wav","db-1",1}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/CfgVehicles.h b/TO_MERGE/cse/sys_ieds/CfgVehicles.h new file mode 100644 index 0000000000..2355fd40e3 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/CfgVehicles.h @@ -0,0 +1,203 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + + + class cse_playerSpawnedIED: Logic { + displayName = "Player placed IED"; + }; + + class cseModule_spawnIEDs: Module_F { + scope = 2; + displayName = "Create IED [CSE]"; + icon = "\cse\cse_main\data\cse_explosive_module.paa"; + category = "cseMisc"; + function = "cse_fnc_module_spawnIED"; + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + class Arguments { + class typeOfIED { + displayName = "Type"; + description = "The Type of the IED"; + typeName = "NUMBER"; + class values { + class land {name="Normal"; value=0; default=1; }; + class urban {name="Urban"; value=1; }; + }; + }; + + class sizeOfIED { + displayName = "Size"; + description = "The size of the IED"; + typeName = "NUMBER"; + class values { + class small {name="Small"; value=1; default=1; }; + class large {name="Large"; value=0; }; + }; + }; + + class heightOfIED { + displayName = "Height"; + description = "The height that the IED is burried"; + typeName = "NUMBER"; + class values { + class Above {name="Above Ground"; value=0; default=1; }; + class slightly {name="Slightly burried"; value=-0.015; }; + class medium {name="Medium burried"; value=-0.025; }; + class almost {name="Almost burried"; value=-0.05; }; + class fully {name="Fully burried"; value=-0.1; }; + }; + }; + + class iedActivationType { + displayName = "Activation Type"; + description = "How is the IED activated"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class PressurePlate {name="Pressure Plate"; value=0; default=1;}; + class Radio {name="Radio"; value=1; }; + }; + }; + + class activatedForTargets { + displayName = "Activated for"; + description = "What types is the IED activated for"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class All {name="Any type"; value=0; default=1;}; + class Vehicles {name="Any Vehicle"; value=1; }; + class Land {name="Ground Vehicles"; value=2; }; + class Air {name="Airial Vehicles"; value=3; }; + class Man {name="Man"; value=4; }; + }; + }; + + class activatedForSides { + displayName = "What sides activate this IED"; + description = "What types is the IED activated for"; + typeName = "NUMBER"; + class values { + class None {name="None"; value=-1; }; + class All {name="Any side"; value=0; default=1; }; + class West {name="BLUFOR"; value=1; }; + class East {name="OpFOR"; value=2; }; + class Ind {name="Independant"; value=3; }; + class Civ {name="Civilian"; value=4; }; + }; + }; + }; + + class ModuleDescription { + description = "Create an IED on position."; // Short description, will be formatted as structured text + sync[] = {"cseModule_spawnIEDs"}; + position = 1; // Position is taken into effect + direction = 0; // Direction is taken into effect + optional = 0; // Synced entity is optional + duplicate = 1; // Multiple entities of this type can be synced + + class cseModule_spawnIEDs { + description[] = { // Multi-line descriptions are supported + "Synchronize ieds with other IEDs to create chain ieds.", + "When one of the synchronized ieds is triggered,", + "all other IEDs will explode as well." + }; + position = 1; // Position is taken into effect + direction = 0; // Direction is taken into effect + optional = 1; // Synced entity is optional + duplicate = 1; // Multiple entities of this type can be synced + synced[] = {"cseModule_spawnIEDs"}; // Pre-define entities like "AnyBrain" can be used. See the list below + }; + + }; + }; + class cseModule_triggerManLinkIEDS: Module_F { + scope = 2; + displayName = "Triggerman [CSE]"; + icon = "\cse\cse_main\data\cse_explosive_module.paa"; + category = "cseMisc"; + function = "cse_fnc_moduleTriggerMan_IEDS"; + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + class Arguments { + class EnableList { + displayName = "List"; + description = "List of unit names that will be able to trigger the radio IED."; + defaultValue = ""; + }; + }; + + class ModuleDescription { + description = "Defines units as triggerman."; // Short description, will be formatted as structured text + sync[] = {"cseModule_spawnIEDs"}; + position = 0; // Position is taken into effect + direction = 0; // Direction is taken into effect + optional = 0; // Synced entity is optional + duplicate = 1; // Multiple entities of this type can be synced + + class cseModule_spawnIEDs { + description[] = { // Multi-line descriptions are supported + "Synchronize module with IEDs to define.", + "which ieds can be triggered by units listed in module," + }; + position = 0; // Position is taken into effect + direction = 0; // Direction is taken into effect + optional = 0; // Synced entity is optional + duplicate = 1; // Multiple entities of this type can be synced + synced[] = {"cseModule_spawnIEDs"}; // Pre-define entities like "AnyBrain" can be used. See the list below + }; + }; + }; + + class B_Kitbag_sgg; + class cse_thorIII_backpack: B_Kitbag_sgg { + scope = 1; + author = "Combat Space Enhancement"; + displayName = "THOR III - Jammer"; + }; + + + // class Items_base_F; + // class cse_ied_pressureplate_small: Items_base_F { + // scope = 2; + // author = "Combat Space Enhancement"; + // displayName = "Pressure Plate IED (Small)"; + // picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + // descriptionShort = "Pressure Plate IED (Small)"; + // descriptionUse = "Pressure Plate IED (Small)"; + // model = "\A3\Weapons_F\Explosives\IED_land_small"; + // }; + // class cse_ied_pressureplate_large: cse_ied_pressureplate_small { + // scope = 2; + // author = "Combat Space Enhancement"; + // displayName = "Pressure Plate IED (Large)"; + // picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + // descriptionShort = "Pressure Plate IED (Large)"; + // descriptionUse = "Pressure Plate IED (Large)"; + // model = "\A3\Weapons_F\Explosives\IED_land_big"; + // }; + // class cse_ied_radio_small: cse_ied_pressureplate_small { + // scope = 2; + // author = "Combat Space Enhancement"; + // displayName = "Radio Triggered IED (Small)"; + // picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + // descriptionShort = "Radio Triggered IED (Small)"; + // descriptionUse = "Radio Triggered IED (Small)"; + // model = "\A3\Weapons_F\Explosives\IED_land_small"; + // }; + // class cse_ied_radio_large: cse_ied_radio_small { + // scope = 2; + // author = "Combat Space Enhancement"; + // displayName = "Radio Triggered IED (Large)"; + // picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + // descriptionShort = "Radio Triggered IED (Large)"; + // descriptionUse = "Radio Triggered IED (Large)"; + // model = "\A3\Weapons_F\Explosives\IED_land_big"; + // }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/CfgWeapons.h b/TO_MERGE/cse/sys_ieds/CfgWeapons.h new file mode 100644 index 0000000000..f5f8ab8adc --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/CfgWeapons.h @@ -0,0 +1,133 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class cse_ied_wires: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Wires (IED Material)"; + picture = "\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Necessary material for creating an IED"; + descriptionUse = "Used to connect the detonation device with the explosive"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_explosive: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Explosive Material (IED Material)"; + picture = "\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Provides the boom."; + descriptionUse = "Makes the IED."; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_detonator: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Detonator (IED Material)"; + picture = "\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Used to detonate the explosive."; + descriptionUse = "Ensures the explosives goes off when activated."; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_pressure_plate: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Pressure Plate (IED Material)"; + picture = "\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Pressure plate for creating IEDs"; + descriptionUse = "Pressure plate for creating IEDs"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_reciever: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Reciever (IED Material)"; + picture = "\cse_sys_ballistics\basicBallistics\data\weatherMeter.paa"; + descriptionShort = "Radio Reciever for creating Radio activated IEDs"; + descriptionUse = "Radio Reciever for creating Radio activated IEDs"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + + + class cse_ied_pressureplate_small: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Pressure Plate IED (Small)"; + picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + descriptionShort = "Pressure Plate IED (Small)"; + descriptionUse = "Pressure Plate IED (Small)"; + model = "\A3\Weapons_F\Explosives\IED_land_small"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_pressureplate_large: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Pressure Plate IED (Large)"; + picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + descriptionShort = "Pressure Plate IED (Large)"; + descriptionUse = "Pressure Plate IED (Large)"; + model = "\A3\Weapons_F\Explosives\IED_land_big"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_radio_small: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Radio Triggered IED (Small)"; + picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + descriptionShort = "Radio Triggered IED (Small)"; + descriptionUse = "Radio Triggered IED (Small)"; + model = "\A3\Weapons_F\Explosives\IED_land_small"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + class cse_ied_radio_large: ItemCore { + author = "Combat Space Enhancement"; + scope = 2; + displayName = "Radio Triggered IED (Large)"; + picture = "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa"; + descriptionShort = "Radio Triggered IED (Large)"; + descriptionUse = "Radio Triggered IED (Large)"; + model = "\A3\Weapons_F\Explosives\IED_land_big"; + class ItemInfo: InventoryItem_Base_F + { + mass=10; + type=201; + }; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_ieds/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..1056858eaa --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/Combat_Space_Enhancement.h @@ -0,0 +1,8 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_ieds { + init = "call compile preprocessFile 'cse\cse_sys_ieds\init_sys_ieds.sqf';"; + name = "IEDs"; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ieds/GUI.h b/TO_MERGE/cse/sys_ieds/GUI.h new file mode 100644 index 0000000000..ccb85e5924 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/GUI.h @@ -0,0 +1,2 @@ +#include "ui\define.hpp" +#include "ui\cellphone.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/config.cpp b/TO_MERGE/cse/sys_ieds/config.cpp new file mode 100644 index 0000000000..ed79dc9966 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/config.cpp @@ -0,0 +1,22 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_ieds + { + units[] = {"cse_thorIII_backpack" /*, "cse_ied_pressureplate_small", "cse_ied_pressureplate_large", "cse_ied_radio_small", "cse_ied_radio_large"*/}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_f_eh","cse_main"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +#include "CfgFunctions.h" +#include "CfgVehicles.h" +#include "CfgWeapons.h" +#include "CfgSounds.h" +#include "Combat_Space_Enhancement.h" +#include "CfgAddOns.h" +#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/data/cellphone_background.paa b/TO_MERGE/cse/sys_ieds/data/cellphone_background.paa new file mode 100644 index 0000000000..0570c7d228 Binary files /dev/null and b/TO_MERGE/cse/sys_ieds/data/cellphone_background.paa differ diff --git a/TO_MERGE/cse/sys_ieds/data/icon_cellphone.paa b/TO_MERGE/cse/sys_ieds/data/icon_cellphone.paa new file mode 100644 index 0000000000..01ec6c683a Binary files /dev/null and b/TO_MERGE/cse/sys_ieds/data/icon_cellphone.paa differ diff --git a/TO_MERGE/cse/sys_ieds/functions.sqf b/TO_MERGE/cse/sys_ieds/functions.sqf new file mode 100644 index 0000000000..0ede0250b9 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions.sqf @@ -0,0 +1,23 @@ + +cse_fnc_spawn_ieds_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_spawn_ieds.sqf"; +cse_fnc_spawn_chain_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_spawn_chain.sqf"; +cse_fnc_link_chain_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_link_chain.sqf"; +cse_fnc_thor3_detection_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_thor3_detection.sqf"; +cse_fnc_triggerManGotVisual_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_triggerManGotVisual.sqf"; + + +cse_fnc_checkIEDActivated_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_checkIEDActivated.sqf"; +cse_fnc_checkPressurePlateActivated_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_checkPressurePlateActivated.sqf"; +cse_fnc_checkRadioTriggered_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_checkRadioTriggered.sqf"; + + + +cse_fnc_spotterFlee_IED = compile preprocessFile "cse\cse_sys_ieds\spotter\fnc_spotterFlee.sqf"; +cse_fnc_spotterBehaviour_IED = compile preprocessFile "cse\cse_sys_ieds\spotter\fnc_spotterBehaviour.sqf"; + + +cse_fnc_searchGround_IED = compile preprocessFile "cse\cse_sys_ieds\fnc_searchGround.sqf"; + +cse_fnc_broadcastTHOR3Sound = { + (_this select 0) say3D "beep"; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_cellphone_detonateIED_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_cellphone_detonateIED_IEDS.sqf new file mode 100644 index 0000000000..98a322443f --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_cellphone_detonateIED_IEDS.sqf @@ -0,0 +1,46 @@ +/** + * fn_cellphone_detonateIED_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display", "_iedInfo"]; +_display = uiNamespace getVariable 'cse_ied_cellphone'; + + +if (isnil "CSE_PLAYER_PLACED_RADIO_IEDS_IEDS") then { + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS = []; +}; + +if (isnil "CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS") then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = 0; +}; + + +if (CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS > count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = 0; +}; + +if (CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS < 0) then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = (count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) - 1; +}; + +if !(CSE_PLAYER_PLACED_RADIO_IEDS_IEDS isEqualTo []) then { + _iedInfo = CSE_PLAYER_PLACED_RADIO_IEDS_IEDS select CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS; + _iedLogic = _iedInfo select 0; + + if !([_iedLogic] call cse_fnc_checkIfJammed_IEDS) then { + if (_iedLogic distance player < 3000) then { + [_iedLogic] call cse_fnc_onIEDActivated_IEDS; + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS set [CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS, objNull]; + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS = CSE_PLAYER_PLACED_RADIO_IEDS_IEDS - [objNull]; + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS - 1; + }; + }; +}; + +[_display] call cse_fnc_onCellPhoneOpened_IEDS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_checkIEDActivated_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_checkIEDActivated_IEDS.sqf new file mode 100644 index 0000000000..87cee1ec8d --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_checkIEDActivated_IEDS.sqf @@ -0,0 +1,39 @@ +/** + * fn_checkIEDActivated_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic","_triggered"]; +_logic = _this select 0; +_triggered = false; + +switch (true) do { + case (_logic getvariable ["iedActivationType",0] == 0): { + if ([_logic] call cse_fnc_checkPressurePlateActivated_IEDS) then { + _triggered = true; + }; + }; + case (_logic getvariable ["iedActivationType",0] == 1): { + if ([_logic] call cse_fnc_checkRadioTriggered_IEDS) then { + _triggered = true; + }; + }; + case (_logic getvariable ["iedActivationType",0] == 2): { + if ([_logic] call cse_fnc_checkPressurePlateActivated_IEDS) then { + _triggered = true; + }; + }; + default { + }; +}; + +if (_triggered) then { + [_logic] call cse_fnc_onIEDActivated_IEDS; +}; + +_triggered \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_checkIfJammed_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_checkIfJammed_IEDS.sqf new file mode 100644 index 0000000000..b458572ce3 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_checkIfJammed_IEDS.sqf @@ -0,0 +1,22 @@ +/** + * fn_checkIfJammed_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_ied", "_radioBlock", "_personsAround"]; +_ied = _this select 0; +_radioBlock = false; +_personsAround = (position _ied) nearEntities [["CaManBase"], 50]; +{ + if ((backpack _x == "cse_thorIII_backpack") && {(_x getvariable ["CSE_THOR_III_PACK_ENABLED_IEDS",false])}) exitwith { + _radioBlock = true; + }; + false; +}count _personsAround; + +_radioBlock \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_checkPressurePlateActivated_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_checkPressurePlateActivated_IEDS.sqf new file mode 100644 index 0000000000..cdca9dc727 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_checkPressurePlateActivated_IEDS.sqf @@ -0,0 +1,34 @@ +/** + * fn_checkPressurePlateActivated_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_pressurePlate","_return","_list","_pos"]; +_pressurePlate = _this select 0; +_return = false; + + _pos = ASLToATL (getPosASL _pressurePlate); + _list = _pos nearEntities [(_pressurePlate getvariable ["activatedForTargets",["Man", "Air", "Car", "Motorcycle", "Tank"]]),3]; + { + if (side _x in (_pressurePlate getvariable ["activatedForSides",[WEST]])) then { + if (_x isKindOf "CaManBase") then { + if (_x distance _pressurePlate < random(1)) then { + _return = true; + }; + } else { + if (_x distance _pressurePlate < (0.5+random(3))) then { + _return = true; + }; + }; + }; + if (_return) exitwith {}; + false; + }count _list; + +_return + diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_checkRadioTriggered_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_checkRadioTriggered_IEDS.sqf new file mode 100644 index 0000000000..c056088b1d --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_checkRadioTriggered_IEDS.sqf @@ -0,0 +1,54 @@ +/** + * fn_checkRadioTriggered_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_ied","_return","_list","_radioBlock","_personsAround","_targetDetected","_triggerMan"]; +_ied = _this select 0; +_return = false; +_targetDetected = false; +_triggerManUnits = _ied getvariable ["cse_ieds_triggerManUnits",[]]; +if ((_triggerManUnits isEqualTo [])) exitwith{false;}; +_list = (position _ied) nearEntities [(_ied getvariable ["activatedForTargets",["CaManBase", "Air", "Car", "Motorcycle", "Tank"]]),5]; +{ + _target = _x; + { + if ([_x, _target] call cse_fnc_triggerManGotVisual_IEDS) then { + if (side _target in (_ied getvariable ["activatedForSides",[WEST]])) then { + _targetDetected = true; + }; + }; + if (_targetDetected) exitwith {}; + }count _triggerManUnits; + if (_targetDetected) exitwith {}; +}count _list; + +if (!(_list isEqualTo []) && _targetDetected) then { + _radioBlock = [_ied] call cse_fnc_checkifJammed_IEDS; + _nearestPerson = _list select 0; + _vehicleNear = false; + { + if (_ied distance _x < (_ied distance _nearestPerson)) then { + _nearestPerson = _x; + }; + if (!(_x iskindof "CaManBase")) then { + _vehicleNear = true; + }; + }foreach _list; + + if (!_radioBlock) then { + if (count _list > 5) then { + _return = true; + } else { + if (((_nearestPerson distance _ied < 1) || _vehicleNear) && random(1) >0.985) then { + _return = true; + }; + }; + }; +}; +_return diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_createIEDObject_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_createIEDObject_IEDS.sqf new file mode 100644 index 0000000000..bb4b8d5179 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_createIEDObject_IEDS.sqf @@ -0,0 +1,31 @@ +/** + * fn_createIEDObject_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define LAND_IEDS ["IEDLandBig_Remote_Ammo", "IEDLandSmall_Remote_Ammo"] +#define URBAN_IEDS ["IEDUrbanBig_Remote_Ammo", "IEDUrbanSmall_Remote_Ammo"] + +private ["_logic","_typeOfIED", "_sizeOfIED", "_heightOfIED", "_iedClass", "_iedCreated"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + +if (isNull _logic) exitwith { + +}; +_typeOfIED = _logic getvariable ["typeOfIED", 0]; +_sizeOfIED = _logic getvariable ["sizeOfIED", 0]; +_heightOfIED = _logic getvariable ["heightOfIED", 0]; + +_iedClass = switch (_typeOfIED) do { + case 0: { LAND_IEDS select _sizeOfIED}; + case 1: { URBAN_IEDS select _sizeOfIED }; +}; +_iedCreated = _iedClass createVehicle (getPos _logic); +_logic setvariable ["cse_linkedIED_IEDS",_iedCreated, true]; +_iedCreated setPos [getPos _Logic select 0, getPos _Logic select 1, (getPos _Logic select 2) + _heightOfIED]; +[format["CREATED IED: %1", _iedCreated]] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_moduleTriggerMan_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_moduleTriggerMan_IEDS.sqf new file mode 100644 index 0000000000..97b9f7c3f7 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_moduleTriggerMan_IEDS.sqf @@ -0,0 +1,16 @@ +/** + * fn_moduleTriggerMan_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic", "_units", "_activated", "_totalCollection", "_collection", "_collectObjects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +_units = [_this,1,[],[[]]] call BIS_fnc_param; +_activated = [_this,2,true,[true]] call BIS_fnc_param; + +if (!local _logic) exitwith {}; diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_module_spawnIED.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_module_spawnIED.sqf new file mode 100644 index 0000000000..be7fa94fdf --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_module_spawnIED.sqf @@ -0,0 +1,84 @@ +/** + * fn_module_spawnIED.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic", "_units", "_activated", "_totalCollection", "_collection", "_collectObjects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +_units = [_this,1,[],[[]]] call BIS_fnc_param; +_activated = [_this,2,true,[true]] call BIS_fnc_param; + +if (!local _logic) exitwith {}; + +_totalCollection = []; +_collectObjects = { + private ["_logic", "_collection"]; + _logic = _this select 0; + _collection = synchronizedObjects _logic; + { + if !(_x in _totalCollection) then { + if (typeOf _x == "cseModule_spawnIEDs") then { + if !(_x getvariable ["cse_master_IED", false]) then { + _x setvariable ["cse_subclass_IED", true]; + _x setvariable ["cse_controlledBy_IED",_logic]; + _totalCollection pushback _x; + [_x] call _collectObjects; + }; + } else { + if (typeOf _x == "cseModule_triggerManLinkIEDS") then { + _list = _x getvariable ["EnableList",""]; + _list = "[" + _list + "]"; + _parsedList = [] call compile _list; + _triggerManList = (_logic getvariable ["cse_ieds_triggerManUnits", []]) + _parsedList; + _logic setvariable ["cse_ieds_triggerManUnits", _triggerManList]; + [format["_triggerManList %1",_triggerManList]] call cse_fnc_debug; + }; + }; + }; + }foreach _collection; +}; + +if !(_logic getvariable ["cse_subclass_IED",false]) then { + _logic setvariable ["cse_master_IED", true]; + [_logic] call _collectObjects; + if (_logic getvariable ["cse_master_IED", false]) then { + _logic setvariable ["cse_iedCollection", (_logic getvariable ["cse_iedCollection",[]]) + _totalCollection]; + [format["%1 I am a master IED. Collection is: %2", _logic, (_logic getvariable ["cse_iedCollection",[]])]] call cse_fnc_debug; + if (isnil "CSE_MASTER_IED_COLLECTION") then { + CSE_MASTER_IED_COLLECTION = []; + }; + CSE_MASTER_IED_COLLECTION pushback _logic; + }; +}; + +[_logic] call cse_fnc_createIEDObject_IEDS; + +_activatedSides = _logic getvariable ["activatedForSides", -1]; +_activatedTargets = _logic getvariable ["activatedForTargets", -1]; + +_activatedTargets = switch (_activatedTargets) do { + case 0: {["CaManBase", "Air", "Car", "Motorcycle", "Tank"]}; + case 1: {["Air", "Car", "Motorcycle", "Tank"]}; + case 2: {["Car", "Motorcycle", "Tank"]}; + case 3: {["Air"]}; + case 4: {["CaManBase"]}; + default {[]}; +}; +_logic setvariable ["activatedForTargets", _activatedTargets]; + +_activatedSides = switch (_activatedSides) do { + case 0: {[west, east, independent, civilian, sideEnemy, sideFriendly]}; + case 1: {[west, sideEnemy]}; + case 2: {[east, sideEnemy]}; + case 3: {[independent, sideEnemy]}; + case 4: {[civilian, sideEnemy]}; + default {[]}; +}; + +_logic setvariable ["activatedForSides", _activatedSides, true]; +_logic setvariable ["iedActivationType", _logic getvariable ["iedActivationType",0], true]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_monitorIEDs_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_monitorIEDs_IEDS.sqf new file mode 100644 index 0000000000..3b9d63333c --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_monitorIEDs_IEDS.sqf @@ -0,0 +1,40 @@ +/** + * fn_monitorIEDs_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_activated"]; +if !(isnil "CSE_MONITORING_IEDS") exitwith {}; +CSE_MONITORING_IEDS = true; +sleep 1; +if (isnil "CSE_MASTER_IED_COLLECTION") then { + CSE_MASTER_IED_COLLECTION = []; +}; +_code = ' + { + _activated = false; + if !([_x] call cse_fnc_checkIEDActivated_IEDS) then { + { + if ([_x] call cse_fnc_checkIEDActivated_IEDS) exitwith { _activated = true;}; + }foreach (_x getvariable ["cse_iedCollection", []]); + } else { + _activated = true; + }; + if (_activated) exitwith { + CSE_MASTER_IED_COLLECTION deleteAt _foreachIndex; + }; + false; + }count CSE_MASTER_IED_COLLECTION; + + false;'; + +cse_sys_ieds_monitorIEDs_Trigger = createTrigger["EmptyDetector", [0,0,0]]; +cse_sys_ieds_monitorIEDs_Trigger setTriggerActivation ["NONE", "PRESENT", true]; +cse_sys_ieds_monitorIEDs_Trigger setTriggerTimeout [0, 0, 0, false]; +cse_sys_ieds_monitorIEDs_Trigger setTriggerStatements[_code, "", ""]; + diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_monitorPlayerIEDs_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_monitorPlayerIEDs_IEDS.sqf new file mode 100644 index 0000000000..aa55d1203a --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_monitorPlayerIEDs_IEDS.sqf @@ -0,0 +1,40 @@ +/** + * fn_monitorPlayerIEDs_IEDS.sqf + * @Descr: Checks player placed pressure plate IEDs + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_activated"]; +if !(isnil "CSE_MONITORING_PLAYER_IEDS") exitwith {}; +CSE_MONITORING_PLAYER_IEDS = true; +sleep 1; +if (isnil "CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS") then { + CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS = []; +}; + +[format["CSE_MONITORING_PLAYER_IEDS"]] call cse_fnc_debug; +_code = ' + { + _activated = false; + if ([_X] call cse_fnc_checkPressurePlateActivated_IEDS) then { + _activated = true; + [_x] call cse_fnc_onIEDActivated_IEDS; + }; + if (_activated || isNull _x) exitwith { + CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS deleteAt _foreachIndex; + }; + false; + }count CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS; +'; + + +cse_sys_ieds_monitorPlayerIEDs_Trigger = createTrigger["EmptyDetector", [0,0,0]]; +cse_sys_ieds_monitorPlayerIEDs_Trigger setTriggerActivation ["NONE", "PRESENT", true]; +cse_sys_ieds_monitorPlayerIEDs_Trigger setTriggerTimeout [0, 0, 0, false]; +cse_sys_ieds_monitorPlayerIEDs_Trigger setTriggerStatements[_code, "", ""]; + diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_onCellPhoneOpened_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_onCellPhoneOpened_IEDS.sqf new file mode 100644 index 0000000000..fbd83c30f2 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_onCellPhoneOpened_IEDS.sqf @@ -0,0 +1,53 @@ +/** + * fn_onCellPhoneOpened_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_display"]; +_display = uiNamespace getVariable 'cse_ied_cellphone'; + + +if (isnil "CSE_PLAYER_PLACED_RADIO_IEDS_IEDS") then { + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS = []; +}; + +(_display displayCtrl 10) ctrlSetText "Adres book"; + +if (isnil "CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS") then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = 0; +}; + +if (CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS > count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = 0; +}; + +if (CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS < 0) then { + CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = (count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) - 1; +}; +(_display displayCtrl 12) ctrlSetText ""; +(_display displayCtrl 13) ctrlSetText ""; +(_display displayCtrl 14) ctrlSetText ""; + +_ctrlIDC = 12; +_cellphoneBookPointer = CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS; +for [{_EHiterator=0}, {(_EHiterator< 3)}, {_EHiterator=_EHiterator+1}] do { + if (_cellphoneBookPointer >= count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) then { + _cellphoneBookPointer = 0; + }; + if (_cellphoneBookPointer < 0) then { + _cellphoneBookPointer = (count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) - 1; + }; + if (_EHiterator < count CSE_PLAYER_PLACED_RADIO_IEDS_IEDS) then { + (_display displayCtrl _ctrlIDC) ctrlSetText format["#%1", ((CSE_PLAYER_PLACED_RADIO_IEDS_IEDS select _cellphoneBookPointer) select 1)]; + _cellphoneBookPointer = _cellphoneBookPointer + 1; + _ctrlIDC = _ctrlIDC + 1; + }; +}; + +(_display displayCtrl 12) ctrlSetbackgroundColor [0,0,0,0.1]; diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_onIEDActivated_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_onIEDActivated_IEDS.sqf new file mode 100644 index 0000000000..2059f50f27 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_onIEDActivated_IEDS.sqf @@ -0,0 +1,46 @@ +/** + * fn_onIEDActivated_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic","_chain","_iedLogic", "_trigger", "_getMasterIED"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + + +_getMasterIED = { + if (_logic getvariable ["cse_subclass_IED",false]) then { + _logic = _logic getvariable ["cse_controlledBy_IED",_logic]; + if (_logic getvariable ["cse_subclass_IED",false]) then { + call _getMasterIED; + }; + }; +}; +call _getMasterIED; + +_chain = _logic getvariable ["cse_iedCollection",[]]; +_chain pushback _logic; +{ + private ["_ied", "_trigger"]; + _iedLogic = _x; + _trigger = _iedLogic getvariable ["cse_linkedIED_IEDS", objNull]; + [_iedLogic,_trigger, _logic] spawn { + _iedLogic = _this select 0; + _trigger = _this select 1; + _master = _this select 2; + if (!isNull _trigger) then { + if (random(1)>0.5 && (_iedLogic != _master)) then { + uisleep (random(2)); + }; + //(_iedLogic getvariable ["explosiveType","R_60mm_HE"]) createVehicle (getPos _iedLogic); + deleteVehicle _iedLogic; + _trigger setDamage 1; + }; + }; +}foreach _chain; + +[format["%1 is triggering ied chain: %1",_logic, _chain]] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_placeDownIED_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_placeDownIED_IEDS.sqf new file mode 100644 index 0000000000..67021314d1 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_placeDownIED_IEDS.sqf @@ -0,0 +1,53 @@ +/** + * fn_placeDownIED_IEDS.sqf + * @Descr: Places down an IED (Player side) + * @Author: Glowbal + * + * @Arguments: [type NUMBER (The type of IED.), size NUMBER, activationType NUMBER (1 = radio, 0 = pressure plate)] + * @Return: logic LOGIC Returns the created IED logic + * @PublicAPI: true + */ + +private ["_position", "_logic"]; +_typeOfIED = _this select 0; +_sizeOfIED = _this select 1; +_activationType = _this select 2; +//_position = _this select 3; + + +_position = getPos player; +_logic = (createGroup sideLogic) createUnit ["cse_playerSpawnedIED", _position, [], 0, "FORM"]; +_logic setPos _position; + +_logic setvariable ["typeOfIED", _typeOfIED, true]; +_logic setvariable ["sizeOfIED", _sizeOfIED, true]; +_logic setvariable ["heightOfIED", 0, true]; +_logic setvariable ["iedActivationType", _activationType, true]; + +[_logic] call cse_fnc_createIEDObject_IEDS; + +if (isnil "CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS") then { + CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS = []; +}; + +if (isnil "CSE_PLAYER_PLACED_RADIO_IEDS_IEDS") then { + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS = []; +}; +if (isnil "CSE_PLAYER_PLACED_RADIO_IEDS_COUNTER_IEDS") then { + CSE_PLAYER_PLACED_RADIO_IEDS_COUNTER_IEDS = 0; +}; + +if (_activationType != 1) then { + _logic spawn { + hintSilent parseText "You placed down an IED.
IED will be activate in 5 seconds.
"; + uisleep 5; + CSE_PLAYER_PLACED_PRESSURE_IEDS_IEDS pushback _this; + }; +} else { + CSE_PLAYER_PLACED_RADIO_IEDS_COUNTER_IEDS = CSE_PLAYER_PLACED_RADIO_IEDS_COUNTER_IEDS + 1; + CSE_PLAYER_PLACED_RADIO_IEDS_IEDS pushback [_logic, format["IED %1",CSE_PLAYER_PLACED_RADIO_IEDS_COUNTER_IEDS]]; +}; + +[format["fn_placeDownIED_IEDS %1", _logic]] call cse_fnc_debug; + +_logic \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_playThorIIISound_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_playThorIIISound_IEDS.sqf new file mode 100644 index 0000000000..b736c95d9e --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_playThorIIISound_IEDS.sqf @@ -0,0 +1,11 @@ +/** + * fn_playThorIIISound_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +(_this select 0) say3D "cse_thor3_beep1"; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_searchGround_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_searchGround_IEDS.sqf new file mode 100644 index 0000000000..3564f522af --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_searchGround_IEDS.sqf @@ -0,0 +1,46 @@ +/** + * fn_searchGround_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define AVAILABLE_IEDS ["cseModule_spawnIEDs", "cse_playerSpawnedIED"] +#define MAX_SEARCH_DISTANCE 2.5 + +private ["_unit", "_foundIEDS", "_diggedUp", "_pos", "_height"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; + +_foundIEDS = nearestObjects [_unit, AVAILABLE_IEDS, MAX_SEARCH_DISTANCE]; +_diggedUp = false; +{ + _ied = _x getvariable ["cse_linkedIED_IEDS", objNull]; + if (((getPos _ied) select 2) < 0) then { + if (random(1)>0.1) then { + _diggedUp = true; + }; + }; + if (_diggedUp) exitwith{ + _pos = getPos _ied; + _height = (_pos select 2) + 0.09; + if (_height > 0) then { + _height = 0; + }; + _pos set[2,_height]; + _ied setPos _pos; + }; +}foreach _foundIEDs; + +if (_unit == player) then { + if (_diggedUp) then { + _unit sidechat "You uncover some of an IED"; + _unit sidechat format["Pos: %1",_pos]; + } else { + _unit sidechat "You didn't find anything"; + }; +}; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_thor3_detection_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_thor3_detection_IEDS.sqf new file mode 100644 index 0000000000..d13c08809c --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_thor3_detection_IEDS.sqf @@ -0,0 +1,28 @@ +if (!isnil "CSE_LAST_TRACKER_THORBEEP_MOMENT") exitwith {}; + +CSE_PLAY_THOR_III_SOUND_IEDS = false; +CSE_THOR_III_PACK_ENABLED_IEDS = true; +player setvariable ["CSE_THOR_III_PACK_ENABLED_IEDS",true,true]; +CSE_LAST_TRACKER_THORBEEP_MOMENT = time; +_code = { + if ((backpack player) == "cse_thorIII_backpack" && {(player getvariable ["CSE_THOR_III_PACK_ENABLED_IEDS", false])}) then { + _foundIEDS = nearestObjects [player, ["cseModule_spawnIEDs", "cse_playerSpawnedIED"], 50]; + { + _distanceToIED = player distance _x; + if (_distanceToIED < 50) exitwith { + if (_X getvariable ["iedActivationType",0] == 1) exitwith { + _timeDifference = (_distanceToIED/50) * 10 * MODIFIER_LOOP_DELAY; + if (time - CSE_LAST_TRACKER_THORBEEP_MOMENT >= (_timeDifference*accTime)) then { + CSE_LAST_TRACKER_THORBEEP_MOMENT = time; + playSound3D ["cse\cse_sys_ieds\sounds\beeps\03_Dull_Short_Mid.wav", player, false, getPos player, 35, 1, 10]; + }; + }; + }; + CSE_LAST_TRACKER_THORBEEP_MOMENT = time; + }count _foundIEDS; + }; +}; + +["cse_thor3TrackerBeeping", [], _code] call cse_fnc_addTaskToPool_f; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/functions/fn_triggerManGotVisual_IEDS.sqf b/TO_MERGE/cse/sys_ieds/functions/fn_triggerManGotVisual_IEDS.sqf new file mode 100644 index 0000000000..fd400be10b --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/functions/fn_triggerManGotVisual_IEDS.sqf @@ -0,0 +1,22 @@ +/** + * fn_triggerManGotVisual_IEDS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_triggerMan","_obj","_return"]; +_triggerMan = _this select 0; +_obj = _this select 1; +_return = false; + +if (!(_triggerMan getvariable ["cse_ieds_SpotterFleeing_IEDS",false]) && _triggerMan != _obj && alive _triggerMan) then { + if (_obj distance _triggerMan <350) then { + _triggerMan doWatch _obj; + _return = !(lineIntersects [eyePos _triggerMan, getPos _obj,_triggerMan]); + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/icon.paa b/TO_MERGE/cse/sys_ieds/icon.paa new file mode 100644 index 0000000000..976f316c8e Binary files /dev/null and b/TO_MERGE/cse/sys_ieds/icon.paa differ diff --git a/TO_MERGE/cse/sys_ieds/init_sys_ieds.sqf b/TO_MERGE/cse/sys_ieds/init_sys_ieds.sqf new file mode 100644 index 0000000000..a123a5ca36 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/init_sys_ieds.sqf @@ -0,0 +1,37 @@ +/** + * init_sys_ieds.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define IED_ICON "\A3\Weapons_F\Data\UI\gear_c4_charge_small_CA.paa" + +if (isServer) then { + call cse_fnc_monitorIEDS_IEDS; +}; + +if (hasInterface) then { + CSE_THOR_III_PACK_ENABLED_IEDS = true; + call cse_fnc_thor3_detection_IEDS; + call cse_fnc_monitorPlayerIEDS_IEDS; +}; + +waituntil{!isnil "cse_gui"}; + +_entries = [ + ["Pressure Plate (S)", {([player,"cse_ied_pressureplate_small"] call cse_fnc_hasItem)}, IED_ICON, {closeDialog 0; [0, 1, 0] call cse_fnc_placeDownIED_IEDS; player removeItem "cse_ied_pressureplate_small";}, "Place Pressure plate IED (Small)"], + + ["Pressure Plate (M)", {([player,"cse_ied_pressureplate_large"] call cse_fnc_hasItem)}, IED_ICON, {closeDialog 0; [0, 0, 0] call cse_fnc_placeDownIED_IEDS; player removeItem "cse_ied_pressureplate_large";}, "Place Pressure plate IED (Large)"], + + ["Radio (S)", {([player,"cse_ied_radio_small"] call cse_fnc_hasItem)}, IED_ICON, {closeDialog 0; [0, 1, 1] call cse_fnc_placeDownIED_IEDS; player removeItem "cse_ied_radio_small";}, "Place Radio IED (Small)"], + ["Radio (M)", {([player,"cse_ied_radio_large"] call cse_fnc_hasItem)}, IED_ICON, {closeDialog 0; [0, 0, 1] call cse_fnc_placeDownIED_IEDS; player removeItem "cse_ied_radio_large";}, "Place Radio IED (Large)"], + ["Cell Phone", {([player,"cse_oldphone"] call cse_fnc_hasItem)}, "cse\cse_sys_ieds\data\icon_cellphone.paa", {closeDialog 0; createDialog "cse_ied_cellphone";}, "Use Cell Phone Trigger"] +]; + +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ieds/sounds/beeps/03_Dull_Short_Mid.wav b/TO_MERGE/cse/sys_ieds/sounds/beeps/03_Dull_Short_Mid.wav new file mode 100644 index 0000000000..b8ad2067ba Binary files /dev/null and b/TO_MERGE/cse/sys_ieds/sounds/beeps/03_Dull_Short_Mid.wav differ diff --git a/TO_MERGE/cse/sys_ieds/stringtable.xml b/TO_MERGE/cse/sys_ieds/stringtable.xml new file mode 100644 index 0000000000..0eb106e300 --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/stringtable.xml @@ -0,0 +1,28 @@ + + + + + + + Pressure Plate IED (Small) + IED z zapalnikiem naciskowym (maÅ‚y) + IED Placa de PresiĂ³n (Pequeño) + + + Pressure Plate IED (Large) + IED z zapalnikiem naciskowym (duży) + IED Placa de PresiĂ³n (Grande) + + + Radio IED (Small) + IED z zapalnikiem radiowym (maÅ‚y) + IED ActivaciĂ³n remota (Pequeño) + + + Radio IED (Large) + IED z zapalnikiem radiowym (duży) + IED ActivaciĂ³n remota (Grande) + + + + diff --git a/TO_MERGE/cse/sys_ieds/ui/cellphone.hpp b/TO_MERGE/cse/sys_ieds/ui/cellphone.hpp new file mode 100644 index 0000000000..72126be1ca --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/ui/cellphone.hpp @@ -0,0 +1,111 @@ +class cse_ied_cellphone { + idd = 754321; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_ied_cellphone', _this select 0]; [_this] call cse_fnc_onCellPhoneOpened_IEDS; ['CSE_RADIAL_MENU', false] call cse_fnc_gui_blurScreen;"; + onUnload = ""; + + class controlsBackground { + class cse_background : cse_gui_backgroundBase { + idc = -1; + x = "0 * (((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 = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "30 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "cse\cse_sys_ieds\data\cellphone_background.paa"; + }; + }; + class controls { + class labelTextMenu : cse_gui_staticBase { + idc = 10; + x = "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 = "5.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + text = "SERVICE"; + colorBackground[] = {0,0,0,0.0}; + colorText[] = {0.0, 0.0, 0.0, 1.0}; + style = ST_CENTER; + }; + class labelTextLineOne : labelTextMenu { + idc = 11; + x = "5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "5.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.6)"; + text = ""; + style = ST_LEFT; + }; + class labelTextLineTwo : labelTextLineOne { + idc = 12; + y = "20.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class labelTextLineThree : labelTextLineOne { + idc = 13; + y = "21 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class labelTextLineFour : labelTextLineOne { + idc = 14; + y = "21.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + + + class actionCenter : cse_gui_buttonBase { + idc = 30; + text = ""; + x = "6.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "23 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "2.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((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_cellphone_detonateIED_IEDS;"; + }; + + class actionButtonLeft : actionCenter { + idc = 31; + text = ""; + x = "5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "24 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = ""; + }; + class actionButtonRight_downwards : actionButtonLeft { + idc = 32; + text = ""; + x = "8.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "24.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS - 1; [_this] call cse_fnc_onCellPhoneOpened_IEDS;"; + }; + class actionButtonRight_up : actionButtonRight_downwards { + idc = 32; + text = ""; + x = "9.3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "23.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS = CSE_CELLPHONE_ADRESSBOOK_POINTER_IEDS + 1; [_this] call cse_fnc_onCellPhoneOpened_IEDS;"; + }; + + }; +}; diff --git a/TO_MERGE/cse/sys_ieds/ui/createIED.hpp b/TO_MERGE/cse/sys_ieds/ui/createIED.hpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_ieds/ui/define.hpp b/TO_MERGE/cse/sys_ieds/ui/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_ieds/ui/define.hpp @@ -0,0 +1,797 @@ + +#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/sys_launchers/backblast/CfgFunctions.h b/TO_MERGE/cse/sys_launchers/backblast/CfgFunctions.h new file mode 100644 index 0000000000..d63428835d --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/CfgFunctions.h @@ -0,0 +1,8 @@ +class CfgFunctions { + class CSE { + class Backblast { + file = "cse\cse_sys_launchers\backblast\functions"; + class handleBackBlast_BB { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/CfgVehicles.h b/TO_MERGE/cse/sys_launchers/backblast/CfgVehicles.h new file mode 100644 index 0000000000..115bcf8b6f --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/CfgVehicles.h @@ -0,0 +1,45 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_backblast: Module_F { + scope = 2; + displayName = "Backblast [CSE]"; + icon = "\cse\cse_main\data\cse_backblast_module.paa"; + category = "cse_equipment"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class inBuilding { + displayName = "Affect Buildings"; + description = "Should backblast be affected by structures"; + typeName = "BOOL"; + }; + class forAI { + displayName = "Enable for AI"; + description = "Should backblast be enabled for AI"; + typeName = "BOOL"; + }; + class damageModifier { + displayName = "Damage modifier"; + description = "Select the aggressiveness of the backblast damage"; + typeName = "NUMBER"; + class values { + class recruit { name = "Recruit"; value = 0.5; }; + class regular { name = "Regular"; value = 1.0; default = 1; }; + class veteran { name = "Veteran"; value = 1.2; }; + class expert { name = "Expert"; value = 1.4; }; + }; + }; + class advanced { + displayName = "Advanced Backblast"; + description = "Should enviroment and walls have an effect on backblast?"; + typeName = "BOOL"; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_launchers/backblast/CfgWeapons.h b/TO_MERGE/cse/sys_launchers/backblast/CfgWeapons.h new file mode 100644 index 0000000000..9194336d8f --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/CfgWeapons.h @@ -0,0 +1,9 @@ +class CfgWeapons { + class Launcher; + class Launcher_Base_F: Launcher { + cse_backblastAngle = 75; + cse_backblastDamage = 1; + cse_backblast_maxDistance = 5; + cse_backblast_noObjectDistance = 5; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_launchers/backblast/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..387fa6b562 --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/Combat_Space_Enhancement.h @@ -0,0 +1,13 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_backblast { + init = "call compile preprocessFile 'cse\cse_sys_launchers\backblast\init_sys_backblast.sqf';"; + name = "Backblast"; + class EventHandlers { + class CAManBase { + FiredNear = "_this call cse_fnc_handleBackBlast_BB;"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/config.cpp b/TO_MERGE/cse/sys_launchers/backblast/config.cpp new file mode 100644 index 0000000000..48ad7fe65e --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/config.cpp @@ -0,0 +1,25 @@ +class CfgPatches { + class cse_sys_backblast { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_f_eh","cse_main"}; + versionDesc = "CSE Backblast"; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class cse_sys_weaponrest { + class PreloadAddons { + class cse_sys_backblast { + list[] = {"cse_sys_backblast"}; + }; + }; +}; + +#include "CfgVehicles.h" +#include "CfgWeapons.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/functions/fn_handleBackblast_BB.sqf b/TO_MERGE/cse/sys_launchers/backblast/functions/fn_handleBackblast_BB.sqf new file mode 100644 index 0000000000..68e723075f --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/functions/fn_handleBackblast_BB.sqf @@ -0,0 +1,153 @@ +/** + * fn_handleBackblast_BB.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_unitFired","_firedDistance","_weaponFired","_backblastAngle","_backblastRange","_backblastDamage","_direction","_distance","_relativePosition","_relativeDirection","_relativeAzimuth","_relativeInclination","_return","_handle","_percentage","_doDamage", "_weaponDir", "_positionEndLauncher", "_positionBehindMax", "_positionBehindNoObj"]; + +_unit = _this select 0; +if (!local _unit) exitwith {}; +_unitFired = _this select 1; +_firedDistance = _this select 2; +_weaponFired = _this select 3; + +if (!CSE_BACKBLAST_EFFECT_AI_BB && !(IsPlayer _unit)) exitwith {}; +if (vehicle _unit != _unit) exitWith {}; + +_return = false; + +_backblastDamage = getNumber (configFile >> "CfgWeapons" >> _weaponFired >> "cse_backblastDamage"); +if (_backblastDamage == 0) exitwith {}; +if (_unit != _unitFired) then { + _noObjectDistance = getNumber (configFile >> "CfgWeapons" >> _weaponFired >> "cse_backblast_noObjectDistance"); + _backblastDistance = (getNumber (configFile >> "CfgWeapons" >> _weaponFired >> "cse_backblast_maxDistance")); + if ((_noObjectDistance + _backblastDistance) < _firedDistance) exitwith {}; + + _doDamage = _backblastDamage; + if (_firedDistance > _noObjectDistance ) then { + _percentage = (_firedDistance / _backblastDistance); + if (_percentage < 1) then { + _doDamage = _backblastDamage * _percentage; + }; + }; + // _doDamage = _backblastDamage / (_backblastDistance-(_firedDistance^(1/2))); + + _doDamage = _doDamage * CSE_BACKBLAST_DAMAGE_MODIFIER_BB; + + _weaponDir = _unitFired weaponDirection currentWeapon _unitFired; + _positionEndLauncher = ATLtoASL ((_unitFired modelToWorld (_unitFired selectionPosition "RightHand")) vectorAdd (_weaponDir vectorMultiply (0.5))); + _positionBehindNoObj = _positionEndLauncher vectorAdd (_weaponDir vectorMultiply _noObjectDistance); + _positionBehindMax = _positionEndLauncher vectorAdd (_weaponDir vectorMultiply (_noObjectDistance + _backblastDistance)); + + + _direction = direction _unitFired; + + _backblastAngle = getNumber (configFile >> "CfgWeapons" >> _weaponFired >> "cse_backblastAngle"); + if ([position _unitFired,_direction - 180,_backblastAngle / 2,position _unit] call BIS_fnc_inAngleSector) then { + + _line = [_positionEndLauncher, eyePos _unit, _unit, _unitFired]; + if ((!lineIntersects _line) /*&& {!terrainIntersect [_positionEndLauncher, getPosASL _unit]}*/) then { + _return = true; + + if (["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) then { + if (random(1)>0.5) then { + [_unit,"body",(damage _unit + (random(_doDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + [_unit,"head",(damage _unit + (random(_doDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + [_unit,"legs",(damage _unit + (random(_doDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + [_unit,"arms",(damage _unit + (random(_doDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + [_unit, _backblastDamage, 0] call cse_fnc_increasePain_CMS; + + if (random(1)>0.1) then { + [_unit] call cse_fnc_setProne; + [_unit] call cse_fnc_setUnconsciousState; + } else { + [_unit,_doDamage] call cse_fnc_reactionToHit_CMS; + }; + } else { + _unit setDamage (damage _unit + _doDamage) min 0.95; + if (random(1)>0.1) then { + [_unit] call cse_fnc_setProne; + }; + }; + + if (isPlayer _unit) then { + playSound "combat_deafness"; + [_doDamage] call BIS_fnc_bloodEffect; + [_unit,0.5] call BIS_fnc_dirtEffect; + }; + }; + }; +} else { + _noObjectDistance = getNumber (configFile >> "CfgWeapons" >> _weaponFired >> "cse_backblast_noObjectDistance"); + if (CSE_BACKBLAST_AFFECTS_INBUILDING_BB || CSE_BACKBLAST_AFFECTS_ADVANCED_BB) then { + if ([_unitFired] call cse_fnc_isInBuilding || CSE_BACKBLAST_AFFECTS_ADVANCED_BB) then { + private ["_eyePos","_buildingBehind","_obj"]; + _eyePos = eyePos _unit; + _buildingBehind = false; + + _weaponDir = _unitFired weaponDirection currentWeapon _unitFired; + _positionEndLauncher = ATLtoASL ((_unitFired modelToWorld (_unitFired selectionPosition "RightHand")) vectorAdd (_weaponDir vectorMultiply (0.5))); + _positionBehindNoObj = _positionEndLauncher vectorAdd (_weaponDir vectorMultiply _noObjectDistance); + _positionBehindMax = _positionEndLauncher vectorAdd (_weaponDir vectorMultiply (_noObjectDistance + _backblastDistance)); + + + _obj = (lineIntersectsWith [_positionEndLauncher, _positionBehindNoObj, _unit]); + _buildingBehind = ({(_x isKindOf "Building")}count _obj) > 0; + + if (CSE_BACKBLAST_AFFECTS_ADVANCED_BB) then { + if (!_buildingBehind) then { + _buildingBehind = (terrainIntersect [_positionEndLauncher, _positionBehindNoObj]); + }; + }; + + if (_buildingBehind) then { + _return = true; + //_backblastDamage = _backblastDamage * CSE_BACKBLAST_DAMAGE_MODIFIER_BB; + if (["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) then { + if (random(1)>0.5) then { + _handle = [_unit,"body",(damage _unit + (random(_backblastDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + _handle = [_unit,"head",(damage _unit + (random(_backblastDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + _handle = [_unit,"legs",(damage _unit + (random(_backblastDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + if (random(1)>0.5) then { + _handle = [_unit,"arms",(damage _unit + (random(_backblastDamage))),_unitFired,_weaponFired,"backblast"] spawn cse_fnc_handleDamage_CMS; + }; + [_unit,_backblastDamage,0] call cse_fnc_increasePain_CMS; + + if (random(1)>0.1) then { + [_unit] call cse_fnc_setUnconsciousState; + } else { + [_unit,_backblastDamage] call cse_fnc_reactionToHit_CMS; + }; + } else { + _unit setDamage (damage _unit + 0.2); + if (random(1)>0.1) then { + [_unit] call cse_fnc_setProne; + }; + }; + if (isPlayer _unit) then { + playSound "combat_deafness"; + [_backblastDamage] call BIS_fnc_bloodEffect; + [_unit,0.5] call BIS_fnc_dirtEffect; + }; + }; + }; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/init_sys_backblast.sqf b/TO_MERGE/cse/sys_launchers/backblast/init_sys_backblast.sqf new file mode 100644 index 0000000000..4ad04eb716 --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/init_sys_backblast.sqf @@ -0,0 +1,21 @@ +CSE_BACKBLAST_AFFECTS_INBUILDING_BB = false; +CSE_BACKBLAST_EFFECT_AI_BB = false; +CSE_BACKBLAST_AFFECTS_ADVANCED_BB = false; +CSE_BACKBLAST_DAMAGE_MODIFIER_BB = 0.5; +private ["_args"]; +_args = _this; + +{ + if (_x select 0 == "inBuilding") then { + CSE_BACKBLAST_AFFECTS_INBUILDING_BB = _x select 1; + }; + if (_x select 0 == "forAI") then { + CSE_BACKBLAST_EFFECT_AI_BB = _x select 1; + }; + if (_x select 0 == "damageModifier") then { + CSE_BACKBLAST_DAMAGE_MODIFIER_BB = _x select 1; + }; + if (_x select 0 == "advanced") then { + CSE_BACKBLAST_AFFECTS_ADVANCED_BB = _x select 1; + }; +}foreach _args; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_launchers/backblast/stringtable.xml b/TO_MERGE/cse/sys_launchers/backblast/stringtable.xml new file mode 100644 index 0000000000..a1df2063e2 --- /dev/null +++ b/TO_MERGE/cse/sys_launchers/backblast/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/CfgFunctions.h b/TO_MERGE/cse/sys_logistics/CfgFunctions.h new file mode 100644 index 0000000000..3270411518 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/CfgFunctions.h @@ -0,0 +1,14 @@ +class CfgFunctions { + class CSE { + class Logistics { + file = "cse\cse_sys_logistics\functions"; + class hideObjCargo_LOG { recompile = 1; }; + class findVehicle_LOG { recompile = 1; }; + class loadObject_LOG { recompile = 1; }; + class unloadObject_LOG { recompile = 1; }; + class canCarryObj_LOG { recompile = 1; }; + class canDragObj_LOG { recompile = 1; }; + class dragObject_LOG { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/CfgVehicles.h b/TO_MERGE/cse/sys_logistics/CfgVehicles.h new file mode 100644 index 0000000000..ab14a81a96 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/CfgVehicles.h @@ -0,0 +1,35 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic + { + class ArgumentsBaseUnits + { + }; + }; + class cse_sys_logistics: Module_F + { + scope = 2; + displayName = "Logistics [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments + { + + }; + }; + +/* class NATO_Box_Base; + class cse_logisticCrate : NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "Logistic Crate"; + model = "\cse\cse_sys_logistics\data\crate\crate.p3d"; + author = "Combat Space Enhancement"; + };*/ + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_logistics/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..049cc8ef3a --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/Combat_Space_Enhancement.h @@ -0,0 +1,8 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_logistics { + init = "call compile preprocessFile 'cse\cse_sys_logistics\init_sys_logistics.sqf';"; + name = "Logistics Module"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/GUI.h b/TO_MERGE/cse/sys_logistics/GUI.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_logistics/config.cpp b/TO_MERGE/cse/sys_logistics/config.cpp new file mode 100644 index 0000000000..d55f707993 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/config.cpp @@ -0,0 +1,26 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_logistics + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main","cse_f_modules"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_sys_logistics { + list[] = {"cse_sys_logistics"}; + }; + }; +}; + +#include "CfgVehicles.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" +#include "GUI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/data/crate/crate.p3d b/TO_MERGE/cse/sys_logistics/data/crate/crate.p3d new file mode 100644 index 0000000000..2fe8b0775a Binary files /dev/null and b/TO_MERGE/cse/sys_logistics/data/crate/crate.p3d differ diff --git a/TO_MERGE/cse/sys_logistics/data/crate/crate.rvmat b/TO_MERGE/cse/sys_logistics/data/crate/crate.rvmat new file mode 100644 index 0000000000..7549f8f750 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/data/crate/crate.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=57.799999; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\crate\crate_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\crate\crate_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_logistics/data/crate/crate_co.paa b/TO_MERGE/cse/sys_logistics/data/crate/crate_co.paa new file mode 100644 index 0000000000..77cccead11 Binary files /dev/null and b/TO_MERGE/cse/sys_logistics/data/crate/crate_co.paa differ diff --git a/TO_MERGE/cse/sys_logistics/data/crate/crate_nohq.paa b/TO_MERGE/cse/sys_logistics/data/crate/crate_nohq.paa new file mode 100644 index 0000000000..119f1810d1 Binary files /dev/null and b/TO_MERGE/cse/sys_logistics/data/crate/crate_nohq.paa differ diff --git a/TO_MERGE/cse/sys_logistics/data/crate/crate_smdi.paa b/TO_MERGE/cse/sys_logistics/data/crate/crate_smdi.paa new file mode 100644 index 0000000000..cd10050fc0 Binary files /dev/null and b/TO_MERGE/cse/sys_logistics/data/crate/crate_smdi.paa differ diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_canCarryObj_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_canCarryObj_LOG.sqf new file mode 100644 index 0000000000..ef783d9933 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_canCarryObj_LOG.sqf @@ -0,0 +1,26 @@ +/** + * fn_canCarryObj_LOG.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#define MIN_DISTANCE 4 + +private ["_caller", "_object", "_log"]; +_caller = _this select 0; +_object = _this select 1; + +if (!(isNull ([_caller] call cse_fnc_getCarriedObj)) || !((_object distance _caller) < MIN_DISTANCE)) exitwith { + false; +}; + +_log = (_object getvariable "CSE_Logistics_Enable"); +if !(isnil "_log") exitwith { + (_object getVariable ["CSE_Logistics_Enable", false]) +}; + +false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_canDragObj_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_canDragObj_LOG.sqf new file mode 100644 index 0000000000..ff09078de8 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_canDragObj_LOG.sqf @@ -0,0 +1,26 @@ +/** + * fn_canDragObj_LOG.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#define MIN_DISTANCE 4 + +private ["_caller", "_object", "_check"]; +_caller = _this select 0; +_object = _this select 1; + +if (!(isNull ([_caller] call cse_fnc_getCarriedObj)) || !((_object distance _caller) < MIN_DISTANCE)) exitwith { + false; +}; + +_check = _object getvariable "CSE_Logistics_Enable_drag"; +if !(isnil "_check") exitwith { + _check; +}; + +((_object iskindof "StaticWeapon") || ((_object iskindof "ReammoBox") || (_object iskindof "ReammoBox_F"))); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_dragObject_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_dragObject_LOG.sqf new file mode 100644 index 0000000000..1a5b60aa32 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_dragObject_LOG.sqf @@ -0,0 +1,27 @@ +/** + * fn_dragObject_LOG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define DISTANCE_OBJECT 1.3 + +private ["_caller", "_object", "_attachToPos"]; +_caller = _this select 0; +_object = _this select 1; + +_attachToPos = [0, DISTANCE_OBJECT, (_caller worldToModel (_object modelToWorld [0,0,0])) select 2]; +if ([_caller, _object, _attachToPos, false] call cse_fnc_carryObj) then { + closeDialog 0; + [player, "STR_CSE_LOG_DRAG_OBJECT","STR_CSE_LOG_START_DRAGGING"] call cse_fnc_sendDisplayMessageTo; + + if (currentWeapon _caller == primaryWeapon _caller) then { + [_caller, "AcinPknlMstpSrasWrflDnon", true] call cse_fnc_localAnim; + } else { + [_caller, "AcinPknlMstpSnonWnonDnon", true] call cse_fnc_localAnim; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_findVehicle_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_findVehicle_LOG.sqf new file mode 100644 index 0000000000..4bd4ecee2a --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_findVehicle_LOG.sqf @@ -0,0 +1,33 @@ +/** + * fn_findVehicle_LOG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_loadcar","_loadhelicopter", "_loadtank", "_vehicle"]; +_unit = _this select 0; +_loadcar = nearestObject [_unit, "car"]; +_loadhelicopter = nearestObject [_unit, "air"]; +_loadtank = nearestObject [_unit, "tank"]; +_vehicle = ObjNull; + + +if (_unit distance _loadcar <= 10) then { + _vehicle = _loadcar; +} else { + if (_unit distance _loadhelicopter <= 10) then + { + _vehicle = _loadhelicopter; + } else { + if (_unit distance _loadtank <= 10) then + { + _vehicle = _loadtank; + } else { + }; + }; +}; +_vehicle \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_hideObjCargo_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_hideObjCargo_LOG.sqf new file mode 100644 index 0000000000..787b77bc1e --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_hideObjCargo_LOG.sqf @@ -0,0 +1,22 @@ +/** + * fn_hideObjCargo_LOG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_obj","_veh"]; +_obj = _this select 0; +_veh = _this select 1; +_hide = _this select 2; + +if (_hide) then { + _obj enableSimulation false; + _obj hideObject true; +} else { + _obj enableSimulation true; + _obj hideObject false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_loadObject_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_loadObject_LOG.sqf new file mode 100644 index 0000000000..97c8a2e05a --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_loadObject_LOG.sqf @@ -0,0 +1,36 @@ +/** + * fn_loadObject_LOG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_obj","_veh","_loaded","_numberLoaded"]; +_obj = _this select 0; +_veh = _this select 1; +if (isNull _veh) exitwith { + hintSilent "Cannot load object in vehicle"; + false; +}; +if (speed _veh > 1) exitwith {false}; +if (((getPos _veh) select 2) > 3) exitwith {false}; +_loaded = _veh getvariable ["cse_logistics_loadedCargo_LOG",[]]; +_numberLoaded = count _loaded; +if (_numberLoaded > 5) exitwith { + // we need to properly implement a check for amount of cargo in vehicle + hintSilent "This vehicle is full!"; + false; +}; +_loaded set[ _numberLoaded, _obj]; +_veh setvariable ["cse_logistics_loadedCargo_LOG",_loaded,true]; +detach _obj; +_obj attachTo [_veh,[0,0,100]]; + +[[_obj, _veh, true], "cse_fnc_hideObjCargo_LOG", true, false] spawn BIS_fnc_MP; + +[[_obj, _veh], "logistics_ObjectLoaded"] call cse_fnc_customEventHandler_F; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/functions/fn_unloadObject_LOG.sqf b/TO_MERGE/cse/sys_logistics/functions/fn_unloadObject_LOG.sqf new file mode 100644 index 0000000000..5c0fdf1c50 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/functions/fn_unloadObject_LOG.sqf @@ -0,0 +1,48 @@ +/** + * fn_unloadObject_LOG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_obj","_veh","_loaded","_numberLoaded","_position","_mTw"]; +_obj = _this select 0; +_veh = _this select 1; + +if (speed _veh > 5) exitwith { + hintSilent "Vehicle is moving to fast"; +}; +if (((getPos _veh) select 2) > 5) exitwith { + hintSilent "Vehicle is to high"; +}; + +_position = position _veh findEmptyPosition [0, 50, typeOf _obj]; +if (count _position < 1) exitwith { + hintSilent "No empty space available - cannot unload cargo!"; +}; + +_loaded = _veh getvariable ["cse_logistics_loadedCargo_LOG",[]]; + +_numberLoaded = count _loaded; +_loaded = _loaded - [_obj]; +_veh setvariable ["cse_logistics_loadedCargo_LOG",_loaded,true]; +detach _obj; + +_obj setPos _position; +//_obj setPos [((getPos _veh) select 0), ((getPos _veh) select 1), (getPos _veh ) select 2]; +[[_obj, _veh, false], "cse_fnc_hideObjCargo_LOG", true, false] spawn BIS_fnc_MP; + +if ([player, _obj] call cse_fnc_canCarryObj_LOG) then { + if ([player,_obj,[0,1.5,1],false] call cse_fnc_carryObj) then { + hint format["Object unloaded / moving"]; + }; +} else { + if ([player, _obj] call cse_fnc_canDragObj_LOG) then { + [player, _obj] call cse_fnc_dragObject_LOG; + }; +}; + +[[_obj, _veh], "logistics_ObjectUnloaded"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/init_sys_logistics.sqf b/TO_MERGE/cse/sys_logistics/init_sys_logistics.sqf new file mode 100644 index 0000000000..d93c22d582 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/init_sys_logistics.sqf @@ -0,0 +1,49 @@ +/* + NAME: init + USAGE: CSE SYS Logistics init file + AUTHOR: Glowbal + RETURN: void + +*/ + + +waituntil{!isnil "cse_gui"}; +[format["LOG - Logistics Module initialised"],2] call cse_fnc_debug; + +_entries = [ + [localize "STR_CSE_LOG_CARRY", cse_fnc_canCarryObj_LOG, CSE_ICON_PATH + "icon_movement.paa", + { + if ([_this select 0,_this select 1,[0,1.5,1],false] call cse_fnc_carryObj) then { + closeDialog 0; + [player, "STR_CSE_LOG_MOVE_OBJECT","STR_CSE_LOG_OBJECT_PICKED_UP"] call cse_fnc_sendDisplayMessageTo; + + [player, 10] call cse_fnc_limitSpeed; + }; + }, localize "STR_CSE_LOG_CARRY_OBJECT"], + + [localize "STR_CSE_LOG_DRAG", cse_fnc_canDragObj_LOG, CSE_ICON_PATH + "icon_movement.paa", cse_fnc_dragObject_LOG, localize "STR_CSE_LOG_DRAG_OBJECT"], + + [localize "STR_CSE_LOG_DROP",{(!isNull ([(_this select 0)] call cse_fnc_getCarriedObj)) && !(([(_this select 0)] call cse_fnc_getCarriedObj) isKindOf "CaManBase")}, CSE_ICON_PATH + "icon_placedown.paa", + { + ([_this select 0,ObjNull,[0,1,1]] call cse_fnc_carryObj); + [player, "STR_CSE_LOG_DROPPED_OBJECT","STR_CSE_LOG_PLACED_DOWN_OBJECT"] call cse_fnc_sendDisplayMessageTo; + closeDialog 0; + player switchMove ""; + [player, -1] call cse_fnc_limitSpeed; + },localize "STR_CSE_LOG_DROP_OBJECT"], + + [localize "STR_CSE_LOG_LOAD",{(!isNull ([(_this select 0)] call cse_fnc_getCarriedObj)) && !(([(_this select 0)] call cse_fnc_getCarriedObj) isKindOf "CaManBase")}, CSE_ICON_PATH + "icon_place_in.paa", + { + ([_this select 0,ObjNull,[0,1,1]] call cse_fnc_carryObj); + if ([(_this select 1),[(_this select 1)] call cse_fnc_findVehicle_LOG] call cse_fnc_loadObject_LOG) then { + [player, "STR_CSE_LOG_LOAD_OBJECT","STR_CSE_LOG_LOADED_OBJECT"] call cse_fnc_sendDisplayMessageTo; + }; + player switchMove ""; + closeDialog 0; + [player, -1] call cse_fnc_limitSpeed; + }, localize "STR_CSE_LOG_LOAD_OBJECT"] +]; +["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + //call compile preprocessFile "cse\cse_sys_logistics\scripts\addactions.sqf"; + diff --git a/TO_MERGE/cse/sys_logistics/scripts/addactions.sqf b/TO_MERGE/cse/sys_logistics/scripts/addactions.sqf new file mode 100644 index 0000000000..6c2de1e5fe --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/scripts/addactions.sqf @@ -0,0 +1,17 @@ +/* + NAME: Addactions + USAGE: Adds the interaction options to objects + AUTHOR: gobbo + RETURN: void + +*/ + +// == Carry system == +//CSE_Logistics_Pickup = player addaction ["Pick up object", "cse\cse_sys_logistics\scripts\carry\pickup.sqf", [], 6, false, true, "","(alive cursorTarget) AND (cursorTarget distance player <= 5) AND (cursortarget getVariable [""CSE_Logistics_Enable"", true]) AND ((cursortarget iskindof ""ReammoBox"") OR (cursortarget iskindof ""ReammoBox_F"")) && (isNull ([player] call cse_fnc_getCarriedObj))"]; + +//CSE_Logistics_Drop = player addaction ["Drop object", "cse\cse_sys_logistics\scripts\carry\drop.sqf", [], 6, false, true, "","(!isNull ([player] call cse_fnc_getCarriedObj))"]; + +// == Load system == +//CSE_Logistics_Load = player addaction ["Load object", "cse\cse_sys_logistics\scripts\load\load.sqf", [], 6, false, true, "","(!isNull ([player] call cse_fnc_getCarriedObj)) && !(([player] call cse_fnc_getCarriedObj) isKindof 'Man') "]; + +//CSE_Logistics_Unload = player addaction ["Unload object", "cse\cse_sys_logistics\scripts\load\unload.sqf", [], 6, false, true, "","(alive cursorTarget) AND (cursorTarget distance player <= 10) AND (cursortarget getVariable [""CSE_Logistics_Loaded"", 0] > 0) AND (player getVariable [""CSE_HandsFree"", true])"]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_logistics/stringtable.xml b/TO_MERGE/cse/sys_logistics/stringtable.xml new file mode 100644 index 0000000000..286551b0a0 --- /dev/null +++ b/TO_MERGE/cse/sys_logistics/stringtable.xml @@ -0,0 +1,67 @@ + + + + + + Carry + Transportar + + + Carry Object + Transportar Objeto + + + Drag + Arrastrar + + + Drag Object + Arrastrar Objeto + + + Drop + Soltar + + + Drop Object + Soltar Objeto + + + Load + Cargar + + + Load Object + Cargar Objeto + + + + + + Moving Object + Moviendo Objeto + + + Dropped Object + Objeto Liberado + + + Object picked up + Objeto Tomado + + + + You start dragging the object + Arrastrando Objeto + + + You placed down the object + Objeto Liberado + + + You loaded the object in a vehicle + Objeto cargado en el vehĂ­culo + + + + diff --git a/TO_MERGE/cse/sys_medical/CfgFactionClasses.h b/TO_MERGE/cse/sys_medical/CfgFactionClasses.h new file mode 100644 index 0000000000..19f4307cb5 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgFactionClasses.h @@ -0,0 +1,7 @@ +class CfgFactionClasses +{ + class NO_CATEGORY; + class cse_medical: NO_CATEGORY { + displayName = "CSE Medical"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/CfgFunctions.h b/TO_MERGE/cse/sys_medical/CfgFunctions.h new file mode 100644 index 0000000000..88845199f1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgFunctions.h @@ -0,0 +1,157 @@ +class CfgFunctions { + class CSE { + class Medical { + file = "cse\cse_sys_medical\functions"; + class initForUnit_CMS { recompile = 1; }; + class getSelectedBodyPart_CMS { recompile = 1; }; + class getBandageOptions_CMS { recompile = 1; }; + class getAdvancedOptions_CMS { recompile = 1; }; + class getExamineOptions_CMS { recompile = 1; }; + class getAirwayOptions_CMS { recompile = 1; }; + class getMedicationOptions_CMS { recompile = 1; }; + class getToggleOptions_CMS { recompile = 1; }; + class getTriageCardOptions_CMS { recompile = 1; }; + class getDragOptions_CMS { recompile = 1; }; + class getOptionsForCategory_CMS { recompile = 1; }; + class updateAttributes_CMS { recompile = 1; }; + class getBloodLoss_CMS { recompile = 1; }; + class effectsLoop_CMS { recompile = 1; }; + class inMedicalFacility_CMS { recompile = 1; }; + class medicClass_CMS { recompile = 1; }; + class playInjuredSound_CMS { recompile = 1; }; + class setDead_CMS { recompile = 1; }; + class setMedicRole_CMS { recompile = 1; }; + class assignMedicRoles_CMS { recompile = 1;}; + class assignMedicalFacility_CMS { recompile = 1;}; + class assignMedicalVehicle_CMS { recompile = 1; }; + class assignMedicalEquipment_CMS { recompile = 1; }; + class addOpenWounds_CMS { recompile = 1; }; + class isMedicalVehicle_CMS { recompile = 1; }; + class canAccessMedicalEquipment_CMS; + class hasMedicalEnabled_CMS { recompile = 1; }; + class placeInBodyBag_CMS { recompile = 1; }; + class canPutInBodyBag_CMS { recompile = 1; }; + class hasOpenWounds_CMS { recompile = 1; }; + }; + + class Blood { + file = "cse\cse_sys_medical\functions\blood"; + class BloodConditions_CMS { recompile = 1; }; + class cardiacArrest_CMS { recompile = 1; }; + }; + + class ActivityLog { + file = "cse\cse_sys_medical\functions\activityLog"; + class addActivityToLog_CMS { recompile = 1; }; + class getActivityLog_CMS { recompile = 1; }; + class addToQuickViewLog_CMS { recompile = 1; }; + class getQuickViewLog_CMS { recompile = 1; }; + }; + + class MedicalUI { + file = "cse\cse_sys_medical\functions\ui"; + class openMenu_CMS { recompile = 1; }; + class onMenuOpen_CMS { recompile = 1; }; + class updateUIInfo_CMS { recompile = 1; }; + class displayOptions_CMS { recompile = 1; }; + class updateActivityLog_CMS { recompile = 1; }; + class updateBodyImg_CMS { recompile = 1; }; + class dropDownTriageCard_CMS { recompile = 1; }; + class updateIcons_CMS { recompile = 1; }; + class getCurrentSelectedInjuryData_CMS { recompile = 1; }; + }; + + class handleDamage { + file = "cse\cse_sys_medical\functions\handledamage"; + class handleDamage_CMS { recompile = 1; }; + class getBodyPartNumber_CMS { recompile = 1; }; + class getNewDamageBodyPart_CMS { recompile = 1; }; + class getTypeOfDamage_CMS { recompile = 1; }; + class assignOpenWounds_CMS { recompile = 1; }; + class assignFractures_CMS { recompile = 1; }; + class assignAirwayStatus_CMS { recompile = 1; }; + class determineIfFatal_CMS { recompile = 1; }; + class determineIfUnconscious_CMS { recompile = 1; }; + class reactionToHit_CMS { recompile = 1; }; + class increasePain_CMS { recompile = 1; }; + class damageBodyPart_CMS { recompile = 1; }; + + }; + class BasicMedical { + file = "cse\cse_sys_medical\functions\basic"; + class basicBandage_CMS { recompile = 1; }; + class fromNumberToBodyPart_CMS { recompile = 1; }; + }; + + class MedicalTreatment { + file = "cse\cse_sys_medical\functions\treatment"; + class treatmentMutex_CMS { recompile = 1; }; + class isSetTreatmentMutex_CMS { recompile = 1; }; + class bandage_CMS { recompile = 1; }; + class bandageLocal_CMS { recompile = 1; }; + class bandageOpening_CMS { recompile = 1; }; + class iv_CMS { recompile = 1; }; + class ivLocal_CMS { recompile = 1; }; + class medication_CMS { recompile = 1; }; + class medicationLocal_CMS { recompile = 1; }; + class removeTourniquet_CMS { recompile = 1; }; + class tourniquet_CMS { recompile = 1; }; + class tourniquetLocal_CMS { recompile = 1; }; + class hasTourniquetAppliedTo_CMS {recompile = 1; }; + class performCPR_CMS { recompile = 1; }; + class performCPRLocal_CMS { recompile = 1; }; + class performCPRProvider_CMS { recompile = 1; }; + class performCPRSuccess_CMS { recompile = 1; }; + class heal_CMS { recompile = 1; }; + class healLocal_CMS { recompile = 1; }; + class handleHeal_CMS { recompile = 1; }; + class treatmentAirway_CMS { recompile = 1; }; + class treatmentAirwayLocal_CMS { recompile = 1; }; + class hasEquipment_CMS { recompile = 1; }; + class useEquipment_CMS { recompile = 1; }; + class performStitching_CMS { recompile = 1; }; + }; + + class MedicalDrag { + file = "cse\cse_sys_medical\functions\drag"; + class switchBody_CMS { recompile = 1; }; + class drag_CMS { recompile = 1; }; + class carry_CMS { recompile = 1; }; + class drop_CMS { recompile = 1; }; + }; + + class MedicalLoading { + file = "cse\cse_sys_medical\functions\loading"; + class load_CMS { recompile = 1; }; + class loadLocal_CMS { recompile = 1; }; + class unload_CMS { recompile = 1; }; + }; + + class MedicalExamine { + file = "cse\cse_sys_medical\functions\examine"; + class checkPulseLocal_CMS { recompile = 1; }; + class checkBloodPressureLocal_CMS { recompile = 1; }; + class checkPulse_CMS { recompile = 1; }; + class checkBloodPressure_CMS { recompile = 1; }; + class checkResponse_CMS { recompile = 1; }; + }; + + class TriageCard { + file = "cse\cse_sys_medical\functions\triage"; + class getTriageList_CMS { recompile = 1; }; + class addToTriageList_CMS { recompile = 1; }; + class setTriageStatus_CMS { recompile = 1; }; + class getTriageStatus_CMS { recompile = 1; }; + }; + + class Vitals { + file = "cse\cse_sys_medical\functions\vitals"; + class updateVitals_CMS { recompile = 1; }; + class getHeartRateChange_CMS { recompile = 1; }; + class getBloodVolumeChange_CMS { recompile = 1; }; + class getBloodPressure_CMS { recompile = 1; }; + class addHeartRateAdjustment_CMS { recompile = 1; }; + class getCardiacOutput_CMS { recompile = 1; }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/CfgHints.h b/TO_MERGE/cse/sys_medical/CfgHints.h new file mode 100644 index 0000000000..ac1b693273 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgHints.h @@ -0,0 +1,38 @@ +class CfgHints +{ + class Combat_Space_Enhancement + { + displayName = "Combat Space Enhancement"; + class CSE_CMS_Module + { + displayName = "Combat Medical System"; + displayNameShort = "Combat Medical System"; + description = "Combat Medical System is an advanced medical system for players and AI."; + tip = ""; + arguments[] = {}; + image = ""; + noImage = true; + }; + class Assessment + { + displayName = "Patient Assessment"; + displayNameShort = "Patient Assessment"; + description = "It is essential when treating a casualty that you fully assess each of the areas of the casualty to determine not only the injuries but the priority of each in severity.
You cna assess a patient by clicking on the Assessment ICON
Use Check Pulse, check Blood Pressure and Check Response to get an overview."; + tip = "Medics will get a faster and more accurate result when assessing patients."; + arguments[] = {}; + image = ""; + noImage = true; + }; + + class Bleeding + { + displayName = "Bandaging a wound"; + displayNameShort = "Bandaging a wound"; + description = "For casualties the first priority is to stop the bleeding. You will want to bandage the largest wounds first, before attending to the smaller ones.
You can apply a tourniquet on the limbs to stem the bleeding faster, but remember to remove it!"; + tip = "Select a wound in the injury list to bandage that one first!"; + arguments[] = {}; + image = ""; + noImage = true; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/CfgMagazines.h b/TO_MERGE/cse/sys_medical/CfgMagazines.h new file mode 100644 index 0000000000..d3f2e51356 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgMagazines.h @@ -0,0 +1,224 @@ +class CfgMagazines +{ + class Default; + class CA_magazine: Default{}; + class cse_backwardsCompatMagazineBase_CMS: CA_magazine {}; + class cse_bandage_basic: cse_backwardsCompatMagazineBase_CMS + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_BANDAGE_BASIC_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\field_dressing.paa"; + model = "\cse\cse_sys_medical\equipment\bandages\fielddressing.p3d"; + descriptionShort = $STR_CSE_MAG_BANDAGE_BASIC_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BANDAGE_BASIC_DESC_USE; + mass = 0.5; + }; + class cse_packing_bandage: cse_backwardsCompatMagazineBase_CMS + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_PACKING_BANDAGE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\packing_bandage.paa"; + descriptionShort = $STR_CSE_MAG_PACKING_BANDAGE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_PACKING_BANDAGE_DESC_USE; + mass = 1; + // model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + model = "\cse\cse_sys_medical\equipment\bandages\packingbandage.p3d"; + }; + class cse_bandageElastic: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_BANDAGE_ELASTIC_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\bandageElastic.paa"; + model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + descriptionShort = $STR_CSE_MAG_BANDAGE_ELASTIC_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BANDAGE_ELASTIC_DESC_USE; + mass = 1; + }; + class cse_tourniquet: cse_backwardsCompatMagazineBase_CMS + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_TOURNIQUET_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\tourniquet.paa"; + model = "\cse\cse_sys_medical\equipment\Tourniquet.p3d"; + descriptionShort = $STR_CSE_MAG_TOURNIQUET_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_TOURNIQUET_DESC_USE; + mass = 1; + }; + class cse_splint: cse_backwardsCompatMagazineBase_CMS + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_SPLINT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\splint.paa"; + descriptionUse = $STR_CSE_MAG_SPLINT_DESC_USE; + descriptionShort = $STR_CSE_MAG_SPLINT_DESC_SHORT; + mass = 1; + }; + class cse_morphine: cse_backwardsCompatMagazineBase_CMS + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_MORPHINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\morphine.paa"; + model = "\cse\cse_sys_medical\equipment\Morphinpen.p3d"; + descriptionShort = $STR_CSE_MAG_MORPHINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_MORPHINE_DESC_USE; + mass = 1; + }; + class cse_atropine: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_ATROPINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\atropine.paa"; + model = "\cse\cse_sys_medical\equipment\Atropin-pen.p3d"; + descriptionShort = $STR_CSE_MAG_ATROPINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_ATROPINE_DESC_USE; + mass = 1; + }; + class cse_epinephrine: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_EPINEPHRINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\epinephrine.paa"; + model = "\cse\cse_sys_medical\equipment\Epipen.p3d"; + descriptionShort = $STR_CSE_MAG_EPINEPHRINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_EPINEPHRINE_DESC_USE; + mass = 1; + }; + class cse_plasma_iv: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + mass = 1; + displayName = $STR_CSE_MAG_PLASMA_IV; + picture = "\cse\cse_sys_medical\equipment\img\plasma_iv.paa"; + descriptionShort = $STR_CSE_MAG_PLASMA_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_PLASMA_IV_DESC_USE; + }; + class cse_plasma_iv_500: cse_plasma_iv { + displayName = $STR_CSE_MAG_PLASMA_IV_500; + }; + class cse_plasma_iv_250: cse_plasma_iv_500 { + displayName = $STR_CSE_MAG_PLASMA_IV_250; + }; + class cse_blood_iv: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + mass = 1; + model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; + displayName = $STR_CSE_MAG_BLOOD_IV; + picture = "\cse\cse_sys_medical\equipment\img\bloodbag.paa"; + descriptionShort = $STR_CSE_MAG_BLOOD_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BLOOD_IV_DESC_USE; + }; + class cse_blood_iv_500: cse_blood_iv { + displayName = $STR_CSE_MAG_BLOOD_IV_500; + }; + class cse_blood_iv_250: cse_blood_iv_500 { + displayName = $STR_CSE_MAG_BLOOD_IV_250; + }; + class cse_saline_iv: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + mass = 1; + displayName = $STR_CSE_MAG_SALINE_IV; + picture = "\cse\cse_sys_medical\equipment\img\saline_iv.paa"; + descriptionShort = $STR_CSE_MAG_SALINE_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_SALINE_IV_DESC_USE; + }; + class cse_saline_iv_500: cse_saline_iv { + displayName = $STR_CSE_MAG_SALINE_IV_500; + }; + class cse_saline_iv_250: cse_saline_iv_500 { + displayName = $STR_CSE_MAG_SALINE_IV_250; + }; + class cse_quikclot: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_QUIKCLOT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\quickclot.paa"; + descriptionShort = $STR_CSE_MAG_QUIKCLOT_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_QUIKCLOT_DESC_USE; + mass = 1; + }; + class cse_nasopharyngeal_tube: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_NPA_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\nasopharyngeal_tube.paa"; + descriptionUse = $STR_CSE_MAG_NPA_DESC_USE; + descriptionShort = $STR_CSE_MAG_NPA_DESC_SHORT; + mass = 1; + }; + class cse_opa: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_OPA_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\nasopharyngeal_tube.paa"; + descriptionShort = $STR_CSE_MAG_OPA_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_OPA_DESC_USE; + mass = 1; + }; + class cse_liquidSkin: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_LIQUID_SKIN_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\liquidSkin.paa"; + model = "\cse\cse_sys_medical\equipment\skinliquid.p3d"; + descriptionShort = $STR_CSE_MAG_LIQUID_SKIN_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_LIQUID_SKIN_DESC_USE; + mass = 1; + }; + class cse_chestseal: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_CHEST_SEAL_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\chestseal.paa"; + descriptionShort = $STR_CSE_MAG_CHEST_SEAL_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_CHEST_SEAL_DESC_USE; + mass = 1; + }; + class cse_personal_aid_kit: cse_backwardsCompatMagazineBase_CMS { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_AID_KIT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\personal_aid_kit.paa"; + model = "\cse\cse_sys_medical\equipment\Personal-aidkits\MTP.p3d"; + descriptionShort = $STR_CSE_MAG_AID_KIT_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_AID_KIT_DESC_USE; + mass = 2; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/CfgSounds.h b/TO_MERGE/cse/sys_medical/CfgSounds.h new file mode 100644 index 0000000000..6249bbe13a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgSounds.h @@ -0,0 +1,45 @@ +class CfgSounds +{ + class cse_heartbeat_fast_1 + { + name = "cse_heartbeat_fast_1"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\fast_1.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_fast_2 + { + name = "cse_heartbeat_fast_2"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\fast_2.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_fast_3 + { + name = "cse_heartbeat_fast_3"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\fast_3.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_norm_1 + { + name = "cse_heartbeat_norm_1"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\norm_1.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_norm_2 + { + name = "cse_heartbeat_norm_2"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\norm_2.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_slow_1 + { + name = "cse_heartbeat_slow_1"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\slow_1.wav","db-1",1}; + titles[] = {}; + }; + class cse_heartbeat_slow_2 + { + name = "cse_heartbeat_slow_2"; + sound[] = {"cse\cse_sys_medical\sounds\heart_beats\slow_2.wav","db-1",1}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/CfgVehicles.h b/TO_MERGE/cse/sys_medical/CfgVehicles.h new file mode 100644 index 0000000000..f7f084a6e8 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgVehicles.h @@ -0,0 +1,762 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_medical: Module_F { + scope = 2; + displayName = "Combat Medical System [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class openingOfWounds { + displayName = "Advanced Wounds"; + description = "When set to true, bandaged wounds could on occasion re-open, resulting in new open wounds that need to be bandaged."; + typeName = "BOOL"; + defaultValue = 1; + }; + class medicSetting { + displayName = "Advanced Medic roles"; + description = "Medics only are able to view the detailed information"; + typeName = "BOOL"; + defaultValue = 1; + }; + class difficultySetting { + displayName = "Survival Difficulty"; + description = "Select the aggressiveness of the medical simulation"; + typeName = "NUMBER"; + class values { + class recruit { + name = "Recruit"; + value = 0.5; + }; + class regular { + name = "Regular"; + value = 1; + default = 1; + }; + class veteran { + name = "Veteran"; + value = 1.2; + }; + class expert { + name = "Expert"; + value = 1.5; + }; + }; + }; + class enableFor { + displayName = "Enabled for"; + description = "Select what units CMS will be enabled for"; + typeName = "NUMBER"; + class values { + class playableUnits { + name = "Players only"; + value = 0; + default = 1; + }; + class playableUnitsAndAI { + name = "Players and AI"; + value = 1; + }; + }; + }; + class enableAirway { + displayName = "Enable Airway"; + description = "Should CMS Airway system be enabled?"; + typeName = "NUMBER"; + class values { + class enable { + name = "Yes"; + value = 1; + }; + class disable { + name = "No"; + value = 0; + default = 1; + }; + }; + }; + class vehCrashes { + displayName = "Vehicle Crashes"; + description = "Enable injuries on vehicle crashes"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class aidKitUponUsage { + displayName = "Disposable Aid kit"; + description = "Is a personal aid kit disposable?"; + typeName = "BOOL"; + defaultValue = false; + }; + class aidKitMedicsOnly { + displayName = "Medics only"; + description = "Are aid kits restricted to medics only?"; + typeName = "BOOL"; + defaultValue = false; + }; + class aidKitRestrictions { + displayName = "Aid kit"; + description = "When can an Aid kit be used?"; + typeName = "NUMBER"; + class values { + class medFacility { + name = "Medical Facility"; + value = 0; + default = 1; + }; + class medFAcilityNoBleeding { + name = "Medical Facility & No bleeding"; + value = 1; + }; + class Everywhere { + name = "Everywhere"; + value = 2; + }; + class EverywhereNoBleeding { + name = "Everywhere & No Bleeding"; + value = 3; + }; + }; + }; + class bandageTime { + displayName = "Bandage Time"; + description = "Time it takes for a bandage action to be completed"; + typeName = "NUMBER"; + defaultValue = 5; + }; + class stitchingAllow { + displayName = "Can Stitch"; + description = "What units can use stitching?"; + typeName = "NUMBER"; + defaultValue = 0; + class values { + class medicsOnly { + name = "Medics Only"; + value = 0; + default = 1; + }; + class everyone { + name = "Everyone"; + value = 1; + }; + class noOne { + name = "No units"; + value = -1; + }; + }; + }; + + }; + class ModuleDescription { + description = "Provides a more realistic medical system for both players and AI."; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + class cse_assignMedicRoles_CMS: Module_F { + scope = 2; + displayName = "Set Medic Class [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_assignMedicRoles_CMS"; + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Combat Space Enhancement"; + class Arguments { + class EnableList { + displayName = "List"; + description = "List of unit names that will be classified as medic, separated by commas."; + defaultValue = ""; + }; + class class { + displayName = "Is Medic"; + description = "Medics allow for more advanced treatment in case of Advanced Medic roles enabled"; + typeName = "BOOL"; + defaultValue = true; + }; + }; + class ModuleDescription { + description = "Assigns the CSE medic class to a unit"; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + + class cse_assignMedicalVehicle_CMS: Module_F { + scope = 2; + displayName = "set Medical Vehicle [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_assignMedicalVehicle_CMS"; + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Combat Space Enhancement"; + class Arguments { + class EnableList { + displayName = "List"; + description = "List of object names that will be classified as medical vehicle, separated by commas."; + defaultValue = ""; + }; + class enabled { + displayName = "Is Medical Vehicle"; + description = "Whatever or not the objects in the list will be a medical vehicle."; + typeName = "BOOL"; + defaultValue = true; + }; + }; + class ModuleDescription { + description = "Assigns the CSE medical vehicle class to a vehicle."; + sync[] = {}; + }; + }; + + class cse_assignMedicalFacility_CMS: Module_F { + scope = 2; + displayName = "Set Medical Facility [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_assignMedicalFacility_CMS"; + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Combat Space Enhancement"; + class Arguments { + class class { + displayName = "Is Medical Facility"; + description = "Registers an object as a medical facility for CMS"; + typeName = "BOOL"; + }; + }; + class ModuleDescription { + description = "Defines an object as a medical facility for CMS. This allows for more advanced treatments. Can be used on buildings and vehicles. "; + sync[] = {}; + }; + }; + class cse_assignMedicalEquipment_CMS: Module_F { + scope = 2; + displayName = "Assign Medical Equipment [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_assignMedicalEquipment_CMS"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class equipment { + displayName = "Assign Equipment"; + description = "Assign Medical equipment to all players"; + typeName = "NUMBER"; + defaultValue = 0; + class values { + class AllPlayers { + name = "All Players"; + value = 0; + default = 1; + }; + class MedicsOnly { + name = "Medics only"; + value = 1; + }; + }; + }; + }; + class ModuleDescription { + description = "Assigns medical equipment to units"; + sync[] = {}; + }; + }; + + + class MapBoard_altis_F; + class cse_bodyBag: MapBoard_altis_F { + scope = 1; + side = -1; + model = "\cse\cse_sys_medical\equipment\bodybag.p3d"; + icon = ""; + displayName = $STR_CSE_MAG_BODYBAG_DISPLAY; + }; + + + class Item_Base_F; + class cse_bandage_basicItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BANDAGE_BASIC_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_bandage_basic + { + name = "cse_bandage_basic"; + count = 1; + }; + }; + }; + class cse_packing_bandageItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_PACKING_BANDAGE_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_packing_bandage + { + name = "cse_packing_bandage"; + count = 1; + }; + }; + }; + class cse_bandageElasticItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BANDAGE_ELASTIC_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_bandageElastic + { + name = "cse_bandageElastic"; + count = 1; + }; + }; + }; + class cse_tourniquetItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_TOURNIQUET_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_tourniquet + { + name = "cse_tourniquet"; + count = 1; + }; + }; + }; + class cse_splintItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_SPLINT_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_splint + { + name = "cse_splint"; + count = 1; + }; + }; + }; + class cse_morphineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_MORPHINE_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_morphine + { + name = "cse_morphine"; + count = 1; + }; + }; + }; + class cse_atropineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_ATROPINE_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_atropine + { + name = "cse_atropine"; + count = 1; + }; + }; + }; + class cse_epinephrineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_EPINEPHRINE_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_epinephrine + { + name = "cse_epinephrine"; + count = 1; + }; + }; + }; + class cse_plasma_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_PLASMA_IV; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_plasma_iv + { + name = "cse_plasma_iv"; + count = 1; + }; + }; + }; + class cse_plasma_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_PLASMA_IV_500; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_plasma_iv_500 + { + name = "cse_plasma_iv_500"; + count = 1; + }; + }; + }; + class cse_plasma_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_PLASMA_IV_250; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_plasma_iv_250 + { + name = "cse_plasma_iv_250"; + count = 1; + }; + }; + }; + class cse_blood_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BLOOD_IV; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_blood_iv + { + name = "cse_blood_iv"; + count = 1; + }; + }; + }; + class cse_blood_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BLOOD_IV_500; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_blood_iv_500 + { + name = "cse_blood_iv_500"; + count = 1; + }; + }; + }; + class cse_blood_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BLOOD_IV_250; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_blood_iv_250 + { + name = "cse_blood_iv_250"; + count = 1; + }; + }; + }; + class cse_saline_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_SALINE_IV; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_saline_iv + { + name = "cse_saline_iv"; + count = 1; + }; + }; + }; + class cse_saline_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_SALINE_IV_500; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_saline_iv_500 + { + name = "cse_saline_iv_500"; + count = 1; + }; + }; + }; + class cse_saline_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_SALINE_IV_250; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_saline_iv_250 + { + name = "cse_saline_iv_250"; + count = 1; + }; + }; + }; + class cse_quikclotItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_QUIKCLOT_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_quikclot + { + name = "cse_quikclot"; + count = 1; + }; + }; + }; + class cse_nasopharyngeal_tubeItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_NPA_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_nasopharyngeal_tube + { + name = "cse_nasopharyngeal_tube"; + count = 1; + }; + }; + }; + class cse_opaItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_OPA_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_opa + { + name = "cse_opa"; + count = 1; + }; + }; + }; + class cse_liquidSkinItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_LIQUID_SKIN_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_liquidSkin + { + name = "cse_liquidSkin"; + count = 1; + }; + }; + }; + class cse_chestsealItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_CHEST_SEAL_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_chestseal + { + name = "cse_chestseal"; + count = 1; + }; + }; + }; + class cse_personal_aid_kitItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_AID_KIT_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_personal_aid_kit + { + name = "cse_personal_aid_kit"; + count = 1; + }; + }; + }; + class cse_bodyBagItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_CSE_MAG_BODYBAG_DISPLAY; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_itemBodyBag + { + name = "cse_itemBodyBag"; + count = 1; + }; + }; + }; + + + class NATO_Box_Base; + class cse_medical_supply_crate_cms : NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "Medical Supply Crate (CSE)"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + author = "Combat Space Enhancement"; + class TransportItems { + class cse_bandage_basic { + name = "cse_bandage_basic"; + count = 25; + }; + class cse_packing_bandage { + name = "cse_packing_bandage"; + count = 25; + }; + class cse_tourniquet { + name = "cse_tourniquet"; + count = 25; + }; + class cse_splint { + name = "cse_splint"; + count = 25; + }; + class cse_plasma_iv { + name = "cse_plasma_iv"; + count = 25; + }; + class cse_plasma_iv_500 { + name = "cse_plasma_iv_500"; + count = 25; + }; + class cse_plasma_iv_250 { + name = "cse_plasma_iv_250"; + count = 25; + }; + class cse_blood_iv { + name = "cse_blood_iv"; + count = 25; + }; + class cse_blood_iv_500 { + name = "cse_blood_iv_500"; + count = 25; + }; + class cse_blood_iv_250 { + name = "cse_blood_iv_250"; + count = 25; + }; + class cse_saline_iv { + name = "cse_saline_iv"; + count = 25; + }; + class cse_saline_iv_500 { + name = "cse_saline_iv_500"; + count = 25; + }; + class cse_saline_iv_250 { + name = "cse_saline_iv_250"; + count = 25; + }; + class cse_morphine { + name = "cse_morphine"; + count = 25; + }; + class cse_epinephrine { + name = "cse_epinephrine"; + count = 25; + }; + class cse_atropine { + name = "cse_atropine"; + count = 25; + }; + class cse_quikclot { + name = "cse_quikclot"; + count = 25; + }; + class cse_nasopharyngeal_tube { + name = "cse_nasopharyngeal_tube"; + count = 25; + }; + class cse_bandageElastic { + name = "cse_bandageElastic"; + count = 25; + }; + class cse_liquidSkin { + name = "cse_liquidSkin"; + count = 25; + }; + class cse_chestseal { + name = "cse_chestseal"; + count = 25; + }; + class cse_personal_aid_kit { + name = "cse_personal_aid_kit"; + count = 25; + }; + class cse_surgical_kit { + name = "cse_surgical_kit"; + count = 25; + }; + class cse_itemBodyBag { + name = "cse_itemBodyBag"; + count = 5; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/CfgWeapons.h b/TO_MERGE/cse/sys_medical/CfgWeapons.h new file mode 100644 index 0000000000..02bfc614c4 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/CfgWeapons.h @@ -0,0 +1,317 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class cse_bandage_basic: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_BANDAGE_BASIC_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\field_dressing.paa"; + model = "\cse\cse_sys_medical\equipment\bandages\fielddressing.p3d"; + descriptionShort = $STR_CSE_MAG_BANDAGE_BASIC_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BANDAGE_BASIC_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=0.5; + type=201; + }; + }; + class cse_packing_bandage: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_PACKING_BANDAGE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\packing_bandage.paa"; + descriptionShort = $STR_CSE_MAG_PACKING_BANDAGE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_PACKING_BANDAGE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + model = "\cse\cse_sys_medical\equipment\bandages\packingbandage.p3d"; + }; + class cse_bandageElastic: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_BANDAGE_ELASTIC_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\bandageElastic.paa"; + model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + descriptionShort = $STR_CSE_MAG_BANDAGE_ELASTIC_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BANDAGE_ELASTIC_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_tourniquet: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_TOURNIQUET_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\tourniquet.paa"; + model = "\cse\cse_sys_medical\equipment\Tourniquet.p3d"; + descriptionShort = $STR_CSE_MAG_TOURNIQUET_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_TOURNIQUET_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_splint: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_SPLINT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\splint.paa"; + descriptionUse = $STR_CSE_MAG_SPLINT_DESC_USE; + descriptionShort = $STR_CSE_MAG_SPLINT_DESC_SHORT; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_morphine: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_MORPHINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\morphine.paa"; + model = "\cse\cse_sys_medical\equipment\Morphinpen.p3d"; + descriptionShort = $STR_CSE_MAG_MORPHINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_MORPHINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_atropine: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_ATROPINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\atropine.paa"; + model = "\cse\cse_sys_medical\equipment\Atropin-pen.p3d"; + descriptionShort = $STR_CSE_MAG_ATROPINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_ATROPINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_epinephrine: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_EPINEPHRINE_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\epinephrine.paa"; + model = "\cse\cse_sys_medical\equipment\Epipen.p3d"; + descriptionShort = $STR_CSE_MAG_EPINEPHRINE_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_EPINEPHRINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_plasma_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + displayName = $STR_CSE_MAG_PLASMA_IV; + picture = "\cse\cse_sys_medical\equipment\img\plasma_iv.paa"; + descriptionShort = $STR_CSE_MAG_PLASMA_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_PLASMA_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_plasma_iv_500: cse_plasma_iv { + displayName = $STR_CSE_MAG_PLASMA_IV_500; + }; + class cse_plasma_iv_250: cse_plasma_iv_500 { + displayName = $STR_CSE_MAG_PLASMA_IV_250; + }; + class cse_blood_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; + displayName = $STR_CSE_MAG_BLOOD_IV; + picture = "\cse\cse_sys_medical\equipment\img\bloodbag.paa"; + descriptionShort = $STR_CSE_MAG_BLOOD_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BLOOD_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_blood_iv_500: cse_blood_iv { + displayName = $STR_CSE_MAG_BLOOD_IV_500; + }; + class cse_blood_iv_250: cse_blood_iv_500 { + displayName = $STR_CSE_MAG_BLOOD_IV_250; + }; + class cse_saline_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + displayName = $STR_CSE_MAG_SALINE_IV; + picture = "\cse\cse_sys_medical\equipment\img\saline_iv.paa"; + descriptionShort = $STR_CSE_MAG_SALINE_IV_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_SALINE_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_saline_iv_500: cse_saline_iv { + displayName = $STR_CSE_MAG_SALINE_IV_500; + }; + class cse_saline_iv_250: cse_saline_iv_500 { + displayName = $STR_CSE_MAG_SALINE_IV_250; + }; + class cse_quikclot: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_QUIKCLOT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\quickclot.paa"; + descriptionShort = $STR_CSE_MAG_QUIKCLOT_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_QUIKCLOT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_nasopharyngeal_tube: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_NPA_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\nasopharyngeal_tube.paa"; + descriptionUse = $STR_CSE_MAG_NPA_DESC_USE; + descriptionShort = $STR_CSE_MAG_NPA_DESC_SHORT; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_opa: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_OPA_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\nasopharyngeal_tube.paa"; + descriptionShort = $STR_CSE_MAG_OPA_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_OPA_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_liquidSkin: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_LIQUID_SKIN_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\liquidSkin.paa"; + model = "\cse\cse_sys_medical\equipment\skinliquid.p3d"; + descriptionShort = $STR_CSE_MAG_LIQUID_SKIN_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_LIQUID_SKIN_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_chestseal: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_CHEST_SEAL_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\chestseal.paa"; + descriptionShort = $STR_CSE_MAG_CHEST_SEAL_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_CHEST_SEAL_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class cse_personal_aid_kit: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_CSE_MAG_AID_KIT_DISPLAY; + picture = "\cse\cse_sys_medical\equipment\img\personal_aid_kit.paa"; + model = "\cse\cse_sys_medical\equipment\Personal-aidkits\MTP.p3d"; + descriptionShort = $STR_CSE_MAG_AID_KIT_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_AID_KIT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + }; + }; + class cse_surgical_kit: ItemCore + { + scope=2; + displayName= $STR_CSE_MAG_SURGICALKIT_DISPLAY; + model="\cse\cse_sys_medical\equipment\surgical_kit.p3d"; + picture="\cse\cse_sys_medical\equipment\img\surgical_kit.paa"; + descriptionShort = $STR_CSE_MAG_SURGICALKIT_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_SURGICALKIT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type=201; + }; + }; + class cse_itemBodyBag: ItemCore + { + scope=2; + displayName= $STR_CSE_MAG_BODYBAG_DISPLAY; + model="\cse\cse_sys_medical\equipment\bodybagItem.p3d"; + picture="\cse\cse_sys_medical\equipment\img\bodybag.paa"; + descriptionShort = $STR_CSE_MAG_BODYBAG_DESC_SHORT; + descriptionUse = $STR_CSE_MAG_BODYBAG_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass= 15; + type=201; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_medical/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..1b043d924a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/Combat_Space_Enhancement.h @@ -0,0 +1,49 @@ +#define MENU_KEYBINDING 1 +#define ACTION_KEYBINDING 2 +#define CLIENT_SETTING 3 + +class Combat_Space_Enhancement { + class cfgModules { + class cse_sys_medical { + init = "call compile preprocessFile 'cse\cse_sys_medical\init_sys_medical.sqf';"; + name = "Combat Medical System"; + class EventHandlers { + class CAManBase { + init = "_this call cse_fnc_initForUnit_CMS;"; + handleDamage = "_this call cse_fnc_handleDamage_CMS;"; + handleHeal = "_this call cse_fnc_handleHeal_CMS;"; + killed = "_this call cse_eh_killed_CMS;"; + local = "_this call cse_eh_local_CMS;"; + }; + }; + class Configurations { + class combat_medical_system_openMenu { + type = MENU_KEYBINDING; + title = $STR_OPEN_CMS_MENU_TITLE; + description = $STR_OPEN_CMS_MENU_DESC; + value[] = {0,0,0,0}; + onPressed = "[] call cse_fnc_openMenu_CMS"; + idd = 314412; + }; + }; + }; + }; + + class CustomEventHandlers { + class getMedicationOptions_CMS {}; // [target] + class getExamineOptions_CMS {}; // [target] + class getDragOptions_CMS {}; // [target] + class getBandageOptions_CMS {}; // [target] + class getAirwayOptions_CMS {}; // [target] + class getAdvancedOptions_CMS {}; // [target] + class onDropInjured {}; // [_caller, _unit, number (0=from drag, 1=from carry)] + class onDragInjured {}; // [_caller, _unit] + class onCarryInjured {}; // [_caller, _unit] + + class setUnconsciousState { + class cse_sys_medical_onUnconscious { + onCall = "_this call cse_fnc_onUnconscious_CMS;"; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/bodyParts.h b/TO_MERGE/cse/sys_medical/bodyParts.h new file mode 100644 index 0000000000..1838cecfd1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/bodyParts.h @@ -0,0 +1,6 @@ +#define HEAD 0 +#define TORSO 1 +#define ARM_R 2 +#define ARM_L 3 +#define LEG_R 4 +#define LEG_L 5 \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/config.cpp b/TO_MERGE/cse/sys_medical/config.cpp new file mode 100644 index 0000000000..dcc8ad4f36 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/config.cpp @@ -0,0 +1,37 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_medical + { + units[] = {"cse_medical_supply_crate_cms", "cse_bandage_basicItem","cse_packing_bandageItem","cse_bandageElasticItem","cse_tourniquetItem","cse_splintItem","cse_morphineItem","cse_atropineItem","cse_epinephrineItem","cse_plasma_ivItem","cse_plasma_iv_500Item","cse_plasma_iv250Item","cse_blood_ivItem","cse_blood_iv_500Item","cse_blood_iv_250Item","cse_saline_ivItem","cse_saline_iv_500Item","cse_saline_iv_250Item","cse_quikclotItem","cse_nasopharyngeal_tubeItem","cse_opaItem","cse_liquidSkinItem","cse_chestsealItem","cse_personal_aid_kitItem"}; + weapons[] = {"cse_surgical_kit"}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_sys_medical { + list[] = {"cse_sys_medical"}; + }; + }; +}; +#include "CfgFactionClasses.h" +#include "CfgFunctions.h" + +// TODO To be removed at a later stage, as it is being replaced by items (CfgWeapons.h). Will stay around for backwards compatability for now. +// #include "CfgMagazines.h" + +// Replacing the old magazine approach by items. +#include "CfgWeapons.h" + + +#include "CfgSounds.h" +#include "CfgVehicles.h" +#include "CfgHints.h" +#include "Combat_Space_Enhancement.h" +#include "ui\define.hpp" +#include "ui\menu.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/data/body_arm_left.paa b/TO_MERGE/cse/sys_medical/data/body_arm_left.paa new file mode 100644 index 0000000000..245cc4ba31 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_arm_left.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_arm_right.paa b/TO_MERGE/cse/sys_medical/data/body_arm_right.paa new file mode 100644 index 0000000000..2023d1e0b4 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_arm_right.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_arms.paa b/TO_MERGE/cse/sys_medical/data/body_arms.paa new file mode 100644 index 0000000000..b4b272f73d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_arms.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_background.paa b/TO_MERGE/cse/sys_medical/data/body_background.paa new file mode 100644 index 0000000000..d3f7440e68 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_background.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_head.paa b/TO_MERGE/cse/sys_medical/data/body_head.paa new file mode 100644 index 0000000000..77ddd995bc Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_head.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_img-arms.paa b/TO_MERGE/cse/sys_medical/data/body_img-arms.paa new file mode 100644 index 0000000000..f469a59359 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_img-arms.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_img-head.paa b/TO_MERGE/cse/sys_medical/data/body_img-head.paa new file mode 100644 index 0000000000..2f7d15e1ca Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_img-head.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_img-legs.paa b/TO_MERGE/cse/sys_medical/data/body_img-legs.paa new file mode 100644 index 0000000000..35f68d8635 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_img-legs.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_img-torso.paa b/TO_MERGE/cse/sys_medical/data/body_img-torso.paa new file mode 100644 index 0000000000..cc5ecb9d60 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_img-torso.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_leg_left.paa b/TO_MERGE/cse/sys_medical/data/body_leg_left.paa new file mode 100644 index 0000000000..a116305258 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_leg_left.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_leg_right.paa b/TO_MERGE/cse/sys_medical/data/body_leg_right.paa new file mode 100644 index 0000000000..02ce66ba70 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_leg_right.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_legs.paa b/TO_MERGE/cse/sys_medical/data/body_legs.paa new file mode 100644 index 0000000000..9af3adc2ca Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_legs.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/body_torso.paa b/TO_MERGE/cse/sys_medical/data/body_torso.paa new file mode 100644 index 0000000000..0a7212ac95 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/body_torso.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_arm_left.paa b/TO_MERGE/cse/sys_medical/data/border_arm_left.paa new file mode 100644 index 0000000000..eae1d751cf Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_arm_left.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_arm_right.paa b/TO_MERGE/cse/sys_medical/data/border_arm_right.paa new file mode 100644 index 0000000000..0aea4ce20e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_arm_right.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_head.paa b/TO_MERGE/cse/sys_medical/data/border_head.paa new file mode 100644 index 0000000000..3b2e7aaf10 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_head.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_leg_left.paa b/TO_MERGE/cse/sys_medical/data/border_leg_left.paa new file mode 100644 index 0000000000..7ff3b170fa Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_leg_left.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_leg_right.paa b/TO_MERGE/cse/sys_medical/data/border_leg_right.paa new file mode 100644 index 0000000000..bef0f70779 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_leg_right.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/border_torso.paa b/TO_MERGE/cse/sys_medical/data/border_torso.paa new file mode 100644 index 0000000000..2b70076939 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/border_torso.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/buttonDisabled_gradient.paa b/TO_MERGE/cse/sys_medical/data/buttonDisabled_gradient.paa new file mode 100644 index 0000000000..43b1b8d100 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/buttonDisabled_gradient.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient.paa b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient.paa new file mode 100644 index 0000000000..2210f98741 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient2.paa b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient2.paa new file mode 100644 index 0000000000..cabe6c7fed Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient2.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient3.paa b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient3.paa new file mode 100644 index 0000000000..7da9fbcf8a Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient3.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient_top.paa b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient_top.paa new file mode 100644 index 0000000000..904e1a62f7 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/buttonNormal_gradient_top.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/cse_background_img.paa b/TO_MERGE/cse/sys_medical/data/cse_background_img.paa new file mode 100644 index 0000000000..de59065e3b Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/cse_background_img.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/advanced_treatment_small.paa b/TO_MERGE/cse/sys_medical/data/icons/advanced_treatment_small.paa new file mode 100644 index 0000000000..8becb9d2df Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/advanced_treatment_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/airway_management_small.paa b/TO_MERGE/cse/sys_medical/data/icons/airway_management_small.paa new file mode 100644 index 0000000000..ab4da47958 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/airway_management_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/bandage_fracture_small.paa b/TO_MERGE/cse/sys_medical/data/icons/bandage_fracture_small.paa new file mode 100644 index 0000000000..a869f260ec Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/bandage_fracture_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/examine_patient_small.paa b/TO_MERGE/cse/sys_medical/data/icons/examine_patient_small.paa new file mode 100644 index 0000000000..2e9fc9831d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/examine_patient_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_advanced_treatment.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_advanced_treatment.paa new file mode 100644 index 0000000000..d6bf6effd9 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_advanced_treatment.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_airway_management.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_airway_management.paa new file mode 100644 index 0000000000..f444f5f385 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_airway_management.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_bandage_fracture.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_bandage_fracture.paa new file mode 100644 index 0000000000..df8d1de571 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_bandage_fracture.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_bleeding.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_bleeding.paa new file mode 100644 index 0000000000..d11c2ed496 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_bleeding.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_carry.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_carry.paa new file mode 100644 index 0000000000..7ebb830b03 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_carry.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_examine_patient.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_examine_patient.paa new file mode 100644 index 0000000000..12eb06c890 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_examine_patient.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_medication.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_medication.paa new file mode 100644 index 0000000000..98893ad863 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_medication.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_toggle_self.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_toggle_self.paa new file mode 100644 index 0000000000..3078eb5dd5 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_toggle_self.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet.paa new file mode 100644 index 0000000000..8b34a7bfbb Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet_small.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet_small.paa new file mode 100644 index 0000000000..a457e2c0d5 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_tourniquet_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/icon_triage_card.paa b/TO_MERGE/cse/sys_medical/data/icons/icon_triage_card.paa new file mode 100644 index 0000000000..850ab0f4ce Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/icon_triage_card.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/medication_small.paa b/TO_MERGE/cse/sys_medical/data/icons/medication_small.paa new file mode 100644 index 0000000000..b6acd670c8 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/medication_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/toggle_self_small.paa b/TO_MERGE/cse/sys_medical/data/icons/toggle_self_small.paa new file mode 100644 index 0000000000..73108e5a98 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/toggle_self_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/icons/triage_card_small.paa b/TO_MERGE/cse/sys_medical/data/icons/triage_card_small.paa new file mode 100644 index 0000000000..92eb0f0d20 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/icons/triage_card_small.paa differ diff --git a/TO_MERGE/cse/sys_medical/data/ui_background.paa b/TO_MERGE/cse/sys_medical/data/ui_background.paa new file mode 100644 index 0000000000..f1c42c7d7d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/data/ui_background.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Atropin-pen.p3d b/TO_MERGE/cse/sys_medical/equipment/Atropin-pen.p3d new file mode 100644 index 0000000000..84d210518d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Atropin-pen.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Atropin-pen_used.p3d b/TO_MERGE/cse/sys_medical/equipment/Atropin-pen_used.p3d new file mode 100644 index 0000000000..ba2e4c4c38 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Atropin-pen_used.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Bandage elastic.p3d b/TO_MERGE/cse/sys_medical/equipment/Bandage elastic.p3d new file mode 100644 index 0000000000..1ada83c00e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Bandage elastic.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Bandage-Pack.p3d b/TO_MERGE/cse/sys_medical/equipment/Bandage-Pack.p3d new file mode 100644 index 0000000000..4e48818373 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Bandage-Pack.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Bandage-elastic.p3d b/TO_MERGE/cse/sys_medical/equipment/Bandage-elastic.p3d new file mode 100644 index 0000000000..1b29b17f7c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Bandage-elastic.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Epipen.p3d b/TO_MERGE/cse/sys_medical/equipment/Epipen.p3d new file mode 100644 index 0000000000..437e15c0bb Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Epipen.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Epipen_used.p3d b/TO_MERGE/cse/sys_medical/equipment/Epipen_used.p3d new file mode 100644 index 0000000000..5359c83a23 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Epipen_used.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Morphinpen.p3d b/TO_MERGE/cse/sys_medical/equipment/Morphinpen.p3d new file mode 100644 index 0000000000..af3f03ec6a Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Morphinpen.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Morphinpen_used.p3d b/TO_MERGE/cse/sys_medical/equipment/Morphinpen_used.p3d new file mode 100644 index 0000000000..80489bd74d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Morphinpen_used.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/DPM-wood.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/DPM-wood.p3d new file mode 100644 index 0000000000..dad1a7880e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/DPM-wood.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-desert.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-desert.p3d new file mode 100644 index 0000000000..2597ddd826 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-desert.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-wood.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-wood.p3d new file mode 100644 index 0000000000..13502cb0fa Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Flecktarn-wood.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/MTP.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/MTP.p3d new file mode 100644 index 0000000000..fb5ee9fddc Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/MTP.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-desert.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-desert.p3d new file mode 100644 index 0000000000..9ee93c126d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-desert.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-grey.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-grey.p3d new file mode 100644 index 0000000000..8464bbb9eb Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-grey.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-wood.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-wood.p3d new file mode 100644 index 0000000000..a3599f3ace Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Marpat-wood.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Multicam.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Multicam.p3d new file mode 100644 index 0000000000..51651d7144 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/Multicam.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-Desert.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-Desert.paa new file mode 100644 index 0000000000..94478b8c58 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-Desert.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-wood.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-wood.paa new file mode 100644 index 0000000000..435fdd434c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/DPM-wood.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-desert.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-desert.paa new file mode 100644 index 0000000000..a4beb7de20 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-desert.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-wood.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-wood.paa new file mode 100644 index 0000000000..1def142a27 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Flecktarn-wood.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/MTP_co.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/MTP_co.paa new file mode 100644 index 0000000000..660ebe3477 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/MTP_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-grey.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-grey.paa new file mode 100644 index 0000000000..8b3fc21a60 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-grey.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-wood.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-wood.paa new file mode 100644 index 0000000000..94e2187dc2 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Marpat-wood.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Mulitcam.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Mulitcam.paa new file mode 100644 index 0000000000..3e55892c84 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Mulitcam.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit.rvmat b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit.rvmat new file mode 100644 index 0000000000..5da2e3099b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=100; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\Personal-aidkits\data\Personalaidkit_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\Personal-aidkits\data\Personalaidkit_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa new file mode 100644 index 0000000000..0d03b45372 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa new file mode 100644 index 0000000000..2fb8bec533 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/marpat-desert.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/marpat-desert.paa new file mode 100644 index 0000000000..6b9262427b Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/data/marpat-desert.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/dpm-desert.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/dpm-desert.p3d new file mode 100644 index 0000000000..a94b619260 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/dpm-desert.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/MTP_cross.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/MTP_cross.p3d new file mode 100644 index 0000000000..017426e3f8 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/MTP_cross.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-desert_cross.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-desert_cross.p3d new file mode 100644 index 0000000000..2a8dfa1c88 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-desert_cross.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-grey_cross.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-grey_cross.p3d new file mode 100644 index 0000000000..1e1e4a846e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-grey_cross.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-wood_cross.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-wood_cross.p3d new file mode 100644 index 0000000000..4116d04741 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Marpat-wood_cross.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Multicam_cross.p3d b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Multicam_cross.p3d new file mode 100644 index 0000000000..459f25ae24 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/Multicam_cross.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/MTP-cross.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/MTP-cross.paa new file mode 100644 index 0000000000..4f6fea84ee Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/MTP-cross.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-desert-cross.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-desert-cross.paa new file mode 100644 index 0000000000..1069ce681c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-desert-cross.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-grey-cross.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-grey-cross.paa new file mode 100644 index 0000000000..773080a8e4 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-grey-cross.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-wood-cross.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-wood-cross.paa new file mode 100644 index 0000000000..1d5fa1f674 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/Marpat-wood-cross.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/multicam-cross.paa b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/multicam-cross.paa new file mode 100644 index 0000000000..e7a0460256 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personal-aidkits/mediccross/data/multicam-cross.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Personalaidkit.p3d b/TO_MERGE/cse/sys_medical/equipment/Personalaidkit.p3d new file mode 100644 index 0000000000..e121de645d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Personalaidkit.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/QuickClot.p3d b/TO_MERGE/cse/sys_medical/equipment/QuickClot.p3d new file mode 100644 index 0000000000..25a596f9e5 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/QuickClot.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/Tourniquet.p3d b/TO_MERGE/cse/sys_medical/equipment/Tourniquet.p3d new file mode 100644 index 0000000000..31330499cd Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/Tourniquet.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.p3d b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.p3d new file mode 100644 index 0000000000..53c53ac9fa Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.rvmat b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.rvmat new file mode 100644 index 0000000000..c643c4f0c1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=57.799999; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\bandages\fielddressing_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\bandages\fielddressing_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_color.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_color.paa new file mode 100644 index 0000000000..7d68a365c2 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_color.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_garbage.p3d b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_garbage.p3d new file mode 100644 index 0000000000..f3eed095d3 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_garbage.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_nohq.paa new file mode 100644 index 0000000000..c66785cf13 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_smdi.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_smdi.paa new file mode 100644 index 0000000000..96376989f7 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/fielddressing_smdi.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.p3d b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.p3d new file mode 100644 index 0000000000..0c530a097f Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.rvmat b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.rvmat new file mode 100644 index 0000000000..df5beda1a4 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=57.799999; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\bandages\packingbandage_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\bandages\packingbandage_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_color.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_color.paa new file mode 100644 index 0000000000..54b1f75e2e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_color.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_garbage.p3d b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_garbage.p3d new file mode 100644 index 0000000000..b0bbf671a3 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_garbage.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_nohq.paa new file mode 100644 index 0000000000..1b3782c501 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_smdi.paa b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_smdi.paa new file mode 100644 index 0000000000..8d5b3848ac Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bandages/packingbandage_smdi.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bodybag.p3d b/TO_MERGE/cse/sys_medical/equipment/bodybag.p3d new file mode 100644 index 0000000000..854c46059c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bodybag.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/bodybagItem.p3d b/TO_MERGE/cse/sys_medical/equipment/bodybagItem.p3d new file mode 100644 index 0000000000..778752ca7e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/bodybagItem.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Atropinpen_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/Atropinpen_co.paa new file mode 100644 index 0000000000..3e44836bee Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Atropinpen_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Epipen_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/Epipen_co.paa new file mode 100644 index 0000000000..2a1afe1f33 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Epipen_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing.rvmat b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing.rvmat new file mode 100644 index 0000000000..e4c98edc42 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing.rvmat @@ -0,0 +1,32 @@ +ambient[]={1,1,1,1}; +diffuse[]={0.5,0.5,0.5,1}; +forcedDiffuse[]={0.5,0.5,0.5,0}; +emmisive[]={0,0,0,1}; +specular[]={0.30000001,0.30000001,0.30000001,0}; +specularPower=57.799999; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\data\Field-Dressing_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\data\Field-Dressing_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_nohq.paa new file mode 100644 index 0000000000..6972636a3d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_smdi.paa b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_smdi.paa new file mode 100644 index 0000000000..f450605958 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Field-Dressing_smdi.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Field-dressing.paa b/TO_MERGE/cse/sys_medical/equipment/data/Field-dressing.paa new file mode 100644 index 0000000000..07bae7d595 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Field-dressing.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Liquid-skin.paa b/TO_MERGE/cse/sys_medical/equipment/data/Liquid-skin.paa new file mode 100644 index 0000000000..fda64304bc Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Liquid-skin.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Morphin_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/Morphin_co.paa new file mode 100644 index 0000000000..8d91fd0e10 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Morphin_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/Tournequit_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/Tournequit_co.paa new file mode 100644 index 0000000000..e83aada994 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/Tournequit_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bandage-elastic.paa b/TO_MERGE/cse/sys_medical/equipment/data/bandage-elastic.paa new file mode 100644 index 0000000000..3164b5d4ca Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bandage-elastic.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybag.rvmat b/TO_MERGE/cse/sys_medical/equipment/data/bodybag.rvmat new file mode 100644 index 0000000000..d2955e1c4a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/data/bodybag.rvmat @@ -0,0 +1,92 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.703999,0.703999,0.703999,0.000000}; +specularPower=70.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\data\bodybag_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 +{ + texture="cse\cse_sys_medical\equipment\data\env_co.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem.rvmat b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem.rvmat new file mode 100644 index 0000000000..8be756a025 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem.rvmat @@ -0,0 +1,32 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={1.000000,1.000000,1.000000,1.000000}; +specularPower=20.000000; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\data\bodybagItem_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 +{ + texture="cse\cse_sys_medical\equipment\data\bodybagItem_smdi.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_co.paa new file mode 100644 index 0000000000..d04f8ec64c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_nohq.paa new file mode 100644 index 0000000000..5699ec5e04 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_smdi.paa b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_smdi.paa new file mode 100644 index 0000000000..cf4cf805e3 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bodybagItem_smdi.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybag_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/bodybag_co.paa new file mode 100644 index 0000000000..21996761b7 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bodybag_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/bodybag_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/data/bodybag_nohq.paa new file mode 100644 index 0000000000..5c6b35c595 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/bodybag_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/env_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/env_co.paa new file mode 100644 index 0000000000..77645347b5 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/env_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/quickclot_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/quickclot_co.paa new file mode 100644 index 0000000000..bf0edccd7e Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/quickclot_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit.rvmat b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit.rvmat new file mode 100644 index 0000000000..4af111299b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit.rvmat @@ -0,0 +1,92 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.70399898,0.70399898,0.70399898,0}; +specularPower=70; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="cse\cse_sys_medical\equipment\data\surgical_kit_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage7 +{ + texture="cse\cse_sys_medical\equipment\data\env_co.tga"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_co.paa b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_co.paa new file mode 100644 index 0000000000..3e622afe48 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_co.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_metal.rvmat b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_metal.rvmat new file mode 100644 index 0000000000..65192a777f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_metal.rvmat @@ -0,0 +1,22 @@ +ambient[]={1,1,1,0}; +diffuse[]={1,1,1,0}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,0}; +specular[]={0.5,0.5,0.5,0}; +specularPower=11.6; +renderFlags[]= +{ + "NoAlphaWrite" +}; +PixelShaderID="Glass"; +VertexShaderID="Glass"; +class Stage1 +{ + texture="#(argb,8,8,3)color(1,1,1,0.9)"; + uvSource="none"; +}; +class Stage2 +{ + texture="a3\data_f\env_chrome_co.paa"; + uvSource="none"; +}; diff --git a/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_nohq.paa b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_nohq.paa new file mode 100644 index 0000000000..b8027515bc Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/data/surgical_kit_nohq.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/field_dressing.p3d b/TO_MERGE/cse/sys_medical/equipment/field_dressing.p3d new file mode 100644 index 0000000000..a94a398b68 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/field_dressing.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/field_dressing_used.p3d b/TO_MERGE/cse/sys_medical/equipment/field_dressing_used.p3d new file mode 100644 index 0000000000..7d6765db10 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/field_dressing_used.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/atropine.paa b/TO_MERGE/cse/sys_medical/equipment/img/atropine.paa new file mode 100644 index 0000000000..49b79e99e5 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/atropine.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/bandageElastic.paa b/TO_MERGE/cse/sys_medical/equipment/img/bandageElastic.paa new file mode 100644 index 0000000000..bbf7901ceb Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/bandageElastic.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/bloodbag.paa b/TO_MERGE/cse/sys_medical/equipment/img/bloodbag.paa new file mode 100644 index 0000000000..489614bf44 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/bloodbag.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/bodybag.paa b/TO_MERGE/cse/sys_medical/equipment/img/bodybag.paa new file mode 100644 index 0000000000..a3a7257fc3 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/bodybag.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/chestseal.paa b/TO_MERGE/cse/sys_medical/equipment/img/chestseal.paa new file mode 100644 index 0000000000..be0f4f77bf Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/chestseal.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/epinephrine.paa b/TO_MERGE/cse/sys_medical/equipment/img/epinephrine.paa new file mode 100644 index 0000000000..d4c556281a Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/epinephrine.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/field_dressing.paa b/TO_MERGE/cse/sys_medical/equipment/img/field_dressing.paa new file mode 100644 index 0000000000..bfe11f2a07 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/field_dressing.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/liquidSkin.paa b/TO_MERGE/cse/sys_medical/equipment/img/liquidSkin.paa new file mode 100644 index 0000000000..40e72038ec Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/liquidSkin.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/morphine.paa b/TO_MERGE/cse/sys_medical/equipment/img/morphine.paa new file mode 100644 index 0000000000..16918da53f Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/morphine.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/nasopharyngeal_tube.paa b/TO_MERGE/cse/sys_medical/equipment/img/nasopharyngeal_tube.paa new file mode 100644 index 0000000000..6629605519 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/nasopharyngeal_tube.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/packing_bandage.paa b/TO_MERGE/cse/sys_medical/equipment/img/packing_bandage.paa new file mode 100644 index 0000000000..5825d17a77 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/packing_bandage.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/personal_aid_kit.paa b/TO_MERGE/cse/sys_medical/equipment/img/personal_aid_kit.paa new file mode 100644 index 0000000000..87d6a1612f Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/personal_aid_kit.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/plasma_iv.paa b/TO_MERGE/cse/sys_medical/equipment/img/plasma_iv.paa new file mode 100644 index 0000000000..31eb3e34df Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/plasma_iv.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/quickclot.paa b/TO_MERGE/cse/sys_medical/equipment/img/quickclot.paa new file mode 100644 index 0000000000..8727b7d1d0 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/quickclot.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/saline_iv.paa b/TO_MERGE/cse/sys_medical/equipment/img/saline_iv.paa new file mode 100644 index 0000000000..a957e36d7c Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/saline_iv.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/splint.paa b/TO_MERGE/cse/sys_medical/equipment/img/splint.paa new file mode 100644 index 0000000000..87c1cb8686 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/splint.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/surgical_kit.paa b/TO_MERGE/cse/sys_medical/equipment/img/surgical_kit.paa new file mode 100644 index 0000000000..e6b3533a12 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/surgical_kit.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/img/tourniquet.paa b/TO_MERGE/cse/sys_medical/equipment/img/tourniquet.paa new file mode 100644 index 0000000000..1a0dace011 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/img/tourniquet.paa differ diff --git a/TO_MERGE/cse/sys_medical/equipment/skinliquid.p3d b/TO_MERGE/cse/sys_medical/equipment/skinliquid.p3d new file mode 100644 index 0000000000..485457a54a Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/skinliquid.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/splint.p3d b/TO_MERGE/cse/sys_medical/equipment/splint.p3d new file mode 100644 index 0000000000..42f3ad14b7 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/splint.p3d differ diff --git a/TO_MERGE/cse/sys_medical/equipment/surgical_kit.p3d b/TO_MERGE/cse/sys_medical/equipment/surgical_kit.p3d new file mode 100644 index 0000000000..0c01cc8add Binary files /dev/null and b/TO_MERGE/cse/sys_medical/equipment/surgical_kit.p3d differ diff --git a/TO_MERGE/cse/sys_medical/functions.sqf b/TO_MERGE/cse/sys_medical/functions.sqf new file mode 100644 index 0000000000..53a52d84a7 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions.sqf @@ -0,0 +1,65 @@ +/* +functions.sqf +Usage: compileFinals the function SQF files into variables for use +Author: Glowbal + +Arguments: none +Returns: none + +Affects: n/a +Executes: +*/ + +cse_fnc_unitLoop_CMS = { + _unit = _this select 0; + if !(local _unit) exitwith{}; + if !(_unit getvariable["cse_fnc_unitLoop_CMS",false]) then{ + _unit setvariable ["cse_fnc_unitLoop_CMS",true]; + }; + + if ([_unit] call cse_fnc_hasMedicalEnabled_CMS) then { + if (isnil "CSE_MEDICAL_COMBINED_LOOP_CMS") then { + CSE_MEDICAL_COMBINED_LOOP_CMS = []; + }; + if (_unit in CSE_MEDICAL_COMBINED_LOOP_CMS) exitwith {}; + CSE_MEDICAL_COMBINED_LOOP_CMS pushback _unit; + [format["Added %1 to unitLoop",_unit]] call cse_fnc_debug; + }; +}; + +cse_fnc_onBodySwitch_CMS = { + private ["_unit","_newUnit"]; + _unit = _this select 0; + _newUnit = _this select 1; + if (!dialog) exitwith{}; + if (CSE_SYS_MEDICAL_INTERACTION_TARGET == _unit) then { + CSE_SYS_MEDICAL_INTERACTION_TARGET = _newUnit; + }; +}; + +cse_eh_killed_CMS = { + private["_unit"]; + _unit = _this select 0; + if (!local _unit) exitwith {}; + [_unit, "cse_pain",0,true] call cse_fnc_setVariable; + [_unit, "cse_heartRate",0,true] call cse_fnc_setVariable; + [_unit, "cse_bloodPressure", [0,0],true] call cse_fnc_setVariable; + if (_unit getvariable["cse_unconscious_non_captive_f",false]) then { + _unit setCaptive false; + _unit setvariable["cse_unconscious_non_captive_f",nil]; + }; +}; + +cse_eh_local_CMS = { + private["_unit"]; + _unit = _this select 0; + _local = _this select 1; + [format["Locality changed for: %1",_this]] call cse_fnc_Debug; + if (_local) then { + if (_unit getvariable["cse_fnc_unitLoop_CMS",false]) then { + [_unit] call cse_fnc_unitLoop_CMS; + }; + } else { + + }; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addActivityToLog_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addActivityToLog_CMS.sqf new file mode 100644 index 0000000000..57cf285406 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addActivityToLog_CMS.sqf @@ -0,0 +1,44 @@ +/** + * fn_addActivityToLog_CMS.sqf + * @Descr: adds an item to the activity log + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, type STRING, message STRING] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit","_caller","_type","_activity","_log"]; + +_unit = _this select 0; +_type = _this select 1; +_message = _this select 2; + +if (!local _unit) exitwith { + [_this, "cse_fnc_addActivityToLog_CMS", _unit, false] spawn BIS_fnc_MP; +}; +_lastNumber = date select 4; +_moment = format["%1:%2",date select 3, _lastNumber]; +if (_lastNumber < 10) then { + _moment = format["%1:0%2",date select 3, _lastNumber]; +}; + + +_log = [_unit, "cse_activityLog_CMS"] call cse_fnc_getVariable; +if (count _log >= 8) then { + _newLog = []; + _counter = 0; + { + // ensure the first element will not be added + if (_counter > 0) then { + _newLog pushback _x; + } else { + _counter = _counter + 1; + }; + }foreach _log; + _log = _newLog; +}; +_log pushback [_message,_moment,_type]; + +[_unit, "cse_activityLog_CMS",_log] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addToQuickViewLog_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addToQuickViewLog_CMS.sqf new file mode 100644 index 0000000000..53088849a4 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_addToQuickViewLog_CMS.sqf @@ -0,0 +1,42 @@ +/** + * fn_addToQuickViewLog_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit","_caller","_type","_activity","_log"]; + +_unit = _this select 0; +_type = _this select 1; +_message = _this select 2; +_lastNumber = date select 4; +if (!local _unit) exitwith { + [_this, "cse_fnc_addToQuickViewLog_CMS", _unit, false] spawn BIS_fnc_MP; +}; +_moment = format["%1:%2",date select 3, _lastNumber]; +if (_lastNumber < 10) then { + _moment = format["%1:0%2",date select 3, _lastNumber]; +}; + + +_log = [_unit,"cse_quickviewLog_CMS"] call cse_fnc_getVariable; +if (count _log >= 8) then { + _newLog = []; + _counter = 0; + { + if (_counter > 0) then { + _newLog pushback _x; + } else { + _counter = _counter + 1; + }; + }foreach _log; + _log = _newLog; +}; +_log pushback [_message,_moment,_type]; + +[_unit,"cse_quickviewLog_CMS",_log] call cse_fnc_setVariable; diff --git a/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getActivityLog_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getActivityLog_CMS.sqf new file mode 100644 index 0000000000..68d82d4cf5 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getActivityLog_CMS.sqf @@ -0,0 +1,22 @@ +/** + * fn_getActivityLog_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,"cse_activityLog_CMS"] call cse_fnc_getVariable; + +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getQuickViewLog_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getQuickViewLog_CMS.sqf new file mode 100644 index 0000000000..2e9e50d827 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/activityLog/fn_getQuickViewLog_CMS.sqf @@ -0,0 +1,21 @@ +/** + * fn_getQuickViewLog_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,"cse_quickviewLog_CMS"] call cse_fnc_getVariable; +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/TO_MERGE/cse/sys_medical/functions/basic/fn_basicBandage_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/basic/fn_basicBandage_CMS.sqf new file mode 100644 index 0000000000..80622fb40a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/basic/fn_basicBandage_CMS.sqf @@ -0,0 +1,53 @@ +/** + * fn_basicBandage_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_removeItem = _this select 2; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_treatingPerson] call cse_fnc_treatmentMutex_CMS; + +if (!([_treatingPerson,_removeItem] call cse_fnc_hasMagazine)) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; + [_treatingPerson,_removeItem] call cse_fnc_useMagazine; +if (dialog) then { + [] call cse_fnc_gui_refreshLastSubMenu; +}; + +if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson)) then { + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_broadcastAnim; +}; + +_spot = 0; +_openWounds = [_injuredPerson,"cse_openWounds"] call cse_fnc_getvariable; +_counter = 0; +_highestTotal = 0; +{ + _totalNumber = 0; + { + _totalNumber = _totalNumber + _x; + }foreach _x; + if (_totalNumber > _highestTotal) then { + [format["_totalNumber vs _highestTotal",_totalNumber,_highestTotal]] call cse_fnc_debug; + _spot = _counter; + _highestTotal = _totalNumber; + }; + _counter = _counter + 1; +}foreach _openWounds; + +if (_spot < 0) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; +_selectionName = [_spot] call cse_fnc_fromNumberToBodyPart_CMS; +[format["CONVERTED NUMBER TO: %1 TO %2",_spot,_selectionName]] call cse_fnc_debug; +_name = [_injuredPerson,"cse_name"] call cse_fnc_getVariable; +_messageSend = formatText ["You apply a bandage on %1 - %2", _name,_selectionName]; +[_treatingPerson,_messageSend] call cse_fnc_sendHintTo; +[[_injuredPerson, _treatingPerson, _selectionName, _removeItem], "cse_fnc_bandageLocal_CMS", _injuredPerson, false] spawn BIS_fnc_MP; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/basic/fn_fromNumberToBodyPart_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/basic/fn_fromNumberToBodyPart_CMS.sqf new file mode 100644 index 0000000000..1995516ba7 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/basic/fn_fromNumberToBodyPart_CMS.sqf @@ -0,0 +1,38 @@ +/** + * fn_fromNumberToBodyPart_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_selectionName","_part"]; +_part = _this select 0; +_selectionName = ""; +_selectionName = switch (_part) do { + case 0: { + "head" + }; + case 1: { + "body" + }; + case 2: { + "hand_l" + }; + case 3: { + "hand_r" + }; + case 4: { + "leg_l" + }; + case 5: { + "leg_r" + }; + default { + "" + }; +}; +_selectionName \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/blood/fn_bloodConditions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/blood/fn_bloodConditions_CMS.sqf new file mode 100644 index 0000000000..c7bc6b68ce --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/blood/fn_bloodConditions_CMS.sqf @@ -0,0 +1,58 @@ +/** + * fn_bloodConditions_CMS.sqf + * @Descr: Check if any of the unconscious or dead conditions are true for given unit and if so, make the relevant function calls. + * @Author: Glowbal + * + * @Arguments: [unit OBJECt, bloodVolume NUMBER, bloodPressure ARRAY, heartRate NUMBER] + * @Return: void + * @PublicAPI: false + */ + + +private ["_unit","_bloodVolume","_bloodPressure","_heartRate","_bloodPressureL","_bloodPressureH","_bloodLoss"]; +_unit = _this select 0; +_bloodVolume = _this select 1; +_bloodPressure = _this select 2; +_heartRate = _this select 3; + +if ((_unit getvariable["CSE_ENABLE_REVIVE_SETDEAD_F",0]) == 0) then { + _bloodPressureL = _bloodPressure select 0; + _bloodPressureH = _bloodPressure select 1; + if (!(_unit getvariable ["cse_cardiacArrest_CMS",false])) then { + if (_bloodPressureH > 260) then { + if (random(1) > 0.7) then { + [_unit] spawn cse_fnc_cardiacArrest_CMS; + }; + }; + if (_bloodPressureL < 40 && _heartRate > 190) then { + if (random(1) > 0.7) then { + [_unit] spawn cse_fnc_cardiacArrest_CMS; + }; + }; + if (_bloodPressureH > 145 && _heartRate > 150) then { + if (random(1) > 0.7) then { + [_unit] spawn cse_fnc_cardiacArrest_CMS; + }; + }; + if (_heartRate > 200) then { + [_unit] spawn cse_fnc_cardiacArrest_CMS; + }; + + if (_heartRate < 20) then { + [_unit] spawn cse_fnc_cardiacArrest_CMS; + }; + }; + if ([_unit] call cse_fnc_isAwake) then { + if (_bloodVolume < 60) then { + if (random(1) > 0.9) then { + [_unit] call cse_fnc_setUnconsciousState; + }; + }; + if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then { + [_unit] call cse_fnc_setUnconsciousState; // safety check to at least ensure unconsciousness for units if they are not dead already. + }; + }; +}; +if (_bloodVolume < 30) then { + [_unit] call cse_fnc_setDead_CMS; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/blood/fn_cardiacArrest_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/blood/fn_cardiacArrest_CMS.sqf new file mode 100644 index 0000000000..fb296aacb4 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/blood/fn_cardiacArrest_CMS.sqf @@ -0,0 +1,37 @@ +/** + * fn_cardiacArrest_CMS.sqf + * @Descr: Triggers a unit into the Cardiac Arrest state from CMS. Will put the unit in an unconscious state and run a countdown timer until unit dies.
Timer is a random value between 120 and 720 seconds. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit that will be put in cardiac arrest state)] + * @Return: void + * @PublicAPI: true + */ + + +private ["_unit", "_modifier","_timer","_counter", "_heartRate"]; +_unit = _this select 0; + +if (_unit getvariable ["cse_cardiacArrest_CMS",false]) exitwith {}; +[format["%1 is put into cardiac arrest",_unit]] call cse_fnc_debug; +_unit setvariable ["cse_cardiacArrest_CMS", true,true]; +[_unit,"cse_heartRate", 0] call cse_fnc_setVariable; + + +[_unit] call cse_fnc_setUnconsciousState; +_counter = 120 + round(random(600)); +_timer = 0; +while {(_timer < _counter && alive _unit)} do { + _heartRate = [_unit,"cse_heartRate"] call cse_fnc_getVariable; + if (_heartRate > 0) exitwith { + [format["%1 is moved out of cardiac: %2",_unit, _heartRate]] call cse_fnc_debug; + _unit setvariable ["cse_cardiacArrest_CMS", nil,true]; + }; + if (_counter - _timer < 1) exitwith { + [_unit] call cse_fnc_setDead_CMS; + }; + sleep 1; + _timer = _timer + 1; +}; + +_unit setvariable ["cse_cardiacArrest_CMS", nil,true]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/drag/fn_carry_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/drag/fn_carry_CMS.sqf new file mode 100644 index 0000000000..c23b51af7c --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/drag/fn_carry_CMS.sqf @@ -0,0 +1,103 @@ +/* + fnc_carry.sqf + Usage: makes the calling unit start carrying the specified unit + Author: Glowbal + + Arguments: array [caller (object), target (object)] + 1: caller (OBJECT), Object of type Man + 2: target (OBJECT), Object of type Man + Returns: none + + Affects: Caller and target locality + Executes: spawn +*/ + +private ["_caller", "_unit", "_positionUnit", "_killOnDrop"]; +_caller = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_unit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; + + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; + +if (!(_unit isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{ [_caller,"release"] call cse_fnc_treatmentMutex_CMS; }; +if (vehicle _caller != _caller || vehicle _unit != _unit) exitwith { [_caller,"release"] call cse_fnc_treatmentMutex_CMS;}; + +if (!([_caller] call cse_fnc_canInteract) || {_caller == _unit} || {(([_unit] call cse_fnc_isAwake))}) exitwith { + ["cse_fnc_drag_CMS call failed condition: canInteract, equal, is awake"] call cse_fnc_debug; + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +if (([_caller] call cse_fnc_getCarriedObj) != _unit && !(isNull ([_caller] call cse_fnc_getCarriedObj)) || {!isNull(_unit getvariable ["cse_beingDragged_CMS",objNull]) || !isNull(_caller getvariable ["cse_dragging_CMS",objNull])} || {!isNull(_unit getvariable ["cse_beingCarried_CMS",objNull]) || !isNull(_caller getvariable ["cse_carrying_CMS",objNull])}) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + ["carryobj reset"] call cse_fnc_debug; + [_caller,objNull] call cse_fnc_carryObj; +}; +_killOnDrop = false; +if (!alive _unit) then { + _killOnDrop = true; + _unit = [_unit,_caller] call cse_fnc_makeCopyOfBody_F; +}; +if (isNull _unit) exitwith {}; + +if !([_caller,_unit] call cse_fnc_carryObj) exitwith { + ["couldn't carry object!"] call cse_fnc_debug; [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; +_unit setvariable ["cse_beingCarried_CMS",_caller,true]; +_caller setvariable ["cse_carrying_CMS",_unit,true]; +_caller selectWeapon (primaryWeapon _caller); + +[_caller,"acinpercmstpsraswrfldnon",true] call cse_fnc_broadcastAnim; +_unit attachTo [_caller, [0.1, -0.1, -1.25], "LeftShoulder"]; +[_unit,"AinjPfalMstpSnonWnonDf_carried_dead",true] call cse_fnc_broadcastAnim; + +if (!isnil "CSE_DROP_ADDACTION_CMS") then { + _caller removeAction CSE_DROP_ADDACTION_CMS; + CSE_DROP_ADDACTION_CMS = nil; +}; + +CSE_DROP_ADDACTION_CMS = _caller addAction [format["Drop %1",[_unit] call cse_fnc_getName], {[_this select 1, _this select 2] call cse_fnc_drop_CMS;}]; +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; + +[[_caller, _unit],"onCarryInjured"] call cse_fnc_customEventHandler_F; + +waituntil {((isNull ([_caller] call cse_fnc_getCarriedObj)) || !([_caller] call cse_fnc_isAwake) || !(vehicle _caller == _caller))}; +[_caller,ObjNull] call cse_fnc_carryObj; + +if (([_caller] call cse_fnc_isAwake)) then { + if (vehicle _unit == _unit) then { + if (([_unit] call cse_fnc_isAwake)) then { + [_unit,"",false] call cse_fnc_broadcastAnim; + } else { + [_unit,([_unit] call cse_fnc_getDeathAnim),false] call cse_fnc_broadcastAnim; + }; + }; + if (vehicle _caller == _caller) then { + [_caller,"",false] call cse_fnc_broadcastAnim; + }; +} else { + if (vehicle _unit == _unit) then { + if (([_unit] call cse_fnc_isAwake)) then { + [_unit,"",false] call cse_fnc_broadcastAnim; + } else { + [_unit,([_unit] call cse_fnc_getDeathAnim),false] call cse_fnc_broadcastAnim; + }; + }; +}; +if (!surfaceIsWater getPos _caller) then { + sleep 0.5; + if (vehicle _unit == _unit) then { + if (vehicle _caller == _caller) then { + _positionUnit = getPosATL _unit; + _positionUnit set [2, (getPosATL _caller) select 2]; + _unit setPosATL _positionUnit; + }; + }; +}; +if (_killOnDrop) then { + _unit setDamage 1; +}; +_unit setvariable ["cse_beingCarried_CMS",objNull,true]; +_caller setvariable ["cse_carrying_CMS",objNull,true]; + +[[_caller, _unit, 1],"onDropInjured"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/drag/fn_drag_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/drag/fn_drag_CMS.sqf new file mode 100644 index 0000000000..542f209392 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/drag/fn_drag_CMS.sqf @@ -0,0 +1,115 @@ +/* +fnc_drag.sqf +Usage: makes the calling unit start dragging the specified unit +Author: Glowbal + +Arguments: array [unit (object), unit (object)] + 1: Caller OBJECT. Unit that initiats the dragging + 2: Target OBJECT. Unit that will be dragged +Returns: none + +Affects: Caller and target Locality +Executes: spawn +*/ +private ["_caller", "_unit", "_positionUnit", "_killOnDrop"]; +_caller = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_unit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; + +["cse_fnc_drag_CMS has been called",2] call cse_fnc_debug; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; + +if (!(_unit isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{ [_caller,"release"] call cse_fnc_treatmentMutex_CMS;}; +if (vehicle _caller != _caller || vehicle _unit != _unit) exitwith { [_caller,"release"] call cse_fnc_treatmentMutex_CMS;}; + +if (!([_caller] call cse_fnc_canInteract) || {_caller == _unit} || {(([_unit] call cse_fnc_isAwake))}) exitwith { ["cse_fnc_drag_CMS call failed condition: canInteract, equal, is awake"] call cse_fnc_debug; + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +if (([_caller] call cse_fnc_getCarriedObj) != _unit && !(isNull ([_caller] call cse_fnc_getCarriedObj)) || {!isNull(_unit getvariable ["cse_beingDragged_CMS",objNull]) || !isNull(_caller getvariable ["cse_dragging_CMS",objNull])}) exitwith { + ["carryobj reset"] call cse_fnc_debug; + [_caller,objNull] call cse_fnc_carryObj; + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; +_caller action ["WeaponOnBack", _caller]; + + +_killOnDrop = false; +if (!alive _unit) then { + _unit = [_unit,_caller] call cse_fnc_makeCopyOfBody_F; + _killOnDrop = true; + _unit playMove "AinjPpneMstpSnonWrflDb"; +}; +if (isNull _unit) exitwith {}; + +if !([_caller,_unit,[0.125, 1.007, 0]] call cse_fnc_carryObj) exitwith { [_caller,"release"] call cse_fnc_treatmentMutex_CMS; }; +_unit setDir 180; +[_unit,"AinjPpneMstpSnonWrflDb",true] call cse_fnc_broadcastAnim; +_caller selectWeapon (primaryWeapon _caller); + +if (currentWeapon _caller == primaryWeapon _caller) then { + [_caller,"AcinPknlMstpSrasWrflDnon",true] call cse_fnc_localAnim; +} else { + [_caller,"AcinPknlMstpSnonWnonDnon",true] call cse_fnc_localAnim; +}; + +_unit setvariable ["cse_beingDragged_CMS",_caller,true]; +_caller setvariable ["cse_dragging_CMS",_unit,true]; +if (!isnil "CSE_DROP_ADDACTION_CMS") then { +_caller removeAction CSE_DROP_ADDACTION_CMS; + CSE_DROP_ADDACTION_CMS = nil; +}; +CSE_DROP_ADDACTION_CMS = _caller addAction [format["Drop %1",[_unit] call cse_fnc_getName], {[_this select 1, _this select 2] call cse_fnc_drop_CMS;}]; + +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; + +[[_caller, _unit],"onDragInjured"] call cse_fnc_customEventHandler_F; + +waituntil {((isNull ([_caller] call cse_fnc_getCarriedObj)) || !([_caller] call cse_fnc_isAwake))}; +[_caller,ObjNull] call cse_fnc_carryObj; + +_unit setvariable ["cse_beingDragged_CMS",objNull,true]; +_caller setvariable ["cse_dragging_CMS",objNull,true]; + + +if (([_caller] call cse_fnc_isAwake)) then { + if (vehicle _unit == _unit) then { + if (([_unit] call cse_fnc_isAwake)) then { + [_unit,"AinjPpneMstpSnonWrflDb_release",false] call cse_fnc_broadcastAnim; + //[_unit,"aidlppnemstpsraswrfldnon0s",false] call cse_fnc_broadcastAnim; + } else { + [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; + }; + }; + if (vehicle _caller == _caller) then { + [_caller,"amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon",false] call cse_fnc_broadcastAnim; + }; +} else { + if (([_unit] call cse_fnc_isAwake)) then { + if (vehicle _unit == _unit) then { + [_unit,"AinjPpneMstpSnonWrflDb_release",false] call cse_fnc_broadcastAnim; + //[_unit,"aidlppnemstpsraswrfldnon0s",false] call cse_fnc_broadcastAnim; + } else { + [_unit,"",false] call cse_fnc_broadcastAnim; + }; + } else { + [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; + }; +}; +if (!surfaceIsWater getPos _caller) then { + sleep 0.5; + if (vehicle _unit == _unit) then { + if (vehicle _caller == _caller) then { + _positionUnit = getPosATL _unit; + _positionUnit set [2, (getPosATL _caller) select 2]; + _unit setPosATL _positionUnit; + }; + }; +}; + +if (_killOnDrop) then { + _unit setDamage 1; +}; + +[[_caller, _unit, 0],"onDropInjured"] call cse_fnc_customEventHandler_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/drag/fn_drop_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/drag/fn_drop_CMS.sqf new file mode 100644 index 0000000000..29b4bc28b6 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/drag/fn_drop_CMS.sqf @@ -0,0 +1,21 @@ + +/* + fnc_drop.sqf + Usage: makes the calling unit start dragging the specified unit + Author: Glowbal + + Arguments: array [unit (object), unit (object)] + Returns: none + + Affects: + Executes: +*/ + +private ["_caller", "_unit","_info","_draggedPerson"]; +_caller = _this select 0; +_unit = _this select 1; +[_caller,objNull] call cse_fnc_carryObj; +if (!isnil "CSE_DROP_ADDACTION_CMS") then { +_caller removeAction CSE_DROP_ADDACTION_CMS; + CSE_DROP_ADDACTION_CMS = nil; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/drag/fn_switchBody_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/drag/fn_switchBody_CMS.sqf new file mode 100644 index 0000000000..9271d19bea --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/drag/fn_switchBody_CMS.sqf @@ -0,0 +1,82 @@ +/** + * fn_switchBody_CMS.sqf + * @Descr: DEPCRECATED + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_oldBody","_newUnit","_class","_group","_position","_side","_allVariables"]; +_oldBody = _this select 0; +_caller = _this select 1; + + if (alive _oldBody) exitwith {}; + _name = _oldBody getvariable ["cse_name","unknown"]; + _class = typeof _oldBody; + _side = side _caller; + _group = createGroup _side; + _position = getPos _oldBody; + + //_group = (group _oldBody); + //_newUnit = _group createUnit [_class, _position, [], 3, "FORM"]; + _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]; + + _newUnit setvariable ["cse_heartRate", 0]; + _newUnit setvariable ["cse_bloodPressure", [0,0]]; + + 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; + + if (CSE_SYS_MEDICAL_INTERACTION_TARGET == _oldBody) then { + CSE_SYS_MEDICAL_INTERACTION_TARGET = _newUnit; + }; +// [[_oldBody,_newUnit],_name,"cse_fnc_onBodySwtich_CMS",true,false] spawn BIS_fnc_MP; + + deleteVehicle _oldBody; +_newUnit \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressureLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressureLocal_CMS.sqf new file mode 100644 index 0000000000..f883c4ecf6 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressureLocal_CMS.sqf @@ -0,0 +1,57 @@ +/** + * fn_checkBloodPressureLocal_CMS.sqf + * @Descr: Displays specified units current blood pressure + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_unit","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"]; +_caller = _this select 0; +_unit = _this select 1; + + + _bloodPressure = [_unit] call cse_fnc_getBloodPressure_CMS; + if (!alive _unit) then { + _bloodPressure = [0,0]; + }; + + _bloodPressureHigh = _bloodPressure select 1; + _bloodPressureLow = _bloodPressure select 0; + _output = ""; +_logOutPut = ""; + if ([_caller] call cse_fnc_medicClass_CMS) then { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_1"; + _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; + } else { + if (_bloodPressureHigh > 20) then { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_2"; + _logOutPut = "Low"; + if (_bloodPressureHigh > 100) then { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_3"; + _logOutPut = "Normal"; + if (_bloodPressureHigh > 160) then { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_4"; + _logOutPut = "High"; + }; + + }; + } else { + if (random(10) > 3) then { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_5"; + _logOutPut = "No Blood Pressure"; + } else { + _output = "STR_CSE_CMS_CHECK_BLOODPRESSURE_OUTPUT_6"; + }; + }; + }; + +_title = format["STR_CSE_CMS_CHECK_BLOODPRESSURE"]; +_content = ["STR_CSE_CMS_CHECK_BLOODPRESSURE_CHECKED_MEDIC", _output]; +[_caller, _title, _content, 0,[[_unit] call cse_fnc_getName, round(_bloodPressureHigh),round(_bloodPressureLow)] ] call cse_fnc_sendDisplayInformationTo; + +if (_logOutPut != "") then { + [_unit,"examine",format["%1 checked Blood Pressure: %2",[_caller] call cse_fnc_getName,_logOutPut]] call cse_fnc_addToQuickViewLog_CMS; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressure_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressure_CMS.sqf new file mode 100644 index 0000000000..0736576321 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkBloodPressure_CMS.sqf @@ -0,0 +1,29 @@ +/** + * fn_checkBloodPressure_CMS.sqf + * @Descr: Displays specified units current blood pressure + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller","_unit","_bloodPressure","_bloodPressureHigh","_bloodPressureLow"]; +_caller = _this select 0; +_unit = _this select 1; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; +_title = format["STR_CSE_CMS_CHECK_BLOODPRESSURE"]; +_content = ["STR_CSE_CMS_CHECK_BLOODPRESSURE_CONTENT"]; +[_caller, _title, _content] call cse_fnc_sendDisplayInformationTo; + + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([(2 + round(random(4))),{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +[_this, "cse_fnc_checkBloodPressureLocal_CMS", _unit, false] spawn BIS_fnc_MP; +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulseLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulseLocal_CMS.sqf new file mode 100644 index 0000000000..1b644dfa00 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulseLocal_CMS.sqf @@ -0,0 +1,50 @@ +/** + * fn_checkPulseLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_unit"]; +_caller = _this select 0; +_unit = _this select 1; + + _heartRate = [_unit,"cse_heartRate"] call cse_fnc_getVariable; + if (!alive _unit) then { + _heartRate = 0; + }; + _heartRateOutput = ""; + _logOutPut = ""; + if (_heartRate > 1.0) then { + if ([_caller] call cse_fnc_medicClass_CMS) then { + _heartRateOutput = "STR_CSE_CMS_CHECK_PULSE_OUTPUT_1"; + _logOutPut = format["%1",round(_heartRate)]; + } else { + // non medical personel will only find a pulse/HR + _heartRateOutput = "STR_CSE_CMS_CHECK_PULSE_OUTPUT_2"; + _logOutPut = "Weak"; + if (_heartRate > 60) then { + if (_heartRate > 100) then { + _heartRateOutput = "STR_CSE_CMS_CHECK_PULSE_OUTPUT_3"; + _logOutPut = "Strong"; + } else { + _heartRateOutput = "STR_CSE_CMS_CHECK_PULSE_OUTPUT_4"; + _logOutPut = "Normal"; + }; + }; + }; + } else { + _heartRateOutput = "STR_CSE_CMS_CHECK_PULSE_OUTPUT_5"; + _logOutPut = "No heart rate"; + }; + +_title = "STR_CSE_CMS_CHECK_PULSE"; +_content = ["STR_CSE_CMS_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput]; +[_caller, _title, _content,0, [[_unit] call cse_fnc_getName, round(_heartRate)]] call cse_fnc_sendDisplayInformationTo; + +if (_logOutPut != "") then { + [_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call cse_fnc_getName,_logOutPut]] call cse_fnc_addToQuickViewLog_CMS; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulse_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulse_CMS.sqf new file mode 100644 index 0000000000..812c1bbaf2 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkPulse_CMS.sqf @@ -0,0 +1,30 @@ +/** + * fn_checkPulse_CMS.sqf + * @Descr: Displays specified units current pulse + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_unit","_title","_content"]; +_caller = _this select 0; +_unit = _this select 1; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; +_title = format["STR_CSE_CMS_CHECK_PULSE"]; +_content = ["STR_CSE_CMS_CHECK_PULSE_CONTENT"]; +[_caller, _title, _content] call cse_fnc_sendDisplayInformationTo; + + + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([(2 + round(random(4))),{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +[_this, "cse_fnc_checkPulseLocal_CMS", _unit, false] spawn BIS_fnc_MP; + +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/examine/fn_checkResponse_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkResponse_CMS.sqf new file mode 100644 index 0000000000..ead154db66 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/examine/fn_checkResponse_CMS.sqf @@ -0,0 +1,39 @@ +/** + * fn_checkResponse_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_unit"]; +_caller = _this select 0; +_unit = _this select 1; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; +_title = format["STR_CSE_CMS_CHECK_RESPONSE"]; +_content = ["STR_CSE_CMS_CHECK_RESPONSE_CONTENT"]; +[_caller, _title, _content] call cse_fnc_sendDisplayInformationTo; + + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([(2 + round(random(4))),{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +_output = ""; +if ([_unit] call cse_fnc_isAwake) then { + _output = format[localize "STR_CSE_CMS_CHECK_REPONSE_RESPONSIVE",[_unit] call cse_fnc_getName]; +} else { + _output = format[localize "STR_CSE_CMS_CHECK_REPONSE_UNRESPONSIVE",[_unit] call cse_fnc_getName]; +}; + +_title = format["STR_CSE_CMS_CHECK_RESPONSE"]; +_content = [format[localize "STR_CSE_CMS_CHECK_REPONSE_YOU_CHECKED",[_unit] call cse_fnc_getName],_output]; +[_caller, _title, _content] call cse_fnc_sendDisplayInformationTo; + +[_unit,"examine",_output] call cse_fnc_addToQuickViewLog_CMS; +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_addOpenWounds_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_addOpenWounds_CMS.sqf new file mode 100644 index 0000000000..5ee4f16d89 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_addOpenWounds_CMS.sqf @@ -0,0 +1,43 @@ +/** + * fn_addOpenWounds_CMS.sqf + * @Descr: Add open wounds to unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The object that will recieve the wound), bodyPart STRING, type STRING (Small, medium or large), amount NUMBER (The amount of open wounds added)] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit", "_bodyPart", "_type", "_openWounds", "_selection", "_amount", "_newAmount"]; +_unit = _this select 0; +_bodyPart = _this select 1; +_type = _this select 2; +_amount = _this select 3; + +if (typeName _bodyPart == "STRING") then { + _bodyPart = [_bodyPart] call cse_fnc_getBodyPartNumber_CMS; +}; +if (typeName _type == "STRING") then { + _type = switch (toLower _type) do { + case "small": {0}; + case "medium": {1}; + case "large": {2}; + default {-1}; + }; +}; + +if (_type < 0) exitwith { + [format["Adding an injury with an invalid type: %1",_this], 0] call cse_fnc_debug; +}; + +_openWounds = [_unit,"cse_openWounds"] call cse_fnc_getVariable; +_selection = _openWounds select _bodyPart; +_newAmount = (_selection select _type) + _amount; +if (_newAmount < 0) then { + _newAmount = 0; +}; +_selection set [ _type, _newAmount]; +_openWounds set [ _bodyPart , _selection]; +[_unit, "cse_openWounds",_openWounds] call cse_fnc_setVariable; + +[_unit] call cse_fnc_unitLoop_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_assignMedicRoles_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicRoles_CMS.sqf new file mode 100644 index 0000000000..74d039a2c0 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicRoles_CMS.sqf @@ -0,0 +1,62 @@ +/** + * fn_assignMedicRoles_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic","_setting","_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + + [format["AssignMedicalRoles called. Arguments are: %1 %2", _this]] call cse_fnc_debug; + +if (!isNull _logic) then { + _list = _logic getvariable ["EnableList",""]; + + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call cse_fnc_string_removeWhiteSpace; + if !(isnil _x) then { + if (_nilCheckPassedList == "") then { + _nilCheckPassedList = _x; + } else { + _nilCheckPassedList = _nilCheckPassedList + ","+ _x; + }; + }; + }foreach _splittedList; + + _list = "[" + _nilCheckPassedList + "]"; + _parsedList = [] call compile _list; + _setting = _logic getvariable ["class",0]; + _objects = synchronizedObjects _logic; + if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { + /* + This has been enabled again to allow backwards compatability for older CSE missions. + */ + [["synchronizedObjects for the 'Assign Medic Role' Module is deprecated. Please use the enable for list instead!"], 1] call cse_fnc_debug; + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + [_x,_setting] call cse_fnc_setMedicRole_CMS; + }; + }; + }; + }foreach _objects; + }; + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + [_x,_setting] call cse_fnc_setMedicRole_CMS; + }; + }; + }; + }foreach _parsedList; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalEquipment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalEquipment_CMS.sqf new file mode 100644 index 0000000000..ce72402043 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalEquipment_CMS.sqf @@ -0,0 +1,83 @@ +/** + * fn_assignMedicalEquipment_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#define ALL_PLAYERS 0 +#define ONLY_MEDICS 1 + + +// TODO add amount of to defines +#define BASIC_BANDAGES "cse_bandage_basic" +#define PACKING_BANDAGES "cse_packing_bandage" + + +private ["_logic","_setting","_objects", "_medicsLoadout", "_nonMedics", "_code"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + _setting = _logic getvariable ["equipment",0]; + waituntil {!isnil "cse_gui"}; // ensure the player unit is available. + waituntil {time>0}; + + _start = diag_tickTime; + waituntil {(["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) || (diag_tickTime - _start > 10000)}; + + if (!(["cse_sys_medical"] call cse_fnc_isModuleEnabled_F)) exitwith {}; + // TODO Create functions for adding multiple magazines to a unit + // TODO Check if unit can store more magazines (ie backpack/vest/uniform are not full) + + _medicsLoadout = { + for "_i" from 1 to 8 do { + player addItem BASIC_BANDAGES; + player addItem PACKING_BANDAGES; + }; + for "_i" from 1 to 3 do { + player addItem "cse_tourniquet"; + }; + for "_i" from 1 to 3 do { + player addItem "cse_morphine"; + }; + for "_i" from 1 to 2 do { + player addItem "cse_epinephrine"; + }; + }; + + _nonMedics = { + for "_i" from 1 to 3 do { + player addItem BASIC_BANDAGES; + }; + player addItem "cse_tourniquet"; + player addItem "cse_morphine"; + }; + + + // TODO make this neat code. + switch (_setting) do { + case ALL_PLAYERS: { + _code = if ([player] call cse_fnc_medicClass_CMS) then { + _medicsLoadout; + } else { + _nonMedics; + }; + + call _code; + player addEventhandler["Respawn", _code]; + }; + case ONLY_MEDICS: { + _code = if ([player] call cse_fnc_medicClass_CMS) then { + _medicsLoadout; + } else { + {}; + }; + call _code; + player addEventhandler["Respawn", _code]; + }; + default {}; + }; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalFacility_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalFacility_CMS.sqf new file mode 100644 index 0000000000..42bda85c80 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalFacility_CMS.sqf @@ -0,0 +1,23 @@ +/** + * fn_assignMedicalFacility_CMS.sqf + * @Descr: Register synchronized objects from passed object as a medical facility for CMS. + * @Author: Glowbal + * + * @Arguments: [logic OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_logic","_setting","_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + _setting = _logic getvariable ["class",0]; + _objects = synchronizedObjects _logic; + { + if (local _x) then { + _x setvariable["cse_medical_facility", true, true]; + }; + }foreach _objects; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalVehicle_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalVehicle_CMS.sqf new file mode 100644 index 0000000000..8f26dcb8d3 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_assignMedicalVehicle_CMS.sqf @@ -0,0 +1,60 @@ +/** + * fn_assignMedicalVehicle_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic","_setting", "_list", "_parsedList", "_splittedList","_nilCheckPassedList", "_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + + [format["AssignMedicalRoles called. Arguments are: %1 %2", _this]] call cse_fnc_debug; + +if (!isNull _logic) then { + _list = _logic getvariable ["EnableList",""]; + _setting = _logic getvariable ["enabled",0]; + + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call cse_fnc_string_removeWhiteSpace; + if !(isnil _x) then { + if (_nilCheckPassedList == "") then { + _nilCheckPassedList = _x; + } else { + _nilCheckPassedList = _nilCheckPassedList + ","+ _x; + }; + }; + }foreach _splittedList; + + _list = "[" + _nilCheckPassedList + "]"; + _parsedList = [] call compile _list; + + _objects = synchronizedObjects _logic; + { + // assign the medical vehicle role for non man type objects that are local only. + if !(_x isKindOf "CAManBase") then { + if (local _x) then { + _x setvariable ["cse_medicalVehicle_CMS", _setting, true]; + }; + }; + }foreach _objects; + + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + // assign the medical vehicle role for non man type objects that are local only. + if !(_x isKindOf "CAManBase") then { + if (local _x) then { + _x setvariable ["cse_medicalVehicle_CMS", _setting, true]; + }; + }; + }; + }; + }foreach _parsedList; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_canAccessMedicalEquipment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_canAccessMedicalEquipment_CMS.sqf new file mode 100644 index 0000000000..133899ea79 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_canAccessMedicalEquipment_CMS.sqf @@ -0,0 +1,25 @@ +/** + * fn_canAccessMedicalEquipment_CMS.sqf + * @Descr: Check if caller can access targets medical equipment, based upon accessLevel + * @Author: Glowbal + * + * @Arguments: [target OBJECT, caller OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_target", "_caller", "_accessLevel", "_return"]; +_target = _this select 0; +_caller = _this select 1; + +_accessLevel = _target getvariable ["cse_allowSharedEquipmentAccess_CMS", -1]; + +_return = false; + +if (_accessLevel >= 0) then { + if (_accessLevel == 0) exitwith { _return = true; }; + if (_accessLevel == 1) exitwith { _return = (side _target == side _caller); }; + if (_accessLevel == 2) exitwith { _return = (group _target == group _caller); }; +}; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_canPutInBodyBag_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_canPutInBodyBag_CMS.sqf new file mode 100644 index 0000000000..843b3c5d8b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_canPutInBodyBag_CMS.sqf @@ -0,0 +1,15 @@ +/** + * fn_canPutInBodyBag_CMS.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_caller"]; +_unit = _this select 0; +_caller = _this select 1; + +([_caller, "cse_itemBodyBag"] call cse_fnc_hasItem && {(!(alive _unit) || (_unit getvariable ["cse_isDead",false]) || (_unit getvariable ["cse_inReviveState", false]))} && {(_unit distance _caller) < 7.5} && (vehicle _unit == _unit)); // return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_coreLoop_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_coreLoop_CMS.sqf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_medical/functions/fn_effectsLoop_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_effectsLoop_CMS.sqf new file mode 100644 index 0000000000..4d0165b285 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_effectsLoop_CMS.sqf @@ -0,0 +1,72 @@ +/** + * fn_effectsLoop_CMS.sqf + * @Descr: displays visual effects to user + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_bloodLoss","_bloodStatus","_painStatus"]; +_unit = player; +if (!hasInterface || !isPlayer _unit || !local _unit) exitwith{}; +45 cutRsc ["RscCSEScreenEffectsBlack","PLAIN"]; +cseDisplayingBleedingEffect = false; +cseDisplayingPainEffect = false; +cseDisplayingUnconiciousEffect = false; + +_hb_effect = { + _heartRate = _this select 0; + if (_heartRate < 0.1) exitwith {}; + _hbSoundsFast = ["cse_heartbeat_fast_1", "cse_heartbeat_fast_2", "cse_heartbeat_fast_3", "cse_heartbeat_norm_1", "cse_heartbeat_norm_2"]; + _hbSoundsNorm = ["cse_heartbeat_norm_1", "cse_heartbeat_norm_2"]; + _hbSoundsSlow = ["cse_heartbeat_slow_1", "cse_heartbeat_slow_2", "cse_heartbeat_norm_1", "cse_heartbeat_norm_2"]; + if (isnil "CSE_PLAYING_HB_SOUND") then { + CSE_PLAYING_HB_SOUND = false; + }; + if (CSE_PLAYING_HB_SOUND) exitwith {}; + CSE_PLAYING_HB_SOUND = true; + + _sleep = 60 / _heartRate; + if (_heartRate < 60) then { + _sound = _hbSoundsSlow select (random((count _hbSoundsSlow) -1)); + playSound _sound; + + sleep _sleep; + } else { + if (_heartRate > 120) then { + _sound = _hbSoundsFast select (random((count _hbSoundsFast) -1)); + playSound _sound; + sleep _sleep; + }; + }; + CSE_PLAYING_HB_SOUND = false; +}; + +while {true} do { + _unit = player; + if ([_unit] call cse_fnc_isAwake) then { + sleep 0.25; + _bloodLoss = _unit call cse_fnc_getBloodLoss_CMS; + _bloodStatus = [_unit,"cse_bloodVolume",100] call cse_fnc_getVariable; + _painStatus = [_unit,"cse_pain",0] call cse_fnc_getVariable; + + if (_bloodLoss >0) then { + //["cse_sys_medical_isBleeding", true, "cse\cse_sys_medical\data\icons\icon_bleeding.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + [_bloodLoss] spawn cse_fnc_effectBleeding; + } else { + //["cse_sys_medical_isBleeding", false, "cse\cse_sys_medical\data\icons\icon_bleeding.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + }; + sleep 0.25 +(random(2)); + if (_painStatus > 0) then { + [_painStatus] spawn cse_fnc_effectPain; + }; + sleep 0.25 +(random(1)); + _heartRate = [_unit,"cse_heartRate",70] call cse_fnc_getVariable; + [_heartRate] spawn _hb_effect; + } else { + cseDisplayingBleedingEffect = false; + }; +}; + diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getAdvancedOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getAdvancedOptions_CMS.sqf new file mode 100644 index 0000000000..9c14b29db9 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getAdvancedOptions_CMS.sqf @@ -0,0 +1,76 @@ +/** + * fn_getAdvancedOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; + +if (CSE_SYS_MEDICAL_INTERACTION_TARGET != player && (isNull ([player] call cse_fnc_getCarriedObj))) then { + + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET, 'cse_blood_iv'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_BLOODIV_1000ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_blood_iv'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_BLOODIV_1000ML_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET, 'cse_blood_iv_500'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_BLOODIV_500ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_blood_iv_500'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_BLOODIV_500ML_TOOLTIP"]; + }; + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_blood_iv_250'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_BLOODIV_250ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_blood_iv_250'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_BLOODIV_250ML_TOOLTIP"]; + }; + + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_plasma_iv'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_PLASMAIV_1000ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_plasma_iv'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_PLASMAIV_1000ML_TOOLTIP"]; + }; + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_plasma_iv_500'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_PLASMAIV_500ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_plasma_iv_500'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_PLASMAIV_500ML_TOOLTIP"]; + }; + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_plasma_iv_250'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_PLASMAIV_250ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_plasma_iv_250'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_PLASMAIV_250ML_TOOLTIP"]; + }; + + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_saline_iv'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_SALINEIV_1000ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_saline_iv'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_SALINEIV_1000ML_TOOLTIP"]; + }; + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_saline_iv_500'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_SALINEIV_500ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_saline_iv_500'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_SALINEIV_500ML_TOOLTIP"]; + }; + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_saline_iv_250'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_SALINEIV_250ml","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_saline_iv_250'] call cse_fnc_iv_CMS;",localize "STR_CSE_ACTION_SALINEIV_250ML_TOOLTIP"]; + }; + + // TODO refactor this condition into a function. + if ((CSE_AID_KIT_RESTRICTIONS_CMS == 0 && ([player] call cse_fnc_inMedicalFacility_CMS)) || + (CSE_AID_KIT_RESTRICTIONS_CMS == 1 && ([player] call cse_fnc_inMedicalFacility_CMS) && (!([CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_hasOpenWounds_CMS))) || + (CSE_AID_KIT_RESTRICTIONS_CMS == 2) || + (CSE_AID_KIT_RESTRICTIONS_CMS == 3 && (!([CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_hasOpenWounds_CMS)))) then { + + if (CSE_AIDKITMEDICSONLY_CMS && [player] call cse_fnc_medicClass_CMS || !CSE_AIDKITMEDICSONLY_CMS) then { + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_personal_aid_kit'] call cse_fnc_hasEquipment_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_PERSONAL_AID_KIT","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_personal_aid_kit'] call cse_fnc_heal_CMS;",localize "STR_CSE_ACTION_PERSONAL_AID_KIT_TOOLTIP"]; + }; + }; + }; + if (isnil "cse_playerIsProvidingCPR_CMS") then { + cse_playerIsProvidingCPR_CMS = false; + }; + if ((CSE_SYS_MEDICAL_INTERACTION_TARGET getvariable ["cse_cardiacArrest_CMS",false]) || !([CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_isAwake) && !cse_playerIsProvidingCPR_CMS) then { + _return pushback [localize "STR_CSE_ACTION_PERFORM_CPR","[_this select 0,_this select 1] call cse_fnc_performCPR_CMS;", localize "STR_CSE_ACTION_PERFORM_CPR_TOOLTIP"]; + }; + if (cse_playerIsProvidingCPR_CMS) then { + _return pushback [localize "STR_CSE_ACTION_STOP_CPR","cse_playerIsProvidingCPR_CMS = false;", localize "STR_CSE_ACTION_STOP_CPR_TOOLTIP"]; + }; + + if ((CSE_STITCHING_ALLOW_CMS == 0 && [player] call cse_fnc_medicClass_CMS) || CSE_STITCHING_ALLOW_CMS == 1) then { + if ([player, CSE_SYS_MEDICAL_INTERACTION_TARGET, 'cse_surgical_kit'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_STITCHING","[_this select 0,_this select 1, call cse_fnc_getSelectedBodyPart_CMS, 'cse_surgical_kit'] call cse_fnc_performStitching_CMS;", localize "STR_CSE_ACTION_STITCHING_TOOLTIP"]; + }; + }; + + _return = [CSE_SYS_MEDICAL_INTERACTION_TARGET, "getAdvancedOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getAirwayOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getAirwayOptions_CMS.sqf new file mode 100644 index 0000000000..6237a0ac3a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getAirwayOptions_CMS.sqf @@ -0,0 +1,27 @@ +/** + * fn_getAirwayOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_return"]; +_return = []; + + +if (CSE_SYS_MEDICAL_INTERACTION_TARGET != player && (isNull ([player] call cse_fnc_getCarriedObj))) then { + if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + if (([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_nasopharyngeal_tube'] call cse_fnc_hasEquipment_CMS) && !([CSE_SYS_MEDICAL_INTERACTION_TARGET, "cse_airwayTreated"] call cse_fnc_getVariable) && !([CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_isAwake)) then { + _return pushback [localize "STR_CSE_ACTION_APPLY_NPA", "[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_nasopharyngeal_tube'] call cse_fnc_treatmentAirway_CMS;", localize "STR_CSE_ACTION_APPLY_NPA_TOOLTIP"]; + }; + if ([CSE_SYS_MEDICAL_INTERACTION_TARGET, "cse_airwayTreated"] call cse_fnc_getVariable) then { + _return pushback [localize "STR_CSE_ACTION_REMOVE_NPA", "CSE_SYS_MEDICAL_INTERACTION_TARGET setvariable ['cse_airwayTreated', nil, true]; player addMagazine 'cse_nasopharyngeal_tube';", localize "STR_CSE_ACTION_REMOVE_NPA_TOOLTIP"]; + }; + _return = [CSE_SYS_MEDICAL_INTERACTION_TARGET, "getAirwayOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getBandageOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getBandageOptions_CMS.sqf new file mode 100644 index 0000000000..4edc0d7eb9 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getBandageOptions_CMS.sqf @@ -0,0 +1,41 @@ +/** + * fn_getBandageOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define HAS_EQUIPMENT(ITEM) [player,CSE_SYS_MEDICAL_INTERACTION_TARGET,ITEM] call cse_fnc_hasEquipment_CMS + + +private ["_return"]; +_return = []; + +if (isNull ([player] call cse_fnc_getCarriedObj)) then { + if (HAS_EQUIPMENT('cse_bandage_basic')) then { + _return pushback [localize "STR_CSE_ACTION_BANDAGE_BASIC","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_bandage_basic', call cse_fnc_getCurrentSelectedInjuryData_CMS] call cse_fnc_bandage_CMS;",localize "STR_CSE_ACTION_BANDAGE_BASIC_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_quikclot'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_QUIKCLOT","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_quikclot', call cse_fnc_getCurrentSelectedInjuryData_CMS] call cse_fnc_bandage_CMS;",localize "STR_CSE_ACTION_QUIKCLOT_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_bandageElastic'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_BANDAGE_ELASTIC","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_bandageElastic', call cse_fnc_getCurrentSelectedInjuryData_CMS] call cse_fnc_bandage_CMS;",localize "STR_CSE_ACTION_BANDAGE_ELASTIC_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_packing_bandage'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_PACKING_BANDAGE","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_packing_bandage', call cse_fnc_getCurrentSelectedInjuryData_CMS] call cse_fnc_bandage_CMS;",localize "STR_CSE_ACTION_PACKING_BANDAGE_TOOLTIP"]; + }; + + if (([CSE_SYS_MEDICAL_INTERACTION_TARGET, call cse_fnc_getSelectedBodyPart_CMS] call cse_fnc_hasTourniquetAppliedTo_CMS)) then { + _return pushback [localize "STR_CSE_ACTION_REMOVE_TOURNIQUET","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_tourniquet'] call cse_fnc_removeTourniquet_CMS;",localize "STR_CSE_ACTION_REMOVE_TOURNIQUET_TOOLTIP"]; + } else { + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_tourniquet'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_APPLY_TOURNIQUET","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_tourniquet'] call cse_fnc_tourniquet_CMS;",localize "STR_CSE_ACTION_APPLY_TOURNIQUET_TOOLTIP"]; + }; + }; + _return = [CSE_SYS_MEDICAL_INTERACTION_TARGET, "getBandageOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getBloodLoss_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getBloodLoss_CMS.sqf new file mode 100644 index 0000000000..a9ee1cab89 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getBloodLoss_CMS.sqf @@ -0,0 +1,34 @@ +/** + * fn_getBloodLoss_CMS.sqf + * @Descr: Calculate the total blood loss of a unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: NUMBER Total blood loss of unit + * @PublicAPI: true + */ + +#define BLOODLOSS_SMALL_WOUNDS 0.025 +#define BLOODLOSS_MEDIUM_WOUNDS 0.05 +#define BLOODLOSS_LARGE_WOUNDS 0.1 + +/** +* The default cardiac output when all stats are set to normal is 5.25. +*/ +#define DEFAULT_CARDIAC_OUTPUT 5.25 + +private ["_totalBloodLoss","_tourniquets","_openWounds", "_value", "_cardiacOutput"]; + +_totalBloodLoss = 0; +_tourniquets = [_this, "cse_tourniquets"] call cse_fnc_getvariable; +_openWounds = [_this, "cse_openWounds"] call cse_fnc_getvariable; +_cardiacOutput = [_this] call cse_fnc_getCardiacOutput_CMS; + +{ + if ((_tourniquets select _foreachIndex) < 1) then { + _totalBloodLoss = _totalBloodLoss + (((BLOODLOSS_SMALL_WOUNDS * (_x select 0))) + ((BLOODLOSS_MEDIUM_WOUNDS * (_x select 1))) + ((BLOODLOSS_LARGE_WOUNDS * (_x select 2))) * (_cardiacOutput / DEFAULT_CARDIAC_OUTPUT)); + }; +}foreach _openWounds; + +// cap the blood loss to be no greater as the current cardiac output +(_totalBloodLoss min _cardiacOutput); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getDragOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getDragOptions_CMS.sqf new file mode 100644 index 0000000000..427dc219dc --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getDragOptions_CMS.sqf @@ -0,0 +1,42 @@ +/** + * fn_getDragOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return","_nameOfUnit","_unit"]; +_return = []; + +if (hasInterface) then { + //_unit = [player] call cse_fnc_getInteractionTarget; + _unit = CSE_SYS_MEDICAL_INTERACTION_TARGET; + if (!isNull _unit) then { + if (_unit != player && (_unit isKindOf "CaManBase")) then { + _nameOfUnit = [_unit] call cse_fnc_getName; + if (vehicle _unit == _unit) then { + if (([player] call cse_fnc_getCarriedObj) != _unit && (isNull ([player] call cse_fnc_getCarriedObj))) then { + + _return pushback [localize "STR_CSE_ACTION_DRAG_PATIENT","[_this select 1,_this select 0] call CSE_fnc_drag_CMS;",format[localize "STR_CSE_ACTION_DRAG_PATIENT_TOOLTIP",_nameOfUnit]]; + _return pushback [localize "STR_CSE_ACTION_CARRY_PATIENT","[_this select 1,_this select 0] call cse_fnc_carry_CMS;",format[localize "STR_CSE_ACTION_CARRY_PATIENT_TOOLTIP",_nameOfUnit]]; + if ([_unit, player] call cse_fnc_canPutInBodyBag_CMS) then { + _return pushback [localize "STR_CSE_ACTION_BODYBAG","[_this select 0,_this select 1] call cse_fnc_placeInBodyBag_CMS;",localize "STR_CSE_ACTION_BODYBAG_TOOLTIP"]; + }; + } else { + if (([player] call cse_fnc_getCarriedObj) == _unit) then { + _return pushback [localize "STR_CSE_ACTION_DROP_PATIENT","[_this select 1,_this select 0] call cse_fnc_drop_CMS;",format[localize "STR_CSE_ACTION_DROP_PATIENT_TOOLTIP",_nameOfUnit]]; + }; + }; + _return pushback [localize "STR_CSE_ACTION_LOAD_PATIENT","[_this select 1,_this select 0] call cse_fnc_load_CMS;",format[localize "STR_CSE_ACTION_LOAD_PATIENT_TOOLTIP",_nameOfUnit]]; + } else { + _return pushback [localize "STR_CSE_ACTION_UNLOAD_PATIENT","[_this select 1,_this select 0] call cse_fnc_unload_CMS;",format[localize "STR_CSE_ACTION_UNLOAD_PATIENT_TOOLTIP",_nameOfUnit]]; + }; + }; + _return = [_unit, "getDragOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; + }; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getExamineOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getExamineOptions_CMS.sqf new file mode 100644 index 0000000000..f5ef66b92b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getExamineOptions_CMS.sqf @@ -0,0 +1,22 @@ +/** + * fn_getExamineOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; + +_return pushback [localize "STR_CSE_ACTION_CHECK_PULSE","[_this select 1,_this select 0] call cse_fnc_checkPulse_CMS;",localize "STR_CSE_ACTION_CHECK_PULSE_TOOLTIP"]; + +_return pushback [localize "STR_CSE_ACTION_CHECK_BP","[_this select 1,_this select 0] call cse_fnc_checkBloodPressure_CMS;",localize "STR_CSE_ACTION_CHECK_BP_TOOLTIP"]; + +_return pushback [localize "STR_CSE_ACTION_CHECK_RESPONSE","[_this select 1,_this select 0] call cse_fnc_checkResponse_CMS;",localize "STR_CSE_ACTION_CHECK_RESPONSE_TOOLTIP"]; + +_return = [CSE_SYS_MEDICAL_INTERACTION_TARGET, "getExamineOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getMedicationOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getMedicationOptions_CMS.sqf new file mode 100644 index 0000000000..3705d15099 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getMedicationOptions_CMS.sqf @@ -0,0 +1,29 @@ +/** + * fn_getMedicationOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; +if (isNull ([player] call cse_fnc_getCarriedObj)) then { + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_morphine'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_MORPHINE","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_morphine'] call cse_fnc_medication_CMS;",localize "STR_CSE_ACTION_MORPHINE_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_atropine'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_ATROPINE","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_atropine'] call cse_fnc_medication_CMS;",localize "STR_CSE_ACTION_ATROPINE_TOOLTIP"]; + }; + if ([player,CSE_SYS_MEDICAL_INTERACTION_TARGET,'cse_epinephrine'] call cse_fnc_hasEquipment_CMS) then { + _return pushback [localize "STR_CSE_ACTION_EPINEPHRINE","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_epinephrine'] call cse_fnc_medication_CMS;",localize "STR_CSE_ACTION_EPINEPHRINE_TOOLTIP"]; + }; + + _return = [CSE_SYS_MEDICAL_INTERACTION_TARGET, "getMedicationOptions_CMS", _return] call cse_fnc_getOptionsForCategory_CMS; + + //_return set [count _return, ["Anti-Biotics","[_this select 0,_this select 1,call cse_fnc_getSelectedBodyPart_CMS,'cse_antiBiotics'] call cse_fnc_medication_CMS;","To counter infections"]]; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getOptionsForCategory_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getOptionsForCategory_CMS.sqf new file mode 100644 index 0000000000..868aa53835 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getOptionsForCategory_CMS.sqf @@ -0,0 +1,33 @@ +/** + * fn_getOptionsForCategory_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target", "_category", "_return", "_allow", "_resultsOfEH"]; +_target = _this select 0; +_category = _this select 1; +_return = _this select 2; + +_resultsOfEH = [[_target],_category] call cse_fnc_customEventHandler_F; +{ + { + if (count _x == 3) then { + _allow = true; + { + if (typeName _x != typeName "") exitwith { + _allow = false; + }; + }foreach _x; + if (_allow) then { + _return pushback _x; + }; + }; + }foreach _x; +}foreach _resultsOfEH; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getSelectedBodyPart_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getSelectedBodyPart_CMS.sqf new file mode 100644 index 0000000000..f9ffa3ee22 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getSelectedBodyPart_CMS.sqf @@ -0,0 +1,16 @@ +/** + * fn_getSelectedBodyPart_CMS.sqf + * @Descr: Get the current selected body part for client + * @Author: Glowbal + * + * @Arguments: [] + * @Return: STRING bodyPart selected + * @PublicAPI: true + */ + + + if (isnil "CSE_SELECTED_BODY_PART_CMS") then { + CSE_SELECTED_BODY_PART_CMS = "head"; + }; + +CSE_SELECTED_BODY_PART_CMS \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getToggleOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getToggleOptions_CMS.sqf new file mode 100644 index 0000000000..eace6ef0ed --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getToggleOptions_CMS.sqf @@ -0,0 +1,13 @@ +/** + * fn_getToggleOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_getTriageCardOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_getTriageCardOptions_CMS.sqf new file mode 100644 index 0000000000..7e3ddd11d4 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_getTriageCardOptions_CMS.sqf @@ -0,0 +1,16 @@ +/** + * fn_getTriageCardOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; + + + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_hasMedicalEnabled_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_hasMedicalEnabled_CMS.sqf new file mode 100644 index 0000000000..ba75151d6b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_hasMedicalEnabled_CMS.sqf @@ -0,0 +1,20 @@ +/** + * fn_hasMedicalEnabled_CMS.sqf + * @Descr: Check if unit has CMS enabled. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + + +private ["_unit", "_medicalEnabled"]; +_unit = _this select 0; + +_medicalEnabled = _unit getvariable "cse_sys_medical_enabled"; +if (isnil "_medicalEnabled") then { + (((CSE_ENABLE_SETTING_FORUNITS_CMS == 0 && (isPlayer _unit || (_unit getvariable ["cse_isDeadPlayer", false])))) || (CSE_ENABLE_SETTING_FORUNITS_CMS == 1)); +} else { + _medicalEnabled; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/fn_hasOpenWounds_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_hasOpenWounds_CMS.sqf new file mode 100644 index 0000000000..3470e2f634 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_hasOpenWounds_CMS.sqf @@ -0,0 +1,14 @@ +/** + * fn_hasOpenWounds_CMS.sqf + * @Descr: Check if unit has open wounds + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit to check)] + * @Return: BOOL + * @PublicAPI: true + */ + +private "_openWounds"; +_openWounds = [_this select 0,"cse_openWounds"] call cse_fnc_getvariable; + +({(((_x select 0) + (_x select 1) + (_x select 2)) > 0)}count _openWounds > 0); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_inMedicalFacility_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_inMedicalFacility_CMS.sqf new file mode 100644 index 0000000000..f13c3e7d44 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_inMedicalFacility_CMS.sqf @@ -0,0 +1,49 @@ +/** + * fn_inMedicalFacility_CMS.sqf + * @Descr: Checks if a unit is in a designated medical facility + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL true if unit is in a building or under a roof. + * @PublicAPI: true + */ + +private ["_unit","_eyePos","_objects","_isInBuilding","_medicalFacility"]; +_unit = [_this, 0, ObjNull, [ObjNull]] call BIS_fnc_Param; + +_eyePos = eyePos _unit; +_isInBuilding = false; + +_medicalFacility = + [ + "TK_GUE_WarfareBFieldhHospital_Base_EP1", + "TK_GUE_WarfareBFieldhHospital_EP1", + "TK_WarfareBFieldhHospital_Base_EP1", + "TK_WarfareBFieldhHospital_EP1", + "US_WarfareBFieldhHospital_Base_EP1", + "US_WarfareBFieldhHospital_EP1", + "MASH_EP1", + "MASH", + "Land_A_Hospital", + "CDF_WarfareBFieldhHospital", + "GUE_WarfareBFieldhHospital", + "INS_WarfareBFieldhHospital", + "RU_WarfareBFieldhHospital", + "USMC_WarfareBFieldhHospital" + ]; + +_objects = (lineIntersectsWith [_unit modelToWorld [0, 0, (_eyePos select 2)], _unit modelToWorld [0, 0, (_eyePos select 2) +10], _unit]); +{ + if (((typeOf _x) in _medicalFacility) || (_x getVariable ["cse_medical_facility",false])) exitwith { + _isInBuilding = true; + }; +}foreach _objects; +if (!_isInBuilding) then { + _objects = position _unit nearObjects 7.5; + { + if (((typeOf _x) in _medicalFacility) || (_x getVariable ["cse_medical_facility",false])) exitwith { + _isInBuilding = true; + }; + }foreach _objects; +}; +_isInBuilding \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_initForUnit_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_initForUnit_CMS.sqf new file mode 100644 index 0000000000..107fc20996 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_initForUnit_CMS.sqf @@ -0,0 +1,33 @@ +/** + * fn_initForUnit_CMS.sqf + * @Descr: Deprecated. Is no longer used, as we dropped init eventhandler methods. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_handler"]; + _unit = _this select 0; + if (!local _unit) exitwith {[format["UNIT IS NOT LOCAL: %1",_this]] call cse_fnc_debug;}; + if !(_unit isKindOf "CAManBase") exitwith{[format["UNIT IS NOT CAManBase: %1",_this]] call cse_fnc_debug;}; + if (isPlayer _unit) then { + [_unit] spawn { + disableSerialization; + _CMSFadingBlackUI = uiNamespace getVariable "CMSFadingBlackUI"; + if (!isnil "_CMSFadingBlackUI") then { + _ctrlFadingBlackUI = _CMSFadingBlackUI displayCtrl 11112; + 2 fadeSound 1; + _ctrlFadingBlackUI ctrlSetTextColor [0.0,0.0,0.0,0.0]; + }; + waituntil {!isnil "cse_fnc_effectsLoop_CMS"}; + [_this select 0] call cse_fnc_effectsLoop_CMS; + }; + }; + +{ + if(_x == "FirstAidKit" || {_x == "Medikit" || {_x isKindOf "FirstAidKit" || {_x isKindOf "Medikit"}}}) then { + _unit removeItem _x; + }; +}foreach (items _unit); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_isMedicalVehicle_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_isMedicalVehicle_CMS.sqf new file mode 100644 index 0000000000..cf498be577 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_isMedicalVehicle_CMS.sqf @@ -0,0 +1,15 @@ +/** + * fn_isMedicalVehicle_CMS.sqf + * @Descr: Check if vehicle is a medical vehicle + * @Author: Glowbal + * + * @Arguments: [vehicle OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_veh"]; +_veh = _this select 0; + +if !(_veh getvariable ["cse_medicalVehicle_CMS", true]) exitwith {false}; // exit in case the false is set. +((getNumber(configFile >> "CfgVehicles" >> typeOf _veh >> "cse_medicalVehicle") == 1) || (_veh getvariable ["cse_medicalVehicle_CMS", false])); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_medicClass_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_medicClass_CMS.sqf new file mode 100644 index 0000000000..b13c9b0c20 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_medicClass_CMS.sqf @@ -0,0 +1,31 @@ +/** + * fn_medicClass_CMS.sqf + * @Descr: Check if a unit is any medical class above normal. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_unit","_class","_return"]; +_unit = [_this, 0, objNull,[ObjNull]] call BIS_fnc_Param; + +if (isnil "CSE_ADVANCED_MEDICAL_ROLES_CMS") exitwith { + true; +}; + +if (CSE_ADVANCED_MEDICAL_ROLES_CMS) then { + _class = [_unit,"cse_medicClass"] call cse_fnc_getVariable; + _return = switch (_class) do { + case 0: {false}; + case 1: {true}; + case 2: {true}; + default {false}; + + }; +} else { + _return = true; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_onUnconscious_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_onUnconscious_CMS.sqf new file mode 100644 index 0000000000..a859c8b996 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_onUnconscious_CMS.sqf @@ -0,0 +1,14 @@ + +private ["_unit", "_state"]; +_unit = _this select 0; +_state = _this select 1; + +if (_state) then { + if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + if (random(1) >= 0.3) then { + _unit setvariable ["cse_airwayOccluded", true, true]; + }; + }; +} else { + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_placeInBodyBag_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_placeInBodyBag_CMS.sqf new file mode 100644 index 0000000000..0b385fa7a0 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_placeInBodyBag_CMS.sqf @@ -0,0 +1,41 @@ +/** + * fn_placeInBodyBag_CMS.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +private ["_unit","_caller"]; +_unit = _this select 0; +_caller = _this select 1; + +if !([_caller, "cse_itemBodyBag"] call cse_fnc_hasItem) exitwith {}; + +[_caller, "cse_itemBodyBag"] call cse_fnc_useItem; + +_nameOfUnit = [_unit] call cse_fnc_getName; +if (alive _unit) then { + // force kill the unit. + [_unit, true] call cse_fnc_setDead; +}; +_onPosition = getPos _unit; +_allVariables = [_unit] call cse_fnc_getAllSetVariables; +deleteVehicle _unit; + +_bodyBagCreated = createVehicle ["cse_bodyBag", _onPosition, [], 0, "NONE"]; +_bodyBagCreated setvariable ["cse_nameOfBody", _nameOfUnit, true]; + +{ +// [_bodyBagCreated,_x select 0, _x select 2] call cse_fnc_setVariable; +}foreach _allVariables; +// reset the position to ensure it is on the correct one. +_bodyBagCreated setPos _onPosition; + +[[_bodyBagCreated], "cse_fnc_revealObject_f", true] spawn bis_fnc_MP; + +_bodyBagCreated setvariable ["CSE_Logistics_Enable_drag", true, true]; + +_bodyBagCreated; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_playInjuredSound_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_playInjuredSound_CMS.sqf new file mode 100644 index 0000000000..06991a7497 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_playInjuredSound_CMS.sqf @@ -0,0 +1,74 @@ +/** + * fn_playInjuredSound_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit","_amountOfDamage","_bodyPartStatus","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound"]; +_unit = _this select 0; +if (!local _unit) exitwith{}; + +if ((_unit getvariable ["CSE_PLAYING_INJURED_SOUND_CMS",false])) exitwith {}; +_unit setvariable ["CSE_PLAYING_INJURED_SOUND_CMS",true]; +_availableSounds_A = [ + "WoundedGuyA_01", + "WoundedGuyA_02", + "WoundedGuyA_03", + "WoundedGuyA_04", + "WoundedGuyA_05", + "WoundedGuyA_06", + "WoundedGuyA_07", + "WoundedGuyA_08" +]; +_availableSounds_B = [ + "WoundedGuyB_01", + "WoundedGuyB_02", + "WoundedGuyB_03", + "WoundedGuyB_04", + "WoundedGuyB_05", + "WoundedGuyB_06", + "WoundedGuyB_07", + "WoundedGuyB_08" +]; +_availableSounds_C = [ + "WoundedGuyC_01", + "WoundedGuyC_02", + "WoundedGuyC_03", + "WoundedGuyC_04", + "WoundedGuyC_05" +]; + +_bodyPartStatus = [_unit,"cse_bodyPartStatus"] call cse_fnc_getvariable; + +_amountOfDamage = 0; +{ + _amountOfDamage = _amountOfDamage + _x; +}foreach _bodyPartStatus; + + +if (_amountOfDamage > 0) then { + _sound = ""; + if (_amountOfDamage > 1) then { + if (random(1) > 0.5) then { + _sound = _availableSounds_A select (round(random((count _availableSounds_A) - 1))); + } else { + _sound = _availableSounds_B select (round(random((count _availableSounds_B) - 1))); + }; + } else { + _sound = _availableSounds_B select (round(random((count _availableSounds_B) - 1))); + }; + [[_unit,_sound], "cse_fnc_broadcastSound3D_F", true, false] spawn BIS_fnc_MP; + if (_amountOfDamage < 1) then { + sleep 10; + sleep (random(50)); + } else { + sleep (60 / _amountOfDamage); + }; + +}; +_unit setvariable ["CSE_PLAYING_INJURED_SOUND_CMS",nil]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_setDead_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_setDead_CMS.sqf new file mode 100644 index 0000000000..c049473ae8 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_setDead_CMS.sqf @@ -0,0 +1,22 @@ +/** + * fn_setDead_CMS.sqf + * @Descr: Set a unit dead from within CMS. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit"]; +_unit = _this select 0; + +if (!alive _unit) exitwith{}; +if (!local _unit) exitwith {}; + +[_unit, "cse_pain",0,true] call cse_fnc_setVariable; +[_unit, "cse_heartRate",0,true] call cse_fnc_setVariable; +[_unit, "cse_bloodPressure", [0,0],true] call cse_fnc_setVariable; +[_unit, "cse_airway", 3, true] call cse_fnc_setVariable; + +[_unit] call cse_fnc_setDead; // calling framework function \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_setMedicRole_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_setMedicRole_CMS.sqf new file mode 100644 index 0000000000..3459341faf --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_setMedicRole_CMS.sqf @@ -0,0 +1,19 @@ +/** + * fn_setMedicRole_CMS.sqf + * @Descr: Register a unit as a medic + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (Any unit of type CAManBase), value NUMBER (0 is normal. 1 or above is medic)] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit","_value"]; +_unit = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param; +_value = [_this, 1, false,[false]] call BIS_fnc_param; + +if (_unit isKindOf "CaManBase") then { + if (_value) then { + _unit setvariable ["cse_medicClass",1,true]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/fn_updateAttributes_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/fn_updateAttributes_CMS.sqf new file mode 100644 index 0000000000..c68b15c954 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/fn_updateAttributes_CMS.sqf @@ -0,0 +1,209 @@ +/** + * fn_updateAttributes_CMS.sqf + * @Descr: This is the old update vitals script. It is here just in case we need to make the switch back to the old version but is not used. + * @Author: Glowbal + * @DEPRECATED + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: false + */ + + +// OLD ALGHORIM +private ["_unit","_bloodVolume","_bloodPressure","_bloodPressureLow","_bloodPressureHigh","_heartRate","_totalBloodLoss","_hrIncrease","_bpIncreaseHigh","_bpIncreaseLow","_speed","_ivVolume","_painStatus","_showedHint", "_modifier"]; +_unit = _this select 0; + +_bloodVolume = [_unit,"cse_bloodVolume"] call cse_fnc_getVariable; +_bloodPressure = [_unit,"cse_bloodPressure"] call cse_fnc_getVariable; +_bloodPressureLow = _bloodPressure select 0; +_bloodPressureHigh = _bloodPressure select 1; +_heartRate = [_unit,"cse_heartRate"] call cse_fnc_getVariable; +_painStatus = [_unit,"cse_pain",0] call cse_fnc_getVariable; +_totalBloodLoss = _unit call cse_fnc_getBloodLoss_CMS; +_hrIncrease = 0; +_bpIncreaseHigh = 0; +_bpIncreaseLow = 0; + +// _totalBloodLoss affecting Heart Rate and bloodpressure + + if (_totalBloodLoss >0.0) then { + if (_totalBloodLoss <0.5) then { + if (_heartRate < 126) then { + _hrIncrease = _hrIncrease + 0.5; + }; + } else { + if (_totalBloodLoss < 1) then { + if (_heartRate < 161) then { + _hrIncrease = _hrIncrease + 1; + }; + if (_bloodPressureLow > 60 && _bloodVolume < 95) then { + _bpIncreaseLow = _bpIncreaseLow - 0.5; + }; + } else { + if (_heartRate < 220) then { + _hrIncrease = _hrIncrease + 1.5; + }; + if (_bloodPressureLow > 60 && _bloodVolume < 95) then { + _bpIncreaseLow = _bpIncreaseLow - 2; + }; + }; + }; + }; + + if ((_totalBloodLoss == 0) && _bloodVolume > 80) then { + if (_bloodPressureLow < 80) then { + _bpIncreaseLow = _bpIncreaseLow + 1; + }; + if (_bloodPressureHigh < 120) then { + _bpIncreaseHigh = _bpIncreaseHigh + 1; + }; + if (_bloodPressureLow > 100) then { + _bpIncreaseLow = _bpIncreaseLow - 1; + }; + if (_bloodPressureHigh > 120) then { + _bpIncreaseHigh = _bpIncreaseHigh - 1; + }; + }; + + // affecting Heart Rate + if !(_unit getvariable ["cse_cardiacArrest",false]) then { + if (_bloodPressureLow > 50 && _bloodPressureHigh < 130) then { + if (_bloodPressureHigh > 70 && _bloodPressureHigh < 190) then { + _speed = abs(speed _unit); + if (_speed > 0 && _bloodVolume > 60) then { + if (_speed > 10 && (vehicle _unit == _unit)) then { + if (_heartRate <100) then { + _hrIncrease = _hrIncrease + (_speed/200); + }; + }; + } else { + if (_bloodVolume > 60 && _totalBloodLoss == 0) then { + if (_heartRate < (60 + round(random(10)))) then { + _hrIncrease = _hrIncrease + 0.2; + } else { + if (_heartRate > (77 + round(random(10)))) then { + _hrIncrease = _hrIncrease - 0.2; + }; + }; + }; + }; + if (_bloodVolume < 60 && _bloodPressureLow<60 && _bloodPressureHigh < 90 && _hrIncrease <1) then { + _hrIncrease = _hrIncrease + 1; + }; + if (_bloodVolume < 40) then { + _hrIncrease = _hrIncrease - 3; + }; + }; + } else { + }; + }; + + if (_heartRate > 10) then { + if (_totalBloodLoss == 0 && _hrIncrease>0) then { + _bpIncreaseLow = _bpIncreaseLow + (_hrIncrease/2); + _bpIncreaseHigh = _bpIncreaseHigh + (_hrIncrease/2) + }; + + if (_hrIncrease<0) then { + _bpIncreaseLow = _bpIncreaseLow - 0.5; + _bpIncreaseHigh = _bpIncreaseHigh - 1.5; + }; + if (_totalBloodLoss > 0 && _totalBloodLoss < 1 && _hrIncrease>0) then { + _bpIncreaseLow = _bpIncreaseLow + 0.03; + _bpIncreaseHigh = _bpIncreaseHigh + 0.03; + }; + }; + _showedHint = false; + if (_totalBloodLoss >0) then { + if !(_unit getvariable ["cse_isBleeding_CMS",false]) then { + [_unit, "cse_isBleeding_CMS",true] call cse_fnc_setVariable; + if (CSE_DISPLAY_ADDITIONAL_HINTS_CMS) then { + _showedHint = true; + [_unit,"Injured","You are bleeding!",1] call cse_fnc_sendDisplayMessageTo; + }; + }; + } else { + if (_unit getvariable ["cse_isBleeding_CMS",false]) then { + [_unit, "cse_isBleeding_CMS",false] call cse_fnc_setVariable; + }; + }; + if (_painStatus > 0) then { + if !(_unit getvariable ["cse_hasPain_CMS",false]) then { + [_unit, "cse_hasPain_CMS",true] call cse_fnc_setVariable; + if (CSE_DISPLAY_ADDITIONAL_HINTS_CMS && !_showedHint) then { + [_unit,"Injured","You are in Pain!",1] call cse_fnc_sendDisplayMessageTo; + }; + }; + + } else { + if (_unit getvariable ["cse_hasPain_CMS",false]) then { + [_unit, "cse_hasPain_CMS",false] call cse_fnc_setVariable; + }; + }; + +_modifier = 1; +if (!([_unit] call cse_fnc_isAwake)) then { + _modifier = 0.5; +}; + +_bloodVolume = _bloodVolume - (_totalBloodLoss * _modifier); + + _heartRate = _heartRate + (_hrIncrease * _modifier); + _bloodPressureLow = _bloodPressureLow + (_bpIncreaseLow * _modifier); + _bloodPressureHigh = _bloodPressureHigh + (_bpIncreaseHigh * _modifier); + // Safety checks, prefent values below zero + if (_bloodPressureLow <0) then { + _bloodPressureLow = 0; + }; + if (_bloodPressureHigh < _bloodPressureLow) then { + _bloodPressureHigh = _bloodPressureLow + 10; + }; + _bloodPressure = [_bloodPressureLow, _bloodPressureHigh]; + + if (_heartRate <0) then { + _heartRate = 0; + }; + +if (_bloodVolume < 100.0) then { + if (_bloodVolume <0) then { + _bloodVolume = 0; + }; + if (([_unit,"cse_salineIVVolume",0] call cse_fnc_getvariable) > 0) then { + _bloodVolume = _bloodVolume + 0.2; + _ivVolume = ([_unit,"cse_salineIVVolume",0] call cse_fnc_getvariable) - 0.2; + _unit setvariable ["cse_salineIVVolume",_ivVolume]; + }; + if (([_unit,"cse_plasmaIVVolume",0] call cse_fnc_getvariable) > 0) then { + _bloodVolume = _bloodVolume + 0.2; + _ivVolume = ([_unit,"cse_plasmaIVVolume",0] call cse_fnc_getvariable) - 0.2; + _unit setvariable ["cse_plasmaIVVolume",_ivVolume]; + }; + if (([_unit,"cse_bloodIVVolume",0] call cse_fnc_getvariable) > 0) then { + _bloodVolume = _bloodVolume + 0.2; + _ivVolume = ([_unit,"cse_bloodIVVolume",0] call cse_fnc_getvariable) - 0.2; + _unit setvariable ["cse_bloodIVVolume",_ivVolume]; + }; + +} else { + if (_bloodVolume > 100) then { + _bloodVolume = 100; + }; +}; + +if (_bloodVolume < 90) then { + if !(_unit getvariable ["cse_hasLostBlood_CMS",false]) then { + [_unit, "cse_hasLostBlood_CMS",true] call cse_fnc_setVariable; + }; +} else { + if (_unit getvariable ["cse_hasLostBlood_CMS",false]) then { + [_unit, "cse_hasLostBlood_CMS",false] call cse_fnc_setVariable; + }; +}; + +[_unit,"cse_bloodVolume",_bloodVolume] call cse_fnc_setVariable; +[_unit,"cse_bloodPressure",_bloodPressure] call cse_fnc_setVariable; +[_unit,"cse_heartRate",_heartRate] call cse_fnc_setVariable; + + +[_unit,_bloodVolume,_bloodPressure,_heartRate] call cse_fnc_bloodConditions_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignAirwayStatus_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignAirwayStatus_CMS.sqf new file mode 100644 index 0000000000..920dd3166c --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignAirwayStatus_CMS.sqf @@ -0,0 +1,25 @@ +/** + * fn_assignAirwayStatus_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit", "_amountOfDamage", "_typeOfInjury", "_bodyPartn","_airwayItem","_airwayStatus","_selection", "_airwayIncrease"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_typeOfInjury = _this select 2; +_bodyPartn = _this select 3; + +// only the head +if (_bodyPartn != 0) exitwith {}; + +if (_amountOfDamage > 0.4) then { + if (random(1) >= 0.8) then { + _unit setvariable ["cse_airwayCollapsed", true, true]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignFractures_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignFractures_CMS.sqf new file mode 100644 index 0000000000..6c180b81c0 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignFractures_CMS.sqf @@ -0,0 +1,69 @@ +/** + * fn_assignFractures_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit", "_amountOfDamage", "_typeOfInjury", "_bodyPartn","_amountOfBrokenBones","_fractures","_size","_selection"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_typeOfInjury = _this select 2; +_bodyPartn = _this select 3; +_amountOfBrokenBones = 1; +_size = 1; +if (_amountOfDamage > 0.05) then { + switch (_typeOfInjury) do { + case "Bullet": { + _amountOfBrokenBones = 1; + _size = round(random(2)); + }; + case "Grenade": { + _amountOfBrokenBones = 1; + _size = round(random(2)); + if (_size < 1) then { + _size = 1; + }; + }; + case "Explosive": { + _amountOfBrokenBones = 1; + _size = round(random(2)); + if (_size < 1) then { + _size = 1; + }; + }; + case "Shell": { + _amountOfBrokenBones = 1; + _size = round(random(2)); + if (_size < 1) then { + _size = 1; + }; + }; + case "Unknown": { + _amountOfBrokenBones = 1; + _size = round(random(1)); + }; + case "Crash": { + _amountOfBrokenBones = 0; + _size = round(random(0)); + }; + default { + _amountOfBrokenBones = 1; + _size = round(random(1)); + }; + }; + if (_size > 2) then { + _size = 3; + }; + + _fractures = [_unit,"cse_fractures"] call cse_fnc_getVariable; + _selection = _fractures select _bodyPartn; + _selection set [ _size, (_selection select _size) + _amountOfBrokenBones ]; + _fractures set [ _bodyPartn , _selection]; + + [_unit, "cse_fractures",_fractures] call cse_fnc_setVariable; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignOpenWounds_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignOpenWounds_CMS.sqf new file mode 100644 index 0000000000..17727c581f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_assignOpenWounds_CMS.sqf @@ -0,0 +1,70 @@ +/** + * fn_assignOpenWounds_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit", "_amountOfDamage", "_typeOfInjury", "_bodyPartn","_sizeOfWound","_amountOfNewWounds", "_return"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_typeOfInjury = _this select 2; +_bodyPartn = _this select 3; +_sizeOfWound = 0; +_amountOfNewWounds = 0; + +_return = false; +if (_amountOfDamage > 0.05) then { + switch (_typeOfInjury) do { + case "Bullet": { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(2)); + }; + case "Grenade": { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(2)); + if (_sizeOfWound < 1) then { + _sizeOfWound = 1; + }; + }; + case "Explosive": { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(2)); + if (_sizeOfWound < 1) then { + _sizeOfWound = 1; + }; + }; + case "Shell": { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(2)); + if (_sizeOfWound < 1) then { + _sizeOfWound = 1; + }; + }; + case "Unknown": { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(1)); + }; + case "VehicleCrash": { + _amountOfNewWounds = if (random(1)>=0.5) then{0}else{1}; + _sizeOfWound = round(random(1)); + }; + default { + _amountOfNewWounds = 1; + _sizeOfWound = round(random(1)); + }; + }; + if (_sizeOfWound > 2) then { + _sizeOfWound = 3; + }; + if (_amountOfNewWounds>0) then { + [_unit, _bodyPartn, _sizeOfWound, _amountOfNewWounds] call cse_fnc_addOpenWounds_CMS; + _return = true; + }; +}; + +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_damageBodyPart_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_damageBodyPart_CMS.sqf new file mode 100644 index 0000000000..6796d65f3a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_damageBodyPart_CMS.sqf @@ -0,0 +1,24 @@ + +private ["_unit", "_bodyPart", "_amountOfDamage"]; +_unit = _this select 0; +_bodyPart = _this select 1; +_amountOfDamage = _this select 2; +if (alive _unit) then { + _hitPointName = switch (_bodyPart) do { + case 0: {"hitHead"}; + case 1: {"hitBody"}; + case 2: {"hitHands"}; + case 3: {"hitHands"}; + case 4: {"hitLegs"}; + case 5: {"hitLegs"}; + default {"hitLegs"}; + }; + + if (_amountOfDamage < 0.95) then { + _unit setHitPointDamage [_hitPointName, _amountOfDamage]; + _unit setHit [_selectionName, _amountOfDamage]; + } else { + _unit setHitPointDamage [_hitPointName, 0.95]; + _unit setHit [_selectionName, 0.95]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfFatal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfFatal_CMS.sqf new file mode 100644 index 0000000000..ba0f005d9f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfFatal_CMS.sqf @@ -0,0 +1,41 @@ +/** + * fn_determineIfFatal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define DEFAULT_DAMAGE_THRESHOLD 1 + +private ["_unit","_part","_damageThreshold"]; +_unit = _this select 0; +_part = _this select 1; + +if (!alive _unit) exitwith {true}; + +if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; + +// Find the correct Damage threshold for unit. +_damageThreshold = [1,1,1]; +if (isPlayer _unit) then { + _damageThreshold =_unit getvariable["cse_damageThresholds_players_cms", [CSE_DAMAGE_THRESHOLD_PLAYERS_DMG, CSE_DAMAGE_THRESHOLD_PLAYERS_DMG, CSE_DAMAGE_THRESHOLD_PLAYERS_DMG]]; +} else { + _damageThreshold =_unit getvariable["cse_damageThresholds_AI_cms", [CSE_DAMAGE_THRESHOLD_AI_DMG, CSE_DAMAGE_THRESHOLD_AI_DMG, CSE_DAMAGE_THRESHOLD_AI_DMG]]; +}; + +_damageBodyPart = ([_unit,"cse_bodyPartStatus",[0,0,0,0,0,0]] call cse_fnc_getVariable) select _part; + +// Check if damage to body part is higher as damage head +if (_part == 0) exitwith { + (_damageBodyPart >= (_damageThreshold select 0) && {(random(1) > 0.2)}); +}; + +// Check if damage to body part is higher as damage torso +if (_part == 1) exitwith { + (_damageBodyPart >= (_damageThreshold select 1) && {(random(1) > 0.2)}); +}; +// Check if damage to body part is higher as damage limbs +(_damageBodyPart >= (_damageThreshold select 2) && {(random(1) > 0.95)}); diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfUnconscious_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfUnconscious_CMS.sqf new file mode 100644 index 0000000000..dd0ece2d92 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_determineIfUnconscious_CMS.sqf @@ -0,0 +1,38 @@ +/** + * fn_determineIfUnconscious_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_part","_damageThreshold"]; +_unit = _this select 0; +_part = _this select 1; + +if (!alive _unit) exitwith { true }; + +if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true }; + +// Find the correct Damage threshold for unit. +_damageThreshold = if (isPlayer _unit) then { + missionNamespace getvariable["cse_damageThresholds_players_cms", [CSE_DAMAGE_THRESHOLD_PLAYERS_DMG, CSE_DAMAGE_THRESHOLD_PLAYERS_DMG, CSE_DAMAGE_THRESHOLD_PLAYERS_DMG]]; +} else { + missionNamespace getvariable["cse_damageThresholds_AI_cms", [CSE_DAMAGE_THRESHOLD_AI_DMG, CSE_DAMAGE_THRESHOLD_AI_DMG, CSE_DAMAGE_THRESHOLD_AI_DMG]]; +}; + +_damageBodyPart = ([_unit,"cse_bodyPartStatus",[0,0,0,0,0,0]] call cse_fnc_getVariable) select _part; + +// Check if damage to body part is higher as damage head +if (_part == 0) exitwith { + ((_damageBodyPart * CSE_MEDICAL_DIFFICULTY) >= ((_damageThreshold select 0) * 0.7) && {(random(1) > 0.35)}); +}; + +// Check if damage to body part is higher as damage torso +if (_part == 1) exitwith { + ((_damageBodyPart * CSE_MEDICAL_DIFFICULTY) >= ((_damageThreshold select 1) * 0.5) && {(random(1) > 0.4)}); +}; +// Check if damage to body part is higher as damage limbs +((_damageBodyPart * CSE_MEDICAL_DIFFICULTY) >= ((_damageThreshold select 2) * 0.8) && {(random(1) > 0.7)}); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getBodyPartNumber_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getBodyPartNumber_CMS.sqf new file mode 100644 index 0000000000..fbd8e3b0c1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getBodyPartNumber_CMS.sqf @@ -0,0 +1,53 @@ +/** + * fn_getBodyPartNumber_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_selectionName","_part"]; +_selectionName = _this select 0; + + _part = -1; + _part = switch (_selectionName) do { + case "head": { + 0 + }; + case "body": { + 1 + }; + case "hands": { + if (random(1)>0.499) then { + 2 + } else { + 3 + }; + }; + case "hand_l": { + 2 + }; + case "hand_r": { + 3 + }; + case "legs": { + if (random(1)>0.499) then { + 4 + } else { + 5 + }; + }; + case "leg_l": { + 4 + }; + case "leg_r": { + 5 + }; + default { + -1 + }; + }; +_part \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getNewDamageBodyPart_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getNewDamageBodyPart_CMS.sqf new file mode 100644 index 0000000000..4408d288f1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getNewDamageBodyPart_CMS.sqf @@ -0,0 +1,27 @@ +/** + * fn_getNewDamageBodyPart_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit","_selectionName","_newDamage", "_previousDamage", "_origDamage"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_number = _this select 2; + +_previousDamage = _unit getvariable ["cse_bodyPartStatusPrevious_cms", [0,0,0,0,0,0]]; +_newDamage = _amountOfDamage - (_previousDamage select _number); +_previousDamage set [_number, _newDamage]; +[_unit,"cse_bodyPartStatusPrevious_cms",_previousDamage] call cse_fnc_setVariable; + + +_origDamage = [_unit,"cse_bodyPartStatus",[0,0,0,0,0,0]] call cse_fnc_getVariable; +_origDamage set [_number, (_origDamage select _number) + _newDamage]; /* We are storing the total Damage done on a body part for determining the damage properly */ +[_unit,"cse_bodyPartStatus",_origDamage] call cse_fnc_setVariable; + +_newDamage \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getTypeOfDamage_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getTypeOfDamage_CMS.sqf new file mode 100644 index 0000000000..9adbcfb217 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_getTypeOfDamage_CMS.sqf @@ -0,0 +1,29 @@ +/** + * fn_getTypeOfDamage_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_typeOfProjectile","_typeOfInjury"]; +_typeOfProjectile = _this select 0; +_typeOfInjury = switch (true) do { + case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"}; + case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"}; + case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"}; + case (_typeOfProjectile iskindof "MineCore"): {"Explosive"}; + case (_typeOfProjectile iskindof "FuelExplosion"): {"Explosive"}; + case (_typeOfProjectile iskindof "ShellBase"): {"Shell"}; + case (_typeOfProjectile iskindof "RocketBase"): {"Explosive"}; + case (_typeOfProjectile iskindof "MissileBase"): {"Explosive"}; + case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"}; + case (_typeOfProjectile iskindof "BombCore"): {"Explosive"}; + case (_typeOfProjectile iskindof "Grenade"): {"Grenade"}; + case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"}; + default {"Unknown"}; +}; +_typeOfInjury \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_handleDamage_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_handleDamage_CMS.sqf new file mode 100644 index 0000000000..12979ebf57 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_handleDamage_CMS.sqf @@ -0,0 +1,81 @@ +/** + * fn_handleDamage_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage", "_typeOfProjectile","_bodyPartn","_newDamage","_typeOfDamage","_caliber", "_hitPointName", "_returnDamage", "_varCheck"]; +_unit = _this select 0; +_selectionName = _this select 1; +_amountOfDamage = _this select 2; +_sourceOfDamage = _this select 3; +_typeOfProjectile = _this select 4; +_returnDamage = _amountOfDamage; + +_bodyPartn = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; + + +// Check for vehicle crash +if (vehicle _unit != _unit && {_bodyPartn < 0} && {isNull _sourceOfDamage} && {_typeOfProjectile == ""} && {_selectionName == ""}) then { + if (CSE_ALLOW_VEH_CRASH_INJURIES_CMS) then { + _bodyPartn = if (random(1)>=0.5) then { 0 } else { 1 }; + _typeOfProjectile = "VehicleCrash"; + }; +}; + +// If it is not a valid bodyPart number, exit because we cannot do anything with it. +if (_bodyPartn < 0) exitwith {0}; + +// Most likely taking exessive fire damage. Lets exit. +if (isNull _sourceOfDamage && (_selectionName == "head" || isBurning _unit) && _typeOfProjectile == "" && vehicle _unit == _unit) exitwith { + 0 +}; // Prefent excessive fire damage + +if (local _unit && {([_unit] call cse_fnc_hasMedicalEnabled_CMS)}) then { + if (_amountOfDamage < 0) then { + _amountOfDamage = 0; + }; + + // Ensure damage is being handled correctly. + [_unit, _bodyPartn, _amountOfDamage] call cse_fnc_damageBodyPart_CMS; + _newDamage = [_unit, _amountOfDamage, _bodyPartn] call cse_fnc_getNewDamageBodyPart_CMS; + + // figure out the type of damage so we can use that to determine what injures should be given. + _typeOfDamage = [_typeOfProjectile] call cse_fnc_getTypeOfDamage_CMS; + + if !([_unit, _newDamage, _typeOfDamage, _bodyPartn] call cse_fnc_assignOpenWounds_CMS) then { + _returnDamage = 0; + }; + + //[_unit,_newDamage,_typeOfDamage,_bodyPartn] call cse_fnc_assignFractures_CMS; + if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + [_unit, _amountOfDamage, _typeOfDamage, _bodyPartn] call cse_fnc_assignAirwayStatus_CMS; + }; + [_unit,_newDamage,_bodyPartn] call cse_fnc_increasePain_CMS; + + if (([_unit, _bodyPartn] call cse_fnc_determineIfFatal_CMS) || !(alive (vehicle _unit))) then { + [_unit] call cse_fnc_setDead_CMS; + _returnDamage = 1; + } else { + [_unit] call cse_fnc_unitLoop_CMS; + if ([_unit, _bodyPartn] call cse_fnc_determineIfUnconscious_CMS) then { + [_unit] call cse_fnc_setUnconsciousState; + } else { + [_unit,_newDamage] call cse_fnc_reactionToHit_CMS; + }; + if (_returnDamage > 0.95) then { + _returnDamage = 0.95; + }; + }; + + if (!(alive (vehicle _unit))) then { + _returnDamage = 1; + [_unit] call cse_fnc_setDead_CMS; + }; +}; + +_returnDamage \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_increasePain_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_increasePain_CMS.sqf new file mode 100644 index 0000000000..b41934f512 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_increasePain_CMS.sqf @@ -0,0 +1,40 @@ +/** + * fn_increasePain_CMS.sqf + * @Descr: Increase the pain level of a unit + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, amount NUMBER, sectionName NUMBER (Also supports string representation of bodyparts)] + * @Return: nil + * @PublicAPI: true + */ + +private ["_unit","_amountOfDamage","_selectionName","_sourceOfDamage","_painStatus"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_selectionName = _this select 2; +_amountOfDamage = _amountOfDamage * 10; +if (!alive _unit || (_amountOfDamage <= 0)) exitwith{}; +_painStatus = [_unit,"cse_pain",0] call cse_fnc_getVariable; + +if (typeName _selectionName == "STRING") then { + _selectionName = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; +}; + +_painStatus = switch (_selectionName) do { + case 0: { + _painStatus + (_amountOfDamage*1.5); + }; + case 1: { + _painStatus + (_amountOfDamage*0.9); + }; + case 2: { + _painStatus + (_amountOfDamage*0.8); + }; + case 3: { + _painStatus + (_amountOfDamage*0.7); + }; + default {_painStatus}; +}; + +[_unit,"cse_pain",_painStatus] call cse_fnc_setVariable; +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/handledamage/fn_reactionToHit_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_reactionToHit_CMS.sqf new file mode 100644 index 0000000000..b3d7959654 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/handledamage/fn_reactionToHit_CMS.sqf @@ -0,0 +1,49 @@ +/** + * fn_reactionToHit_CMS.sqf + * @Descr: triggers a reaction to being hit for a unit and spawns on screen effects. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_amountOfDamage"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; + +if (_amountOfDamage > 0.2) then { + [_unit] spawn cse_fnc_playInjuredSound_CMS; + if ((vehicle _unit) isKindOf "StaticWeapon") exitwith { + if (_amountOfDamage > 1) then { + _unit action ["eject", vehicle _unit]; + unassignVehicle _unit; + }; + }; + if (animationState _unit in ["ladderriflestatic","laddercivilstatic"]) exitwith { + _unit action ["ladderOff", (nearestBuilding _unit)]; + }; + + if (vehicle _unit == _unit && [_unit] call cse_fnc_isAwake) then { + if (random(1) > 0.5) then { + _unit setDir ((getDir _unit) + 1 + random(30)); + } else { + _unit setDir ((getDir _unit) - (1 + random(30))); + }; + }; + if (_amountOfDamage > 0.6) then { + if (random(1)>0.6) then { + [_unit] call cse_fnc_setProne; + }; + }; + if (isPlayer _unit) then { + 76 cutRsc ["RscCSEScreenEffectsHit","PLAIN"]; + addCamShake [3, 5, _amountOfDamage + random 10]; + }; +} else { + if (_amountOfDamage > 0) then { + if (isPlayer _unit) then { + 76 cutRsc ["RscCSEScreenEffectsHit","PLAIN"]; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_addInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_addInjury.sqf new file mode 100644 index 0000000000..d72d5dd393 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_addInjury.sqf @@ -0,0 +1,11 @@ + + +_unit = _this select 0; +_injury = _this select 1; +// TODO implement injury vertifying check - is this a correct form of the injury? +/* Injury map: + +*/ +_injuryVector = _unit getvariable ["cse_injuryVector",[]]; +_injuryVector pushback _injury; +[_unit,"cse_injuryVector",_injuryVector] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_createInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_createInjury.sqf new file mode 100644 index 0000000000..c0a6bb1a4d --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_createInjury.sqf @@ -0,0 +1,22 @@ + +private ["_injury","_injuryType","_bodyPart","_id"]; + +_bodyPart = _this select 0; +_injuryType = _this select 1; +_souceType = _this select 2; + +/* Injury map: + +*/ +if (isnil "CSE_INJURY_ID_COUNTER_CMS") then { + CSE_INJURY_ID_COUNTER_CMS = 0; + CSE_INJURY_CREATION_MUTEX_CMS = false; +}; +waituntil{!CSE_INJURY_CREATION_MUTEX_CMS}; +CSE_INJURY_CREATION_MUTEX_CMS = true; + _id = CSE_INJURY_ID_COUNTER_CMS + round(random(100)); /* implement ID creation check */ + _injury = [_id, _bodyPart, _injuryType, _souceType , 1]; + CSE_INJURY_ID_COUNTER_CMS = _id; +CSE_INJURY_CREATION_MUTEX_CMS = false; + +_injury \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBlastDamageInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBlastDamageInjury.sqf new file mode 100644 index 0000000000..3ef1ffc258 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBlastDamageInjury.sqf @@ -0,0 +1,169 @@ +#include "cse\cse_sys_medical\injuryTypes.h" +#include "cse\cse_sys_medical\bodyParts.h" + +private ["_bodyPart","_damage","_injuryTypeReturn"]; +_bodyPart = _this select 0; +_damage = _this select 1; +_distance = _this select 2; + +_injuryTypeReturn = []; +if (_damage >0.2) then { + switch (_bodyPart) do { + case HEAD: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + case TORSO: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + case ARM_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + case ARM_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + case LEG_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + case LEG_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, HIGH_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + }; + }; + }; + }; + + default {}; + }; +} else { + if (_damage >0.01) then { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_BURN]; + }; + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCHRAPNEL_WOUND]; + }; + }; +}; + +_injuryTypeReturn \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBulletInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBulletInjury.sqf new file mode 100644 index 0000000000..0a4a65a23b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findBulletInjury.sqf @@ -0,0 +1,119 @@ +#include "cse\cse_sys_medical\injuryTypes.h" +#include "cse\cse_sys_medical\bodyParts.h" + +private ["_bodyPart","_damage","_injuryTypeReturn"]; +_bodyPart = _this select 0; +_damage = _this select 1; +_distance = _this select 2; + +_injuryTypeReturn = []; +if (_damage >0.2) then { + switch (_bodyPart) do { + case HEAD: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + case TORSO: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + case ARM_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + case ARM_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + case LEG_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + case LEG_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, LARGE_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_GSW]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_GSW]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_BURN]; + _injuryTypeReturn set [count _injuryTypeReturn, GRAZE_WOUND]; + }; + }; + }; + }; + default {}; + }; +} else { + if (_damage >0.01) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_BURN]; + }; + }; +}; + +_injuryTypeReturn \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findInjuryType.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findInjuryType.sqf new file mode 100644 index 0000000000..fb67efde9f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findInjuryType.sqf @@ -0,0 +1,32 @@ + +private ["_bodyPart","_typeOfInjury","_distance","_damage","_return"]; +_bodyPart = _this select 0; +_typeOfInjury = _this select 1; +_damage = _this select 2; +_distance = _this select 3; + +_return = []; +switch (_typeOfInjury) do { + case "Bullet": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findBulletInjury; + }; + case "Grenade": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findBlastDamageInjury; + }; + case "Explosive": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findBlastDamageInjury; + }; + case "Shell": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findBlastDamageInjury; + }; + case "Unknown": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findUnknownTypeInjury; + }; + case "Crash": { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findUnknownTypeInjury; + }; + default { + _return = [_bodyPart, _damage,_distance] call cse_fnc_findUnknownTypeInjury; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findUknownTypeInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findUknownTypeInjury.sqf new file mode 100644 index 0000000000..5430ea7da3 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_findUknownTypeInjury.sqf @@ -0,0 +1,112 @@ +#include "cse\cse_sys_medical\injuryTypes.h" +#include "cse\cse_sys_medical\bodyParts.h" + +private ["_bodyPart","_damage","_injuryTypeReturn"]; +_bodyPart = _this select 0; +_damage = _this select 1; +_distance = _this select 2; + +_injuryTypeReturn = []; +if (_damage >0.2) then { + switch (_bodyPart) do { + case HEAD: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + case TORSO: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + case ARM_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + case ARM_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + case LEG_R: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + case LEG_L: { + if (_damage > 0.4) then { + _injuryTypeReturn set [count _injuryTypeReturn, MEDIUM_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_OPEN_WOUND]; + } else { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + } else { + _injuryTypeReturn set [count _injuryTypeReturn, MINOR_CUT]; + }; + }; + }; + }; + default {}; + }; +} else { + if (_damage >0.01) then { + if (random(1)>0.5) then { + _injuryTypeReturn set [count _injuryTypeReturn, SCRATCH]; + }; + }; +}; + +_injuryTypeReturn \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_getAllIInjuriesOnBodyPart.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_getAllIInjuriesOnBodyPart.sqf new file mode 100644 index 0000000000..c913b441d7 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_getAllIInjuriesOnBodyPart.sqf @@ -0,0 +1,16 @@ +_unit = _this select 0; +_bodyPart = _this select 1; + + +/* Injury map: + +*/ +_injuryVector = _unit getvariable ["cse_injuryVector",[]]; +_return = []; +{ + if (_bodyPart == (_x select 1)) then { + _return set [ count _return, _x]; + }; +}foreach _injuryVector; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_removeInjury.sqf b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_removeInjury.sqf new file mode 100644 index 0000000000..ec5c561942 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/injuryVector/fn_removeInjury.sqf @@ -0,0 +1,20 @@ + +private ["_unit","_injuryID","_toRemove"]; +_unit = _this select 0; +_injuryID = _this select 1; +/* Injury map: + +*/ +_injuryVector = _unit getvariable ["cse_injuryVector",[]]; +_toRemove = -1; +{ + if (_injuryID == (_x select 0)) then { + _toRemove = _forEachIndex; + }; +}foreach _injuryVector; + +if (_toRemove > 0) then { + _injuryVector set [_toRemove, objNull]; + _injuryVector = _injuryVector - [ObjNull]; + [_unit,"cse_injuryVector",_injuryVector] call cse_fnc_setVariable; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/loading/fn_loadLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/loading/fn_loadLocal_CMS.sqf new file mode 100644 index 0000000000..a327bfec1a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/loading/fn_loadLocal_CMS.sqf @@ -0,0 +1,42 @@ +/** + * fn_loadLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +// NO LONGER USED. + +private ["_unit","_vehicle","_caller"]; +_unit = _this select 0; +_vehicle = _this select 1; +_caller = _this select 2; + +[_unit,_vehicle,_caller] spawn { + [_this] call cse_fnc_debug; + private ["_unit","_vehicle","_caller"]; + _unit = _this select 0; + _vehicle = _this select 1; + _caller = _this select 2; + + //_dead = false; + //if !(alive _unit) then { + //_dead = true; + //_unit = [_unit,_caller] call cms_fnc_switchDeadBody; + //_unit setvariable ["cms_isDead", true,true]; + //}; + + _unit moveInCargo _vehicle; + _loaded = _vehicle getvariable ["cse_loaded_casualties_CMS",[]]; + _loaded pushback _unit; + _vehicle setvariable ["cse_loaded_casualties_CMS",_loaded,true]; + + if (!([_unit] call cse_fnc_isAwake)) then { + waituntil {vehicle _unit == _vehicle}; + [_unit,([_unit] call cse_fnc_getDeathAnim)] call cse_fnc_broadcastAnim; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/loading/fn_load_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/loading/fn_load_CMS.sqf new file mode 100644 index 0000000000..9a21063660 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/loading/fn_load_CMS.sqf @@ -0,0 +1,34 @@ +/** + * fn_load_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller", "_unit","_vehicle", "_loaded"]; +_caller = _this select 0; +_unit = _this select 1; + +if ([_unit] call cse_fnc_isAwake) exitwith { + hintSilent "This person is awake and cannot be loaded"; +}; + +[_caller,objNull] call cse_fnc_carryObj; +[_unit,objNull] call cse_fnc_carryObj; +waituntil {(isNull (_unit getvariable ["cse_beingCarried_CMS", objNull]))}; + +_vehicle = [_caller, _unit] call cse_fnc_loadPerson_F; +if (!isNull _vehicle) then { + _loaded = _vehicle getvariable ["cse_loaded_casualties_CMS",[]]; + _loaded pushback _unit; + _vehicle setvariable ["cse_loaded_casualties_CMS",_loaded,true]; + + if (!isnil "CSE_DROP_ADDACTION_CMS") then { + _caller removeAction CSE_DROP_ADDACTION_CMS; + CSE_DROP_ADDACTION_CMS = nil; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/loading/fn_unload_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/loading/fn_unload_CMS.sqf new file mode 100644 index 0000000000..31317da65f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/loading/fn_unload_CMS.sqf @@ -0,0 +1,37 @@ +/** + * fn_unload_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller", "_unit","_vehicle", "_drag", "_handle"]; +_caller = [_this, 0, ObjNull,[ObjNull]] call BIS_fnc_Param; +_unit = [_this, 1, ObjNull,[ObjNull]] call BIS_fnc_Param; +_drag = [_this, 2, false, [false]] call BIS_fnc_Param; + +// cannot unload a unit not in a vehicle. +if (vehicle _unit == _unit) exitwith {}; + +if (([_unit] call cse_fnc_isAwake)) exitwith {}; + +_vehicle = vehicle _unit; +if ([_caller, _unit] call cse_fnc_unloadPerson_F) then { + _loaded = _vehicle getvariable ["cse_loaded_casualties_CMS",[]]; + _loaded = _loaded - [_unit]; + _vehicle setvariable ["cse_loaded_casualties_CMS",_loaded,true]; + if (_drag) then { + if ((vehicle _caller) == _caller) then { + _handle = [_caller, _unit] spawn { + _caller = _this select 0; + _unit = _this select 1; + waituntil {(vehicle _unit == _unit)}; + [[_caller,_unit], "cse_fnc_drag_CMS", _caller, false] spawn BIS_fnc_MP; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageLocal_CMS.sqf new file mode 100644 index 0000000000..de07ff3034 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageLocal_CMS.sqf @@ -0,0 +1,120 @@ +/** + * fn_bandageLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_treatingPerson","_injuredPerson","_part","_selectionName","_openWounds","_woundsArray","_highest_amount","_highestSpot","_collectiveImpact", "_highestTotal","_totalNumber", "_selectedData"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_selectedData = [_this, 4, "", [""]] call BIS_fnc_Param; + +if (!local _injuredPerson) exitwith{["fnc_bandageLocal called on non local machine",3] call cse_fnc_debug; }; +[_injuredPerson] spawn cse_fnc_unitLoop_CMS; +if (_treatingPerson != _injuredPerson) then { + [_injuredPerson,"STR_CSE_CMS_BANDAGING", "STR_CSE_CMS_IS_BANDAGING_YOU", 0, [[_treatingPerson] call cse_fnc_getName]] call cse_fnc_sendDisplayMessageTo; +}; +[_this] call cse_fnc_debug; + +[_injuredPerson,_removeItem] call cse_fnc_addToTriageList_CMS; +_collectiveImpact = switch (_removeItem) do { + case "cse_packing_bandage": {[1.0, 1.5, 1.2]}; + case "cse_bandageElastic": {[1.3, 0.9, 0.9]}; + case "cse_bandage_basic": {[1.5, 1.0, 0.6]}; + case "cse_stitching": {[2.0, 2.0, 2.0]}; + case "cse_quikclot": {[0.9, 0.3, 0.3]}; + default {[0.9, 0.5, 0.5]}; + }; + _part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; + + _openWounds = [_injuredPerson,"cse_openWounds"] call cse_fnc_getvariable; + _woundsArray = _openWounds select _part; + + _highestSpot = 0; + _highest_amount = 0; + { + if (_x > _highest_amount) then { + _highestSpot = _foreachIndex; + _highest_amount = _x; + }; + }foreach _woundsArray; + + if (_selectedData != "") then { + [format["CUSTOM STUFF: %1", _selectedData]] call cse_fnc_debug; + _highestSpot = switch (_selectedData) do { + case "open_wound_0": {0}; + case "open_wound_1": {1}; + case "open_wound_2": {2}; + default {_highestSpot}; + }; + }; + + if (_highest_amount == 0 && CSE_BANDAGING_AID_CMS) then { + _highestTotal = 0; + { + _totalNumber = 0; + { + _totalNumber = _totalNumber + _x; + }foreach _x; + if (_totalNumber > _highestTotal) then { + _part = _foreachIndex; + _highestTotal = _totalNumber; + }; + }foreach _openWounds; + _woundsArray = _openWounds select _part; + _highestSpot = 0; + _highest_amount = 0; + { + if (_x > _highest_amount) then { + _highestSpot = _foreachIndex; + _highest_amount = _x; + }; + }foreach _woundsArray; + }; + + _impactOfBandage = (_collectiveImpact select _highestSpot); + + _wounds = _woundsArray select _highestSpot; + _amountOfInpact = 0; + if (_wounds >0) then { + [_injuredPerson,"treatment",format["%2 has bandaged a wound on %1",[_part] call cse_fnc_fromNumberToBodyPart_CMS,[_treatingPerson] call cse_fnc_getName]] call cse_fnc_addActivityToLog_CMS; + + _amountOfInpact = _impactOfBandage; + if (_impactOfBandage > _wounds) then { + _amountOfInpact = _wounds; + }; + }; + _wounds = (_wounds - _impactOfBandage); + if (_wounds < 0) then { + _wounds = 0; + }; + _woundsArray set[_highestSpot, _wounds]; + _openWounds set [_part, _woundsArray]; + [_injuredPerson,"cse_openWounds",_openWounds] call cse_fnc_setvariable; + if (isnil "CSE_ADVANCED_WOUNDS_SETTING_CMS") then { + CSE_ADVANCED_WOUNDS_SETTING_CMS = true; + }; + if (_amountOfInpact > 0.0 && CSE_ADVANCED_WOUNDS_SETTING_CMS) then { + _bandagedWounds = [_injuredPerson,"cse_bandagedWounds"] call cse_fnc_getvariable; + _bandagedPart = _bandagedWounds select _part; + if (_highestSpot > 0) then { + _bandagedWound = _bandagedPart select _highestSpot; + _bandagedWound = _bandagedWound + _amountOfInpact; + _bandagedPart set [_highestSpot,_bandagedWound]; + _bandagedWounds set[_part,_bandagedPart]; + [_injuredPerson,"cse_bandagedWounds",_bandagedWounds] call cse_fnc_setvariable; + [_injuredPerson, _amountOfInpact,_part,_highestSpot, _removeItem] spawn cse_fnc_bandageOpening_CMS; + }; + }; + + if (!([_injuredPerson] call cse_fnc_hasOpenWounds_CMS)) then { + _injuredPerson setDamage 0; + }; + +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageOpening_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageOpening_CMS.sqf new file mode 100644 index 0000000000..b1af816d23 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandageOpening_CMS.sqf @@ -0,0 +1,76 @@ +/** + * fn_bandageOpening_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define CFG_DEFAULT_WAITING_TIME 900 + random(120) +#define WAITINGTIME 1 +#define RATIO 2 +#define CHANCE 3 + +private ["_person","_amount","_bodyPart","_woundClass","_item","_config","_found"]; +_person = _this select 0; +_amount = _this select 1; +_bodyPart = _this select 2; +_woundClass = _this select 3; +_item = _this select 4; + +// classname, waiting time until wound opens, ratio in which it start bleeding again, chance of the wound ever opening up // +_config = [ + ["cse_bandage_basic", 900 + random (120), 0.75, 0.4], + ["cse_packing_bandage", 1200 + random (120), 0.5, 0.6], + ["cse_bandageElastic", 900 + random (900), 0.75, 0.2], + ["cse_quikclot", 1, 0.1, 0] +]; +_found = false; +{ + if (_item == _x select 0) exitwith { + if (random(1)> (1 - (_x select CHANCE))) then { + _found = true; + sleep (_x select WAITINGTIME); + _bandagedWounds = [_person,"cse_bandagedWounds"] call cse_fnc_getVariable; + _bandagedBodyPart = _bandagedWounds select _bodyPart; + _bandagedWoundClass = _bandagedBodyPart select _woundClass; + if (_bandagedWoundClass >= _amount) then { + _openWounds =[_person,"cse_openWounds"] call cse_fnc_getVariable; + _openWoundsBodyPart = _openWounds select _bodyPart; + _openWoundClass = _openWoundsBodyPart select _woundClass; + + _bandagedBodyPart set [_woundClass,_bandagedWoundClass - (_amount * (_x select RATIO))]; + _openWoundsBodyPart set [_woundClass,_openWoundClass + (_amount * (_x select RATIO))]; + + _bandagedWounds set[_bodyPart,_bandagedBodyPart]; + _openWounds set[_bodyPart,_openWoundsBodyPart]; + [_person,"cse_openWounds",_openWounds] call cse_fnc_setVariable; + [_person,"cse_bandagedWounds",_bandagedWounds] call cse_fnc_setVariable; + }; + }; + }; +}foreach _config; + +if (!_found && (random(1)>0.2)) then { + sleep CFG_DEFAULT_WAITING_TIME; + _bandagedWounds = [_person,"cse_bandagedWounds"] call cse_fnc_getVariable; + _bandagedBodyPart = _bandagedWounds select _bodyPart; + _bandagedWoundClass = _bandagedBodyPart select _woundClass; + + if (_bandagedWoundClass >= _amount) then { + _openWounds =[_person,"cse_openWounds"] call cse_fnc_getVariable; + _openWoundsBodyPart = _openWounds select _bodyPart; + _openWoundClass = _openWoundsBodyPart select _woundClass; + + _bandagedBodyPart set [_woundClass,_bandagedWoundClass - _amount]; + _openWoundsBodyPart set [_woundClass,_openWoundClass + _amount]; + + _bandagedWounds set[_bodyPart,_bandagedBodyPart]; + _openWounds set[_bodyPart,_openWoundsBodyPart]; + [_person,"cse_openWounds",_openWounds] call cse_fnc_setVariable; + [_person,"cse_bandagedWounds",_bandagedWounds] call cse_fnc_setVariable; + }; +}; + diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandage_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandage_CMS.sqf new file mode 100644 index 0000000000..db34f55b89 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_bandage_CMS.sqf @@ -0,0 +1,53 @@ +/** + * fn_bandage_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_treatingPerson","_injuredPerson","_part","_selectionName","_openWounds","_woundsArray","_highest_amount","_highestSpot", "_selectedData", "_continue", "_prevAnim"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_selectedData = [_this, 4, "", [""]] call BIS_fnc_Param; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_treatingPerson] call cse_fnc_treatmentMutex_CMS; + +if (!([_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; + +_prevAnim = ""; +if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson) && !(stance _treatingPerson == "PRONE")) then { + if (primaryWeapon _treatingPerson == "") then { + _prevAnim = animationState _treatingPerson; + }; + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; + +[_treatingPerson,"STR_CSE_CMS_BANDAGING","STR_CSE_CMS_APPLY_BANDAGE", 0, [[_injuredPerson] call cse_fnc_getName, _selectionName]] call cse_fnc_sendDisplayMessageTo; + +if (isnil "CSE_BANDAGE_WAITING_TIME_CMS") then { + CSE_BANDAGE_WAITING_TIME_CMS = 5; +}; + +["cse_sys_medical_treatment", true, "cse\cse_sys_medical\data\icons\bandage_fracture_small.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _treatingPerson; +if ([CSE_BANDAGE_WAITING_TIME_CMS,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar) then { + + [_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_useEquipment_CMS; + + [_this, "cse_fnc_bandageLocal_CMS", _injuredPerson, false] spawn BIS_fnc_MP; +}; + +if (_prevAnim != "") then { + _treatingPerson switchMove _prevAnim; +}; +["cse_sys_medical_treatment", false, "cse\cse_sys_medical\data\icons\bandage_fracture_small.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + +[_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_handleHeal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_handleHeal_CMS.sqf new file mode 100644 index 0000000000..7121c9e04b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_handleHeal_CMS.sqf @@ -0,0 +1,25 @@ +/** + * fn_handleHeal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit",'_healer']; +_unit = _this select 0; +_healer = _this select 1; + +if (!(isPlayer _healer) && CSE_ALLOW_AI_FULL_HEAL_CMS && !([_unit] call cse_Fnc_isUnconscious)) then { + [_unit, "cse_openWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call cse_fnc_setVariable; + [_unit, "cse_bandagedWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call cse_fnc_setVariable; + + if (_unit != _healer) then { + [_unit,"STR_CSE_CMS_BANDAGED","STR_CSE_CMS_IS_BANDAGING_YOU", 0, [[_healer] call cse_fnc_getName]] call cse_fnc_sendDisplayMessageTo; + }; + [_unit,"treatment",format["%1 has patched up the patient",[_healer] call cse_fnc_getName]] call cse_fnc_addActivityToLog_CMS; +}; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasEquipment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasEquipment_CMS.sqf new file mode 100644 index 0000000000..f27f7521a8 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasEquipment_CMS.sqf @@ -0,0 +1,37 @@ +/** + * fn_hasEquipment_CMS.sqf + * @Descr: Check if the medic or patient have the right equipment for treatment. + * @Author: Glowbal + * + * @Arguments: [medic OBJECT, patient OBJECT, item STRING (Classname of the item. Expects magazine type.)] + * @Return: BOOL + * @PublicAPI: false + */ + +private ["_medic", "_patient", "_item", "_return"]; +_medic = _this select 0; +_patient = _this select 1; +_item = _this select 2; + +if (isnil "CSE_ALLOW_SHARED_EQUIPMENT_CMS") then { + CSE_ALLOW_SHARED_EQUIPMENT_CMS = true; +}; +if (CSE_ALLOW_SHARED_EQUIPMENT_CMS && {[_patient, _item] call cse_fnc_hasItem}) exitwith { + true; +}; + +if ([_medic, _item] call cse_fnc_hasItem) exitwith { + true; +}; + +_return = false; +if ([vehicle _medic] call cse_fnc_isMedicalVehicle_CMS && {(vehicle _medic != _medic)}) then { + _crew = crew vehicle _medic; + { + if ([_x, _medic] call cse_fnc_canAccessMedicalEquipment_CMS && {([_x, _item] call cse_fnc_hasItem)}) exitwith { + _return = true; + }; + }foreach _crew; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasTourniquetAppliedTo_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasTourniquetAppliedTo_CMS.sqf new file mode 100644 index 0000000000..91d51f1441 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_hasTourniquetAppliedTo_CMS.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasTourniquetAppliedTo_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_part","_selectionName","_tourniquets"]; +_unit = _this select 0; +_selectionName = _this select 1; +_part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; +_tourniquets = [_unit,"cse_tourniquets"] call cse_fnc_getVariable; +((_tourniquets select _part) > 0) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_healLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_healLocal_CMS.sqf new file mode 100644 index 0000000000..b732249af1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_healLocal_CMS.sqf @@ -0,0 +1,73 @@ +/** + * fn_healLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_caller", "_wasUnconscious"]; +_unit = _this select 0; +_caller = _this select 1; + +if (alive _unit) then { + _wasUnconscious = [_unit] call cse_fnc_isUnconscious; + [_unit,"treatment",format["%1 used a personal aid kit",[_caller] call cse_fnc_getName]] call cse_fnc_addActivityToLog_CMS; + + [_unit,"cse_openWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call cse_fnc_setVariable; + [_unit,"cse_bandagedWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call cse_fnc_setVariable; + [_unit,"cse_fractures",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call cse_fnc_setVariable; + [_unit,"cse_airway",0] call cse_fnc_setVariable; + [_unit,"cse_tourniquets",[0,0,0,0,0,0]] call cse_fnc_setVariable; + [_unit,"cse_splints",0] call cse_fnc_setVariable; + + //["cse_activityLog_CMS",[]] call cse_fnc_setVariable; + [_unit,"cse_triageLevel",0] call cse_fnc_setVariable; + [_unit,"cse_triageCard",[]] call cse_fnc_setVariable; + + // private variables + [_unit,"cse_bloodVolume",100] call cse_fnc_setVariable; + [_unit,"cse_bloodIVVolume",0] call cse_fnc_setVariable; + [_unit,"cse_plasmaIVVolume",0] call cse_fnc_setVariable; + [_unit,"cse_salineIVVolume",0] call cse_fnc_setVariable; + + [_unit,"cse_pain",0] call cse_fnc_setVariable; + [_unit,"cse_heartRate",80] call cse_fnc_setVariable; + [_unit,"cse_andrenaline",0] call cse_fnc_setVariable; + [_unit,"cse_bloodPressure",[80,120]] call cse_fnc_setVariable; + + [_unit,"cse_givenMorphine",0] call cse_fnc_setVariable; + [_unit,"cse_givenAtropine",0] call cse_fnc_setVariable; + [_unit,"cse_givenEpinephrine",0] call cse_fnc_setVariable; + + [_unit,"cse_bodyPartStatus",[0,0,0,0,0,0]] call cse_fnc_setVariable; + [_unit,"CSE_ENABLE_REVIVE_SETDEAD_F", 0] call cse_fnc_setVariable; + [_unit,"CSE_ENABLE_REVIVE_COUNTER", 0] call cse_fnc_setVariable; + + _unit setDamage 0; + if (!CSE_ALLOW_INSTANT_DEAD_CMS) then { + [_unit, "cse_noInstantDeath", false] call cse_fnc_setVariable; + }; + + if (isPlayer _unit) then { + [false] call cse_fnc_effectBlackOut; + [true] call cse_fnc_setVolume_f; + ["unconscious", false] call cse_fnc_disableUserInput_f; + }; + if (_wasUnconscious) then { + ["waiting until no longer unconscious"] call cse_fnc_debug; + waituntil {!([_unit] call cse_fnc_isUnconscious)}; + sleep 0.1; + + if (vehicle _unit == _unit) then { + if (!([_unit] call cse_fnc_beingCarried)) then { + ["Resetting animation"] call cse_fnc_debug; + [_unit,"",false] call cse_fnc_broadcastAnim; + [_unit,"amovppnemstpsnonwnondnon",false] call cse_fnc_broadcastAnim; + }; + }; + }; + ["Completed healLocal"] call cse_fnc_debug; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_heal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_heal_CMS.sqf new file mode 100644 index 0000000000..be403202a6 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_heal_CMS.sqf @@ -0,0 +1,50 @@ +/** + * fn_heal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit", "_caller", "_selectionName", "_removeItem", "_prevAnim"]; +_unit = _this select 0; +_caller = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +if !((CSE_AID_KIT_RESTRICTIONS_CMS == 0 && ([_caller] call cse_fnc_inMedicalFacility_CMS)) || (CSE_AID_KIT_RESTRICTIONS_CMS == 1 && ([_caller] call cse_fnc_inMedicalFacility_CMS) && (!([_unit] call cse_fnc_hasOpenWounds_CMS))) || (CSE_AID_KIT_RESTRICTIONS_CMS == 2) || (CSE_AID_KIT_RESTRICTIONS_CMS == 3 && (!([_unit] call cse_fnc_hasOpenWounds_CMS)))) exitwith {}; + +if (!([_caller, _unit, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith {}; +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller] call cse_fnc_treatmentMutex_CMS; + +_prevAnim = ""; +if (vehicle _caller == _caller && (vehicle _unit == _unit) && !(stance _caller == "PRONE")) then { + if (primaryWeapon _caller == "") then { + _prevAnim = animationState _caller; + }; + [_caller,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([5,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{hint "Action aborted. You moved away";}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; +CSE_ORIGINAL_POSITION_PLAYER_CMS = nil; + +if (CSE_AID_KIT_REMOVED_UPON_USAGE_CMS) then { + [_caller, _unit,_removeItem] call cse_fnc_useEquipment_CMS; +}; + +if (_prevAnim != "") then { + _caller switchMove _prevAnim; +}; + +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; + +if (!(_unit getvariable ["cms_isDead",false]) && alive _unit) then { + [[_unit,_caller], "cse_fnc_healLocal_CMS", _unit, false] spawn BIS_fnc_MP; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_isSetTreatmentMutex_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_isSetTreatmentMutex_CMS.sqf new file mode 100644 index 0000000000..6d34ae3abd --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_isSetTreatmentMutex_CMS.sqf @@ -0,0 +1,15 @@ +/** + * fn_isSetTreatmentMutex_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (isnil "CSE_PERFORMING_TREATMENT_CMS_MUTEX") then { + CSE_PERFORMING_TREATMENT_CMS_MUTEX = false; +}; + +CSE_PERFORMING_TREATMENT_CMS_MUTEX \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_ivLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_ivLocal_CMS.sqf new file mode 100644 index 0000000000..8988dfd51c --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_ivLocal_CMS.sqf @@ -0,0 +1,49 @@ +/** + * fn_ivLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_attributes","_patient", "_value"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + + + +_attributes = switch (_removeItem) do { + case "cse_blood_iv": {["cse_bloodIVVolume",1000,"Blood IV"]}; + case "cse_saline_iv": {["cse_salineIVVolume",1000,"Saline IV"]}; + case "cse_plasma_iv": {["cse_plasmaIVVolume",1000,"Plasma IV"]}; + + case "cse_blood_iv_500": {["cse_bloodIVVolume",500,"Blood IV"]}; + case "cse_saline_iv_500": {["cse_salineIVVolume",500,"Saline IV"]}; + case "cse_plasma_iv_500": {["cse_plasmaIVVolume",500,"Plasma IV"]}; + + case "cse_blood_iv_250": {["cse_bloodIVVolume",250,"Blood IV"]}; + case "cse_saline_iv_250": {["cse_salineIVVolume",250,"Saline IV"]}; + case "cse_plasma_iv_250": {["cse_plasmaIVVolume",250,"Plasma IV"]}; + + default {[]}; +}; +if (count _attributes > 1) then { + + _value = [_injuredPerson,(_attributes select 0)] call cse_fnc_getVariable; + _value = _value + (_attributes select 1); + [format["Has given patient: %1",[_value, _attributes select 0, _attributes select 1]]] call cse_fnc_debug; + [_injuredPerson,(_attributes select 0),_value] call cse_fnc_setVariable; + [format["Confirm: %1",[_injuredPerson getvariable [_attributes select 0, 0], _injuredPerson]]] call cse_fnc_debug; + + _patient = "patient"; + if (_injuredPerson == _treatingPerson) then { + _patient = "himself"; + }; + [_injuredPerson,"treatment",format["%1 has given %4 a %2(%3ml)",[_treatingPerson] call cse_fnc_getName,_attributes select 2,_attributes select 1,_patient]] call cse_fnc_addActivityToLog_CMS; + [_injuredPerson,_removeItem] call cse_fnc_addToTriageList_CMS; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_iv_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_iv_CMS.sqf new file mode 100644 index 0000000000..d365c6400d --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_iv_CMS.sqf @@ -0,0 +1,43 @@ +/** + * fn_iv_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_attributes","_patient", "_continue", "_prevAnim"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_treatingPerson,"set"] call cse_fnc_treatmentMutex_CMS; + +if (!([_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; + + +_prevAnim = ""; +if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson) && !(stance _treatingPerson == "PRONE")) then { + if (primaryWeapon _treatingPerson == "") then { + _prevAnim = animationState _treatingPerson; + }; + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _treatingPerson; +if !([5,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{hint "Action aborted. You moved away";}] call cse_fnc_gui_loadingBar) exitwith { + [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; +}; + +[_treatingPerson, _injuredPerson,_removeItem] call cse_fnc_useEquipment_CMS; +[_this, "cse_fnc_ivLocal_CMS", _injuredPerson, false] spawn BIS_fnc_MP; + +if (_prevAnim != "") then { + _treatingPerson switchMove _prevAnim; +}; + +[_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_medicationLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_medicationLocal_CMS.sqf new file mode 100644 index 0000000000..51beb092ac --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_medicationLocal_CMS.sqf @@ -0,0 +1,170 @@ +/** + * fn_medicationLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_patient","_attributes","_value"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +_attributes = switch (_removeItem) do { + case "cse_morphine": { + ["cse_givenMorphine",1,"Morphine"] + }; + case "cse_atropine": { + ["cse_givenAtropine",1,"Atropine"] + }; + case "cse_epinephrine": { + ["cse_givenEpinephrine",1,"Epinephrine"] + }; + case "cse_antiBiotics": { + [] + }; + default {[]}; +}; + +if (count _attributes > 1) then { + [_injuredPerson] spawn cse_fnc_unitLoop_CMS; + _value = [_injuredPerson,(_attributes select 0)] call cse_fnc_getVariable; + _value = _value + (_attributes select 1); + [_injuredPerson,(_attributes select 0),_value] call cse_fnc_setVariable; + + _patient = "patient"; + if (_injuredPerson == _treatingPerson) then { + _patient = "himself"; + }; + [_injuredPerson,"treatment",format["%1 has given %3 %2",[_treatingPerson] call cse_fnc_getName, (_attributes select 2),_patient]] call cse_fnc_addActivityToLog_CMS; +[_injuredPerson,_removeItem] call cse_fnc_addToTriageList_CMS; + + _usedMedication = { + private ["_injuredPerson","_var","_usedMed","_morphineUsed","_epiUsed","_atroUsed","_totalUsed"]; + _injuredPerson = _this select 0; + _var = _this select 1; + _overDose = 5; + _wearOff = 120; + + if (!alive _injuredPerson) exitwith{}; + if (count _this > 2) then { + _overDose = _this select 2; + if (count _this > 3) then { + _wearOff = _this select 3; + }; + }; + _usedMed = [_injuredPerson, _var, 0] call cse_fnc_getVariable; + if (isnil "_usedMed") then { + _usedMed = 0; + }; + if (_usedMed > (_overDose + round(random(2)))) then { + [_injuredPerson] spawn cse_fnc_setDead; + }; + + _morphineUsed = _injuredPerson getvariable ["cse_givenMorphine", 0]; + _epiUsed = _injuredPerson getvariable ["cse_givenEpinephrine", 0]; + _atroUsed = _injuredPerson getvariable ["cse_givenAtropine", 0]; + _totalUsed = _morphineUsed + _epiUsed + _atroUsed; + if (_totalUsed > 10) then { + [_injuredPerson] spawn cse_fnc_setDead; + }; + [_injuredPerson,_wearOff,_var] spawn { + sleep ((_this select 1) + (round(random(30)))); + _amountDecreased = 0; + _usedMed = [_this select 0, _this select 2] call cse_fnc_getVariable; + if (typeName _usedMed != typeName 0) then { + _usedMed = 0; + }; + while {(_usedMed > 0.000000 && _amountDecreased < 1.000000)} do { + _usedMed = ([_this select 0, _this select 2] call cse_fnc_getVariable); + if ( typeName _usedMed != typeName 0) then { + _usedMed = 0; + }; + [_this select 0, _this select 2,_usedMed - 0.001] call cse_fnc_setVariable; + _amountDecreased = _amountDecreased + 0.001; + sleep 1; + }; + }; + }; + + + switch (_removeItem) do { + case "cse_atropine": { + + _heartRate = [_injuredPerson, "cse_heartRate"] call cse_fnc_getVariable; + //_heartRate = [_injuredPerson, "cse_heartRate"] call cse_fnc_getVariable; + if (alive _injuredPerson) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_injuredPerson, -(10 + random(20)), 30] call cse_fnc_addHeartRateAdjustment_CMS; + }; + + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_injuredPerson, -(10 + random(50)), 30] call cse_fnc_addHeartRateAdjustment_CMS; + } else { + [_injuredPerson, -(10 + random(40)), 30] call cse_fnc_addHeartRateAdjustment_CMS; + }; + }; + }; + //[_injuredPerson, "cse_heartRate",_heartRate] call cse_fnc_setVariable; + [_injuredPerson,(_attributes select 0),5] call _usedMedication; + }; + }; + case "cse_epinephrine": { + _heartRate = [_injuredPerson, "cse_heartRate"] call cse_fnc_getVariable; + if (alive _injuredPerson) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_injuredPerson, (10 + random(20)), 30] call cse_fnc_addHeartRateAdjustment_CMS; + }; + + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_injuredPerson, (10 + random(50)), 30] call cse_fnc_addHeartRateAdjustment_CMS; + } else { + [_injuredPerson, (10 + random(40)), 30, {}] call cse_fnc_addHeartRateAdjustment_CMS; + }; + }; + }; + [_injuredPerson,(_attributes select 0),3] call _usedMedication; + }; + }; + case "cse_morphine": { + private ["_usedMorphine"]; + _pain = [_injuredPerson, "cse_pain"] call cse_fnc_getVariable; + _pain = 0; + //_pain = _pain - 35; + if (_pain <= 0) then { + _pain = 0; + }; + _heartRate = [_injuredPerson, "cse_heartRate"] call cse_fnc_getVariable; + [format["used morphine: %1",_heartRate]] call cse_fnc_debug; + if (alive _injuredPerson) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_injuredPerson, -(10 + random(20)), 40] call cse_fnc_addHeartRateAdjustment_CMS; + }; + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_injuredPerson, -(10 + random(50)), 40] call cse_fnc_addHeartRateAdjustment_CMS; + } else { + [_injuredPerson, -(10 + random(40)), 40] call cse_fnc_addHeartRateAdjustment_CMS; + }; + }; + }; + }; + [_injuredPerson, "cse_pain",_pain] call cse_fnc_setVariable; + [_injuredPerson,(_attributes select 0),4,120] call _usedMedication; + }; + default { + [format["default got triggered for medication. %1",_this]] call cse_fnc_debug; + }; + }; +}; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_medication_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_medication_CMS.sqf new file mode 100644 index 0000000000..fe5030b527 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_medication_CMS.sqf @@ -0,0 +1,62 @@ +/** + * fn_medication_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_patient","_attributes","_value", "_prevAnim"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_treatingPerson,"set"] call cse_fnc_treatmentMutex_CMS; + +if (!([_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; + + +_attributes = switch (_removeItem) do { + case "cse_morphine": { + ["cse_givenMorphine",1,"Morphine"] + }; + case "cse_atropine": { + ["cse_givenAtropine",1,"Atropine"] + }; + case "cse_epinephrine": { + ["cse_givenEpinephrine",1,"Epinephrine"] + }; + case "cse_antiBiotics": { + [] + }; + default {[]}; +}; + +if (count _attributes > 1) then { + _prevAnim = ""; + if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson) && !(stance _treatingPerson == "PRONE")) then { + if (primaryWeapon _treatingPerson == "") then { + _prevAnim = animationState _treatingPerson; + }; + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; + }; + + ["cse_sys_medical_treatment", true, "cse\cse_sys_medical\data\icons\medication_small.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; + + CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _treatingPerson; + if ([2,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{hint "Action aborted. You moved away";}] call cse_fnc_gui_loadingBar) then { + [_treatingPerson, _injuredPerson,_removeItem] call cse_fnc_useEquipment_CMS; + [_this, "cse_fnc_medicationLocal_CMS", _injuredPerson, false] spawn BIS_fnc_MP; + }; + + if (_prevAnim != "") then { + _treatingPerson switchMove _prevAnim; + }; + ["cse_sys_medical_treatment", false, "cse\cse_sys_medical\data\icons\medication_small.paa", [1,1,1,1]] call cse_fnc_gui_displayIcon; +}; +[_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRLocal_CMS.sqf new file mode 100644 index 0000000000..f62975b15d --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRLocal_CMS.sqf @@ -0,0 +1,39 @@ +/** + * fn_performCPRLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller","_unit"]; +_unit = _this select 0; +_caller = _this select 1; + +[_unit] call cse_fnc_unitLoop_CMS; +/*if (([_unit, "cse_heartRate"] call cse_fnc_getVariable) > 0) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + [_caller,"No need for CPR"] call cse_fnc_sendHintTo; +};*/ + +if (vehicle _unit == _unit) then { + [_unit,"AinjPpneMstpSnonWrflDnon_rolltoback"] call cse_fnc_localAnim; +}; + +if (vehicle _caller == _caller) then { + //[_caller,"AinvPknlMstpSnonWrflDr_medic0"] call cse_fnc_broadcastAnim; + [_caller,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; + +[_this, "cse_fnc_performCPRProvider_CMS", _caller, false] spawn BIS_fnc_MP; +_n = _unit getvariable ["CSE_ENABLE_REVIVE_COUNTER",0]; +if (_n > 0) then { + _n = _n - random(20); + if (_n < 0) then { + _n = 0; + }; + _unit setvariable ["CSE_ENABLE_REVIVE_COUNTER", _n]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRProvider_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRProvider_CMS.sqf new file mode 100644 index 0000000000..437b3fc786 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRProvider_CMS.sqf @@ -0,0 +1,61 @@ +/** + * fn_performCPRProvider_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller","_unit","_timer","_succesValueCPR"]; +_unit = _this select 0; +_caller = _this select 1; + +cse_playerIsProvidingCPR_CMS = true; +_timer = 0; +_succesValueCPR = 0; + +[_caller,"You start providing CPR"] call cse_fnc_sendHintTo; + +while {cse_playerIsProvidingCPR_CMS} do { + // [_caller,"Acts_TreatingWounded01"] call cse_fnc_localAnim; + if (vehicle _caller == _caller) then { + _caller playMove "AinvPknlMstpSnonWrflDr_medic0"; + }; + sleep 0.1; + if (alive _unit) then { + if (random(10) > 6) then { + _succesValueCPR = _succesValueCPR + random(2); + } else { + _succesValueCPR = _succesValueCPR - random(1); + if (_succesValueCPR < 0) then { + _succesValueCPR = 0; + }; + }; + }; + _timer = _timer + 1; + sleep 0.1; + if (_succesValueCPR > 20 && ((_unit getvariable ["CSE_ENABLE_REVIVE_SETDEAD_F",0]) == 0)) exitwith { + _succesValueCPR = 40; + }; + if (_succesValueCPR > 35 && ((_unit getvariable ["CSE_ENABLE_REVIVE_SETDEAD_F",0]) > 0)) exitwith { + _succesValueCPR = 40; + }; + + if (_timer > 160) exitwith{_succesValueCPR = 0;}; +}; +cse_playerIsProvidingCPR_CMS = nil; +if (vehicle _caller == _caller) then { + [_caller,"AinvPknlMstpSnonWrflDnon_medicEnd"] call cse_fnc_localAnim; +}; + +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; +if (_succesValueCPR > 20 && alive _unit) then { + _unit setvariable ["cse_cardiacArrest_CMS", nil, true]; + [_caller,"CPR Success"] call cse_fnc_sendHintTo; + [_this, "cse_fnc_performCPRSuccess_CMS", _unit, false] spawn BIS_fnc_MP; +} else { + [_caller,"You stopped giving CPR"] call cse_fnc_sendHintTo; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRSuccess_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRSuccess_CMS.sqf new file mode 100644 index 0000000000..9544d6b4e1 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPRSuccess_CMS.sqf @@ -0,0 +1,21 @@ +/** + * fn_performCPRSuccess_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller","_unit"]; +_unit = _this select 0; +_caller = _this select 1; + +[_unit, "cse_heartRate",40] call cse_fnc_setVariable; +[_unit, "cse_bloodPressure",[50,70]] call cse_fnc_setVariable; + +// setting this to waken up unconscious revivable units +[_unit, "CSE_ENABLE_REVIVE_SETDEAD_F", 0] call cse_fnc_setVariable; +[_unit, "CSE_ENABLE_REVIVE_COUNTER", 0] call cse_fnc_setVariable; diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPR_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPR_CMS.sqf new file mode 100644 index 0000000000..8d152dda83 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performCPR_CMS.sqf @@ -0,0 +1,34 @@ +/** + * fn_performCPR_CMS.sqf + * @Descr: Start the CPR action from CMS. Caller unit will attempt to restart the targets heart using CPR. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit that cPR will be performed upon), caller OBJECT (The unit that does the CPR action)] + * @Return: void + * @PublicAPI: true + */ + + +private ["_caller","_unit"]; +_unit = _this select 0; +_caller = _this select 1; +if (isnil "cse_playerIsProvidingCPR_CMS") then { + cse_playerIsProvidingCPR_CMS = false; +}; + +[_this] call cse_Fnc_Debug; +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {cse_playerIsProvidingCPR_CMS = false;}; +[_caller] call cse_fnc_treatmentMutex_CMS; + +if (cse_playerIsProvidingCPR_CMS) exitwith { + [_caller,"You are already providing CPR"] call cse_fnc_sendHintTo; + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + cse_playerIsProvidingCPR_CMS = false; // stop giving CPR +}; + +if (_unit == _caller) exitwith{[_caller,"You cannot give yourself CPR"] call cse_fnc_sendHintTo; [_caller,"release"] call cse_fnc_treatmentMutex_CMS;}; + + //_name = _unit getvariable ["cse_nameUnit",[_unit] call cse_fnc_getName]; +[_caller,"You start providing CPR"] call cse_fnc_sendHintTo; + +[_this, "cse_fnc_performCPRLocal_CMS", _unit, false] spawn BIS_fnc_MP; diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performStitching_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performStitching_CMS.sqf new file mode 100644 index 0000000000..1389858e8c --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performStitching_CMS.sqf @@ -0,0 +1,83 @@ +/** + * fn_performStitching_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define WAITING_TIME_SMALL 2.5 +#define WAITING_TIME_MEDIUM 3.5 +#define WAITING_TIME_LARGE 4.5 + +#define WAITING_TIMES_WOUNDS [WAITING_TIME_SMALL, WAITING_TIME_MEDIUM, WAITING_TIME_LARGE] + +private ["_injuredPerson", "_treatingPerson", "_selectionName", "_removeItem", "_prevAnim", "_bandagedWounds", "_bodyPartN", "_allWounds", "_totalWoundsCount", "_totalTime", "_startTimeOfStitching", "_indexStitch", "_woundstoStitchOf", "_afterStitchingWoundsCount", "_waitingTime", "_i", "_startTime", "_messageSend"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +if (!([_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith {}; +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_treatingPerson,"set"] call cse_fnc_treatmentMutex_CMS; + +[_treatingPerson,"STR_CSE_CMS_STITCHING","STR_CSE_CMS_START_STITCHING_INJURIES", 0, [[_injuredPerson] call cse_fnc_getName,_selectionName]] call cse_fnc_sendDisplayMessageTo; + + +_prevAnim = ""; +if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson)) then { + if (primaryWeapon _treatingPerson == "") then { + _prevAnim = animationState _treatingPerson; + }; + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; +_bandagedWounds = [_injuredPerson,"cse_bandagedWounds"] call cse_fnc_getVariable; +_bodyPartN = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; + +_allWounds = _bandagedWounds select _bodyPartN; +_totalWoundsCount = (_allWounds select 0) + (_allWounds select 1) + (_allWounds select 2); +_totalTime = ((_allWounds select 0) * 2.5) + ((_allWounds select 1) * 3.5) + ((_allWounds select 2) * 4.5); + +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _treatingPerson; +CSE_CONDITION_STITCHING_CMS = {((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}; +CSE_RUNNING_STITCHING_CMS = true; + +_startTimeOfStitching = diag_tickTime; +_totalTime spawn { + CSE_RUNNING_STITCHING_CMS = [_this, CSE_CONDITION_STITCHING_CMS, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar; +}; + +_indexStitch = 0; +while {CSE_RUNNING_STITCHING_CMS && _indexStitch < 3} do { + _woundstoStitchOf = _allWounds select _indexStitch; + _afterStitchingWoundsCount = _woundstoStitchOf; + _waitingTime = WAITING_TIMES_WOUNDS select _indexStitch; + + for [{_i=0}, {_i< (ceil _woundstoStitchOf)}, {_i=_i+1}] do { + _startTime = diag_tickTime; + waitUntil {(diag_tickTime - _startTime > _waitingTime) || !CSE_RUNNING_STITCHING_CMS}; + if (CSE_RUNNING_STITCHING_CMS) then { + // TODO play sound + _afterStitchingWoundsCount = _afterStitchingWoundsCount - 1; + }; + }; + + if (_afterStitchingWoundsCount < 0) then { + _afterStitchingWoundsCount = 0; + }; + _allWounds set [_indexStitch, _afterStitchingWoundsCount]; + _indexStitch = _indexStitch + 1; +}; +_bandagedWounds set [_bodyPartN, _allWounds]; +[_injuredPerson, "cse_bandagedWounds", _bandagedWounds] call cse_fnc_setVariable; + +[_injuredPerson,"treatment",format["%1 has stitched up some bandages wounds",[_treatingPerson] call cse_fnc_getName]] call cse_fnc_addActivityToLog_CMS; + +if (_prevAnim != "") then { + _treatingPerson switchMove _prevAnim; +}; + +[_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_performTreatment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performTreatment_CMS.sqf new file mode 100644 index 0000000000..323fec5ee9 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_performTreatment_CMS.sqf @@ -0,0 +1,30 @@ +/** + * fn_performTreatment_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_unit","_caller","_treatment","_removeOnSuccess","_params"]; +_caller = _this select 0; +_unit = _this select 1; +_treatment = _this select 2; +_removeOnSuccess = _this select 3; + +CMS_PERFORMING_TREATMENT = true; +if (!isnil "_removeOnSuccess") then { + + if (([_caller,_removeOnSuccess] call cse_fnc_hasMagazine)) then { + _params = [_unit,_caller, (call cse_fnc_getSelectedBodyPart_CMS),_removeOnSuccess]; + [_params, _treatment, _unit, false] spawn BIS_fnc_MP; + }; + [//-1, cms_fnc_clutter, [_unit, _removeOnSuccess]] call CBA_fnc_globalExecute; +}; +call cms_ui_hideSubMenus; +// waituntil {(!CMS_PERFORMING_TREATMENT || time>5 seconds)}; +//sleep 5; +CMS_PERFORMING_TREATMENT = false; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_removeTourniquet_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_removeTourniquet_CMS.sqf new file mode 100644 index 0000000000..90e23877cb --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_removeTourniquet_CMS.sqf @@ -0,0 +1,41 @@ +/** + * fn_removeTourniquet_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_caller","_unit","_part","_selectionName","_removeItem","_tourniquets"]; +_unit = _this select 0; +_caller = _this select 1; +_selectionName = _this select 2; + +[_caller,"You attempt to remove a tourniquet"] call cse_fnc_sendHintTo; +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {["MUTEX HAS BEEN SET - EXITING"] call cse_fnc_debug;}; + [_caller,"set"] call cse_fnc_treatmentMutex_CMS; + + +if !([_unit, _selectionName] call cse_fnc_hasTourniquetAppliedTo_CMS) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + [_caller,"There is no tourniquet on this body part!"] call cse_fnc_sendHintTo; +}; + +if (vehicle _caller == _caller && (vehicle _unit == _unit)) then { + [_caller,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([5,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{hint "Action aborted. You moved away";}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; +_part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; +_tourniquets = [_unit,"cse_tourniquets"] call cse_fnc_getVariable; +_tourniquets set[_part,0]; +[_unit,"cse_tourniquets",_tourniquets] call cse_fnc_setVariable; + +_caller addMagazine "cse_tourniquet"; +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; + +[_unit,"treatment",format["%1 removed a tourniquet on %2",[_caller] call cse_fnc_getName,_selectionName]] call cse_fnc_addActivityToLog_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquetLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquetLocal_CMS.sqf new file mode 100644 index 0000000000..dce56d6175 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquetLocal_CMS.sqf @@ -0,0 +1,52 @@ +/** + * fn_tourniquetLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + + [_injuredPerson,"treatment",format["%1 applied a tourniquet on %2",[_treatingPerson] call cse_fnc_getName,_selectionName]] call cse_fnc_addActivityToLog_CMS; + [_injuredPerson,_removeItem] call cse_fnc_addToTriageList_CMS; + [_injuredPerson] spawn cse_fnc_unitLoop_CMS; + _part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; + _tourniquets = [_injuredPerson,"cse_tourniquets"] call cse_fnc_getVariable; + _applyingTo = (_tourniquets select _part) +1 + round(random(100)); + _tourniquets set[_part,_applyingTo]; + [_injuredPerson,"cse_tourniquets",_tourniquets] call cse_fnc_setVariable; + + [_injuredPerson,_part,_applyingTo] spawn { + private ["_injuredPerson","_part","_tourniquets","_appliedTo","_totalAmountOfPainAdded"]; + _injuredPerson = _this select 0; + _part = _this select 1; + _key = _this select 2; + sleep 300 + (random(1800)); + _tourniquets = [_injuredPerson,"cse_tourniquets"] call cse_fnc_getVariable; + _totalAmountOfPainAdded = 0; + while {((_tourniquets select _part) == _key)} do { + // increase pain level + _pain = [_injuredPerson, "cse_pain"] call cse_fnc_getVariable; + _pain = _pain + 0.005; + _totalAmountOfPainAdded = _totalAmountOfPainAdded + 0.005; + [_injuredPerson, "cse_pain",_pain] call cse_fnc_setVariable; + sleep 5; + }; + + _pain = [_injuredPerson, "cse_pain"] call cse_fnc_getVariable; + if (_pain < _totalAmountOfPainAdded) then { + _pain = 0; + } else { + _pain = _pain - _totalAmountOfPainAdded; + }; + [_injuredPerson, "cse_pain",_pain] call cse_fnc_setVariable; + }; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquet_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquet_CMS.sqf new file mode 100644 index 0000000000..f71b0a32ff --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_tourniquet_CMS.sqf @@ -0,0 +1,47 @@ +/** + * fn_tourniquet_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_caller","_unit","_part","_selectionName","_removeItem", "_tourniquets", "_continue"]; +_unit = _this select 0; +_caller = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +[_caller,"You attempt to apply a tourniquet"] call cse_fnc_sendHintTo; + +if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; +[_caller,"set"] call cse_fnc_treatmentMutex_CMS; +if (!([_caller, _unit, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith { [_caller,"release"] call cse_fnc_treatmentMutex_CMS; }; + +_part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; +if (_part == 0 || _part == 1) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + [_caller,"You cannot apply a CAT on this body part!"] call cse_fnc_sendHintTo; +}; + +_tourniquets = [_unit,"cse_tourniquets"] call cse_fnc_getVariable; +if ((_tourniquets select _part) >0) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; + [_caller,"There is already a tourniquet on this body part!"] call cse_fnc_sendHintTo; +}; + +if (vehicle _caller == _caller && (vehicle _unit == _unit) && !(stance _caller == "PRONE")) then { + [_caller,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; +}; +CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _caller; +if !([5,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{hint "Action aborted. You moved away";}] call cse_fnc_gui_loadingBar) exitwith { + [_caller,"release"] call cse_fnc_treatmentMutex_CMS; +}; +["Now uses the magazine"] call cse_fnc_debug; +[_caller, _unit,_removeItem] call cse_fnc_useEquipment_CMS; + +[_this, "cse_fnc_tourniquetLocal_CMS", _unit, false] spawn BIS_fnc_MP; +[_caller,"release"] call cse_fnc_treatmentMutex_CMS; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirwayLocal_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirwayLocal_CMS.sqf new file mode 100644 index 0000000000..df79d5fa45 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirwayLocal_CMS.sqf @@ -0,0 +1,40 @@ +/** + * fn_treatmentAirwayLocal_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_part","_selectionName","_openWounds","_woundsArray","_highest_amount","_highestSpot","_collectiveImpact", "_highestTotal","_totalNumber"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +if (!local _injuredPerson) exitwith{["cse_fnc_treatmentAirwayLocal_CMS called on non local machine",3] call cse_fnc_debug; }; +[_injuredPerson] spawn cse_fnc_unitLoop_CMS; +if (_treatingPerson == _injuredPerson) exitwith {}; + + +[_injuredPerson,"STR_CSE_CMS_AIRWAY","STR_CSE_CMS_IS_TREATING_YOUR_AIRWAY",0, [([_treatingPerson] call cse_fnc_getName)]] call cse_fnc_sendDisplayMessageTo; +[_injuredPerson,_removeItem] call cse_fnc_addToTriageList_CMS; + +_airwayStatus = [_injuredPerson,"cse_airway"] call cse_fnc_getVariable; +if (_airwayStatus > 0) then { + if (!([_treatingPerson] call cse_fnc_medicClass_CMS)) then { + _injuredPerson setvariable ["cse_airwayTreated", true, true]; + // [_injuredPerson,"cse_airway", _airwayStatus - 1] call cse_fnc_getVariable; + + } else { + if (random (1) > 0.35) then { + _injuredPerson setvariable ["cse_airwayTreated", true, true]; + // [_injuredPerson,"cse_airway", _airwayStatus - 1] call cse_fnc_getVariable; + } else { + [_injuredPerson] call cse_fnc_setDead_CMS; + }; + }; +}; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirway_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirway_CMS.sqf new file mode 100644 index 0000000000..8dd5730b8b --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentAirway_CMS.sqf @@ -0,0 +1,45 @@ +/** + * fn_treatmentAirway_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_treatingPerson","_injuredPerson","_part","_selectionName","_openWounds","_woundsArray","_highest_amount","_highestSpot"]; +_injuredPerson = _this select 0; +_treatingPerson = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +[format["Treatment Airway: %1",_this]] call cse_fnc_debug; + +_part = [_selectionName] call cse_fnc_getBodyPartNumber_CMS; +if (_part == 0 || _part == 1) then { + if (call cse_fnc_isSetTreatmentMutex_CMS) exitwith {}; + [_treatingPerson] call cse_fnc_treatmentMutex_CMS; + if (!([_treatingPerson, _injuredPerson, _removeItem] call cse_fnc_hasEquipment_CMS)) exitwith { [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; }; + + [_treatingPerson, _injuredPerson,_removeItem] call cse_fnc_useEquipment_CMS; + + if (vehicle _treatingPerson == _treatingPerson && (vehicle _injuredPerson == _injuredPerson)) then { + [_treatingPerson,"AinvPknlMstpSlayWrflDnon_medic"] call cse_fnc_localAnim; + }; + _name = [_injuredPerson] call cse_fnc_getName; + + [_treatingPerson,"STR_CSE_CMS_AIRWAY","STR_CSE_CMS_YOU_TREAT_AIRWAY", 0, [_name]] call cse_fnc_sendDisplayMessageTo; + + CSE_ORIGINAL_POSITION_PLAYER_CMS = getPos _treatingPerson; + if !([5,{((vehicle player != player) ||((getPos player) distance CSE_ORIGINAL_POSITION_PLAYER_CMS) < 1)}, {},{[player, "STR_CSE_CMS_CANCELED", ["STR_CSE_CMS_ACTION_CANCELED","STR_CSE_CMS_YOU_MOVED_AWAY"]] call cse_fnc_sendDisplayInformationTo;}] call cse_fnc_gui_loadingBar) exitwith { + [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; + }; + + [_this, "cse_fnc_treatmentAirwayLocal_CMS", _injuredPerson, false] spawn BIS_fnc_MP; + [_treatingPerson,"release"] call cse_fnc_treatmentMutex_CMS; +} else { + hintSilent "Cannot apply item on this body part"; +}; +true \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentMutex_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentMutex_CMS.sqf new file mode 100644 index 0000000000..82c0cd4d10 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_treatmentMutex_CMS.sqf @@ -0,0 +1,33 @@ +/** + * fn_treatmentMutex_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [client OBJECT, action STRING ("release" releases the mutex if it has been set. "set" for setting the mutex)] + * @Return: void + * @PublicAPI: false + */ + +private ["_client","_action"]; +_client = _this select 0; + +if (!local _client) exitwith { + [_this, "cse_fnc_treatmentMutex_CMS", _client, false] spawn BIS_fnc_MP; +}; +if (isnil "CSE_PERFORMING_TREATMENT_CMS_MUTEX") then { + CSE_PERFORMING_TREATMENT_CMS_MUTEX = false; +}; +if (count _this > 1) exitwith { + _action = _this select 1; + if (_action == "release" || _action == "RELEASE") then { + ["RELEASING TREATMENT MUTEX"] call cse_fnc_debug; + CSE_PERFORMING_TREATMENT_CMS_MUTEX = false; + } else { + waituntil {!CSE_PERFORMING_TREATMENT_CMS_MUTEX}; + CSE_PERFORMING_TREATMENT_CMS_MUTEX = true; + ["SETTING TREATMENT MUTEX 2"] call cse_fnc_debug; + }; +}; +waituntil {!CSE_PERFORMING_TREATMENT_CMS_MUTEX}; +CSE_PERFORMING_TREATMENT_CMS_MUTEX = true; +["SETTING TREATMENT MUTEX 1"] call cse_fnc_debug; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/treatment/fn_useEquipment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/treatment/fn_useEquipment_CMS.sqf new file mode 100644 index 0000000000..65c6e99625 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/treatment/fn_useEquipment_CMS.sqf @@ -0,0 +1,41 @@ +/** + * fn_useEquipment_CMS.sqf + * @Descr: Use Equipment if any is available. Priority: 1) Medic, 2) Patient. If in vehicle: 3) Crew + * @Author: Glowbal + * + * @Arguments: [medic OBJECT, patient OBJECT, item STRING (ClassName of magazine item)] + * @Return: BOOL + * @PublicAPI: true + */ + +private ["_medic", "_patient", "_item", "_return","_crew"]; +_medic = _this select 0; +_patient = _this select 1; +_item = _this select 2; + +if (isnil "CSE_ALLOW_SHARED_EQUIPMENT_CMS") then { + CSE_ALLOW_SHARED_EQUIPMENT_CMS = true; +}; + +if (CSE_ALLOW_SHARED_EQUIPMENT_CMS && {[_patient, _item] call cse_fnc_hasItem}) exitwith { + [[_patient, _item], "cse_fnc_useItem", _patient] call BIS_fnc_MP; + true; +}; + +if ([_medic, _item] call cse_fnc_hasItem) exitwith { + [[_medic, _item], "cse_fnc_useItem", _medic] call BIS_fnc_MP; + true; +}; + +_return = false; +if ([vehicle _medic] call cse_fnc_isMedicalVehicle_CMS && {vehicle _medic != _medic}) then { + _crew = crew vehicle _medic; + { + if ([_x, _medic] call cse_fnc_canAccessMedicalEquipment_CMS && {([_x, _item] call cse_fnc_hasItem)}) exitwith { + _return = true; + [[_x, _item], "cse_fnc_useItem", _x] call BIS_fnc_MP; + }; + }foreach _crew; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/triage/fn_addToTriageList_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/triage/fn_addToTriageList_CMS.sqf new file mode 100644 index 0000000000..0d3afb17bb --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/triage/fn_addToTriageList_CMS.sqf @@ -0,0 +1,34 @@ +/** + * fn_addToTriageList_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_caller","_type","_activity","_log"]; +_unit = _this select 0; +_newItem = _this select 1; + +if (!local _unit) exitwith { + [_this, "cse_fnc_addToTriageList_CMS", _unit, false] spawn BIS_fnc_MP; +}; + +_log = [_unit,"cse_triageCard"] call cse_fnc_getVariable; +_inList = false; +_counter = 0; +{ + if ((_x select 0) == _newItem) exitwith { + _info = _log select _counter; + _info set [1,(_info select 1) + 1]; + _log set [ _counter, _info]; + _inList = true; + }; + _counter = _counter + 1; +}foreach _log; +if (!_inList) then { + _log pushback [_newItem,1]; +}; +[_unit,"cse_triageCard",_log] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageList_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageList_CMS.sqf new file mode 100644 index 0000000000..e0bca66e81 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageList_CMS.sqf @@ -0,0 +1,20 @@ +/** + * fn_getTriageList_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,"cse_triageCard"] call cse_fnc_getVariable; +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageStatus_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageStatus_CMS.sqf new file mode 100644 index 0000000000..d1c3c63029 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/triage/fn_getTriageStatus_CMS.sqf @@ -0,0 +1,25 @@ +/** + * fn_getTriageStatus_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_return","_status"]; +_unit = _this select 0; +//_status = [_unit,"cse_triageLevel"] call cse_fnc_getVariable; + _status = _unit getvariable ["cse_triageLevel", -1]; + +_return = switch (_status) do { + case 0: {["None",0,[0,0,0,0.7]]}; // none + case 1: {["Minor",1,[0,0.5,0,0.7]]}; + case 2: {["Delayed",2,[0.77,0.51,0.08,0.7]]}; + case 3: {["Immediate",3,[1,0.2,0.2,0.7]]}; + case 4: {["Deceased",4,[0,0,0,0.7]]}; + default {["None",0,[0,0,0,0.7]]}; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/triage/fn_setTriageStatus_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/triage/fn_setTriageStatus_CMS.sqf new file mode 100644 index 0000000000..1ed3564e89 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/triage/fn_setTriageStatus_CMS.sqf @@ -0,0 +1,19 @@ +/** + * fn_setTriageStatus_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_caller","_type","_activity","_status"]; + +_unit = _this select 0; +_status = _this select 1; + +if (!local _unit) exitwith { + [_this, "cse_fnc_setTriageStatus_CMS", _unit, false] spawn BIS_fnc_MP; +}; +[_unit,"cse_triageLevel",_status] call cse_fnc_setVariable; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_displayOptions_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_displayOptions_CMS.sqf new file mode 100644 index 0000000000..a5df521c7d --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_displayOptions_CMS.sqf @@ -0,0 +1,92 @@ +/** + * fn_displayOptions_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC 20 +#define END_IDC 27 +#define AMOUNT_OF_ENTRIES (count _entries) + +private ["_name","_entries","_display","_newTarget","_counter","_card","_ctrl","_code"]; +_name = _this select 0; +if (isDedicated) exitwith{}; +_entries = switch (_name) do { + case "advanced": {[_name] call cse_fnc_getAdvancedOptions_CMS}; + case "examine": {[_name] call cse_fnc_getExamineOptions_CMS}; + case "bandage": {[_name] call cse_fnc_getBandageOptions_CMS}; + case "medication": {[_name] call cse_fnc_getMedicationOptions_CMS}; + case "airway": {[_name] call cse_fnc_getAirwayOptions_CMS}; + case "triage": {[_name] call cse_fnc_getTriageCardOptions_CMS}; + case "drag": {[_name] call cse_fnc_getDragOptions_CMS}; + case "toggle": {[_name] call cse_fnc_getToggleOptions_CMS}; + default {[]}; +}; + +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_medicalMenu'; +if ((_name == "toggle")) exitwith { + + if (CSE_SYS_MEDICAL_INTERACTION_TARGET != player) then { + _newTarget = player; + } else { + _newTarget = CSE_SYS_MEDICAL_INTERACTION_TARGET_PREVIOUS; + }; + + CSE_SYS_MEDICAL_INTERACTION_TARGET_PREVIOUS = CSE_SYS_MEDICAL_INTERACTION_TARGET; + [_newTarget] spawn { + closeDialog 0; + sleep 0.1; + [_this select 0] call cse_fnc_openMenu_CMS; + }; +}; + +CSE_LATEST_DISPLAY_OPTION_MENU_CMS = _name; +lbClear 212; +if (_name == "triage") then { + ctrlEnable[212,true]; + _card = ([CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_getTriageList_CMS); + { + lbadd[212,format["%1 x%2",getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName"),_x select 1]]; + }foreach _card; + if (count _card == 0) then { + lbadd[212,"No Entries"]; + }; +} else { + ctrlEnable[212,false]; +}; + + +for [{_x=START_IDC},{_x <= END_IDC},{_x=_x+1}] do { + _ctrl = (_display displayCtrl (_x)); + _ctrl ctrlSetText ""; + //_ctrl ctrlSetPosition[-100,-100]; + _ctrl ctrlShow false; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + _ctrl ctrlSetTooltip ""; + _ctrl ctrlCommit 0; + +}; + +{ + //player sidechat format["TRIGGERED: %1",_x]; + if (_foreachIndex > END_IDC) exitwith {}; + _ctrl = (_display displayCtrl (START_IDC + _foreachIndex)); + if (!(_foreachIndex > AMOUNT_OF_ENTRIES)) then { + _ctrl ctrlSetText (_x select 0); + _code = format["[CSE_SYS_MEDICAL_INTERACTION_TARGET,PLAYER] spawn { %1 };",(_x select 1),CSE_SYS_MEDICAL_INTERACTION_TARGET,player]; + _ctrl ctrlSetEventHandler ["ButtonClick", _code]; + _ctrl ctrlSetTooltip (_x select 2); + _ctrl ctrlShow true; + } else { + _ctrl ctrlSetText ""; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + }; + _ctrl ctrlCommit 0; +}foreach _entries; + +[] call cse_fnc_updateIcons_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_dropDownTriageCard_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_dropDownTriageCard_CMS.sqf new file mode 100644 index 0000000000..7392e0d818 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_dropDownTriageCard_CMS.sqf @@ -0,0 +1,27 @@ +/** + * fn_dropDownTriageCard_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display","_pos","_ctrl","_curPos","_idc"]; +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_medicalMenu'; +_pos = [ 0,0,0,0]; +_curPos = ctrlPosition (_display displayCtrl 2002); +if ((_curPos select 0) == 0 && (_curPos select 1) == 0) then { + _pos = ctrlPosition (_display displayCtrl 2001); +}; + +for "_idc" from 2002 to 2006 step 1 do +{ + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = (_display displayCtrl _idc); + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; +}; + diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_getCurrentSelectedInjuryData_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_getCurrentSelectedInjuryData_CMS.sqf new file mode 100644 index 0000000000..bc2f6e74f3 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_getCurrentSelectedInjuryData_CMS.sqf @@ -0,0 +1,18 @@ +/** + * fn_getCurrentSelectedInjuryData_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return", "_current"]; + +_return = ""; +if (dialog) then { + _current = lbCurSel 213; + _return = lbData [213,_current]; +}; +_return; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_onMenuOpen_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_onMenuOpen_CMS.sqf new file mode 100644 index 0000000000..74aaef6d10 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_onMenuOpen_CMS.sqf @@ -0,0 +1,67 @@ +/** + * fn_onMenuOpen_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (isnil "CSE_LATEST_DISPLAY_OPTION_MENU_CMS") then { + CSE_LATEST_DISPLAY_OPTION_MENU_CMS = "triage"; +} else { + if (CSE_LATEST_DISPLAY_OPTION_MENU_CMS == "toggle") then { + CSE_LATEST_DISPLAY_OPTION_MENU_CMS = "triage"; + CSE_SYS_MEDICAL_INTERACTION_TARGET = CSE_SYS_MEDICAL_INTERACTION_TARGET_PREVIOUS; + }; +}; + +private ["_display","_target"]; +_target = CSE_SYS_MEDICAL_INTERACTION_TARGET; +CSE_SYS_MEDICAL_INTERACTION_TARGET = _target; +if (isnil "CSE_SYS_MEDICAL_INTERACTION_TARGET_PREVIOUS") then { + CSE_SYS_MEDICAL_INTERACTION_TARGET_PREVIOUS = _target; +}; +[CSE_LATEST_DISPLAY_OPTION_MENU_CMS] call cse_fnc_displayOptions_CMS; + +[] call cse_fnc_updateActivityLog_CMS; +[_target] call cse_fnc_updateUIInfo_CMS; + +// 11 till 18 +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_medicalMenu'; +(_display displayCtrl 11) ctrlSetTooltip localize "STR_CSE_UI_VIEW_TRIAGE_CARD"; +(_display displayCtrl 12) ctrlSetTooltip localize "STR_CSE_UI_EXAMINE_PATIENT"; +(_display displayCtrl 13) ctrlSetTooltip localize "STR_CSE_UI_BANDAGE_FRACTURES"; +(_display displayCtrl 14) ctrlSetTooltip localize "STR_CSE_UI_MEDICATION"; +(_display displayCtrl 15) ctrlSetTooltip localize "STR_CSE_UI_AIRWAY_MANAGEMENT"; +(_display displayCtrl 16) ctrlSetTooltip localize "STR_CSE_UI_ADVANCED_TREATMENT"; +(_display displayCtrl 17) ctrlSetTooltip localize "STR_CSE_UI_DRAG_CARRY"; +(_display displayCtrl 18) ctrlSetTooltip localize "STR_CSE_UI_TOGGLE_SELF"; + +(_display displayCtrl 301) ctrlSetTooltip localize "STR_CSE_UI_SELECT_HEAD"; +(_display displayCtrl 302) ctrlSetTooltip localize "STR_CSE_UI_SELECT_TORSO"; +(_display displayCtrl 303) ctrlSetTooltip localize "STR_CSE_UI_SELECT_ARM_R"; +(_display displayCtrl 304) ctrlSetTooltip localize "STR_CSE_UI_SELECT_ARM_L"; +(_display displayCtrl 305) ctrlSetTooltip localize "STR_CSE_UI_SELECT_LEG_R"; +(_display displayCtrl 306) ctrlSetTooltip localize "STR_CSE_UI_SELECT_LEG_L"; +//if (_target != player) then { + (_display displayCtrl 2001) ctrlSetTooltip localize "STR_CSE_UI_SELECT_TRIAGE_STATUS"; +//}; +(_display displayCtrl 1) ctrlSetText format["%1",[_target] call cse_fnc_getName]; +setMousePosition [ 0.4, 0.4]; + +["cse_onMenuOpen_CMS", "onEachFrame", { + _display = _this select 0; + if (isNull CSE_SYS_MEDICAL_INTERACTION_TARGET) then { + CSE_SYS_MEDICAL_INTERACTION_TARGET = player; + }; + [CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_updateUIInfo_CMS; + [] call cse_fnc_updateActivityLog_CMS; + [CSE_LATEST_DISPLAY_OPTION_MENU_CMS] call cse_fnc_displayOptions_CMS; + _status = [CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_getTriageStatus_CMS; + (_display displayCtrl 2000) ctrlSetText (_status select 0); + (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); + + }, [_display]] call BIS_fnc_addStackedEventHandler; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_openMenu_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_openMenu_CMS.sqf new file mode 100644 index 0000000000..14808565ed --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_openMenu_CMS.sqf @@ -0,0 +1,39 @@ +/** + * fn_openMenu_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_interactionTarget"]; +_interactionTarget = objNull; +if (count _this > 0) then { + _interactionTarget = _this select 0; + +} else { + _interactionTarget = cursortarget; + if (isNull _interactionTarget) then { + _interactionTarget = player; + }; + if (_interactionTarget distance player > 5 || !(_interactionTarget isKindOf "CaManBase")) then { + _interactionTarget = player; + }; +}; + +if (isNull _interactionTarget) then { // _interactionTarget undefined here. WTF? + _interactionTarget = player; +}; + +[format["INTERACTION WITH: %1",_interactionTarget]] call cse_fnc_Debug; +[player,_interactionTarget] call cse_fnc_registerInteractingWith; +CSE_SYS_MEDICAL_INTERACTION_TARGET = _interactionTarget; +createDialog "cse_sys_medicalMenu"; +//[player,"release"] call cse_fnc_treatmentMutex_CMS; // Do we want to force release the treatment event, to prefent deadlock within the CMS Module? + +[_interactionTarget] spawn { + waituntil {sleep 0.1; !dialog}; + [player,_this select 0] call cse_fnc_unregisterInteractingWith; +}; diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_updateActivityLog_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateActivityLog_CMS.sqf new file mode 100644 index 0000000000..2b65b5e630 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateActivityLog_CMS.sqf @@ -0,0 +1,46 @@ +/** + * fn_updateActivityLog_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +[] spawn { + _log = [CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_getActivityLog_CMS; + _counter = 0; + lbclear 214; + { + + //[_caller,_moment,_activity,_type] + lbadd[214, _x select 1]; // moment + lbadd[214, _x select 0]; // name, caller + //lbadd[214, _x select 2]; // activity + lbSetData [214,_counter,_x select 2]; + + _counter = _counter + 1; + }foreach _log; + if (count _log < 1) then { + lbadd[214, "No Activity recorded.."]; + lbadd[214, ""]; + }; + + _log = [CSE_SYS_MEDICAL_INTERACTION_TARGET] call cse_fnc_getQuickViewLog_CMS; + _counter = 0; + lbclear 215; + { + + //[_caller,_moment,_activity,_type] + lbadd[215, _x select 1]; // moment + lbadd[215, _x select 0]; // name, caller + lbSetData [215,_counter,_x select 2]; + _counter = _counter + 1; + }foreach _log; + if (count _log < 1) then { + lbadd[215, "No Data recorded.."]; + lbadd[215, ""]; + }; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_updateBodyImg_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateBodyImg_CMS.sqf new file mode 100644 index 0000000000..4b61cfacc3 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateBodyImg_CMS.sqf @@ -0,0 +1,66 @@ +/** + * fn_updateBodyImg_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit", "_interactionDialog", "_openWounds", "_part", "_total", "_amountOfWoundsSmall", "_amountOfWoundsMedium", "_amountOfWoundsLarge", "_bandagedWounds","_alphaLevel"]; +_openWounds = _this select 0; +_bandagedWounds = _this select 1; + +disableSerialization; +_interactionDialog = uiNamespace getvariable "cse_sys_medicalMenu"; +_colorCalculationsOpenWounds = { + if (_total >0) then { + _green = 0.9; + _blue = 0.9; + for [{_i = 0},{ _i < round(_total)},{ _i = _i +1;}] do { + _green = _green - 0.75; + _blue = _blue - 0.75; + }; + if (_green < 0.0) then { + _green = 0.0; + _blue = 0.0; + }; + _damaged set[_part,true]; + }; +}; +_alphaLevel = 1.0; +_damaged = [false,false,false,false,false,false]; +_availableSelections = [50,51,52,53,54,55]; +_part = 0; + { + private ["_red", "_green", "_blue"]; + _amountOfWoundsSmall = (_x select 0); + _amountOfWoundsMedium = (_x select 1); + _amountOfWoundsLarge = (_x select 2); + _total = (_amountOfWoundsSmall) + _amountOfWoundsMedium + (_amountOfWoundsLarge); + + _red = 1; + _green = 1; + _blue = 1; + call _colorCalculationsOpenWounds; + (_interactionDialog displayCtrl (_availableSelections select _part)) ctrlSetTextColor [_red,_green,_blue,_alphaLevel]; + _part = _part + 1; + }foreach _openWounds; + + { + if (!(_damaged select _foreachIndex)) then { + _amountOfWoundsSmall = (_x select 0); + _amountOfWoundsMedium = (_x select 1); + _amountOfWoundsLarge = (_x select 2); + + _total = (_amountOfWoundsSmall) + _amountOfWoundsMedium + (_amountOfWoundsLarge); + if (_total>0) then { + private ["_red", "_green", "_blue"]; + _red = 1.0; + _green = 0.7; + _blue = 0.7; + (_interactionDialog displayCtrl (_availableSelections select _foreachIndex)) ctrlSetTextColor [_red,_green,_blue,_alphaLevel]; + }; + }; + }foreach _bandagedWounds; diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_updateIcons_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateIcons_CMS.sqf new file mode 100644 index 0000000000..66d5ba34a7 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateIcons_CMS.sqf @@ -0,0 +1,36 @@ +/** + * fn_updateIcons_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_display","_startIDC","_idc","_options","_name","_amount"]; +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_medicalMenu'; +_startIDC = 111; + +_options = ["triage" , "examine", "bandage", "medication", "airway", "advanced", "drag", "toggle"]; +for "_idc" from _startIDC to 118 step 1 do +{ + _name = _options select (_idc - 111); + _amount = switch (_name) do { + case "advanced": {[_name] call cse_fnc_getAdvancedOptions_CMS}; + case "examine": {[_name] call cse_fnc_getExamineOptions_CMS}; + case "bandage": {[_name] call cse_fnc_getBandageOptions_CMS}; + case "medication": {[_name] call cse_fnc_getMedicationOptions_CMS}; + case "airway": {[_name] call cse_fnc_getAirwayOptions_CMS}; + case "triage": {[_name] call cse_fnc_getTriageCardOptions_CMS}; + case "drag": {[_name] call cse_fnc_getDragOptions_CMS}; + case "toggle": {[_name] call cse_fnc_getToggleOptions_CMS}; + default {[]}; + }; + if ((count _amount) > 0 || _idc == 111 || _idc == 118) then { + (_display displayCtrl _idc) ctrlSettextColor [1,1,1,1]; + } else { + (_display displayCtrl _idc) ctrlSettextColor [0.4,0.4,0.4,1]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/ui/fn_updateUIInfo_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateUIInfo_CMS.sqf new file mode 100644 index 0000000000..fa5967549c --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/ui/fn_updateUIInfo_CMS.sqf @@ -0,0 +1,218 @@ +/** + * fn_updateUIInfo_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +private ["_targetObj","_bodyPartText","_bodyPartN","_openWounds","_bandagedWounds","_fractures","_listOfWounds","_listOfBandagedWounds","_listOfFractures","_counter","_nameEntry","_untreatedWounds" ,"_remainder", "_numberOf", "_airwayStatus", "_airwayTreated"]; +_targetObj = _this select 0; + +_bodyPartText = (call cse_fnc_getSelectedBodyPart_CMS); +_bodyPartN = [_bodyPartText] call cse_fnc_getBodyPartNumber_CMS; + +if (_bodyPartN < 0 || _bodyPartN > 5) exitwith {}; +_openWounds = [_targetObj,"cse_openWounds"] call cse_fnc_getVariable; +_bandagedWounds = [_targetObj,"cse_bandagedWounds"] call cse_fnc_getVariable; +_fractures = [_targetObj,"cse_fractures"] call cse_fnc_getVariable; +_airwayStatus = [_targetObj,"cse_airway"] call cse_fnc_getVariable; +/*_openWounds = [_targetObj,"cse_openWounds"] call cse_fnc_getMonitoredVariableValue; +_bandagedWounds = [_targetObj,"cse_bandagedWounds"] call cse_fnc_getMonitoredVariableValue; +_fractures = [_targetObj,"cse_fractures"] call cse_fnc_getMonitoredVariableValue;*/ + +if (count _this > 1) then { + switch (_this select 1) do { + case "cse_openWounds": { _openWounds = _this select 2; }; + case "cse_bandagedWounds": { _bandagedWounds = _this select 2; }; + case "cse_fractures": { _fractures = _this select 2; }; + }; +}; + +[_openWounds,_bandagedWounds] spawn cse_fnc_updateBodyImg_CMS; +_listOfWounds = _openWounds select _bodyPartN; +_listOfBandagedWounds = _bandagedWounds select _bodyPartN; +_listOfFractures = _fractures select _bodyPartN; + +// TODO collect all information first, then clear the lb and fill in with details. Also; use ctrl instead of IDC. +_numberOf = 0; +lbClear 213; + +_displayBodyPartText = switch (_bodyPartText) do { + case "head": { + localize "STR_CSE_UI_HEAD"; + }; + case "body": { + localize "STR_CSE_UI_TORSO"; + }; + case "hand_r": { + localize "STR_CSE_UI_ARM_R"; + }; + case "hand_l": { + localize "STR_CSE_UI_ARM_L"; + }; + case "leg_r": { + localize "STR_CSE_UI_LEG_R"; + }; + case "leg_l": { + localize "STR_CSE_UI_LEG_L"; + }; + default {"-"}; +}; + + +lbadd[213,format[localize "STR_CSE_UI_SELECTED_BODY_PART",_displayBodyPartText]]; +lbSetData [213, _numberOf, ""]; +lbSetColor [213, _numberOf, [0.27, 0.40, 0.26, 1]]; +//[] spawn cse_fnc_updateActivityLog_CMS; +_numberOf = _numberOf + 1; + +if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + _airwayTreated = _targetObj getvariable ["cse_airwayTreated", false]; + + if (_airwayStatus > 0) then { + _nameEntry = switch (_airwayStatus) do { + case 0: {localize "STR_CSE_UI_NORMAL_BREATHING"}; + case 1: {localize "STR_CSE_UI_DIFFICULT_BREATHING"}; + case 2: {localize "STR_CSE_UI_ALMOST_NO_BREATHING"}; + default {localize "STR_CSE_UI_NO_BREATHING"}; + }; + + if (!(alive _targetObj) || (_targetObj getvariable ["cse_isDead", false])) then { + lbadd[213,format["%1",localize "STR_CSE_UI_NO_BREATHING"]]; + } else { + lbadd[213,format["%1",_nameEntry]]; + }; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; + } else { + if (!(alive _targetObj) || (_targetObj getvariable ["cse_isDead", false])) then { + lbadd[213,format["%1",localize "STR_CSE_UI_NO_BREATHING"]]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; + }; + }; + + if (_airwayTreated) then { + lbadd[213,localize "STR_CSE_UI_STATUS_NPA_APPLIED"]; + lbSetData [213, _numberOf, ""]; + lbSetColor [213, _numberOf, [0.5, 0.5, 0, 1]]; + _numberOf = _numberOf + 1; + }; +}; + +if (([_targetObj,"cse_isBleeding_CMS"] call cse_fnc_getVariable)) then { + lbadd[213,localize "STR_CSE_UI_STATUS_BLEEDING"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; +if (([_targetObj,"cse_hasLostBlood_CMS"] call cse_fnc_getVariable)) then { + lbadd[213,localize "STR_CSE_UI_STATUS_LOST_BLOOD"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; + +if (([_targetObj,"cse_hasPain_CMS"] call cse_fnc_getVariable)) then { + lbadd[213,localize "STR_CSE_UI_STATUS_PAIN"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; +if (([_targetObj, _bodyPartText] call cse_fnc_hasTourniquetAppliedTo_CMS)) then { + lbadd[213,localize "STR_CSE_UI_STATUS_TOURNIQUET_APPLIED"]; + lbSetColor [213, _numberOf, [0.5, 0.5, 0, 1]]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; + +_counter = 0; +{ + if (_x > 0) then { + + _untreatedWounds = floor _x; + _remainder = _x - (floor _x); + + _nameEntry = switch (_counter) do { + case 0: {localize "STR_CSE_UI_SMALL"}; + case 1: {localize "STR_CSE_UI_MEDIUM"}; + case 2: {localize "STR_CSE_UI_LARGE"}; + default {localize "STR_CSE_UI_SMALL"}; + }; + + if (_untreatedWounds > 1) then { + lbadd[213,format[localize "STR_CSE_UI_MULTIPLE_OPEN_WOUNDS",_nameEntry,_untreatedWounds]]; + lbSetData [213, _numberOf, format["open_wound_%1",_counter]]; + lbSetColor [213, _numberOf, [0.6, 0, 0, 1]]; + _numberOf = _numberOf + 1; + } else { + if (_untreatedWounds == 1) then { + lbadd[213,format[localize "STR_CSE_UI_SINGLE_OPEN_WOUND",_nameEntry]]; + lbSetData [213, _numberOf, format["open_wound_%1",_counter]]; + lbSetColor [213, _numberOf, [0.6, 0, 0, 1]]; + _numberOf = _numberOf + 1; + }; + }; + + if (_remainder > 0) then { + lbadd[213,format[localize "STR_CSE_UI_PARTIAL_OPEN_WOUND",_nameEntry]]; + lbSetData [213, _numberOf, format["open_wound_%1",_counter]]; + lbSetColor [213, _numberOf, [0.6, 0, 0, 1]]; + _numberOf = _numberOf + 1; + }; + }; + _counter = _counter + 1; +}foreach _listOfWounds; + +_counter = 0; +{ + if (_x > 0) then { + + _untreatedWounds = floor _x; + _remainder = _x - (floor _x); + + _nameEntry = switch (_counter) do { + case 0: {localize "STR_CSE_UI_SMALL"}; + case 1: {localize "STR_CSE_UI_MEDIUM"}; + case 2: {localize "STR_CSE_UI_LARGE"}; + default {localize "STR_CSE_UI_SMALL"}; + }; + + if (_untreatedWounds > 1) then { + lbadd[213,format[localize "STR_CSE_UI_MULTIPLE_BANDAGED_WOUNDS",_nameEntry,_untreatedWounds]]; + lbSetData [213, _numberOf, format["bandaged_wound_%1",_counter]]; + _numberOf = _numberOf + 1; + } else { + if (_untreatedWounds == 1) then { + lbadd[213,format[localize "STR_CSE_UI_SINGLE_BANDAGED_WOUND",_nameEntry]]; + lbSetData [213, _numberOf, format["bandaged_wound_%1",_counter]]; + _numberOf = _numberOf + 1; + }; + }; + + if (_remainder > 0) then { + lbadd[213,format[localize "STR_CSE_UI_PARTIAL_BANDAGED_WOUND",_nameEntry]]; + lbSetData [213, _numberOf, format["bandaged_wound_%1",_counter]]; + _numberOf = _numberOf + 1; + }; + }; + _counter = _counter + 1; +}foreach _listOfBandagedWounds; + +_counter = 0; +{ + if (_x > 0) then { + _nameEntry = switch (_counter) do { + case 0: {localize "STR_CSE_UI_SMALL"}; + case 1: {localize "STR_CSE_UI_MEDIUM"}; + case 2: {localize "STR_CSE_UI_LARGE"}; + default {localize "STR_CSE_UI_SMALL"}; + }; + lbadd[213,format["%1 Fracture x%2",_nameEntry,_x]]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; + }; + _counter = _counter + 1; +}foreach _listOfFractures; + diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_addHeartRateAdjustment_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_addHeartRateAdjustment_CMS.sqf new file mode 100644 index 0000000000..15bc298b87 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_addHeartRateAdjustment_CMS.sqf @@ -0,0 +1,19 @@ +/** + * fn_addHeartRateAdjustment_CMS.sqf + * @Descr: Increase the Heart Rate of a local unit by given number within given amount of seconds. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, value NUMBER, time NUMBER (Amount of seconds), callBack CODE (Called when adjustment is completed)] + * @Return: void + * @PublicAPI: true + */ + +private ["_unit", "_value", "_time", "_adjustment", "_callBack"]; +_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param; +_value = [_this, 1, 0, [0]] call BIS_fnc_Param; +_time = [_this, 2, 1, [0]] call BIS_fnc_Param; +_callBack = [_this, 3, {}, [{}]] call BIS_fnc_Param; + +_adjustment = [_unit, "cse_heartRateAdjustments"] call cse_fnc_getVariable; +_adjustment pushback [_value, _time, _callBack]; +_unit setvariable ["cse_heartRateAdjustments", _adjustment ]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodPressure_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodPressure_CMS.sqf new file mode 100644 index 0000000000..cae57c32a5 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodPressure_CMS.sqf @@ -0,0 +1,29 @@ +/** + * fn_getBloodPressure_CMS.sqf + * @Descr: Calculate the current blood pressure of a unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit to get the blood pressure from.)] + * @Return: ARRAY Blood Pressure. Format [low NUMBER, high NUMBER] + * @PublicAPI: true + */ + +/* + Value is taken because with cardic output and resistance at default values, it will put blood pressure High at 120. +*/ +#define MODIFIER_BP_HIGH 0.229 + +/* + Value is taken because with cardic output and resistance at default values, it will put blood pressure Low at 80. +*/ +#define MODIFIER_BP_LOW 0.1524 + +private ["_unit", "_bloodPressureLow", "_bloodPressureHigh", "_cardiacOutput", "_resistance"]; +_unit = _this select 0; +_cardiacOutput = [_unit] call cse_fnc_getCardiacOutput_CMS; +_resistance = [_unit, "cse_peripheralResistance"] call cse_fnc_getVariable; + +_bloodPressureHigh = (_cardiacOutput * MODIFIER_BP_HIGH) * _resistance; +_bloodPressureLow = (_cardiacOutput * MODIFIER_BP_LOW) * _resistance; + +[_bloodPressureLow, _bloodPressureHigh]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodVolumeChange_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodVolumeChange_CMS.sqf new file mode 100644 index 0000000000..241da785b9 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getBloodVolumeChange_CMS.sqf @@ -0,0 +1,57 @@ +/** + * fn_getBloodVolumeChange_CMS.sqf + * @Descr: Calculates the blood volume change and decreases the IVs given to the unit. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: NUMBER Bloodvolume change + * @PublicAPI: false + */ + +/* + IV Change per second calculation: + 250ml should take 60 seconds to fill. 250/60 = 4.166. +*/ +#define IV_CHANGE_PER_SECOND -4.166 + +/* + Blood Change per second calculation for IVs: + 250ml should take 60 seconds to fill in. Total blood volume is 7000ml = 100%. + 7000/100 = 70 = 1% + 250 / 70 = 3.571428571% + 3.571428571 / 60 = 0.0595% per second. +*/ +#define BLOOD_CHANGE_PER_SECOND 0.0595 + + + +private ["_unit","_bloodVolume","_bloodVolumeChange", "_ivVolume"]; +_unit = _this select 0; + +_bloodVolume = _unit getvariable ["cse_bloodVolume", 100]; +_bloodVolumeChange = -(_unit call cse_fnc_getBloodLoss_CMS); + +if (_bloodVolume < 100.0) then { + if ((_unit getvariable ["cse_salineIVVolume", 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable ["cse_salineIVVolume", 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable ["cse_salineIVVolume",_ivVolume]; + if (["cse_sys_field_rations"] call cse_fnc_isModuleEnabled_F) then { + if ([_unit] call cse_fnc_canDrink_FR) then { + _unit setvariable ["cse_drink_status_fr", (_unit getvariable ["cse_drink_status_fr", 100]) + 0.2]; + }; + }; + }; + if ((_unit getvariable ["cse_plasmaIVVolume", 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable ["cse_plasmaIVVolume", 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable ["cse_plasmaIVVolume",_ivVolume]; + }; + if ((_unit getvariable ["cse_bloodIVVolume", 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable ["cse_bloodIVVolume", 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable ["cse_bloodIVVolume",_ivVolume]; + }; +}; + +_bloodVolumeChange diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_getCardiacOutput_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getCardiacOutput_CMS.sqf new file mode 100644 index 0000000000..31abf63b5a --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getCardiacOutput_CMS.sqf @@ -0,0 +1,24 @@ +/** + * fn_getCardiacOutput_CMS.sqf + * @Descr: Get the cardiac output from the Heart, based on current Heart Rate and Blood Volume. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: NUMBER Current cardiac output. + * @PublicAPI: true + */ + + +/* + Cardiac output (Q or or CO ) is the volume of blood being pumped by the heart, in particular by a left or right ventricle in the time interval of one minute. CO may be measured in many ways, for example dm3/min (1 dm3 equals 1 litre). + + Source: http://en.wikipedia.org/wiki/Cardiac_output +*/ + +// to limit the amount of complex calculations necessary, we take a set modifier to calculate Stroke Volume. +#define MODIFIER_CARDIAC_OUTPUT 19.04761 + +private "_unit"; +_unit = _this select 0; + +((_unit getvariable ["cse_bloodVolume", 100])/MODIFIER_CARDIAC_OUTPUT) + ((_unit getvariable ["cse_heartRate", 80])/80-1); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_getHeartRateChange_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getHeartRateChange_CMS.sqf new file mode 100644 index 0000000000..042a8de778 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_getHeartRateChange_CMS.sqf @@ -0,0 +1,81 @@ +/** + * fn_getHeartRateChange_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: void + * @PublicAPI: false + */ + + +#define HEART_RATE_MODIFIER 0.02 + +private ["_unit", "_heartRate", "_hrIncrease", "_bloodLoss", "_time", "_values", "_adjustment", "_adjustments", "_additionalIncrease", "_change", "_callBack", "_bloodVolume"]; +_unit = _this select 0; +_hrIncrease = 0; +if (!(_unit getvariable ["cse_cardiacArrest_CMS",false])) then { + _heartRate = _unit getvariable ["cse_heartRate", 80]; + _bloodLoss = _unit call cse_fnc_getBloodLoss_CMS; + + _adjustment = _unit getvariable ["cse_heartRateAdjustments", []]; + { + _values = (_x select 0); + if (abs _values > 0) then { + _time = (_x select 1); + _callBack = _x select 2; + if (_time <= 0) then { + _time = 1; + }; + _change = (_values / _time); + _hrIncrease = _hrIncrease + _change; + + if ( (_time - 1) < 0) then { + _time = 0; + _adjustment set [_foreachIndex, ObjNull]; + [_unit] call _callBack; + } else { + _time = _time - 1; + _adjustment set [_foreachIndex, [_values - _change, _time]]; + }; + } else { + _adjustment set [_foreachIndex, ObjNull]; + }; + + }foreach _adjustment; + _adjustment = _adjustment - [ObjNull]; + _unit setvariable ["cse_heartRateAdjustments", _adjustment]; + + _bloodVolume = _unit getvariable ["cse_bloodVolume", 100]; + if (_bloodVolume > 75) then { + if (_bloodLoss >0.0) then { + if (_bloodLoss <0.5) then { + if (_heartRate < 126) then { + _hrIncrease = _hrIncrease + 0.05; + }; + } else { + if (_bloodLoss < 1) then { + if (_heartRate < 161) then { + _hrIncrease = _hrIncrease + 0.1; + }; + } else { + if (_heartRate < 220) then { + _hrIncrease = _hrIncrease + 0.15; + }; + }; + }; + } else { + // Stabalize it + if (_heartRate < (60 + round(random(10)))) then { + _hrIncrease = _hrIncrease + HEART_RATE_MODIFIER; + } else { + if (_heartRate > (77 + round(random(10)))) then { + _hrIncrease = _hrIncrease - HEART_RATE_MODIFIER; + }; + }; + }; + } else { + _hrIncrease = _hrIncrease - HEART_RATE_MODIFIER; + }; +}; +_hrIncrease \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/functions/vitals/fn_updateVitals_CMS.sqf b/TO_MERGE/cse/sys_medical/functions/vitals/fn_updateVitals_CMS.sqf new file mode 100644 index 0000000000..20762f44bc --- /dev/null +++ b/TO_MERGE/cse/sys_medical/functions/vitals/fn_updateVitals_CMS.sqf @@ -0,0 +1,74 @@ +/** + * fn_updateVitals_CMS.sqf + * @Descr: Updates the vitals. Is expected to be called every second. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: false + */ + +private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus"]; +_unit = _this select 0; + +_heartRate = [_unit, "cse_heartRate"] call cse_fnc_getVariable; +_bloodVolume = ([_unit, "cse_bloodVolume"] call cse_fnc_getVariable) + ([_unit] call cse_fnc_getBloodVolumeChange_CMS); +_heartRate = _heartRate + ([_unit] call cse_fnc_getHeartRateChange_CMS); +_bloodPressure = [_unit] call cse_fnc_getBloodPressure_CMS; +_painStatus = [_unit,"cse_pain",0] call cse_fnc_getVariable; + +if (_bloodVolume <= 0) then { + _bloodVolume = 0; +}; + +_unit setvariable ["cse_bloodVolume", _bloodVolume]; +_unit setvariable ["cse_bloodPressure", _bloodPressure]; +_unit setvariable ["cse_heartRate", _heartRate]; + +if (_bloodVolume < 90) then { + if !(_unit getvariable ["cse_hasLostBlood_CMS",false]) then { + _unit setvariable ["cse_hasLostBlood_CMS", true, true]; + }; +} else { + if (_unit getvariable ["cse_hasLostBlood_CMS",false]) then { + _unit setvariable ["cse_hasLostBlood_CMS", false, true]; + }; +}; + +if ((_unit call cse_fnc_getBloodLoss_CMS) > 0) then { + if !(_unit getvariable ["cse_isBleeding_CMS",false]) then { + _unit setvariable ["cse_isBleeding_CMS", true, true]; + }; +} else { + if (_unit getvariable ["cse_isBleeding_CMS",false]) then { + _unit setvariable ["cse_isBleeding_CMS", false, true]; + }; +}; + +if (_painStatus > 0) then { + if !(_unit getvariable ["cse_hasPain_CMS",false]) then { + _unit setvariable ["cse_hasPain_CMS", true, true]; + }; +} else { + if (_unit getvariable ["cse_hasPain_CMS",false]) then { + _unit setvariable ["cse_hasPain_CMS", false, true]; + }; +}; + + +if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + _airwayStatus = _unit getvariable ["cse_airwayStatus", 100]; + if (((_unit getvariable ["cse_airwayOccluded", false]) || (_unit getvariable ["cse_airwayCollapsed", false])) && !((_unit getvariable ["cse_airwaySecured", false]))) then { + if (_airwayStatus >= 0.5) then { + _unit setvariable ["cse_airwayStatus", _airwayStatus - 0.5]; + }; + } else { + if !((_unit getvariable ["cse_airwayOccluded", false]) || (_unit getvariable ["cse_airwayCollapsed", false])) then { + if (_airwayStatus <= 98.5) then { + _unit setvariable ["cse_airwayStatus", _airwayStatus + 1.5]; + }; + }; + }; +}; + +[_unit,_bloodVolume,_bloodPressure,_heartRate] call cse_fnc_bloodConditions_CMS; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/init_UI_options.sqf b/TO_MERGE/cse/sys_medical/init_UI_options.sqf new file mode 100644 index 0000000000..6edeedfe97 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/init_UI_options.sqf @@ -0,0 +1,150 @@ + cse_get_basic_bandage_menus_CMS = { + _subMenus = []; + if (([player,'cse_bandage_basic'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Bandage (Basic)",{([player,'cse_bandage_basic'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"cse_bandage_basic"] spawn cse_fnc_basicBandage_CMS; + }] + ]; + }; + if (([player,'cse_quikclot'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["QuikClot",{([player,'cse_quikclot'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"cse_quikclot"] spawn cse_fnc_basicBandage_CMS; + }] + ]; + }; + if (([player,'cse_bandageElastic'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Bandage (Elastic)",{([player,'cse_bandageElastic'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"cse_bandageElastic"] spawn cse_fnc_basicBandage_CMS; + }] + ]; + }; + if (([player,'cse_packing_bandage'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Packing Bandage",{([player,'cse_packing_bandage'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"cse_packing_bandage"] spawn cse_fnc_basicBandage_CMS; + }] + ]; + }; + if (([player,'cse_tourniquet'] call cse_fnc_hasMagazine)) then { + + }; + + _subMenus + }; + cse_display_basic_bandage_menus_CMS = { + ["Bandage",_this select 2,call cse_get_basic_bandage_menus_CMS] call cse_fnc_gui_displaySubMenuButtons; + }; + cse_display_basic_medication_menus_CMS = { + _subMenus = []; + if (([player,'cse_morphine'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Morphine",{([player,'cse_morphine'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"","cse_morphine"] spawn cse_fnc_medication_CMS; + }] + ]; + }; + if (([player,'cse_atropine'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Atropine",{([player,'cse_atropine'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"","cse_atropine"] spawn cse_fnc_medication_CMS; + }] + ]; + }; + if (([player,'cse_epinephrine'] call cse_fnc_hasMagazine)) then { + _subMenus set [ count _subMenus, + ["Epinephrine",{([player,'cse_epinephrine'] call cse_fnc_hasMagazine)}, + { + [(_this select 1),player,"","cse_epinephrine"] spawn cse_fnc_medication_CMS; + }] + ]; + }; + ["Medication",_this select 2,_subMenus] call cse_fnc_gui_displaySubMenuButtons; + }; + + + + + /*["InteractionMenu","Treatment > ",{((cursortarget iskindof "Man") && !(surfaceIsWater position player))},{ + _subMenus = []; + if ((_this select 1) call cse_fnc_getBloodLoss_CMS > 0) then { + hintSilent format["%1 is bleeding", [_this select 1] call cse_fnc_getName]; + }; + _subMenus set [ count _subMenus, + ["Bandage >",{(isNull([player] call cse_fnc_getCarriedObj) && (count (call cse_get_basic_bandage_menus_CMS)) > 0)}, + { + _this call cse_display_basic_bandage_menus_CMS; + }] + ]; + _subMenus set [ count _subMenus, + ["Medication >",{(isNull([player] call cse_fnc_getCarriedObj))}, + { + _this call cse_display_basic_medication_menus_CMS; + }] + ]; + ["Treatment",_this select 2,_subMenus] call cse_fnc_gui_displaySubMenuButtons; + },1] call cse_fnc_gui_addMenuEntry; + + + ["SelfInteraction","Treatment > ",{!(surfaceIsWater position player)},{ + _subMenus = []; + + if ((_this select 1) call cse_fnc_getBloodLoss_CMS > 0) then { + hintSilent format["%1 is bleeding", [_this select 1] call cse_fnc_getName]; + }; + + _subMenus set [ count _subMenus, + ["Bandage >",{(isNull([player] call cse_fnc_getCarriedObj) && (count (call cse_get_basic_bandage_menus_CMS)) > 0)}, + { + _this call cse_display_basic_bandage_menus_CMS; + }] + ]; + _subMenus set [ count _subMenus, + ["Medication >",{(isNull([player] call cse_fnc_getCarriedObj))}, + { + _this call cse_display_basic_medication_menus_CMS; + }] + ]; + ["Treatment",_this select 2,_subMenus] call cse_fnc_gui_displaySubMenuButtons; + },1] call cse_fnc_gui_addMenuEntry; + + */ + + ["InteractionMenu","Unload Casualties",{((_this call cse_fnc_interactWithVehicle_Crew_Condition) && (count ((_this select 1) getvariable ["cse_loaded_casualties_CMS",[]]) > 0))}, +{ + closeDialog 0; + _loaded = ((_this select 1) getvariable ["cse_loaded_casualties_CMS",[]]); + { + [player,_x,false] call cse_fnc_unload_CMS; + }foreach _loaded +},1] call cse_fnc_gui_addMenuEntry; + + +/* +["InteractionMenu","Drag",{(isNull ([player] call cse_fnc_getCarriedObj))}, +{ + closeDialog 0; + [_this select 1,_this select 0] call CSE_fnc_drag_CMS; +},1] call cse_fnc_gui_addMenuEntry; + + +["InteractionMenu","Carry",{(isNull ([player] call cse_fnc_getCarriedObj))}, +{ + closeDialog 0; + [_this select 1,_this select 0] call cse_fnc_carry_CMS; +},1] call cse_fnc_gui_addMenuEntry; + + +["InteractionMenu","Drop",{!(isNull ([player] call cse_fnc_getCarriedObj))}, +{ + closeDialog 0; + [_this select 1,_this select 0] call cse_fnc_drop_CMS; +},1] call cse_fnc_gui_addMenuEntry;*/ \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/init_basic_medical_system.sqf b/TO_MERGE/cse/sys_medical/init_basic_medical_system.sqf new file mode 100644 index 0000000000..8b4ee432d2 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/init_basic_medical_system.sqf @@ -0,0 +1,7 @@ + + waituntil {!isnil "cse_fnc_registerUnconsciousCondition"}; + + [ + {(([_this select 0,"cse_bloodVolume"] call cse_fnc_getVariable) < 60)}, + {(([_this select 0,"cse_pain"] call cse_fnc_getVariable) > 48)} + ] call cse_fnc_registerUnconsciousCondition; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/init_sys_medical.sqf b/TO_MERGE/cse/sys_medical/init_sys_medical.sqf new file mode 100644 index 0000000000..703ba363af --- /dev/null +++ b/TO_MERGE/cse/sys_medical/init_sys_medical.sqf @@ -0,0 +1,199 @@ +/* +init.sqf +Usage: +Author: Glowbal + +Arguments: +Returns: + +Affects: Local +Executes: call +*/ + +private ["_args"]; +_args = _this; + +CSE_ADVANCED_LEVEL_CMS = 2; +CSE_ALLOW_INSTANT_DEAD_CMS = true; +CSE_ADVANCED_WOUNDS_SETTING_CMS = true; +CSE_ADVANCED_MEDICAL_ROLES_CMS = false; +CSE_BANDAGING_AID_CMS = false; +CSE_ALLOW_AI_FULL_HEAL_CMS = false; +CSE_ALLOW_AIRWAY_INJURIES_CMS = false; +CSE_AID_KIT_REMOVED_UPON_USAGE_CMS = false; +CSE_ENABLE_SETTING_FORUNITS_CMS = 1; +CSE_AID_KIT_RESTRICTIONS_CMS = 0; +CSE_AIDKITMEDICSONLY_CMS = false; +CSE_ALLOW_VEH_CRASH_INJURIES_CMS = true; +CSE_STITCHING_ALLOW_CMS = 0; + +// damage thresholds only in case the damge threshold module hasn't been placed down. +if (isnil "CSE_DAMAGE_THRESHOLD_AI_DMG") then { + CSE_DAMAGE_THRESHOLD_AI_DMG = 1; +}; + +if (isnil "CSE_DAMAGE_THRESHOLD_PLAYERS_DMG") then { + CSE_DAMAGE_THRESHOLD_PLAYERS_DMG = 1; +}; + + +// TODO implement this into a switch structure. +{ + _value = _x select 1; + if (!isnil "_value") then { + if (_x select 0 == "advancedLevel") exitwith { + CSE_ADVANCED_LEVEL_CMS = _x select 1; + }; + if (_x select 0 == "openingOfWounds") exitwith { + CSE_ADVANCED_WOUNDS_SETTING_CMS = _x select 1; + }; + if (_x select 0 == "medicSetting") exitwith { + CSE_ADVANCED_MEDICAL_ROLES_CMS = _x select 1; + }; + if (_x select 0 == "difficultySetting") exitwith { + CSE_MEDICAL_DIFFICULTY = _x select 1; + }; + if (_x select 0 == "bandagingAid") exitwith { + CSE_BANDAGING_AID_CMS = _x select 1; + }; + if (_x select 0 == "allowAIFullHeal") exitwith { + CSE_ALLOW_AI_FULL_HEAL_CMS = _x select 1; + }; + if (_x select 0 == "enableFor") exitwith { + CSE_ENABLE_SETTING_FORUNITS_CMS = _x select 1; + }; + if (_x select 0 == "enableAirway") exitwith { + CSE_ALLOW_AIRWAY_INJURIES_CMS = (_x select 1) == 1; + }; + if (_x select 0 == "aidKitRestrictions") exitwith { + CSE_AID_KIT_RESTRICTIONS_CMS = _x select 1; + }; + if (_x select 0 == "aidKitUponUsage") exitwith { + CSE_AID_KIT_REMOVED_UPON_USAGE_CMS = _x select 1; + }; + if (_x select 0 == "aidKitMedicsOnly") exitwith { + CSE_AIDKITMEDICSONLY_CMS = _x select 1; + }; + if (_x select 0 == "bandageTime") exitwith { + CSE_BANDAGE_WAITING_TIME_CMS = _x select 1; + }; + if (_x select 0 == "vehCrashes") exitwith { + CSE_ALLOW_VEH_CRASH_INJURIES_CMS = _value; + }; + if (_x select 0 == "stitchingMedicsOnly") exitwith { + CSE_STITCHING_ALLOW_CMS = _value; + }; + }; +}foreach _args; + +if (CSE_ADVANCED_LEVEL_CMS == -1) exitwith{}; +call compile preprocessFile "cse\cse_sys_medical\functions.sqf"; +CSE_SYS_MEDICAL_SYSTEM_ENABLED_TAGS = true; +waituntil {!isnil "cse_main"}; +#include "variable_defines.sqf" + + +[ + {(([_this select 0,"cse_heartRate"] call cse_fnc_getVariable) < 20)}, + {(([_this select 0,"cse_bloodVolume"] call cse_fnc_getVariable) < 65)}, + {(([_this select 0,"cse_pain"] call cse_fnc_getVariable) > 48)} +] call cse_fnc_registerUnconsciousCondition; + +if (CSE_ALLOW_AIRWAY_INJURIES_CMS) then { + [ + {(([_this select 0,"cse_airway"] call cse_fnc_getVariable) > 2)} + ] call cse_fnc_registerUnconsciousCondition; +}; + +/* +[ + {([_this select 0,"cse_cardiacArrest_CMS"] call cse_fnc_getVariable)} +] call cse_fnc_registerUnconsciousCondition; +*/ + +cse_sys_medical = true; + +waituntil{!isnil "cse_gui"}; +#include "init_UI_options.sqf"; +#include "init_UI_actions.sqf"; + +if (isnil "CSE_MEDICAL_COMBINED_LOOP_CMS") then { + CSE_MEDICAL_COMBINED_LOOP_CMS = []; +}; + +waituntil{!isnil "cse_gui" && !isnil "cse_main"}; +cse_sys_medical_task_pool_CMS_lastTime = time; +_cms_taskLoop = ' + if ((time - cse_sys_medical_task_pool_CMS_lastTime) >= 1 || true) then { + cse_sys_medical_task_pool_CMS_lastTime = time; + { + if (!alive _x || !local _x) then { + CSE_MEDICAL_COMBINED_LOOP_CMS set [ _forEachIndex, ObjNull]; + } else { + [_x] call cse_fnc_updateVitals_CMS; + _pain = _X getvariable ["cse_pain", 0]; + if (_pain > 5 && (random(1) > 0.5)) then { + _x setvariable ["cse_pain", _pain + 0.002]; + }; + if (_pain > 45) then { + if (random(1) > 0.6) then { + [_X] call cse_fnc_setUnconsciousState; + }; + [_X] spawn cse_fnc_playInjuredSound_CMS; + }; + }; + }foreach CSE_MEDICAL_COMBINED_LOOP_CMS; + CSE_MEDICAL_COMBINED_LOOP_CMS = CSE_MEDICAL_COMBINED_LOOP_CMS - [ObjNull]; + }; + false; '; + +cse_sys_medical_cms_taskLoop_trigger = createTrigger["EmptyDetector", [0,0,0]]; +cse_sys_medical_cms_taskLoop_trigger setTriggerActivation ["NONE", "PRESENT", true]; +cse_sys_medical_cms_taskLoop_trigger setTriggerStatements[_cms_taskLoop, "", ""]; + +if (!hasInterface) exitwith{}; +[player] spawn { + disableSerialization; + _CMSFadingBlackUI = uiNamespace getVariable "CMSFadingBlackUI"; + if (!isnil "_CMSFadingBlackUI") then { + _ctrlFadingBlackUI = _CMSFadingBlackUI displayCtrl 11112; + 2 fadeSound 1; + _ctrlFadingBlackUI ctrlSetTextColor [0.0,0.0,0.0,0.0]; + }; + { + if(_x == "FirstAidKit" || {_x == "Medikit"}) then { + player removeItem _x; + }; + }foreach (items player); + [_this select 0] spawn cse_fnc_effectsLoop_CMS; + + + // This is here for backwards compatability. This code will be removed in the near future. + _showError = false; + { + _configEntry = (configFile >> "CfgMagazines" >> _x); + if([_configEntry, "cse_backwardsCompatMagazineBase_CMS"] call cse_fnc_inheritsFrom) then { + player removeMagazine _x; + player addItem _x; + diag_log format["WARNING: Outdated CMS magazine classname %1 found. Please replace magazine by item variant. Future versions will not support this anymore.", _x]; + _showError = true; + }; + }foreach (magazines player); + if (_showError) then { + ["Outdated CMS Classnames have been found. Please replace magazine classname by item variant. Future versions will not support magazine variant"] call BIS_fnc_error; + }; +}; +CSE_DISPLAY_ADDITIONAL_HINTS_CMS = false; + + +["cse_sys_medical_allowSharedEquipment", ["Disable", "Anyone", "Side Only", "Group Only"], (["cse_sys_medical_allowSharedEquipment", 0] call cse_fnc_getClientSideOptionFromProfile_F), { + [_this] call cse_fnc_debug; + switch (_this select 1) do { + case (1): {player setvariable ["cse_allowSharedEquipmentAccess_CMS", 0, true]}; + case (2): {player setvariable ["cse_allowSharedEquipmentAccess_CMS", 1, true]}; + case (3): {player setvariable ["cse_allowSharedEquipmentAccess_CMS", 2, true]}; + default {player setvariable ["cse_allowSharedEquipmentAccess_CMS", -1, true]}; + }; +}] call cse_fnc_addClientSideOptions_f; + +["cse_sys_medical_allowSharedEquipment","option","Shared Medical Equipment","Set your access level for sharing medical equipment with other players."] call cse_fnc_settingsDefineDetails_F; diff --git a/TO_MERGE/cse/sys_medical/init_ui_actions.sqf b/TO_MERGE/cse/sys_medical/init_ui_actions.sqf new file mode 100644 index 0000000000..4d14d356ac --- /dev/null +++ b/TO_MERGE/cse/sys_medical/init_ui_actions.sqf @@ -0,0 +1,53 @@ + + +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; + +_entries = [ + ["Medical (SELF)", {!([player] call cse_fnc_inWater_f)}, CSE_ICON_PATH + "icon_open_dialog.paa", {closeDialog 0; [player] call cse_fnc_openMenu_CMS; }, "Open Medical Menu (SELF)"], + ["Medical", {((_this select 1) != (_this select 0)) && {(((_this select 0) distance (_this select 1) < 10) && {(_this select 1) isKindOf "CaManBase"} && {!([player] call cse_fnc_inWater_f)})}}, CSE_ICON_PATH + "icon_open_dialog.paa", {closeDialog 0; [_this select 1] call cse_fnc_openMenu_CMS; }, "Open Medical Menu"] +]; +["ActionMenu","medical_menu", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +_entries = [ + ["Unload (Cas)", {((_this call cse_fnc_interactWithVehicle_Crew_Condition) && (count ((_this select 1) getvariable ["cse_loaded_casualties_CMS",[]]) > 0))}, CSE_ICON_PATH + "icon_open_dialog.paa", + { + closeDialog 0; + _loaded = ((_this select 1) getvariable ["cse_loaded_casualties_CMS",[]]); + { + [player,_x,false] call cse_fnc_unload_CMS; + }foreach _loaded + }, "Unload Casualties"] +]; +["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + +_conditionDrag = { + private ["_caller", "_unit", "_return"]; + _caller = _this select 0; + _unit = _this select 1; + _return = false; + if (([_caller] call cse_fnc_canInteract) && {_caller != _unit} && {!([_unit] call cse_fnc_isAwake)}) then { + if !([player] call cse_fnc_inWater_f) then { + if (!isNull _unit) then { + if (_unit != player && (_unit isKindOf "CaManBase")) then { + if (vehicle _unit == _unit) then { + if (vehicle _caller == _caller) then { + if (isNull ([player] call cse_fnc_getCarriedObj)) then { + _return = true; + }; + }; + }; + }; + }; + }; + }; + _return +}; + +_entries = [ + ["Drag", _conditionDrag, CSE_ICON_PATH + "icon_hand.paa", {closeDialog 0; CSE_SYS_MEDICAL_INTERACTION_TARGET = _this select 1;[_this select 0, _this select 1] spawn CSE_fnc_drag_CMS; }, "Drag"], + ["Carry", _conditionDrag, CSE_ICON_PATH + "icon_hand.paa", {closeDialog 0; CSE_SYS_MEDICAL_INTERACTION_TARGET = _this select 1; [_this select 0, _this select 1] spawn cse_fnc_carry_CMS; }, "Carry"], + ["Drop", {(([player] call cse_fnc_getCarriedObj) == (_this select 1))}, CSE_ICON_PATH + "icon_hand.paa", {closeDialog 0; CSE_SYS_MEDICAL_INTERACTION_TARGET = _this select 1; [_this select 0, _this select 1] spawn cse_fnc_drop_CMS; }, "Drop"] +]; +["ActionMenu","medical_menu", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/injuryTypes.h b/TO_MERGE/cse/sys_medical/injuryTypes.h new file mode 100644 index 0000000000..3ab27e2c74 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/injuryTypes.h @@ -0,0 +1,46 @@ +#define NO_INJURY -1 + + +/* FLESH WOUNDS/BLEEDING INJURIES */ +#define SCRATCH 0 +#define MINOR_OPEN_WOUND 1 +#define MEDIUM_OPEN_WOUND 2 +#define LARGE_OPEN_WOUND 3 +#define MINOR_GSW 4 +#define MEDIUM_GSW 5 +#define LARGE_GSW 6 +#define STOMACH_WOUND 7 +#define SCHRAPNEL_WOUND 8 +#define GRAZE_WOUND 9 +#define MINOR_CUT 10 +#define MEDIUM_CUT 11 +#define LARGE_CUT 12 +#define MISSING_FLESH 13 +#define EXPLOSION_WOUND 14 + +/* BURN INJURIES */ +#define MINOR_BURN 40 +#define MEDIUM_BURN 41 +#define HIGH_BURN 42 + +/* INTERNAL BLEEDING */ +#define MINOR_INTERNAL_BLEEDING 50 +#define MEDIUM_INTERNAL_BLEEDING 51 +#define HEAVY_INTERNAL_BLEEDING 52 + +/* BROKEN BONES */ +#define BROKEN_BONE_FEMUR 80 +#define BROKEN_BONE_TIBIA 81 +#define BROKEN_BONE_HUMERUS 82 +#define BROKEN_BONE_RADIAL 83 +#define BROKEN_BONE_SKULL 84 +#define BROKEN_RIB 85 +#define SHATTERED_NECK_BONE 86 +#define BROKEN_C_SPINE 87 + +/* AIRWAY INJURIES */ +#define TENSION_PNEUMOTHORA 200 +#define SIMPLE_PNEUMOTHORA 201 +#define HEMOTHORAX 202 +#define AIRWAY_OBSTRUCTION_PARTIAL 205 +#define AIRWAY_OBSTRUCTION_FULL 204 \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_1.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_1.wav new file mode 100644 index 0000000000..4ac1fe6c7d Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_1.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_2.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_2.wav new file mode 100644 index 0000000000..38bae9cb2a Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_2.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_3.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_3.wav new file mode 100644 index 0000000000..f600d30567 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/fast_3.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_1.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_1.wav new file mode 100644 index 0000000000..73ebe128d6 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_1.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_2.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_2.wav new file mode 100644 index 0000000000..c46da91489 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/norm_2.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_1.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_1.wav new file mode 100644 index 0000000000..3cf199ba51 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_1.wav differ diff --git a/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_2.wav b/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_2.wav new file mode 100644 index 0000000000..ba50746326 Binary files /dev/null and b/TO_MERGE/cse/sys_medical/sounds/heart_beats/slow_2.wav differ diff --git a/TO_MERGE/cse/sys_medical/stringtable.xml b/TO_MERGE/cse/sys_medical/stringtable.xml new file mode 100644 index 0000000000..ce6928d06f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/stringtable.xml @@ -0,0 +1,1422 @@ + + + + + + Open Combat Medical System Menu + ĐÑ‚ĐºÑ€Ñ‹Ñ‚ÑŒ Đ¼ĐµĐ½Ñ Đ¼ĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¾Đ¹ ÑиÑÑ‚ĐµĐ¼Ñ‹ CMS + OtwĂ³rz menu Combat Medical System + Abrir MenĂº CMS + + + Opens the CMS menu + ĐÑ‚ĐºÑ€Ñ‹Đ²Đ°ĐµÑ‚ Đ¼ĐµĐ½Ñ CMS + Otwiera menu CMS + Abre el MenĂº CMS + + + + + Nasopharyngeal Tube + ĐĐ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° + CĂ¡nula NasofarĂ­ngea + Canule NasopharyngĂ©e + Rurka nosowo-gardÅ‚owa + + + Used to keep the airway patent + Đ”Đ»Ñ Đ¾Đ±ĐµÑĐ¿ĐµÑ‡ĐµĐ½Đ¸Ñ Đ¿Ñ€Đ¾Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ´Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Ñ… Đ¿ÑƒÑ‚ĐµĐ¹ + Mantiene libre las vĂ­as aĂ©reas + Maintien les voix respiratoires libres + Używana w celu udrożnienia drĂ³g oddechowych + + + Remove Nasopharyngeal + Đ˜Đ·Đ²Đ»ĐµÑ‡ÑŒ Đ½Đ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½ÑƒÑ Ñ‚Ñ€ÑƒĐ±ĐºÑƒ + Retirar CĂ¡nula NasofarĂ­ngea + Retirer la Canule NasopharyngĂ©e + Wyjmij rurkÄ™ nosowo-gardÅ‚owÄ… + + + Remove the Nasopharyngeal Tube + Đ˜Đ·Đ²Đ»ĐµÑ‡ÑŒ Đ½Đ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½ÑƒÑ Ñ‚Ñ€ÑƒĐ±ĐºÑƒ + Retirar CĂ¡nula NasofarĂ­ngea + Retirer la Canule NasopharyngĂ©e + Wyjmuje rurkÄ™ nosowo-gardÅ‚owÄ… + + + + + Give Blood IV (1000ml) + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ ĐºÑ€Đ¾Đ²ÑŒ (1000 Đ¼Đ») + Give Blood IV (1000ml) + Intravenöse Blutspende (1000ml) + Sangre Intravenosa (1000ml) + Cullot Sanguin IV (1000ml) + Podaj krew IV (1000ml) + + + Give Blood IV (500ml) + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ ĐºÑ€Đ¾Đ²ÑŒ (500 Đ¼Đ») + Give Blood IV (500ml) + Intravenöse Blutspende (500ml) + Sangre Intravenosa (500ml) + Cullot Sanguin IV (500ml) + Podaj krew IV (500ml) + + + Give Blood IV (250ml) + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ ĐºÑ€Đ¾Đ²ÑŒ (250 Đ¼Đ») + Give Blood IV (250ml) + Intravenöse Blutspende (250ml) + Sangre Intravenosa (250ml) + Cullot Sanguin IV (250ml) + Podaj krew IV (250ml) + + + Give Plasma IV (1000ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Đ¿Đ»Đ°Đ·Đ¼Ñƒ (1000 Đ¼Đ») + Give Plasma IV (1000ml) + Intravenöse Plasmaspende (1000ml) + Plasma Intravenoso (1000ml) + Plasma Sanguin IV (1000ml) + Podaj osocze IV (1000ml) + + + Give Plasma IV (500ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Đ¿Đ»Đ°Đ·Đ¼Ñƒ (500 Đ¼Đ») + Give Plasma IV (500ml) + Intravenöse Plasmaspende (500ml) + Plasma Intravenoso (500ml) + Plasma Sanguin IV (500ml) + Podaj osocze IV (500ml) + + + Give Plasma IV (250ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Đ¿Đ»Đ°Đ·Đ¼Ñƒ (250 Đ¼Đ») + Give Plasma IV (250ml) + Intravenöse Plasmaspende (250ml) + Plasma Intravenoso (250ml) + Plasma Sanguin IV (250ml) + Podaj osocze IV (250ml) + + + Give Saline IV (1000ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ (1000 Đ¼Đ») + Give Saline IV (1000ml) + Intravenöse Kochsalzlösung (1000ml) + SoluciĂ³n Salina Intravenosa (1000ml) + Solution Saline 0.9% IV (1000ml) + Podaj solankÄ™ 0,9% IV (1000ml) + + + Give Saline IV (500ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ (500 Đ¼Đ») + Give Saline IV (500ml) + Intravenöse Kochsalzlösung (500ml) + SoluciĂ³n Salina Intravenosa (500ml) + Solution Saline 0.9% IV (500ml) + Podaj solankÄ™ 0,9% IV (500ml) + + + Give Saline IV (250ml) + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ (250 Đ¼Đ») + Give Saline IV (250ml) + Intravenöse Kochsalzlösung (250ml) + SoluciĂ³n Salina Intravenosa (250ml) + Solution Saline 0.9% IV (250ml) + Podaj solankÄ™ 0,9% IV (250ml) + + + Full Heal (Personal Aid Kit) + ĐŸĐ¾Đ»Đ½Đ¾Đµ Đ»ĐµÑ‡ĐµĐ½Đ¸Đµ (Đ°Đ¿Ñ‚ĐµÑ‡ĐºĐ°) + Full Heal (Personal Aid Kit) + Ambulante Versorgung (Erste-Hilfe-Tasche) + Tratamiento Avanzado (Kit de Soporte Vital Avanzado) + Soin Complet (Équipement de support vitale + PeÅ‚ne leczenie (Apteczka) + + + Perform CPR + ĐŸÑ€Đ¾Đ²ĐµÑÑ‚Đ¸ Đ¡Đ›Đ  + Perform CPR + Herz-Lungen-Wiederbelebung + Realizar CPR + Effectuer RCR + Wykonaj RKO + + + Stop CPR + ĐŸÑ€ĐµĐºÑ€Đ°Ñ‚Đ¸Ñ‚ÑŒ Đ¡Đ›Đ  + Stop CPR + Przerwij RKO + Abortar CPR + + + Give the patient a Blood IV of 1000ml. Read the label for further information. + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ Đ¿Đ°Ñ†Đ¸ĐµĐ½Ñ‚Ñƒ 1000 Đ¼Đ» ĐºÑ€Đ¾Đ²Đ¸. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Blood IV of 1000ml. Read the label for further information. + Verabreicht dem Patienten 1000ml Spenderblut. Weitere Informationen auf der Verpackung. + Administrar Sangre de 1000ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Cullot Sanguin de 1000ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 1000ml krwi dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Blood IV of 500ml. Read the label for further information. + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ Đ¿Đ°Ñ†Đ¸ĐµĐ½Ñ‚Ñƒ 500 Đ¼Đ» ĐºÑ€Đ¾Đ²Đ¸. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Blood IV of 500ml. Read the label for further information. + Verabreicht dem Patienten 500ml Spenderblut. Weitere Informationen auf der Verpackung. + Administrar Sangre de 500ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Cullot Sanguin de 500ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 500ml krwi dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Blood IV of 250ml. Read the label for further information. + ĐŸĐµÑ€ĐµĐ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 500 Đ¼Đ» ĐºÑ€Đ¾Đ²Đ¸. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Blood IV of 250ml. Read the label for further information. + Verabreicht dem Patienten 250ml Spenderblut. Weitere Informationen auf der Verpackung. + Administrar Sangre de 250ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Cullot Sanguin de 250ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 250ml krwi dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Plasma IV of 1000ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 1000 Đ¼Đ» Đ¿Đ»Đ°Đ·Đ¼Ñ‹. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Plasma IV of 1000ml. Read the label for further information. + Verabreicht dem Patienten 1000ml Blutplasma. Weitere Informationen auf der Verpackung. + Administrar Plasma de 1000ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Plasma Sanguin de 1000ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 1000ml osocza dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Plasma IV of 500ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 500 Đ¼Đ» Đ¿Đ»Đ°Đ·Đ¼Ñ‹. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Plasma IV of 500ml. Read the label for further information. + Verabreicht dem Patienten 500ml Blutplasma. Weitere Informationen auf der Verpackung. + Administrar Plasma de 500ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Plasma Sanguin de 500ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 500ml osocza dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Plasma IV of 250ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 250 Đ¼Đ» Đ¿Đ»Đ°Đ·Đ¼Ñ‹. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Plasma IV of 250ml. Read the label for further information. + Verabreicht dem Patienten 250ml Blutplasma. Weitere Informationen auf der Verpackung. + Administrar Plasma de 250ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Plasma Sanguin de 250ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 250ml osocza dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Saline IV of 1000ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 1000 Đ¼Đ» Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€Đ°. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Saline IV of 1000ml. Read the label for further information. + Verabreicht dem Patienten 1000ml Kochsalzlösung. Weitere Informationen auf der Verpackung. + Administrar SoluciĂ³n Salina de 1000ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Solution Saline 0.9% de 1000ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 1000ml 0,9% roztworu soli fizjologicznej dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Saline IV of 500ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 500 Đ¼Đ» Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€Đ°. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Saline IV of 500ml. Read the label for further information. + Verabreicht dem Patienten 500ml Kochsalzlösung. Weitere Informationen auf der Verpackung. + Administrar SoluciĂ³n Salina de 500ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Solution Saline 0.9% de 500ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 500ml 0,9% roztworu soli fizjologicznej dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Give the patient a Saline IV of 250ml. Read the label for further information. + Đ’Đ»Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ¼Ñƒ 250 Đ¼Đ» Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€Đ°. Đ¡Đ¼. Đ¸Đ½Ñ„Đ¾Ñ€Đ¼Đ°Ñ†Đ¸Ñ Đ½Đ° ÑÑ‚Đ¸ĐºĐµÑ‚ĐºĐµ. + Give the patient a Saline IV of 250ml. Read the label for further information. + Verabreicht dem Patienten 250ml Kochsalzlösung. Weitere Informationen auf der Verpackung. + Administrar SoluciĂ³n Salina de 250ml. Lea la etiqueta para mĂ¡s informaciĂ³n. + Administrer Solution Saline 0.9% de 250ml. Lire l'Ă©tiquette pour plus d'information. + Przetacza pacjentowi 250ml 0,9% roztworu soli fizjologicznej dożylnie (IV). Przeczytaj etykietÄ™, aby dowiedzieć siÄ™ wiÄ™cej. + + + Fully heal a soldier. + ĐŸĐ¾Đ»Đ½Đ¾ÑÑ‚ÑŒÑ Đ²Ñ‹Đ»ĐµÑ‡Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾. + Fully heal a soldier. + Heilt einen Soldaten vollständig. + Curar completamente al herido. + Soigner ComplĂªtement le Soldat. + Pozwala w peÅ‚ni wyleczyć pacjenta. + + + Perform CPR. Success can stabilize heart rate and blood pressure. + ĐŸÑ€Đ¾Đ²ĐµÑÑ‚Đ¸ ÑĐµÑ€Đ´ĐµÑ‡Đ½Đ¾-Đ»ĐµĐ³Đ¾Ñ‡Đ½ÑƒÑ Ñ€ĐµĐ°Đ½Đ¸Đ¼Đ°Ñ†Đ¸Ñ. Đ’ ÑĐ»ÑƒÑ‡Đ°Đµ уÑĐ¿ĐµÑ…Đ° ÑÑ‚Đ°Đ±Đ¸Đ»Đ¸Đ·Đ¸Ñ€ÑƒÑÑ‚ÑÑ Đ¿ÑƒĐ»ÑŒÑ Đ¸ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ. + Perform CPR. Success can stabilize heart rate and blood pressure. + Herz-Lungen-Wiederbelebung, bei Erfolg können sich Puls und Blutdruck stabilisieren. + Realizar CPR. Puede estabilizar la frecuencia cardiaca y la presiĂ³n arterial. + Effectuer RCR. Le succes de la maneuvre peut retablir un pouls et une tention artĂ©riel. + Wykonaj RKO. Sukces może ustabilizować puls oraz ciÅ›nienie krwi. + + + Stop providing CPR. + ĐŸÑ€ĐµĐºÑ€Đ°Ñ‚Đ¸Ñ‚ÑŒ ÑĐµÑ€Đ´ĐµÑ‡Đ½Đ¾-Đ»ĐµĐ³Đ¾Ñ‡Đ½ÑƒÑ Ñ€ĐµĐ°Đ½Đ¸Đ¼Đ°Ñ†Đ¸Ñ. + Stop providing CPR. + Przerwij wykonywanie RKO. + Dejar de aplicar CPR + + + Stitch Wounds. + Đ—Đ°ÑˆĐ¸Ñ‚ÑŒ Ñ€Đ°Đ½Ñ‹. + Suturar Heridas + + + Stitch bandaged wounds. + Đ—Đ°ÑˆĐ¸Ñ‚ÑŒ Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ°Đ½Đ½Ñ‹Đµ Ñ€Đ°Đ½Ñ‹. + Suturar Heridas Vendadas + + + + + Field Dressing (Basic) + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° (Đ¾Đ±Ñ‹Ñ‡Đ½Đ°Ñ) + Vendaje de Campaña (BĂ¡sico) + + + + Apply when wounds have been bandaged + ĐĐ°ĐºĐ»Đ°Đ´Ñ‹Đ²Đ°ĐµÑ‚ÑÑ Đ¿Đ¾Ñле Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ + Aplicar cuando las heridas han sido vendadas + + + Field Dressing (QuikClot) + ĐŸĐµÑ€Đ²Đ¸Ñ‡Đ½Ñ‹Đ¹ Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ¾Ñ‡Đ½Ñ‹Đ¹ Đ¿Đ°ĐºĐµÑ‚ (QuikClot) + Vendaje de Campaña (QuikClot) + + + Apply to cloth the wound and stop bleeding + ĐŸÑ€Đ¸Đ¼ĐµĐ½ÑĐµÑ‚ÑÑ Đ´Đ»Ñ Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ + Aplicar para detener el sangrado + + + Field Dressing (Elastic) + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° (Đ´Đ°Đ²ÑÑ‰Đ°Ñ) + Vendaje de Campaña (ElĂ¡stico) + + + For extra pressure, apply when wounds have been bandaged + ĐбеÑĐ¿ĐµÑ‡Đ¸Đ²Đ°ĐµÑ‚ Đ¿Ñ€Đ¸Đ¶Đ°Ñ‚Đ¸Đµ Ñ€Đ°Đ½Ñ‹ Đ¿Đ¾Ñле Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ + Aplicar a las heridas vendadas para mĂ¡s presiĂ³n + + + Packing Bandage + Đ¢Đ°Đ¼Đ¿Đ¾Đ½Đ¸Ñ€ÑƒÑÑ‰Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° + Vendaje Compresivo + + + Apply on medium to large wounds + ĐŸÑ€Đ¸Đ¼ĐµĐ½ÑĐµÑ‚ÑÑ Đ¿Ñ€Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¸ÑÑ… ÑÑ€ĐµĐ´Đ½ĐµĐ³Đ¾ и Đ±Đ¾Đ»ÑŒÑˆĐ¾Đ³Đ¾ Ñ€Đ°Đ·Đ¼ĐµÑ€Đ° + Aplicar en heridas medianas o grandes + + + Remove Tourniquet + Đ¡Đ½ÑÑ‚ÑŒ Đ¶Đ³ÑƒÑ‚ + Quitar Torniquete + + + Remove applied Tourniquet + Đ¡Đ½ÑÑ‚ÑŒ Ñ€Đ°Đ½ĐµĐµ Đ½Đ°Đ»Đ¾Đ¶ĐµĐ½Đ½Ñ‹Đ¹ Đ¶Đ³ÑƒÑ‚ + Quitar Torniquetes + + + Tourniquet + Đ–Đ³ÑƒÑ‚ + Torniquete + + + Apply on limbs only. Limits blood loss on limb. + ĐĐ°ĐºĐ»Đ°Đ´Ñ‹Đ²Đ°ĐµÑ‚ÑÑ Ñ‚Đ¾Đ»ÑŒĐºĐ¾ Đ½Đ° ĐºĐ¾Đ½ĐµÑ‡Đ½Đ¾ÑÑ‚Đ¸. ĐĐ³Ñ€Đ°Đ½Đ¸Ñ‡Đ¸Đ²Đ°ĐµÑ‚ ĐºÑ€Đ¾Đ²Đ¾Đ¿Đ¾Ñ‚ĐµÑ€Ñ Đ¸Đ· ĐºĐ¾Đ½ĐµÑ‡Đ½Đ¾ÑÑ‚Đ¸. + Aplicar sĂ³lo en las extremidades. Limita la pĂ©rdida de sangre en las extremidades. + + + + + Drag + Đ¢Đ°Ñ‰Đ¸Ñ‚ÑŒ + Arrastrar + + + Drag %1 + Đ¢Đ°Ñ‰Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Arrastrar a %1r + + + Carry + ĐеÑÑ‚Đ¸ + Cargar + + + Carry %1 + ĐеÑÑ‚Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Cargar a %1 + + + Bodybag + ĐœĐµÑˆĐ¾Đº Đ´Đ»Ñ Ñ‚Ñ€ÑƒĐ¿Đ¾Đ² + Bolsa para cadĂ¡veres + + + Put body in bodybag + ĐŸĐ¾Đ¼ĐµÑÑ‚Đ¸Ñ‚ÑŒ Ñ‚Ñ€ÑƒĐ¿ Đ² Đ¼ĐµÑˆĐ¾Đº + Meter cuerpo en la bolsa para cadĂ¡veres + + + Drop + ĐŸĐ¾Đ»Đ¾Đ¶Đ¸Ñ‚ÑŒ + Soltar + + + Drop %1 + ĐŸĐ¾Đ»Đ¾Đ¶Đ¸Ñ‚ÑŒ %1 + Soltar a %1 + + + Load in Vehicle + ĐŸĐ¾Đ³Ñ€ÑƒĐ·Đ¸Ñ‚ÑŒ Đ² Ñ‚Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚ + Meter en vehĂ­culo + + + Load %1 + ĐŸĐ¾Đ³Ñ€ÑƒĐ·Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Cargar a %1 + + + Unload + Đ’Ñ‹Đ³Ñ€ÑƒĐ·Đ¸Ñ‚ÑŒ + Descargar + + + Unload %1 + Đ’Ñ‹Đ³Ñ€ÑƒĐ·Đ¸Ñ‚ÑŒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Descargar a %1 + + + + + Check Pulse + ĐŸÑ€Đ¾Đ²ĐµÑ€Đ¸Ñ‚ÑŒ Đ¿ÑƒĐ»ÑŒÑ + Comprobar Pulso + + + Find the Heart Rate + ĐĐ°Ñ‰ÑƒĐ¿Đ°Ñ‚ÑŒ Đ¿ÑƒĐ»ÑŒÑ + Encontrar el ritmo cardiaco + + + Check Blood Pressure + ĐŸÑ€Đ¾Đ²ĐµÑ€Đ¸Ñ‚ÑŒ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ + Comprobar PresiĂ³n Arterial + + + Find out what Blood Pressure patient has + Đ£Đ·Đ½Đ°Ñ‚ÑŒ Đ°Ñ€Ñ‚ĐµÑ€Đ¸Đ°Đ»ÑŒĐ½Đ¾Đµ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ + Comprobar PresiĂ³n Arterial + + + Check Response + ĐŸÑ€Đ¾Đ²ĐµÑ€Đ¸Ñ‚ÑŒ Ñ€ĐµĐ°ĐºÑ†Đ¸Ñ + Comprobar Respuesta + + + + Check if patient is responsive + ĐŸÑ€Đ¾Đ²ĐµÑ€Đ¸Ñ‚ÑŒ, Ñ€ĐµĐ°Đ³Đ¸Ñ€ÑƒĐµÑ‚ ли Ñ€Đ°Đ½ĐµĐ½Ñ‹Đ¹ Đ½Đ° Ñ€Đ°Đ·Đ´Ñ€Đ°Đ¶Đ¸Ñ‚ĐµĐ»Đ¸ + Comprobar si el paciente reacciona + + + + + Morphine + ĐœĐ¾Ñ€Ñ„Đ¸Đ½ + Morfina + + + Good to counter pain + Đ­Ñ„Ñ„ĐµĐºÑ‚Đ¸Đ²Đ½Đ¾Đµ Đ¾Đ±ĐµĐ·Đ±Đ¾Đ»Đ¸Đ²Đ°ÑÑ‰ĐµĐµ ÑÑ€ĐµĐ´ÑÑ‚Đ²Đ¾ + Alivia el dolor + + + Atropine + ĐÑ‚Ñ€Đ¾Đ¿Đ¸Đ½ + Atropina + + + Relaxes mussles + Đ Đ°ÑÑлаблÑĐµÑ‚ Đ¼Ñ‹ÑˆÑ†Ñ‹ + AntiarrĂ­tmico + + + Epinephrine + ĐĐ´Ñ€ĐµĐ½Đ°Đ»Đ¸Đ½ + Epinefrina + + + Adrenaline to get the heart going + Đ”Đ»Ñ Đ²Đ¾Đ·Đ¾Đ±Đ½Đ¾Đ²Đ»ĐµĐ½Đ¸Ñ ÑĐµÑ€Đ´ĐµÑ‡Đ½Đ¾Đ¹ деÑÑ‚ĐµĐ»ÑŒĐ½Đ¾ÑÑ‚Đ¸ + Incrementa la frecuencia cardiaca + + + + + EXAMINE & TREATMENT + ĐĐ¡ĐœĐĐ¢Đ  Đ˜ ЛЕЧЕĐĐ˜Đ• + EXAMINE & TREATMENT + EXAMINAR & TRATAMIENTO + EXAMINER & TRAITEMENTS + BADANIE & LECZENIE + + + STATUS + Đ¡ĐĐ¡Đ¢ĐĐ¯ĐĐ˜Đ• + STATUS + ESTADO + ÉTATS + STATUS + + + OVERVIEW + ĐĐ‘Đ©ĐĐ¯ Đ˜ĐФĐĐ ĐœĐĐ¦Đ˜Đ¯ + OVERVIEW + DESCRIPCIĂ“N + DESCRIPTION + OPIS + + + ACTIVITY LOG + ĐŸĐ ĐВЕДЕĐĐĐ«Đ• ĐœĐĐĐ˜ĐŸĐ£Đ›Đ¯Đ¦Đ˜Đ˜ + ACTIVITY LOG + REGISTRO DE ACTIVIDAD + REGISTRE DES SOINS + LOGI AKTYWNOÅCI + + + QUICK VIEW + Đ‘Đ«Đ¡Đ¢Đ Đ«Đ™ ĐĐ¡ĐœĐĐ¢Đ  + QUICK VIEW + VISTA RĂPIDA + VUE RAPIDE + SZYBKI PODGLÄ„D + + + None + Đе Ñ€Đ°Đ½ĐµĐ½ + Ninguno + Aucun + Brak + + + Minor + ĐеÑÑ€Đ¾Ñ‡Đ½Đ°Ñ Đ¿Đ¾Đ¼Đ¾Ñ‰ÑŒ + Menor + Mineur + Normalny + + + Delayed + Đ¡Ñ€Đ¾Ñ‡Đ½Đ°Ñ Đ¿Đ¾Đ¼Đ¾Ñ‰ÑŒ + Diferido + Urgent + OpĂ³Åºniony + + + Immediate + ĐĐµĐ¾Ñ‚Đ»Đ¾Đ¶Đ½Đ°Ñ Đ¿Đ¾Đ¼Đ¾Ñ‰ÑŒ + Inmediato + ImmĂ©diat + Natychmiastowy + + + Deceased + ĐœĐ¾Ñ€Đ³ + Fallecido + DĂ©cĂ©dĂ© + Nie żyje + + + View triage Card + Đ¡Đ¼Đ¾Ñ‚Ñ€ĐµÑ‚ÑŒ Đ¿ĐµÑ€Đ²Đ¸Ñ‡Đ½ÑƒÑ ĐºĐ°Ñ€Ñ‚Đ¾Ñ‡ĐºÑƒ + Ver Triage + Voir Carte de Triage + Pokaż kartÄ™ segregacyjnÄ… + + + Examine Patient + ĐÑĐ¼Đ¾Ñ‚Ñ€ĐµÑ‚ÑŒ Đ¿Đ°Ñ†Đ¸ĐµĐ½Ñ‚Đ° + Examinar Paciente + Examiner Patient + Zbadaj pacjenta + + + Bandage / Fractures + Đ Đ°Đ½Ñ‹ / Đ¿ĐµÑ€ĐµĐ»Đ¾Đ¼Ñ‹ + Vendajes/Fracturas + Bandages / Fractures + Bandaże / ZÅ‚amania + + + Medication + ĐœĐµĐ´Đ¸ĐºĐ°Đ¼ĐµĐ½Ñ‚Ñ‹ + MedicaciĂ³n + MĂ©dications + Leki + + + Airway Management + Đ”Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Đµ Đ¿ÑƒÑ‚Đ¸ + VĂ­as AĂ©reas + Gestion Des Voie REspiratoire + Drogi oddechowe + + + Advanced Treatments + Đ¡Đ¿ĐµÑ†Đ¸Đ°Đ»ÑŒĐ½Đ°Ñ Đ¼ĐµĐ´Đ¿Đ¾Đ¼Đ¾Ñ‰ÑŒ + Tratamientos Avanzados + Traitement AvancĂ© + Zaawansowane zabiegi + + + Drag/Carry + Đ¢Đ°Ñ‰Đ¸Ñ‚ÑŒ/Đ½ĐµÑÑ‚Đ¸ + Arrastrar/Cargar + Glisser/Porter + CiÄ…gnij/NieÅ› + + + Toggle (Self) + Đ›ĐµÑ‡Đ¸Ñ‚ÑŒ ÑебÑ/Đ´Ñ€ÑƒĐ³Đ¾Đ³Đ¾ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ + Activer (sois) + PrzeÅ‚Ä…cz (na siebie) + Alternar + + + Select triage status + Đ¡Đ¾Ñ€Ñ‚Đ¸Ñ€Đ¾Đ²ĐºĐ° + Seleccionar estado de Triage + Selectioner l'Ă©tat de Triage + Wybierz priorytet + + + Select Head + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Đ³Đ¾Đ»Đ¾Đ²Ñƒ + Seleccionar Cabeza + Selectioner TĂªte + Wybierz gÅ‚owÄ™ + + + Select Torso + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Ñ‚Đ¾Ñ€Ñ + Seleccionar Torso + Selectioner Torse + Wybierz tors + + + Select Left Arm + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Đ»ĐµĐ²ÑƒÑ Ñ€ÑƒĐºÑƒ + Seleccionar Brazo Izquierdo + Selectioner Bras Gauche + Wybierz lewÄ… rÄ™kÄ™ + + + Select Right Arm + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Đ¿Ñ€Đ°Đ²ÑƒÑ Ñ€ÑƒĐºÑƒ + Seleccionar Brazo Derecho + Selectioner Bras Droit + Wybierz prawÄ… rÄ™kÄ™ + + + Select Left Leg + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Đ»ĐµĐ²ÑƒÑ Đ½Đ¾Đ³Ñƒ + Seleccionar Pierna Izquierda + Selectioner Jambe Gauche + Wybierz lewÄ… nogÄ™ + + + Select Right Leg + Đ’Ñ‹Đ±Ñ€Đ°Ñ‚ÑŒ Đ¿Ñ€Đ°Đ²ÑƒÑ Đ½Đ¾Đ³Ñƒ + Seleccionar Pierna Derecha + Selectioner Jambe Droite + Wybierz prawÄ… nogÄ™ + + + Head + Đ“Đ¾Đ»Đ¾Đ²Đ° + Cabeza + TĂªte + GÅ‚owa + + + Torso + Đ¢Đ¾Ñ€Ñ + Torse + Tors + + + Left Arm + Đ›ĐµĐ²Đ°Ñ Ñ€ÑƒĐºĐ° + Brazo Izquierdo + Bras Gauche + Lewa rÄ™ka + + + Right Arm + ĐŸÑ€Đ°Đ²Đ°Ñ Ñ€ÑƒĐºĐ° + Brazo Derecho + Bras Droit + Prawa rÄ™ka + + + Left Leg + Đ›ĐµĐ²Đ°Ñ Đ½Đ¾Đ³Đ° + Pierna Izquierda + Jambe Gauche + Lewa noga + + + Right Leg + ĐŸÑ€Đ°Đ²Đ°Ñ Đ½Đ¾Đ³Đ° + Pierna Derecha + Jambe Droite + Prawa noga + + + Body Part: %1 + ЧаÑÑ‚ÑŒ Ñ‚ĐµĐ»Đ°: %1 + Parte del cuerpo: %1 + Partie du corps: %1 + Część ciaÅ‚a: %1 + + + Small + Đ¼Đ°Đ»Đ¾Đ³Đ¾ Ñ€Đ°Đ·Đ¼ĐµÑ€Đ° + Pequeña + Petite + maÅ‚ym + + + Medium + ÑÑ€ĐµĐ´Đ½ĐµĐ³Đ¾ Ñ€Đ°Đ·Đ¼ĐµÑ€Đ° + Mediana + moyenne + Å›rednim + + + Large + Đ±Đ¾Đ»ÑŒÑˆĐ¾Đ³Đ¾ Ñ€Đ°Đ·Đ¼ĐµÑ€Đ° + Grande + Grande + dużym + + + There are %2 %1 Open Wounds + %2 Đ¾Ñ‚ĐºÑ€Ñ‹Ñ‚Ñ‹Đµ Ñ€Đ°Đ½Ñ‹ %1 + Hay %2 Heridas Abiertas %1 + Il y a %2 %1 Blessure Ouverte + Widzisz otwarte rany w iloÅ›ci %2 o %1 rozmiarze + + + There is 1 %1 Open Wound + ĐÑ‚ĐºÑ€Ñ‹Ñ‚Đ°Ñ Ñ€Đ°Đ½Đ° %1 + Hay 1 Herida Abierta %1 + Il y a 1 blessure ouverte %1 + Widzisz 1 otwartÄ… ranÄ™ o %1 rozmiarze + + + There is a partial %1 Open wound + ЧаÑÑ‚Đ¸Ñ‡Đ½Đ¾ Đ¾Ñ‚ĐºÑ€Ñ‹Ñ‚Đ°Ñ Ñ€Đ°Đ½Đ° %1 + Hay una herida parcial abierta %1 + Il y a une Blessure Patiellement Ouverte %1 + Widzisz częściowo otwartÄ… ranÄ™ o %1 rozmiarze + + + There are %2 %1 Bandaged Wounds + %2 Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ°Đ½Đ½Ñ‹Đµ Ñ€Đ°Đ½Ñ‹ %1 + Hay %2 Heridas %1 Vendadas + Il y a %2 %1 Blessure BandĂ©e + Widzisz %2 zabandażowanych ran o %1 rozmiarze + + + There is 1 %1 Bandaged Wound + 1 Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ°Đ½Đ½Đ°Ñ Ñ€Đ°Đ½Đ° %1 + Hay 1 Herida Vendada %1 + Il y a 1 %1 Blessure BandĂ©e + Widzisz 1 zabandażowanÄ… ranÄ™ o %1 rozmiarze + + + There is a partial %1 Bandaged wound + ЧаÑÑ‚Đ¸Ñ‡Đ½Đ¾ Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ°Đ½Đ½Đ°Ñ Ñ€Đ°Đ½Đ° %1 + Hay una Herida parcial %1 Vendada + Il y a %1 Blessure Partielment BandĂ©e + Widzisz 1 częściowo zabandażowanÄ… ranÄ™ o %1 rozmiarze + + + Normal breathing + Đ”Ñ‹Ñ…Đ°Đ½Đ¸Đµ Đ² Đ½Đ¾Ñ€Đ¼Đµ + RespiraciĂ³n normal + Respiration Normale + Normalny oddech + + + No breathing + Đ”Ñ‹Ñ…Đ°Đ½Đ¸Ñ Đ½ĐµÑ‚ + No respira + ApnĂ©e + Brak oddechu + + + Difficult breathing + Đ”Ñ‹Ñ…Đ°Đ½Đ¸Đµ Đ·Đ°Ñ‚Ñ€ÑƒĐ´Đ½ĐµĐ½Đ¾ + Dificultad para respirar + DifficultĂ©e Respiratoire + TrudnoÅ›ci z oddychaniem + + + Almost no breathing + Đ”Ñ‹Ñ…Đ°Đ½Đ¸Ñ Đ¿Đ¾Ñ‡Ñ‚Đ¸ Đ½ĐµÑ‚ + Casi sin respirar + Respiration Faible + Prawie brak oddechu + + + Bleeding + ĐÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Đµ + Sangrando + Seignement + Krwawienie zewnÄ™trzne + + + in Pain + Đ˜ÑĐ¿Ñ‹Ñ‚Ñ‹Đ²Đ°ĐµÑ‚ Đ±Đ¾Đ»ÑŒ + Con Dolor + A De La Douleur + W bĂ³lu + + + Lost a lot of Blood + Đ‘Đ¾Đ»ÑŒÑˆĐ°Ñ ĐºÑ€Đ¾Đ²Đ¾Đ¿Đ¾Ñ‚ĐµÑ€Ñ + Mucha Sangre perdida + A Perdu Bcp de Sang + StraciÅ‚ dużo krwi + + + Tourniquet [CAT] + Đ–Đ³ÑƒÑ‚ + Torniquete [CAT] + Garot [CAT] + Opaska uciskowa [CAT] + + + Nasopharyngeal Tube [NPA] + ĐĐ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° + Torniquete [CAT] + Canule NaseaupharyngĂ©e [NPA] + Rurka nosowo-gardÅ‚owa [NPA] + + + + + Bandage (Basic) + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° (Đ¾Đ±Ñ‹Ñ‡Đ½Đ°Ñ) + Vendaje (BĂ¡sico) + Bandage (Standard) + Bandaż (jaÅ‚owy) + + + Used to cover a wound + Đ”Đ»Ñ Đ¿ĐµÑ€ĐµĐ²ÑĐ·ĐºĐ¸ Ñ€Đ°Đ½ + Utilizado para cubrir una herida + UtilisĂ© Pour Couvrir Une Blessure + Używany w celu przykrycia i ochrony miejsca zranienia + + + A dressing, that is a particular material used to cover a wound, which is applied over the wound once bleeding has been stemmed. + ĐŸĐ¾Đ²ÑĐ·ĐºĐ°, Đ½Đ°ĐºĐ»Đ°Đ´Ñ‹Đ²Đ°ĐµĐ¼Đ°Ñ Đ¿Đ¾Đ²ĐµÑ€Ñ… Ñ€Đ°Đ½Ñ‹ Đ¿Đ¾Ñле Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ. + Un apĂ³sito, material especĂ­fico utilizado para cubrir una herida, se aplica sobre la herida una vez ha dejado de sangrar. + C'est un bandage, qui est fait d'un matĂ©riel spĂ©cial utiliser pour couvrir une blessure, qui peut etre appliquer des que le seignement as ete stopper. + Opatrunek materiaÅ‚owy, używany do przykrywania ran, zakÅ‚adany na ranÄ™ po zatamowaniu krwawienia. + + + Packing Bandage + Đ¢Đ°Đ¼Đ¿Đ¾Đ½Đ¸Ñ€ÑƒÑÑ‰Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° + Vendaje Compresivo + Bandage Mèche + Bandaż (uciskowy) + + + Used to pack medium to large wounds and stem the bleeding + Đ”Đ»Ñ Ñ‚Đ°Đ¼Đ¿Đ¾Đ½Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Ñ Ñ€Đ°Đ½ ÑÑ€ĐµĐ´Đ½ĐµĐ³Đ¾ и Đ±Đ¾Đ»ÑŒÑˆĐ¾Đ³Đ¾ Ñ€Đ°Đ·Đ¼ĐµÑ€Đ° и Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ. + Se utiliza para vendar heridas medianas y grandes y detener el sangrado + Utiliser pour remplire la cavitĂ© crĂ©Ă© dans une blessure moyenne et grande. + Używany w celu opatrywania Å›rednich i dużych ran oraz tamowania krwawienia. + + + A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° Đ´Đ»Ñ Ñ‚Đ°Đ¼Đ¿Đ¾Đ½Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Ñ Ñ€Đ°Đ½Ñ‹, Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ Đ¸ Đ»ÑƒÑ‡ÑˆĐµĐ³Đ¾ Đ·Đ°Đ¶Đ¸Đ²Đ»ĐµĐ½Đ¸Ñ. ĐŸÑ€Đ¸ Ñ‚ÑĐ¶ĐµĐ»Ñ‹Ñ… ÑĐ¾Ñ‡ĐµÑ‚Đ°Đ½Đ½Ñ‹Ñ… Ñ€Đ°Đ½ĐµĐ½Đ¸ÑÑ… Đ²Đ¾Đ·Đ¼Đ¾Đ¶Đ½Đ¾ Ñ‚Đ°Đ¼Đ¿Đ¾Đ½Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Đµ Ñ€Đ°Đ½Ñ‹. + Se utiliza para detener la hemorragia de una herida y favorecer su cicatrizaciĂ³n. Se usa en grandes lesiones o politraumatismos. + Un bandage servent a etre inserĂ© dans les blessure pour Ă©ponger le seignement et faciliter la guerrison. Ce bandage est une option pour soigner les lession de politrauma. + Opatrunek stosowany w celu zatrzymania krwawienia i osÅ‚ony wiÄ™kszych ran. + + + Bandage (Elastic) + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° (Đ´Đ°Đ²ÑÑ‰Đ°Ñ) + Vendaje (ElĂ¡stico) + Bandage (Élastique) + Bandaż (elastyczny) + + + Bandage kit, Elastic + Đ”Đ°Đ²ÑÑ‰Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° + Vendaje (ElĂ¡stico) + Bandage Compressif Élastique + Zestaw bandaży elastycznych. + + + + + Ce bandage peut etre utiliser pour compresser la plaie afin de ralentire le seignement et assurer la tenue du bandage lors de mouvment. + Elastyczna opaska podtrzymujÄ…ca opatrunek oraz usztywniajÄ…ca okolice stawĂ³w. + Brinda una compresiĂ³n uniforme y ofrece soporte extra a una zona lesionada + + + Tourniquet (CAT) + Đ–Đ³ÑƒÑ‚ + Torniquete (CAT) + Garot (CAT) + Staza (typ. CAT) + + + Slows down blood loss when bleeding + Đ£Đ¼ĐµĐ½ÑŒÑˆĐ°ĐµÑ‚ ĐºÑ€Đ¾Đ²Đ¾Đ¿Đ¾Ñ‚ĐµÑ€Ñ Đ¿Ñ€Đ¸ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Đ¸. + Reduce la velocidad de pĂ©rdida de sangre + Ralentit le seignement + Zmniejsza ubytek krwi z koÅ„czyn w przypadku krwawienia. + + + A constricting device used to compress venous and arterial circulation in effect inhibiting or slowing blood flow and therefore decreasing loss of blood. + Đ–Đ³ÑƒÑ‚ иÑĐ¿Đ¾Đ»ÑŒĐ·ÑƒĐµÑ‚ÑÑ Đ´Đ»Ñ Đ¿Ñ€Đ¸Đ¶Đ°Ñ‚Đ¸Ñ ÑĐ¾ÑÑƒĐ´Đ¾Đ², Đ¿Ñ€Đ¸Đ²Đ¾Đ´ÑÑ‰ĐµĐ³Đ¾ Đº Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐµ или Đ·Đ½Đ°Ñ‡Đ¸Ñ‚ĐµĐ»ÑŒĐ½Đ¾Đ¼Ñƒ ÑƒĐ¼ĐµĐ½ÑŒÑˆĐµĐ½Đ¸Ñ ĐºÑ€Đ¾Đ²Đ¾Ñ‚ĐµÑ‡ĐµĐ½Đ¸Ñ Đ¸ ÑĐ¾ĐºÑ€Đ°Ñ‰ĐµĐ½Đ¸Ñ ĐºÑ€Đ¾Đ²Đ¾Đ¿Đ¾Ñ‚ĐµÑ€Đ¸. + Dispositivo utilizado para eliminar el pulso distal y de ese modo controlar la pĂ©rdida de sangre + Un appareil servent a compresser les artères et veines afin de reduire la perte de sang. + Opaska zaciskowa CAT sÅ‚uży do tamowanie krwotokĂ³w w sytuacji zranienia koÅ„czyn z masywnym krwawieniem tÄ™tniczym lub żylnym. + + + Splint + Đ¨Đ¸Đ½Đ° + FĂ©rula + Attelle + Szyna + + + An immobilization device used to support, immobilize and to a degree compress the associated wound. Usually used on the limbs but can be used on the hip. + ĐŸÑ€Đ¸ÑĐ¿Đ¾ÑĐ¾Đ±Đ»ĐµĐ½Đ¸Đµ Đ´Đ»Ñ Đ¿Đ¾Đ´Đ´ĐµÑ€Đ¶ĐºĐ¸ и Đ¸Đ¼Đ¼Đ¾Đ±Đ¸Đ»Đ¸Đ·Đ°Ñ†Đ¸Đ¸ ĐºĐ¾Đ½ĐµÑ‡Đ½Đ¾ÑÑ‚Đ¸, Đ° Ñ‚Đ°ĐºĐ¶Đµ Ñ‡Đ°ÑÑ‚Đ¸Ñ‡Đ½Đ¾Đ³Đ¾ Đ¿Ñ€Đ¸Đ¶Đ°Ñ‚Đ¸Ñ ĐµĐµ Ñ€Đ°Đ½Ñ‹. ĐĐ±Ñ‹Ñ‡Đ½Đ¾ Đ½Đ°ĐºĐ»Đ°Đ´Ñ‹Đ²Đ°ĐµÑ‚ÑÑ Đ½Đ° ĐºĐ¾Đ½ĐµÑ‡Đ½Đ¾ÑÑ‚Đ¸, Đ½Đ¾ Đ¼Đ¾Đ¶ĐµÑ‚ Đ½Đ°ĐºĐ»Đ°Đ´Ñ‹Đ²Đ°Ñ‚ÑŒÑÑ Đ¸ Đ½Đ° Đ±ĐµĐ´Ñ€Đ¾. + Un dispositivo de inmovilizaciĂ³n utilizado para apoyar, inmovilizar y comprimir la herida asociada. Normalmente se usa en las extremidades, pero puede ser utilizado en la cadera. + Un dispositif d'immobilisation servant a supporter, immobiliser, et meme comprimer les blessure relier a une fracture. Normalement utiliser sur les extrĂ©mitĂ©s + Szyna jest urzÄ…dzeniem sÅ‚użącym do wsparcia lub unieruchomienia koÅ„czyny lub krÄ™gosÅ‚upa. + + + A Splint, for broken bones + Đ¨Đ¸Đ½Đ° Đ´Đ»Ñ Đ¿ĐµÑ€ĐµĐ»Đ¾Đ¼Đ¾Đ² + FĂ©rula, para huesos rotos + Une attelle, pour les os brisĂ© + Szyna, na zÅ‚amane koÅ›ci. + + + Morphine auto-injector + ĐœĐ¾Ñ€Ñ„Đ¸Đ½ Đ² Đ°Đ²Ñ‚Đ¾Đ¼Đ°Ñ‚Đ¸Ñ‡ĐµÑĐºĐ¾Đ¼ ÑˆĐ¿Ñ€Đ¸Ñ†Đµ + Morfina auto-inyectable + Auto-injecteur de Morphine + Autostrzykawka z morfinÄ… + + + Used to combat moderate to severe pain experiences + Đ”Đ»Ñ ÑĐ½ÑÑ‚Đ¸Ñ ÑÑ€ĐµĐ´Đ½Đ¸Ñ… и ÑĐ¸Đ»ÑŒĐ½Ñ‹Ñ… Đ±Đ¾Đ»ĐµĐ²Ñ‹Ñ… Đ¾Ñ‰ÑƒÑ‰ĐµĐ½Đ¸Đ¹. + Usado para combatir los estados dolorosos moderados a severos + Utiliser pour contrer les douleurs modĂ©rĂ© Ă  severes. + Morfina. Ma silne dziaÅ‚anie przeciwbĂ³lowe. + + + An analgesic used to combat moderate to severe pain experiences. + ĐĐ½Đ°Đ»ÑŒĐ³ĐµÑ‚Đ¸Đº Đ´Đ»Ñ ÑĐ½ÑÑ‚Đ¸Ñ ÑÑ€ĐµĐ´Đ½Đ¸Ñ… и ÑĐ¸Đ»ÑŒĐ½Ñ‹Ñ… Đ±Đ¾Đ»ĐµĐ²Ñ‹Ñ… Đ¾Ñ‰ÑƒÑ‰ĐµĐ½Đ¸Đ¹. + AnalgĂ©sico usado para combatir los estados dolorosos de moderado a severo. + Un AnalgĂ©sique puissant servant a contrer les douleur modĂ©rĂ© a severe. + Organiczny zwiÄ…zek chemiczny z grupy alkaloidĂ³w. Ma silne dziaÅ‚anie przeciwbĂ³lowe. + + + Atropin auto-injector + ĐÑ‚Ñ€Đ¾Đ¿Đ¸Đ½ Đ² Đ°Đ²Ñ‚Đ¾Đ¼Đ°Ñ‚Đ¸Ñ‡ĐµÑĐºĐ¾Đ¼ ÑˆĐ¿Ñ€Đ¸Ñ†Đµ + Atropina auto-inyectable + Auto-injecteur d'Atropine + Autostrzykawka AtroPen + + + Used in NBC scenarios + ĐŸÑ€Đ¸Đ¼ĐµĐ½ÑĐµÑ‚ÑÑ Đ´Đ»Ñ Đ·Đ°Ñ‰Đ¸Ñ‚Ñ‹ Đ¾Ñ‚ ĐĐœĐŸ + Usado en escenarios NBQ + Utiliser en cas d'attaque CBRN + Atropina. Stosowana jako lek rozkurczowy i Å›rodek rozszerzajÄ…cy źrenice. + + + A drug used by the Military in NBC scenarios. + ĐŸÑ€ĐµĐ¿Đ°Ñ€Đ°Ñ‚, иÑĐ¿Đ¾Đ»ÑŒĐ·ÑƒĐµĐ¼Ñ‹Đ¹ Đ² Đ²Đ¾Đ¹ÑĐºĐ°Ñ… Đ´Đ»Ñ Đ·Đ°Ñ‰Đ¸Ñ‚Ñ‹ Đ¾Ñ‚ Đ¾Ñ€ÑƒĐ¶Đ¸Ñ Đ¼Đ°ÑÑĐ¾Đ²Đ¾Đ³Đ¾ Đ¿Đ¾Ñ€Đ°Đ¶ĐµĐ½Đ¸Ñ. + Medicamento usado por Militares en escenarios NBQ + MĂ©dicament utilisĂ© par l'armĂ©e en cas d'attaque CBRN + Atropina. Stosowana jako lek rozkurczowy i Å›rodek rozszerzajÄ…cy źrenice. Årodek stosowany w przypadku zagrożeÅ„ NBC. + + + Epinephrine auto-injector + ĐĐ´Ñ€ĐµĐ½Đ°Đ»Đ¸Đ½ Đ² Đ°Đ²Ñ‚Đ¾Đ¼Đ°Ñ‚Đ¸Ñ‡ĐµÑĐºĐ¾Đ¼ ÑˆĐ¿Ñ€Đ¸Ñ†Đµ + Epinefrina auto-inyectable + Auto-injecteur d'Ă©pinĂ©phrine + Autostrzykawka EpiPen + + + Increase heart rate and counter effects given by allergic reactions + Đ¡Ñ‚Đ¸Đ¼ÑƒĐ»Đ¸Ñ€ÑƒĐµÑ‚ Ñ€Đ°Đ±Đ¾Ñ‚Ñƒ ÑĐµÑ€Đ´Ñ†Đ° и ĐºÑƒĐ¿Đ¸Ñ€ÑƒĐµÑ‚ Đ°Đ»Đ»ĐµÑ€Đ³Đ¸Ñ‡ĐµÑĐºĐ¸Đµ Ñ€ĐµĐ°ĐºÑ†Đ¸Đ¸. + Aumenta la frecuencia cardiaca y contraresta los efectos de las reacciones alĂ©rgicas + Augmente la FrĂ©quance cadiaque et contrĂ© les effet d'une reaction Anaphylactique + Adrenalina. ZwiÄ™ksza puls i przeciwdziaÅ‚a efektom wywoÅ‚anym przez reakcje alergiczne + + + A drug that works on a sympathetic response to dilate the bronchi, increase heart rate and counter such effects given by allergic reactions (anaphylaxis). Used in sudden cardiac arrest scenarios with decreasing positive outcomes. + ĐŸÑ€ĐµĐ¿Đ°Ñ€Đ°Ñ‚, Đ²Ñ‹Đ·Ñ‹Đ²Đ°ÑÑ‰Đ¸Đ¹ ÑĐ¸Đ¼Đ¿Đ°Ñ‚Đ¸Ñ‡ĐµÑĐºÑƒÑ Ñ€ĐµĐ°ĐºÑ†Đ¸Ñ, Đ¿Ñ€Đ¸Đ²Đ¾Đ´ÑÑ‰ÑƒÑ Đº Ñ€Đ°ÑÑˆĐ¸Ñ€ĐµĐ½Đ¸Ñ Đ±Ñ€Đ¾Đ½Ñ…Đ¾Đ², ÑƒĐ²ĐµĐ»Đ¸Ñ‡ĐµĐ½Đ¸Ñ Ñ‡Đ°ÑÑ‚Đ¾Ñ‚Ñ‹ ÑĐµÑ€Đ´ĐµÑ‡Đ½Ñ‹Ñ… ÑĐ¾ĐºÑ€Đ°Ñ‰ĐµĐ½Đ¸Đ¹ и ĐºÑƒĐ¿Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Ñ Đ°Đ»Đ»ĐµÑ€Đ³Đ¸Ñ‡ĐµÑĐºĐ¸Ñ… Ñ€ĐµĐ°ĐºÑ†Đ¸Đ¹ (Đ°Đ½Đ°Ñ„Đ¸Đ»Đ°ĐºÑ‚Đ¸Ñ‡ĐµÑĐºĐ¾Đ³Đ¾ ÑˆĐ¾ĐºĐ°). ĐŸÑ€Đ¸Đ¼ĐµĐ½ÑĐµÑ‚ÑÑ Đ¿Ñ€Đ¸ Đ¾ÑÑ‚Đ°Đ½Đ¾Đ²ĐºĐµ ÑĐµÑ€Đ´Ñ†Đ° Ñ ÑƒĐ¼ĐµĐ½ÑŒÑˆĐµĐ½Đ¸ĐµĐ¼ Đ²ĐµÑ€Đ¾ÑÑ‚Đ½Đ¾ÑÑ‚Đ¸ Đ±Đ»Đ°Đ³Đ¾Đ¿Ñ€Đ¸ÑÑ‚Đ½Đ¾Đ³Đ¾ иÑÑ…Đ¾Đ´Đ°. + Medicamento que dilata los bronquios, aumenta la frecuencia cardiaca y contrarresta los efectos de las reacciones alĂ©rgicas (anafilaxis). Se utiliza en caso de paros cardiacos repentinos. + Un medicament qui fonctione sur le systeme sympatique crĂ©an une dilatation des bronches, augmente la frĂ©quance cardiaque et contre les effet d'une reaction alergique (anaphylaxie). Utiliser lors d'arret cardio-respiratoire pour augmentĂ© les chances retrouver un ryhtme. + EpiPen z adrenalinÄ… ma dziaÅ‚anie sympatykomimetyczne, tj. pobudza receptory alfa- i beta-adrenergiczne. Pobudzenie ukÅ‚adu wspĂ³Å‚czulnego prowadzi do zwiÄ™kszenia czÄ™stotliwoÅ›ci pracy serca, zwiÄ™kszenia pojemnoÅ›ci wyrzutowej serca i przyÅ›pieszenia krążenia wieÅ„cowego. Pobudzenie oskrzelowych receptorĂ³w beta-adrenergicznych wywoÅ‚uje rozkurcz mięśni gÅ‚adkich oskrzeli, co w efekcie zmniejsza towarzyszÄ…ce oddychaniu Å›wisty i dusznoÅ›ci. + + + Plasma IV (1000ml) + ĐŸĐ»Đ°Đ·Đ¼Đ° Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (1000 Đ¼Đ») + Plasma Intravenoso (1000ml) + Plasma Sanguin IV (1000ml) + Osocze IV (1000ml) + + + A volume-expanding blood supplement. + Đ”Đ¾Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Đ¹ Đ¿Ñ€ĐµĐ¿Đ°Ñ€Đ°Ñ‚, Đ¿Ñ€Đ¸Đ¼ĐµĐ½ÑĐµĐ¼Ñ‹Đ¹ Đ¿Ñ€Đ¸ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Đ¸ Đ¾Đ±ÑĐµĐ¼Đ° ĐºÑ€Đ¾Đ²Đ¸. + Suplemento para expandir el volumen sanguĂ­neo. + Supplement visant a remplacer les volume sanguin + SkÅ‚adnik krwi, używany do zwiÄ™kszenia jej objÄ™toÅ›ci. + + + A volume-expanding blood supplement. + Đ”Đ¾Đ¿Đ¾Đ»Đ½Đ¸Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Đ¹ Đ¿Ñ€ĐµĐ¿Đ°Ñ€Đ°Ñ‚, Đ¿Ñ€Đ¸Đ¼ĐµĐ½ÑĐµĐ¼Ñ‹Đ¹ Đ¿Ñ€Đ¸ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Đ¸ Đ¾Đ±ÑĐµĐ¼Đ° ĐºÑ€Đ¾Đ²Đ¸. + Suplemento para expandir el volumen sanguĂ­neo. + Supplement visant a remplacer le volume sanguin et remplace les plaquettes. + SkÅ‚adnik krwi, używany do zwiÄ™kszenia jej objÄ™toÅ›ci. + + + Plasma IV (500ml) + ĐŸĐ»Đ°Đ·Đ¼Đ° Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (500 Đ¼Đ») + Plasma Intravenoso (500ml) + Plasma Sanguin IV (500ml) + Osocze IV (500ml) + + + Plasma IV (250ml) + ĐŸĐ»Đ°Đ·Đ¼Đ° Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (250 Đ¼Đ») + Plasma Intravenoso (250ml) + Plasma Sanguin (250ml) + Osocze IV (250ml) + + + Blood IV (1000ml) + ĐÑ€Đ¾Đ²ÑŒ Đ´Đ»Ñ Đ¿ĐµÑ€ĐµĐ»Đ¸Đ²Đ°Đ½Đ¸Ñ (1000 Đ¼Đ») + Sangre Intravenosa (1000ml) + Cullot Sanguin IV (1000ml) + Krew IV (1000ml) + + + Blood IV, for restoring a patients blood (keep cold) + ĐŸĐ°ĐºĐµÑ‚ ĐºÑ€Đ¾Đ²Đ¸ Đ´Đ»Ñ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Ñ Đ¾Đ±ÑĐµĐ¼Đ° Đ¿Đ¾Ñ‚ĐµÑ€ÑĐ½Đ½Đ¾Đ¹ ĐºÑ€Đ¾Đ²Đ¸ (Ñ…Ñ€Đ°Đ½Đ¸Ñ‚ÑŒ Đ² Ñ…Đ¾Đ»Đ¾Đ´Đ¸Đ»ÑŒĐ½Đ¸ĐºĐµ) + Sangre Intravenosa, para restarurar el volumen sanguĂ­neo (mantener frĂ­o) + Cullot Sanguin IV, pour remplacer le volume sanguin (garder RĂ©frigerĂ©) + Krew IV, używana do uzupeÅ‚nienia krwi u pacjenta, trzymać w warunkach chÅ‚odniczych + + + O Negative infusion blood used in strict and rare events to replenish blood supply usually conducted in the transport phase of medical care. + ĐÑ€Đ¾Đ²ÑŒ I Đ³Ñ€ÑƒĐ¿Đ¿Ñ‹, Ñ€ĐµĐ·ÑƒÑ-Đ¾Ñ‚Ñ€Đ¸Ñ†Đ°Ñ‚ĐµĐ»ÑŒĐ½Đ°Ñ, Đ¿Ñ€Đ¸Đ¼ĐµĐ½ÑĐµÑ‚ÑÑ Đ¿Đ¾ Đ¶Đ¸Đ·Đ½ĐµĐ½Đ½Ñ‹Đ¼ Đ¿Đ¾ĐºĐ°Đ·Đ°Đ½Đ¸ÑĐ¼ Đ´Đ»Ñ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Ñ Đ¾Đ±ÑĐµĐ¼Đ° Đ¿Đ¾Ñ‚ĐµÑ€ÑĐ½Đ½Đ¾Đ¹ ĐºÑ€Đ¾Đ²Đ¸ Đ½Đ° Đ´Đ¾Đ³Đ¾ÑĐ¿Đ¸Ñ‚Đ°Đ»ÑŒĐ½Đ¾Đ¼ ÑÑ‚Đ°Đ¿Đµ Đ¾ĐºĐ°Đ·Đ°Đ½Đ¸Ñ Đ¼ĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¾Đ¹ Đ¿Đ¾Đ¼Đ¾Ñ‰Đ¸. + Cullot Sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. + Krew 0 Rh-, używana w rzadkich i szczegĂ³lnych przypadkach do uzupeÅ‚nienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. + Utilice sĂ³lo durante gran pĂ©rdida de sangre para reemplazar el volumen de sangre perdido. Uso habitual durante el transporte de heridos. + + + Blood IV (500ml) + ĐÑ€Đ¾Đ²ÑŒ Đ´Đ»Ñ Đ¿ĐµÑ€ĐµĐ»Đ¸Đ²Đ°Đ½Đ¸Ñ (500 Đ¼Đ») + Sangre Intravenosa (500ml) + Cullot Sanguin IV (500ml) + Krew IV (500ml) + + + Blood IV (250ml) + ĐÑ€Đ¾Đ²ÑŒ Đ´Đ»Ñ Đ¿ĐµÑ€ĐµĐ»Đ¸Đ²Đ°Đ½Đ¸Ñ (250 Đ¼Đ») + Sangre Intravenosa (250ml) + Cullot Sanguin IV (250ml) + Krew IV (250ml) + + + Saline IV (1000ml) + Đ¤Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (1000 Đ¼Đ») + SoluciĂ³n Salina Intravenosa (1000ml) + solution Saline 0.9% IV (1000ml) + Solanka 0,9% IV (1000ml) + + + Saline IV, for restoring a patients blood + ĐŸĐ°ĐºĐµÑ‚ Ñ„Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€Đ° Đ´Đ»Ñ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Ñ Đ¾Đ±ÑĐµĐ¼Đ° Đ¿Đ¾Ñ‚ĐµÑ€ÑĐ½Đ½Đ¾Đ¹ ĐºÑ€Đ¾Đ²Đ¸ + SoluciĂ³n Salina Intravenosa, para restaurar el volumen sanguĂ­neo + Solution Saline 0.9% IV, pour retablir temporairement la tention arteriel + Solanka 0,9%, podawana dożylnie (IV), używana w celu uzupeÅ‚nienia krwi u pacjenta + + + A medical volume-replenishing agent introduced into the blood system through an IV infusion. + ĐŸĐ°ĐºĐµÑ‚ Ñ„Đ¸Đ·Đ¸Đ¾Đ»Đ¾Đ³Đ¸Ñ‡ĐµÑĐºĐ¾Đ³Đ¾ Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€Đ° Đ´Đ»Ñ Đ²Đ¾Đ·Đ¼ĐµÑ‰ĐµĐ½Đ¸Ñ Đ¾Đ±ÑĐµĐ¼Đ° Đ¿Đ¾Ñ‚ĐµÑ€ÑĐ½Đ½Đ¾Đ¹ ĐºÑ€Đ¾Đ²Đ¸ Đ¿ÑƒÑ‚ĐµĐ¼ Đ²Đ½ÑƒÑ‚Ñ€Đ¸Đ²ĐµĐ½Đ½Đ¾Đ³Đ¾ Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ. + Suero fisiolĂ³gico inoculado al torrente sanguĂ­neo de forma intravenosa. + Un remplacment temporaire pour rĂ©tablir la tention artĂ©riel lors de perte sanguine, Ă©tant ajouter par intraveineuse + Używany w medycynie w formie pÅ‚ynu infuzyjnego jako Å›rodek nawadniajÄ…cy i uzupeÅ‚niajÄ…cy niedobĂ³r elektrolitĂ³w, podawany dożylnie (IV). + + + Saline IV (500ml) + Đ¤Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (500 Đ¼Đ») + SoluciĂ³n Salina Intravenosa (500ml) + Solution Saline 0.9% IV (500ml) + Solanka 0,9% IV (500ml) + + + Saline IV (250ml) + Đ¤Đ¸Đ·Ñ€Đ°ÑÑ‚Đ²Đ¾Ñ€ Đ´Đ»Ñ Đ²/Đ² Đ²Đ»Đ¸Đ²Đ°Đ½Đ¸Ñ (250 Đ¼Đ») + SoluciĂ³n Salina Intravenosa (250ml) + Solution Saline 0.9% IV (250ml) + Solanka 0,9% IV (250ml) + + + Basic Field Dressing (QuikClot) + ĐŸĐµÑ€Đ²Đ¸Ñ‡Đ½Ñ‹Đ¹ Đ¿ĐµÑ€ĐµĐ²ÑĐ·Đ¾Ñ‡Đ½Ñ‹Đ¹ Đ¿Đ°ĐºĐµÑ‚ (QuikClot) + Vendaje BĂ¡sico (Coagulante) + Bandage Regulier (Coagulant) + Opatrunek QuikClot + + + QuikClot bandage + Đ“ĐµĐ¼Đ¾ÑÑ‚Đ°Ñ‚Đ¸Ñ‡ĐµÑĐºĐ¸Đ¹ Đ¿Đ°ĐºĐµÑ‚ QuikClot + Venda Coagulante + Bandage coagulant + Podstawowy opatrunek stosowany na rany + + + + + Un bandage servant a coaguler les seignements mineur Ă  moyen. + Proszkowy opatrunek adsorbcyjny przeznaczony do tamowania zagrażajÄ…cych życiu krwawieÅ„ Å›redniej i dużej intensywnoÅ›ci. + Vendaje HemostĂ¡tico con coagulante que detiene el sangrado. + + + Nasopharyngeal tube + ĐĐ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° + CĂ¡nula NasofarĂ­ngea + Canule NasopharyngĂ©e + Rurka nosowo-gardÅ‚owa + + + Nasopharyngeal tube, for mataining the airway + ĐĐ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° Đ´Đ»Ñ Đ¿Đ¾Đ´Đ´ĐµÑ€Đ¶Đ°Đ½Đ¸Ñ Đ¿Ñ€Đ¾Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ´Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Ñ… Đ¿ÑƒÑ‚ĐµĐ¹ + CĂ¡nula NasofarĂ­ngea, mantiene despejadas las vĂ­as aĂ©reas + Canule Naso, sert a mintenir ouverte les voix respiratoire. + Rurka nosowo-gardÅ‚owa, używana w celu udrożnienia drĂ³g oddechowych + + + Nasopharyngeal airway. An airway adjunct inserted nasally which is then used to keep the airway patent which allows the field medic to ventilate the patient as appropriate. + ĐĐ°Đ·Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ°. Đ˜Đ½Ñ‚ÑƒĐ±Đ°Ñ†Đ¸Đ¾Đ½Đ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ°, Đ²Đ²Đ¾Đ´Đ¸Đ¼Đ°Ñ Ñ‡ĐµÑ€ĐµĐ· Đ½Đ¾Ñ Đ´Đ»Ñ Đ¿Đ¾Đ´Đ´ĐµÑ€Đ¶Đ°Đ½Đ¸Ñ Đ¿Ñ€Đ¾Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ´Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Ñ… Đ¿ÑƒÑ‚ĐµĐ¹, Đ¿Đ¾Đ·Đ²Đ¾Đ»ÑÑÑ‰Đ°Ñ ÑĐ°Đ½Đ¸Ñ‚Đ°Ñ€Ñƒ Đ¿Ñ€Đ¸ Đ½ĐµĐ¾Đ±Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ¾ÑÑƒÑ‰ĐµÑÑ‚Đ²Đ»ÑÑ‚ÑŒ Đ²ĐµĐ½Ñ‚Đ¸Đ»ÑÑ†Đ¸Ñ Đ»ĐµĐ³ĐºĐ¸Ñ… Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾. + CĂ¡nula NasofarĂ­ngea. Dispositivo de vĂ­a aĂ©rea insertado por vĂ­a nasal que se utiliza para mantener libre la vĂ­a aĂ©rea permitiendo ventilar al paciente segĂºn sea apropiado. + Canule Naso. Dispositif, incere par le nez, servant a maintenir les voie respiratoire du patient ouverte, permetant sa ventilation par le personel medical. + Rurki nosowo-gardÅ‚owe stosuje siÄ™ do ratunkowego udrożnienia drĂ³g oddechowych u osĂ³b nieprzytomnych. Rurka nosowo-gardÅ‚owa jest znacznie lepiej tolerowana np. przez osobÄ™ przytomnÄ…, niż rurka ustno-gardÅ‚owa. + + + Oropharyngeal tube + ĐÑ€Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° + CĂ¡nula OrofarĂ­ngea + Canule OropharyngĂ©e + Rurka ustno-gardÅ‚owa + + + Oropharyngeal Airway, for maintaining the airway + ĐÑ€Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ° Đ´Đ»Ñ Đ¿Đ¾Đ´Đ´ĐµÑ€Đ¶Đ°Đ½Đ¸Ñ Đ¿Ñ€Đ¾Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ´Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Ñ… Đ¿ÑƒÑ‚ĐµĐ¹ + CĂ¡nula OrofarĂ­ngea, para mantener despejada las vĂ­a aĂ©reas + Canule OropharyngĂ©e, sert a maintenir les voie respiratoires ouverte. + Rurka ustno-gardÅ‚owa, używana w celu udrożnienia drĂ³g oddechowych + + + Oropharyngeal airway. An airway adjunct inserted via the oral airway (i.e. mouth) which is then used to keep the airway patent which allows the field medic to ventilate the patient as appropriate. + ĐÑ€Đ¾Ñ‚Ñ€Đ°Ñ…ĐµĐ°Đ»ÑŒĐ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ°. Đ˜Đ½Ñ‚ÑƒĐ±Đ°Ñ†Đ¸Đ¾Đ½Đ½Đ°Ñ Ñ‚Ñ€ÑƒĐ±ĐºĐ°, Đ²Đ²Đ¾Đ´Đ¸Đ¼Đ°Ñ Ñ‡ĐµÑ€ĐµĐ· Ñ€Đ¾Ñ‚ Đ´Đ»Ñ Đ¿Đ¾Đ´Đ´ĐµÑ€Đ¶Đ°Đ½Đ¸Ñ Đ¿Ñ€Đ¾Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ´Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Ñ… Đ¿ÑƒÑ‚ĐµĐ¹, Đ¿Đ¾Đ·Đ²Đ¾Đ»ÑÑÑ‰Đ°Ñ ÑĐ°Đ½Đ¸Ñ‚Đ°Ñ€Ñƒ Đ¿Ñ€Đ¸ Đ½ĐµĐ¾Đ±Ñ…Đ¾Đ´Đ¸Đ¼Đ¾ÑÑ‚Đ¸ Đ¾ÑÑƒÑ‰ĐµÑÑ‚Đ²Đ»ÑÑ‚ÑŒ Đ²ĐµĐ½Ñ‚Đ¸Đ»ÑÑ†Đ¸Ñ Đ»ĐµĐ³ĐºĐ¸Ñ… Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾. + CĂ¡nula OrofarĂ­ngea. Dispositivo de vĂ­a aĂ©rea insertado a travĂ©s de la vĂ­a respiratoria oral (es decir, la boca) que se utiliza para mantener despejada las vĂ­as aĂ©reas permitiendo ventilar al paciente segĂºn sea apropiado. + Canule OropharyngĂ©e. Un dispositif, inserĂ© par la bouche, qui est utiliser pour garder les voie respiratoire overte et permetre la ventilation par le personel de soin. + RurkÄ™ ustno - gardÅ‚owÄ… stosuje siÄ™ podczas zabiegĂ³w sztucznej wentylacji pÅ‚uc. Zadaniem rurki ustno - gardÅ‚owej jest zapewnienie drożnoÅ›ci gĂ³rnych drĂ³g oddechowych, a użycie jej zapewnia ratownikowi komfort prowadzenia zabiegĂ³w i podnosi skuteczność prowadzonej akcji. + + + Liquid skin + Â«Đ–Đ¸Đ´ĐºĐ°Ñ ĐºĐ¾Đ¶Đ°Â» + Pomada tĂ³pica + Pomade Topique + Bandaż (w pÅ‚ynie) + + + Liquid Skin, for use on burns + ĐŸÑ€ĐµĐ¿Đ°Ñ€Đ°Ñ‚ Â«Đ¶Đ¸Đ´ĐºĐ°Ñ ĐºĐ¾Đ¶Đ°Â» Đ´Đ»Ñ Đ»ĐµÑ‡ĐµĐ½Đ¸Ñ Đ¾Đ¶Đ¾Đ³Đ¾Đ² + Pomada tĂ³pica, para quemaduras + Pomade Topique, appliquer sur les brulures. + Bandaż w pÅ‚ynie, używany na poparzenia i lekkie urazy + + + Liquid bandage is a topical skin treatment for minor cuts and sores that is sold by several companies. The products are mixtures of chemicals which create a polymeric layer which binds to the skin. This protects the wound by keeping dirt and germs out, and keeping moisture in. + ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ ĐºĐ»ĐµĐ¹ (Â«Đ¶Đ¸Đ´ĐºĐ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ°Â») – Đ½Đ°Ñ€ÑƒĐ¶Đ½Đ¾Đµ ÑÑ€ĐµĐ´ÑÑ‚Đ²Đ¾ Đ´Đ»Ñ Đ»ĐµÑ‡ĐµĐ½Đ¸Ñ Đ½ĐµĐ±Đ¾Đ»ÑŒÑˆĐ¸Ñ… Đ¿Đ¾Ñ€ĐµĐ·Đ¾Đ² и ÑÑĐ°Đ´Đ¸Đ½. ĐŸÑ€Đ¾Đ´ÑƒĐºÑ‚ Đ¿Ñ€ĐµĐ´ÑÑ‚Đ°Đ²Đ»ÑĐµÑ‚ ÑĐ¾Đ±Đ¾Đ¹ ÑĐ¼ĐµÑÑŒ Ñ…Đ¸Đ¼Đ¸Ñ‡ĐµÑĐºĐ¸Ñ… Đ²ĐµÑ‰ĐµÑÑ‚Đ², ÑĐ¾Đ·Đ´Đ°ÑÑ‰Đ¸Ñ… Đ¿Đ¾Đ»Đ¸Đ¼ĐµÑ€Đ½Ñ‹Đ¹ ÑĐ»Đ¾Đ¹, ĐºĐ¾Ñ‚Đ¾Ñ€Ñ‹Đ¹ Đ¿Ñ€Đ¸ĐºĐ»ĐµĐ¸Đ²Đ°ĐµÑ‚ÑÑ Đº ĐºĐ¾Đ¶Đµ. Đ¢Đ°ĐºĐ¸Đ¼ Đ¾Đ±Ñ€Đ°Đ·Đ¾Đ¼ Đ¿Ñ€ĐµĐ´Đ¾Ñ‚Đ²Ñ€Đ°Ñ‰Đ°ĐµÑ‚ÑÑ Đ¿Đ¾Đ¿Đ°Đ´Đ°Đ½Đ¸Đµ Đ² Ñ€Đ°Đ½Ñƒ Đ³Ñ€Ñзи и Đ¼Đ¸ĐºÑ€Đ¾Đ±Đ¾Đ², Đ° Ñ‚Đ°ĐºĐ¶Đµ Đ²Ñ‹ÑÑ‹Ñ…Đ°Đ½Đ¸Đµ Ñ€Đ°Đ½Ñ‹. + Bandage liquide est un traitement de la peau topique pour les coupures et les plaies mineures qui est vendu par plusieurs compagnies. Les produits sont des mĂ©langes de produits chimiques qui crĂ©ent une couche polymère qui se lie Ă  la peau. Cela protège la plaie en gardant la saletĂ© et les germes, et de garder l'humiditĂ©. + Opatrunek nakÅ‚adany na skĂ³rÄ™ atomizerem tworzÄ…cy na powierzchni skĂ³ry warstwÄ™ przyÅ›pieszajÄ…cÄ… gojenie - stosowany przy drobnych ranach i poparzeniach. + LĂ­quido tĂ³pico para pequeños cortes, heridas y quemaduras. Compuesto de sustancias quĂ­micas que crean una capa polimĂ©rica que se une a la piel. Esto protege la herida manteniĂ©ndola libre de suciedad y gĂ©rmenes. + + + Chest seal + ĐĐºĐºĐ»ÑĐ·Đ¸Đ¾Đ½Đ½Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° + Parche Oclusivo + Bandage Occlusif + Opatrunek Chest Seal + + + A Chest seal + ĐĐºĐºĐ»ÑĐ·Đ¸Đ¾Đ½Đ½Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° Đ½Đ° Đ³Ñ€ÑƒĐ´Đ½ÑƒÑ ĐºĐ»ĐµÑ‚ĐºÑƒ + Parche TorĂ¡cico + Bandage toracique pour les pneumothorax + Opatrunek uszczelniajÄ…cy na rany penetracyjne klatki piersiowej + + + Chest Seal is a high performance occlusive dressing designed to treat penetrating chest wounds along with securing other wound dressings. The patented hydro-gel provides superior adhesion to the wound area even when moisture, pleural fluids or blood is present. It will work on patients with heavy perspiration or very wet environments. The highly aggressive tack adhesive of the hydro-gel will enable the dressing to conform and hold to the patient's body. + ĐĐºĐºĐ»ÑĐ·Đ¸Đ¾Đ½Đ½Đ°Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° Đ¿Ñ€ĐµĐ´Đ½Đ°Đ·Đ½Đ°Ñ‡ĐµĐ½Đ° Đ´Đ»Ñ Đ»ĐµÑ‡ĐµĐ½Đ¸Ñ Đ¿Ñ€Đ¾Đ½Đ¸ĐºĐ°ÑÑ‰Đ¸Ñ… Ñ€Đ°Đ½ĐµĐ½Đ¸Đ¹ Đ² Đ³Ñ€ÑƒĐ´Đ½ÑƒÑ ĐºĐ»ĐµÑ‚ĐºÑƒ Ñ Đ¾Đ´Đ½Đ¾Đ²Ñ€ĐµĐ¼ĐµĐ½Đ½Đ¾Đ¹ Ñ„Đ¸ĐºÑĐ°Ñ†Đ¸ĐµĐ¹ Đ´Ñ€ÑƒĐ³Đ¸Ñ… Đ¿Đ¾Đ²ÑĐ·Đ¾Đº. ĐŸĐ°Ñ‚ĐµĐ½Ñ‚Đ¾Đ²Đ°Đ½Đ½Ñ‹Đ¹ Đ³Đ¸Đ´Ñ€Đ¾Đ³ĐµĐ»ÑŒ Đ¾Đ±ĐµÑĐ¿ĐµÑ‡Đ¸Đ²Đ°ĐµÑ‚ Đ¾Ñ‚Đ»Đ¸Ñ‡Đ½Đ¾Đµ ĐºÑ€ĐµĐ¿Đ»ĐµĐ½Đ¸Đµ Đº Đ¾Đ±Đ»Đ°ÑÑ‚Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¸Ñ Đ´Đ°Đ¶Đµ Đ¿Ñ€Đ¸ Đ½Đ°Đ»Đ¸Ñ‡Đ¸Đ¸ Đ²Đ»Đ°Đ³Đ¸, Đ¿Đ»ĐµĐ²Ñ€Đ°Đ»ÑŒĐ½Đ¾Đ¹ Đ¶Đ¸Đ´ĐºĐ¾ÑÑ‚Đ¸ или ĐºÑ€Đ¾Đ²Đ¸. ĐœĐ¾Đ¶ĐµÑ‚ Đ¿Ñ€Đ¸Đ¼ĐµĐ½ÑÑ‚ÑŒÑÑ Đ´Đ°Đ¶Đµ Đ¿Ñ€Đ¸ Đ¾Đ±Đ¸Đ»ÑŒĐ½Đ¾Đ¼ Đ¿Đ¾Ñ‚Đ¾Đ¾Ñ‚Đ´ĐµĐ»ĐµĐ½Đ¸Đ¸ или Đ² Đ¾Ñ‡ĐµĐ½ÑŒ Đ²Đ»Đ°Đ¶Đ½Đ¾Đ¹ ÑÑ€ĐµĐ´Đµ. Đ‘Đ»Đ°Đ³Đ¾Đ´Đ°Ñ€Ñ Đ²Ñ‹ÑĐ¾ĐºĐ¾Đ°Đ´Đ³ĐµĐ·Đ¸Đ²Đ½Đ¾Đ¼Ñƒ Đ¿Đ»Đ°ÑÑ‚Ñ‹Ñ€Ñ Đ¿Đ¾Đ²ÑĐ·ĐºĐ° Đ¿Đ»Đ¾Ñ‚Đ½Đ¾ Đ¿Ñ€Đ¸Đ»ĐµĐ³Đ°ĐµÑ‚ Đº Ñ‚ĐµĐ»Ñƒ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ и Đ½Đµ Đ¾Ñ‚ĐºĐ»ĐµĐ¸Đ²Đ°ĐµÑ‚ÑÑ. + Le pensement occlusif est un pansement occlusif de haute performance conçu pour traiter les plaies pĂ©nĂ©trantes de la poitrine ainsi que la sĂ©curisation d'autres pansements. L'hydro-gel brevetĂ©e offre une adhĂ©rence supĂ©rieure Ă  la surface de la plaie, mĂªme lorsque l'humiditĂ©, liquide pleural ou le sang est prĂ©sent, elle le laisse couller. Il fonctionne sur les patients atteints d'une transpiration abondante ou dans des environnements très humides. + Chest Seal to opatrunek przeznaczony do opatrywania penetracyjnych (otwartych) ran klatki piersiowej, staniowiÄ…cych sytuacjÄ™ zagrażajÄ…cÄ… życiu wskutek możliwoÅ›ci powstawania odmy prężnej. Jest to druga co do czÄ™stotliwoÅ›ci wystÄ™powania przyczyna Å›mierci na polu walki, ktĂ³rej można zapobiec stosujÄ…c odpowiednie procedury medyczne. Chest Seal charakteryzuje siÄ™ trwaÅ‚ym i szczelnym przyleganiem do skĂ³ry pokrytej krwiÄ…, piaskiem, wÅ‚osami, potem lub wodÄ…. MateriaÅ‚em klejÄ…cym opatrunku uszczelniajÄ…cego jest Å›rodek hydrożelowy umożliwiajÄ…cy wielokrotne odklejanie i przyklejanie opatrunku, co pozwala na wentylowanie rany. + Vendaje oclusivo utilizado para el tratamiento de las lesiones penetrantes en el tĂ³rax + + + Personal Aid Kit + ĐĐ¿Ñ‚ĐµÑ‡ĐºĐ° + Kit de Soporte Vital Avanzado + Équipement de support Vitale + Apteczka osobista + + + Includes various treatment kit needed for stitching or advanced treatment + Đ¡Đ¾Đ´ĐµÑ€Đ¶Đ¸Ñ‚ Ñ€Đ°Đ·Đ»Đ¸Ñ‡Đ½Ñ‹Đµ Đ¼Đ°Ñ‚ĐµÑ€Đ¸Đ°Đ»Ñ‹ и Đ¸Đ½ÑÑ‚Ñ€ÑƒĐ¼ĐµĐ½Ñ‚Ñ‹ Đ´Đ»Ñ Đ·Đ°ÑˆĐ¸Đ²Đ°Đ½Đ¸Ñ Ñ€Đ°Đ½ и Đ¾ĐºĐ°Đ·Đ°Đ½Đ¸Ñ ÑĐ¿ĐµÑ†Đ¸Đ°Đ»ÑŒĐ½Đ¾Đ¹ Đ¼ĐµĐ´Đ¿Đ¾Đ¼Đ¾Ñ‰Đ¸. + Incluye material mĂ©dico para tratamientos avanzados + Inclue du matĂ©riel medical pour les traitement avancĂ©, tel les point de suture. + Zestaw Å›rodkĂ³w medycznych do opatrywania ran i dodatkowego leczenia po-urazowego + + + + + + + + + Surgical Kit + Đ¥Đ¸Ñ€ÑƒÑ€Đ³Đ¸Ñ‡ĐµÑĐºĐ¸Đ¹ Đ½Đ°Đ±Đ¾Ñ€ + Kit QuirĂºrgico + + + Surgical Kit for in field advanced medical treatment + ĐĐ°Đ±Đ¾Ñ€ Đ´Đ»Ñ Ñ…Đ¸Ñ€ÑƒÑ€Đ³Đ¸Ñ‡ĐµÑĐºĐ¾Đ¹ Đ¿Đ¾Đ¼Đ¾Ñ‰Đ¸ Đ² Đ¿Đ¾Đ»ĐµĐ²Ñ‹Ñ… уÑĐ»Đ¾Đ²Đ¸ÑÑ… + Kit QuirĂºrgico para el tratamiento avanzado en el campo de batalla + + + Surgical Kit for in field advanced medical treatment + ĐĐ°Đ±Đ¾Ñ€ Đ´Đ»Ñ Ñ…Đ¸Ñ€ÑƒÑ€Đ³Đ¸Ñ‡ĐµÑĐºĐ¾Đ¹ Đ¿Đ¾Đ¼Đ¾Ñ‰Đ¸ Đ² Đ¿Đ¾Đ»ĐµĐ²Ñ‹Ñ… уÑĐ»Đ¾Đ²Đ¸ÑÑ… + Kit QuirĂºrgico para el tratamiento avanzado en el campo de batalla + + + Bodybag + ĐœĐµÑˆĐ¾Đº Đ´Đ»Ñ Ñ‚Ñ€ÑƒĐ¿Đ¾Đ² + Bolsa para cadĂ¡veres + + + A bodybag for dead bodies + ĐœĐµÑˆĐ¾Đº Đ´Đ»Ñ ÑƒĐ¿Đ°ĐºĐ¾Đ²ĐºĐ¸ Ñ‚Ñ€ÑƒĐ¿Đ¾Đ² + Bolsa para cadĂ¡veres + + + A bodybag for dead bodies + ĐœĐµÑˆĐ¾Đº Đ´Đ»Ñ ÑƒĐ¿Đ°ĐºĐ¾Đ²ĐºĐ¸ Ñ‚Ñ€ÑƒĐ¿Đ¾Đ² + Bolsa para cadĂ¡veres + + + + + Canceled + ĐÑ‚Đ¼ĐµĐ½ĐµĐ½Đ¾ + Cancelado + + + Action has been canceled + Đ”ĐµĐ¹ÑÑ‚Đ²Đ¸Đµ Đ¾Ñ‚Đ¼ĐµĐ½ĐµĐ½Đ¾ + AcciĂ³n cancelada + + + You moved away + Đ’Ñ‹ Đ¾Ñ‚Đ¾ÑˆĐ»Đ¸ Đ¾Ñ‚ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ + Te estĂ¡s alejando + + + Blood Pressure + ĐÑ€Ñ‚ĐµÑ€Đ¸Đ°Đ»ÑŒĐ½Đ¾Đµ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ + PresiĂ³n Arterial + + + Checking Blood Pressure.. + ĐŸÑ€Đ¾Đ²ĐµÑ€ĐºĐ° Đ°Ñ€Ñ‚ĐµÑ€Đ¸Đ°Đ»ÑŒĐ½Đ¾Đ³Đ¾ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Ñ... + Comprobando PresiĂ³n Arterial... + + + You checked %1 + Đ’Ñ‹ Đ¾ÑĐ¼Đ¾Ñ‚Ñ€ĐµĐ»Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Examinando a %1 + + + You find a blood pressure of %2/%3 + ĐÑ€Ñ‚ĐµÑ€Đ¸Đ°Đ»ÑŒĐ½Đ¾Đµ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ %2/%3 + La PresiĂ³n Arterial es %2/%3 + + + You find a low blood pressure + Đ”Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Đ½Đ¸Đ·ĐºĐ¾Đµ + La PresiĂ³n Arterial es baja + + + You find a normal blood pressure + Đ”Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Đ½Đ¾Ñ€Đ¼Đ°Đ»ÑŒĐ½Đ¾Đµ + La PresiĂ³n Arterial es normal + + + You find a high blood pressure + Đ”Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Đ²Ñ‹ÑĐ¾ĐºĐ¾Đµ + La PresiĂ³n Arterial es alta + + + You find no blood pressure + Đ”Đ°Đ²Đ»ĐµĐ½Đ¸Ñ Đ½ĐµÑ‚ + No hay PresiĂ³n Arterial + + + You fail to find a blood pressure + ĐÑ€Ñ‚ĐµÑ€Đ¸Đ°Đ»ÑŒĐ½Đ¾Đµ Đ´Đ°Đ²Đ»ĐµĐ½Đ¸Đµ Đ½Đµ Đ¾Đ¿Ñ€ĐµĐ´ĐµĐ»ÑĐµÑ‚ÑÑ + No puedes encontrar PresiĂ³n Arterial + + + Pulse + ĐŸÑƒĐ»ÑŒÑ + Pulso + + + Checking Heart Rate.. + ĐŸÑ€Đ¾Đ²ĐµÑ€ĐºĐ° Đ¿ÑƒĐ»ÑŒÑĐ°... + Comprobando Pulso... + + + You checked %1 + Đ’Ñ‹ Đ¾ÑĐ¼Đ¾Ñ‚Ñ€ĐµĐ»Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Examinando a %1 + + + You find a Heart Rate of %2 + ĐŸÑƒĐ»ÑŒÑ %2 ÑƒĐ´./Đ¼Đ¸Đ½. + El Pulso es %2 + + + You find a weak Heart Rate + ĐŸÑƒĐ»ÑŒÑ ÑĐ»Đ°Đ±Ñ‹Đ¹ + El Pulso es dĂ©bil + + + You find a strong Heart Rate + ĐŸÑƒĐ»ÑŒÑ ÑƒÑ‡Đ°Ñ‰ĐµĐ½Đ½Ñ‹Đ¹ + El Pulso estĂ¡ acelerado + + + You find a normal Heart Rate + ĐŸÑƒĐ»ÑŒÑ Đ² Đ½Đ¾Ñ€Đ¼Đµ + El Pulso es bueno + + + You find no Heart Rate + ĐŸÑƒĐ»ÑŒÑ Đ½Đµ Đ¿Ñ€Đ¾Ñ‰ÑƒĐ¿Ñ‹Đ²Đ°ĐµÑ‚ÑÑ + No tiene Pulso + + + Response + Đ ĐµĐ°ĐºÑ†Đ¸Ñ + Reacciona + + + You check response of patient + Đ’Ñ‹ Đ¿Ñ€Đ¾Đ²ĐµÑ€ÑĐµÑ‚Đµ Ñ€ĐµĐ°ĐºÑ†Đ¸Ñ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ + Compruebas si el paciente reacciona + + + %1 is responsive + %1 Ñ€ĐµĐ°Đ³Đ¸Ñ€ÑƒĐµÑ‚ Đ½Đ° Ñ€Đ°Đ·Đ´Ñ€Đ°Đ¶Đ¸Ñ‚ĐµĐ»Đ¸ + %1 ha reaccionado + + + + %1 is not responsive + %1 Đ½Đµ Ñ€ĐµĐ°Đ³Đ¸Ñ€ÑƒĐµÑ‚ + %1 no reacciona + + + You checked %1 + Đ’Ñ‹ Đ¾ÑĐ¼Đ¾Ñ‚Ñ€ĐµĐ»Đ¸ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + Examinas a %1 + + + Bandaging + ĐŸĐµÑ€ĐµĐ²ÑĐ·ĐºĐ°... + Vendando + + + Bandaged + ĐŸĐ¾Đ²ÑĐ·ĐºĐ° Đ½Đ°Đ»Đ¾Đ¶ĐµĐ½Đ° + Vendado + + + You apply a bandage on %1 - %2 + Đ’Ñ‹ Đ¿ĐµÑ€ĐµĐ²Ñзали Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 (%2) + Aplicas vendaje a %1 en %2 + + + %1 is bandaging you + %1 Đ¿ĐµÑ€ĐµĐ²ÑĐ·Ñ‹Đ²Đ°ĐµÑ‚ Đ²Đ°Ñ + %1 te estĂ¡ vendando + + + You start stitching injures from %1 - %2 + Đ’Ñ‹ Đ·Đ°ÑˆĐ¸Đ²Đ°ĐµÑ‚Đµ Ñ€Đ°Đ½ĐµĐ½Đ¸Ñ Đ¾Ñ‚ %1 (%2) + EstĂ¡s suturando heridas de %1 en %2 + + + Stitching + ĐĐ°Đ»Đ¾Đ¶ĐµĐ½Đ¸Đµ ÑˆĐ²Đ¾Đ² + Suturando + + + You treat the airway of %1 + Đ’Ñ‹ Đ¸Đ½Ñ‚ÑƒĐ±Đ¸Ñ€ÑƒĐµÑ‚Đµ Ñ€Đ°Đ½ĐµĐ½Đ¾Đ³Đ¾ %1 + EstĂ¡s intubando a %1 + + + Airway + Đ”Ñ‹Ñ…Đ°Ñ‚ĐµĐ»ÑŒĐ½Ñ‹Đµ Đ¿ÑƒÑ‚Đ¸ + VĂ­as AĂ©reas + + + %1 is treating your aiway + %1 Đ¿Ñ€Đ¾Đ²Đ¾Đ´Đ¸Ñ‚ Đ²Đ°Đ¼ Đ¸Đ½Ñ‚ÑƒĐ±Đ°Ñ†Đ¸Ñ + %1 te estĂ¡ intubando + + + + diff --git a/TO_MERGE/cse/sys_medical/ui/define.hpp b/TO_MERGE/cse/sys_medical/ui/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_medical/ui/define.hpp @@ -0,0 +1,797 @@ + +#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/sys_medical/ui/menu.hpp b/TO_MERGE/cse/sys_medical/ui/menu.hpp new file mode 100644 index 0000000000..a9ce19d32e --- /dev/null +++ b/TO_MERGE/cse/sys_medical/ui/menu.hpp @@ -0,0 +1,612 @@ +class cse_sys_medicalMenu { + idd = 314412; + movingEnable = true; + onLoad = "uiNamespace setVariable ['cse_sys_medicalMenu', _this select 0]; ['cse_sys_medical', true] call cse_fnc_gui_blurScreen; [_this select 0] spawn cse_fnc_onMenuOpen_CMS;"; + onUnload = " ['cse_sys_medical', false] call cse_fnc_gui_blurScreen; ['cse_onMenuOpen_CMS', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler;"; + + class controlsBackground { + + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + //moving = 1; + }; + class CenterBackground: HeaderBackground { + /*x = 0.138; + y = 0.17; + w = 1.2549; + h = 0.836601;*/ + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + //text = "#(argb,8,8,3)color(0,0,0,0.65)"; + //text = "cse\cse_sys_medical\data\ui_background.paa"; + text = "#(argb,8,8,3)color(0,0,0,0.8)"; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class BottomBackground: CenterBackground { + y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + + class IconsBackGroundBar: cse_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + //text = "#(argb,8,8,3)color(0,0,0,0.4)"; + text ="cse\cse_sys_medical\data\cse_background_img.paa"; + colorText[] = {1, 1, 1, 0.0}; + //moving = 1; + }; + class CatagoryLeft: HeaderName { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + //colorText[] = {0.6, 0.7, 1.0, 1}; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = $STR_CSE_UI_EXAMINE_TREATMENT; + }; + class CatagoryCenter: CatagoryLeft { + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_CSE_UI_STATUS; + }; + class CatagoryRight: CatagoryCenter{ + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_CSE_UI_OVERVIEW; + }; + class Line: cse_gui_backgroundBase { + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(1,1,1,0.5)"; + }; + + class iconImg1: cse_gui_backgroundBase { + idc = 111; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + colorBackground[] = {0,0,0,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = "cse\cse_sys_medical\data\icons\triage_card_small.paa"; + }; + class iconImg2: iconImg1 { + idc = 112; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\examine_patient_small.paa"; + }; + class iconImg3: iconImg1 { + idc = 113; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\bandage_fracture_small.paa"; + }; + class iconImg4: iconImg1 { + idc = 114; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\medication_small.paa"; + }; + class iconImg5: iconImg1 { + idc = 115; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\airway_management_small.paa"; + }; + class iconImg6: iconImg1 { + idc = 116; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\advanced_treatment_small.paa"; + }; + class iconImg7: iconImg1 { + idc = 117; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\icon_carry.paa"; // to be replaced later on! + }; + class iconImg8: iconImg1 { + idc = 118; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_medical\data\icons\toggle_self_small.paa"; + }; + + + class BtnIconLeft1: cse_gui_buttonBase { + idc = 11; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + /*animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.3)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.1)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.95)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.2)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.3)";*/ + + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = "['triage'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft2: BtnIconLeft1 { + idc = 12; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['examine'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft3: BtnIconLeft1 { + idc = 13; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['bandage'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft4: BtnIconLeft1 { + idc = 14; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['medication'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft5: BtnIconLeft1 { + idc = 15; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['airway'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft6: BtnIconLeft1 { + idc = 16; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['advanced'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft7: BtnIconLeft1 { + idc = 17; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['drag'] call cse_fnc_displayOptions_CMS;"; + }; + class BtnIconLeft8: BtnIconLeft1 { + idc = 18; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['toggle'] call cse_fnc_displayOptions_CMS;"; + }; + + + class TriageCardList: cse_gui_listBoxBase { + idc = 212; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + }; + + + // Left side + class BtnMenu1: BtnIconLeft1 { + idc = 20; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + /*animTextureNormal = "cse\cse_sys_medical\data\cse_background_img.paa"; + animTextureDisabled = "cse\cse_sys_medical\data\cse_background_img.paa"; + animTextureOver = "cse\cse_sys_medical\data\cse_background_img.paa"; + animTextureFocused = "cse\cse_sys_medical\data\cse_background_img.paa"; + animTexturePressed = "cse\cse_sys_medical\data\cse_background_img.paa"; + animTextureDefault = "cse\cse_sys_medical\data\cse_background_img.paa";*/ + + action = ""; + }; + class BtnMenu2: BtnMenu1 { + idc = 21; + y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu3: BtnMenu1 { + idc = 22; + y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu4: BtnMenu1 { + idc = 23; + y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text =""; + }; + class BtnMenu5: BtnMenu1 { + idc = 24; + y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu6: BtnMenu1 { + idc = 25; + y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu7: BtnMenu1 { + idc = 26; + y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu8: BtnMenu1 { + idc = 27; + y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + + + + // center + + class bodyImgBackground: cse_gui_backgroundBase { + idc = -1; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = "cse\cse_sys_medical\data\body_background.paa"; + }; + class bodyImgHead: bodyImgBackground { + idc = 50; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = "cse\cse_sys_medical\data\body_head.paa"; + }; + + class bodyImgTorso: bodyImgHead { + idc = 51; + text = "cse\cse_sys_medical\data\body_torso.paa"; + }; + class bodyImgArms_l: bodyImgHead { + idc = 52; + text = "cse\cse_sys_medical\data\body_arm_left.paa"; + }; + class bodyImgArms_r: bodyImgHead { + idc = 53; + text = "cse\cse_sys_medical\data\body_arm_right.paa"; + }; + class bodyImgLegs_l: bodyImgHead { + idc = 54; + text = "cse\cse_sys_medical\data\body_leg_left.paa"; + }; + class bodyImgLegs_r: bodyImgHead { + idc = 55; + text = "cse\cse_sys_medical\data\body_leg_right.paa"; + }; + + + class selectHead: cse_gui_buttonBase { + idc = 301; + x = "18.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + /*animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.4)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.4)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.99)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.99)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.4)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.4)";*/ + + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'head'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + class selectTorso : selectHead { + idc = 302; + x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'body'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + class selectLeftArm: selectHead{ + idc = 303; + x = "17.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'hand_r'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + class selectRightArm: selectLeftArm{ + idc = 304; + x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'hand_l'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + class selectLeftLeg :selectHead { + idc = 305; + x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'leg_r'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + class selectRightLeg :selectLeftLeg { + idc = 306; + x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "CSE_SELECTED_BODY_PART_CMS = 'leg_l'; [CSE_SYS_MEDICAL_INTERACTION_TARGET] spawn cse_fnc_updateUIInfo_CMS;"; + }; + + + class TriageTextBottom: HeaderName { + idc = 2000; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 1}; + colorBackground[] = {0,0.0,0.0,0.7}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + + + + // Right side + + class InjuryList: cse_gui_listBoxBase { + idc = 213; + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + }; + + // bottom + + // activity log + + class ActivityLogHeader: CatagoryLeft { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {0.6, 0.7, 1.0, 1}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = $STR_CSE_UI_ACTIVITY_LOG; + }; + class QuickViewHeader: ActivityLogHeader { + x = "19.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_CSE_UI_QUICK_VIEW; + }; + class LineBottomHeaders: Line { + y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + }; + class ActivityLog: InjuryList { + idc = 214; + style = 16; + type = 102; + rows=1; + colorBackground[] = {0, 0, 0, 1}; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + columns[] = {0.0, 0.08}; + canDrag=true; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + idcLeft = -1; + idcRight = -1; + }; + + class QuikViewLog: InjuryList { + idc = 215; + style = 16; + type = 102; + rows=1; + colorBackground[] = {0, 0, 0, 1}; + x = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + + columns[] = {0.0, 0.08}; + canDrag=true; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + idcLeft = -1; + idcRight = -1; + }; + + class selectTriageStatus: cse_gui_buttonBase { + idc = 2001; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS;"; + }; + class selectTriageStatusNone: selectTriageStatus { + idc = 2002; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_CSE_UI_TRIAGE_NONE; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS; [CSE_SYS_MEDICAL_INTERACTION_TARGET,0] call cse_fnc_setTriageStatus_CMS;"; + }; + + class selectTriageStatusMinor: selectTriageStatus { + idc = 2003; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_CSE_UI_TRIAGE_MINOR; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS; [CSE_SYS_MEDICAL_INTERACTION_TARGET,1] call cse_fnc_setTriageStatus_CMS;"; + }; + class selectTriageStatusDelayed: selectTriageStatus { + idc = 2004; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_CSE_UI_TRIAGE_DELAYED; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS; [CSE_SYS_MEDICAL_INTERACTION_TARGET,2] call cse_fnc_setTriageStatus_CMS;"; + }; + class selectTriageStatusImmediate: selectTriageStatus { + idc = 2005; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_CSE_UI_TRIAGE_IMMEDIATE; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureOver = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS; [CSE_SYS_MEDICAL_INTERACTION_TARGET,3] call cse_fnc_setTriageStatus_CMS;"; + }; + class selectTriageStatusDeceased: selectTriageStatus { + idc = 2006; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_CSE_UI_TRIAGE_DECEASED; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = "[] call cse_fnc_dropDownTriageCard_CMS; [CSE_SYS_MEDICAL_INTERACTION_TARGET,4] call cse_fnc_setTriageStatus_CMS;"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_medical/variable_defines.sqf b/TO_MERGE/cse/sys_medical/variable_defines.sqf new file mode 100644 index 0000000000..ae8a5bf509 --- /dev/null +++ b/TO_MERGE/cse/sys_medical/variable_defines.sqf @@ -0,0 +1,61 @@ +waituntil {!isnil "cse_fnc_defineVariable"}; +// public variables + + ["cse_injuryVector",[],true,"cms"] call cse_fnc_defineVariable; + ["cse_treatedInjuryVector",[],true,"cms"] call cse_fnc_defineVariable; + + ["cse_openWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true,"cms"] call cse_fnc_defineVariable; + ["cse_bandagedWounds",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true,"cms"] call cse_fnc_defineVariable; + ["cse_fractures",[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true,"cms"] call cse_fnc_defineVariable; + ["cse_airway", 0, true, "cms"] call cse_fnc_defineVariable; + ["cse_tourniquets",[0,0,0,0,0,0],true,"cms"] call cse_fnc_defineVariable; + ["cse_splints",[0,0,0,0,0,0],true,"cms"] call cse_fnc_defineVariable; + ["cse_isBleeding_CMS",false,true,"cms"] call cse_fnc_defineVariable; + ["cse_hasPain_CMS",false,true,"cms"] call cse_fnc_defineVariable; + ["cse_hasLostBlood_CMS",false,true,"cms"] call cse_fnc_defineVariable; + ["cse_airwayTreated",false,true,"cms"] call cse_fnc_defineVariable; + + + // Airway + ["cse_airwayOccluded", false, true, "cms"] call cse_fnc_defineVariable; + ["cse_airwayRespiratoryArrest", false, true, "cms"] call cse_fnc_defineVariable; + ["cse_airwayCollapsed", false, true, "cms"] call cse_fnc_defineVariable; + ["cse_airwayStatus", 100, false, "cms"] call cse_fnc_defineVariable; + + // logs + ["cse_quickviewLog_CMS",[],true,"cms"] call cse_fnc_defineVariable; + ["cse_activityLog_CMS",[],true,"cms"] call cse_fnc_defineVariable; + ["cse_triageLevel",0,true,"cms"] call cse_fnc_defineVariable; + ["cse_triageCard",[],true,"cms"] call cse_fnc_defineVariable; + + + ["cse_medicClass",0,true,"cms_static",0,true] call cse_fnc_defineVariable; // should be a persistent variable; must not be removed by a reset all defaults call + ["cse_medical_facility",0,true,"cms_static",0,true] call cse_fnc_defineVariable; // should be a persistent variable; must not be removed by a reset all defaults call + + ["cse_noInstantDeath",false,true,"cms"] call cse_fnc_defineVariable; + ["cse_cardiacArrest_CMS",false,true,"cms"] call cse_fnc_defineVariable; + + // private variables + ["cse_bloodVolume",100,false,"cms"] call cse_fnc_defineVariable; + ["cse_bloodIVVolume",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_plasmaIVVolume",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_salineIVVolume",0,false,"cms"] call cse_fnc_defineVariable; + + ["cse_pain",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_heartRate",80,false,"cms"] call cse_fnc_defineVariable; + ["cse_andrenaline",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_heartRateAdjustments",[],false,"cms"] call cse_fnc_defineVariable; + + ["cse_bloodPressure", [80,120],false,"cms"] call cse_fnc_defineVariable; + ["cse_peripheralResistance", 100,false,"cms"] call cse_fnc_defineVariable; + ["cse_cardiacOutput", 5.25,false,"cms"] call cse_fnc_defineVariable; // Source for default: http://en.wikipedia.org/wiki/Cardiac_output#Example_values + + + ["cse_givenMorphine",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_givenAtropine",0,false,"cms"] call cse_fnc_defineVariable; + ["cse_givenEpinephrine",0,false,"cms"] call cse_fnc_defineVariable; + + ["cse_bodyPartStatus",[0,0,0,0,0,0],false,"cms"] call cse_fnc_defineVariable; + ["cse_bodyPartStatusPrevious_cms",[0,0,0,0,0,0],false,"cms"] call cse_fnc_defineVariable; + + ["cse_fnc_unitLoop_CMS",false,false,"cms"] call cse_fnc_defineVariable; diff --git a/TO_MERGE/cse/sys_misc/CfgFunctions.h b/TO_MERGE/cse/sys_misc/CfgFunctions.h new file mode 100644 index 0000000000..051d374e3d --- /dev/null +++ b/TO_MERGE/cse/sys_misc/CfgFunctions.h @@ -0,0 +1,9 @@ +class CfgFunctions { + class CSE { + class ModulesMisc { + file = "cse\cse_sys_misc\functions"; + class handleDamage_DMG { recompile = 1;}; + class moduleAmbianceSoundLoop { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_misc/CfgVehicles.h b/TO_MERGE/cse/sys_misc/CfgVehicles.h new file mode 100644 index 0000000000..d2945620e1 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/CfgVehicles.h @@ -0,0 +1,151 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_adjust_stamina: Module_F { + scope = 2; + displayName = "Adjust Stamina [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cseMisc"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class adjustment { + displayName = "Adjustment"; + description = "How fast should the stamina be adjusted?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Custom stamina adjustment module"; + sync[] = {}; + }; + }; + class cse_damage_ai: Module_F { + scope = 1; // hidden, for backwards compatability + displayName = "Damage Thredshold AI [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class damageThresholdAI { + displayName = "Damage Threshold AI"; + description = "How much damage does it take for an AI to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class damageThresholdPlayers { + displayName = "Damage Threshold Players"; + description = "How much damage does it take for a player to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Custom damage threshold module"; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + + + class cse_moduleDamageSettings: Module_F { + scope = 2; + displayName = "Damage Settings [CSE]"; + icon = "\cse\cse_main\data\cse_medical_module.paa"; + category = "cse_medical"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class damageThresholdAI { + displayName = "Damage Threshold AI"; + description = "How much damage does it take for an AI to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + class damageThresholdPlayers { + displayName = "Damage Threshold Players"; + description = "How much damage does it take for a player to be killed?"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Custom damage threshold module"; + sync[] = {}; + }; + }; + + class cse_moduleAmbianceSound: Module_F { + scope = 2; + displayName = "Ambiance Sounds [CSE]"; + icon = "\cse\cse_main\data\cse_basic_module.paa"; + category = "cseMisc"; + function = "cse_fnc_moduleAmbianceSoundLoop"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Combat Space Enhancement"; + class Arguments { + class soundFiles { + displayName = "Sounds"; + description = "Classnames of the ambiance sounds played. Seperated by ','. "; + typeName = "STRING"; + defaultValue = ""; + }; + class minimalDistance { + displayName = "Minimal Distance"; + description = "Minimal Distance"; + typeName = "NUMBER"; + defaultValue = 400; + }; + class maximalDistance { + displayName = "Maximal Distance"; + description = "Maximal Distance"; + typeName = "NUMBER"; + defaultValue = 900; + }; + class minimalDelay { + displayName = "Minimal Delay"; + description = "Minimal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 10; + }; + class maximalDelay { + displayName = "Maximal Delay"; + description = "Maximal Delay between sounds played"; + typeName = "NUMBER"; + defaultValue = 170; + }; + class followPlayers { + displayName = "Follow Players"; + description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + typeName = "BOOL"; + defaultValue = 0; + }; + class soundVolume { + displayName = "Volume"; + description = "The volume of the sounds played"; + typeName = "NUMBER"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = "Ambiance sounds loop (synced across MP)"; + sync[] = {}; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_misc/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_misc/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..ef408ddbe6 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/Combat_Space_Enhancement.h @@ -0,0 +1,32 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_adjust_stamina { + init = "call compile preprocessFile 'cse\cse_sys_misc\stamina\init.sqf';"; + name = "Stamina adjustment"; + }; + class cse_damage_ai { + init = "call compile preprocessFile 'cse\cse_sys_misc\damage\init.sqf';"; + name = "Damage thresholds for AI"; + class EventHandlers { + class CAManBase { + handleDamage = "_this call cse_fnc_handleDamage_DMG;"; + }; + }; + }; + + class cse_moduleDamageSettings { + init = "call compile preprocessFile 'cse\cse_sys_misc\damage\init.sqf';"; + name = "Damage thresholds for AI and players"; + class EventHandlers { + class CAManBase { + handleDamage = "_this call cse_fnc_handleDamage_DMG;"; + }; + }; + }; + + class cse_moduleRemoveBodyOnDisconnect { + init = "call compile preprocessFile 'cse\cse_sys_misc\moduleRemoveBodyOnDisconnect.sqf';"; + name = "Remove Player bodies on disconnect"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_misc/config.cpp b/TO_MERGE/cse/sys_misc/config.cpp new file mode 100644 index 0000000000..21223915df --- /dev/null +++ b/TO_MERGE/cse/sys_misc/config.cpp @@ -0,0 +1,22 @@ +class CfgPatches { + class cse_sys_misc { + units[] = {""}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main", "cse_f_modules", "cse_f_eh"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class CfgAddons { + class PreloadAddons { + class cse_sys_misc { + list[] = {"cse_sys_misc"}; + }; + }; +}; +#include "CfgFunctions.h" +#include "CfgVehicles.h" +#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_misc/damage/init.sqf b/TO_MERGE/cse/sys_misc/damage/init.sqf new file mode 100644 index 0000000000..ee09a538e4 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/damage/init.sqf @@ -0,0 +1,34 @@ +/* +init.sqf +Usage: +Author: Glowbal + +Arguments: +Returns: + +Affects: Local +Executes: call +*/ + +private ["_args"]; +_args = _this; + +CSE_DAMAGE_THRESHOLD_AI_DMG = 1; +CSE_DAMAGE_THRESHOLD_PLAYERS_DMG = 1; +{ + _value = _x select 1; + if (!isnil "_value") then { + if (_x select 0 == "damageThresholdAI") exitwith { + CSE_DAMAGE_THRESHOLD_AI_DMG = _x select 1; + }; + if (_x select 0 == "damageThresholdPlayers") exitwith { + CSE_DAMAGE_THRESHOLD_PLAYERS_DMG = _x select 1; + }; + }; +}foreach _args; + + +waituntil {!isnil "cse_main"}; +["cse_damageBodypart_DMG", 0, false, "dmg"] call cse_fnc_defineVariable; +["cse_damageBodypartPrevious_DMG", 0, false, "dmg"] call cse_fnc_defineVariable; + diff --git a/TO_MERGE/cse/sys_misc/functions/fn_handleDamage_DMG.sqf b/TO_MERGE/cse/sys_misc/functions/fn_handleDamage_DMG.sqf new file mode 100644 index 0000000000..a459b70094 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/functions/fn_handleDamage_DMG.sqf @@ -0,0 +1,61 @@ +/** + * handleDamage_DMG.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_unit","_selectionName","_amountOfDamage", "_previousDamage", "_totalDamage"]; +_unit = _this select 0; +_selectionName = _this select 1; +_amountOfDamage = _this select 2; + +if (_amountOfDamage > 0.9 && {alive _unit}) then { + _amountOfDamage = 0.9; +}; + +if !(["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) then { + if !(isPlayer _unit) then { + if (_amountOfDamage >= CSE_DAMAGE_THRESHOLD_AI_DMG) then { + [_unit] call cse_fnc_setDead; + _amountOfDamage = 1; + }; + } else { + if (_amountOfDamage >= CSE_DAMAGE_THRESHOLD_PLAYERS_DMG) then { + [_unit] call cse_fnc_setDead; + _amountOfDamage = 1; + }; + }; +} else { + // let CMS handle the damage + if (([_unit] call cse_fnc_hasMedicalEnabled_CMS)) exitwith { + + }; + + _previousDamage = [_unit,"cse_damageBodypartPrevious_DMG", 0] call cse_fnc_getVariable; + [_unit,"cse_bodyPartStatusPrevious", _amountOfDamage - _previousDamage] call cse_fnc_setVariable; + + + _totalDamage = [_unit,"cse_damageBodypart_DMG", 0] call cse_fnc_getVariable; + _totalDamage = _totalDamage + (_amountOfDamage - _previousDamage); + [_unit,"cse_damageBodypart_DMG",_totalDamage] call cse_fnc_setVariable; + + + // we will handle it here. + if !(isPlayer _unit) then { + if (_totalDamage >= CSE_DAMAGE_THRESHOLD_AI_DMG) then { + [_unit] call cse_fnc_setDead; + _amountOfDamage = 1; + }; + } else { + if (_totalDamage >= CSE_DAMAGE_THRESHOLD_PLAYERS_DMG) then { + [_unit] call cse_fnc_setDead; + _amountOfDamage = 1; + }; + }; +}; + +_amountOfDamage \ No newline at end of file diff --git a/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf b/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf new file mode 100644 index 0000000000..4b4d93d453 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/functions/fn_moduleAmbianceSoundLoop.sqf @@ -0,0 +1,98 @@ +/** + * fn_moduleAmbianceSoundLoop.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +_units = [_this,1,[],[[]]] call BIS_fnc_param; +_activated = [_this,2,true,[true]] call BIS_fnc_param; + +if (_activated && isServer) then { + _ambianceSounds = []; + _unparsedSounds = _logic getvariable ["soundFiles", ""]; + _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; + _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; + _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; + _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; + _volume = (_logic getvariable ["soundVolume", 30]) max 1; + _followPlayers = _logic getvariable ["followPlayers", false]; + + _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; + + _nilCheckPassedList = ""; + { + _x = [_x] call cse_fnc_string_removeWhiteSpace; + _splittedList set [_foreachIndex, _x]; + }foreach _splittedList; + + _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; + { + if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + } else { + if (isclass (configFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + }; + }; + }foreach _splittedList; + + if (count _ambianceSounds == 0) exitwith { + [format["No Ambiance sounds available"]] call cse_fnc_debug; + }; + { + if !([".", _x, true] call BIS_fnc_inString) then { + [format["Ambiance soundfile does not contain a file extension %1", _x]] call cse_fnc_debug; + _ambianceSounds set [_foreachIndex, _x + ".wss"]; + }; + }foreach _ambianceSounds; + [format["Ambiance sounds %1", _ambianceSounds]] call cse_fnc_debug; + + while {alive _logic} do { + _allUnits = switch (true) do { + case isMultiplayer: {playableUnits}; + case isDedicated: {[_logic]}; + default {[player]}; + }; + + if (count _allUnits > 0) then { + _targetUnit = _allUnits select (round(random((count _allUnits)-1))); + + _newPos = (getPos _targetUnit); + if (!_followPlayers) then { + _newPos = getPos _logic; + }; + + if (random(1) >= 0.5) then { + if (random(1) >= 0.5) then { + _newPos set [0, (_newPos select 0) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [0, (_newPos select 0) - (_minimalDistance + random(_maximalDistance))]; + }; + } else { + if (random(1) >= 0.5) then { + _newPos set [1, (_newPos select 1) + (_minimalDistance + random(_maximalDistance))]; + } else { + _newPos set [1, (_newPos select 1) - (_minimalDistance + random(_maximalDistance))]; + }; + }; + + if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { + + _soundToPlay = _ambianceSounds select (round(random((count _ambianceSounds)-1))); + playSound3D [_soundToPlay, _targetUnit, false, _newPos, _volume, 1, 1000]; + + [format["Played a sound %1", _soundToPlay]] call cse_fnc_debug; + + sleep (_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds; + }; + }; + }; +}; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_misc/stamina/init.sqf b/TO_MERGE/cse/sys_misc/stamina/init.sqf new file mode 100644 index 0000000000..8f0ef44fa7 --- /dev/null +++ b/TO_MERGE/cse/sys_misc/stamina/init.sqf @@ -0,0 +1,43 @@ +/** + * init.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_args"]; +_args = _this; + +CSE_STAMINA_ADJUSTMENT_STM = 1; + +{ + _value = _x select 1; + if (!isnil "_value") then { + if (_x select 0 == "adjustment") then { + CSE_STAMINA_ADJUSTMENT_STM = _x select 1; + }; + }; +}foreach _args; + +if (!hasInterface) exitwith {}; +waituntil{!isnil "cse_gui" && !isnil "cse_main"}; + +if (CSE_STAMINA_ADJUSTMENT_STM > 0) then { + ["cse_adjust_stamina", [], { + _currentStamina = getFatigue player; + _difference = _currentStamina - _previousStamina; + if (_difference > 0) then { + _difference = _difference * CSE_STAMINA_ADJUSTMENT_STM; + player setFatigue (_previousStamina + _difference); + _previousStamina = (_previousStamina + _difference); + } else { + _previousStamina = _currentStamina; + }; + }] call cse_fnc_addTaskToPool_f; + +} else { + player enableFatigue false; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/CfgEventHandlers.hpp b/TO_MERGE/cse/sys_nametags/CfgEventHandlers.hpp new file mode 100644 index 0000000000..ab75a246bb --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_postInit.sqf) ); + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/CfgVehicles.hpp b/TO_MERGE/cse/sys_nametags/CfgVehicles.hpp new file mode 100644 index 0000000000..a0d8133e8a --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/CfgVehicles.hpp @@ -0,0 +1,64 @@ +// TODO Check what faction classes are available within ACE and move this to a core pbo +class CfgFactionClasses +{ + class NO_CATEGORY; + class ACEMisc: NO_CATEGORY { + displayName = "ACE Misc Modules"; + }; +}; + + +class CfgVehicles +{ + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class GVAR(Module): Module_F { + scope = 2; + displayName = $STR_ACE_NameTags_Title; + icon = QUOTE(PATHOF(data\module_icon.paa)); + category = "ACEMisc"; + function = QUOTE(FUNC(initalizeModule)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class enableModule { + displayName = $STR_ACE_NameTags_Arg_enable; + description = $STR_ACE_NameTags_Arg_enable_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + class indirectDistance { + displayName = $STR_ACE_NameTags_Arg_indirectDistance; + description = $STR_ACE_NameTags_Arg_indirectDistance_Desc; + typeName = "NUMBER"; + defaultValue = 7.5; + }; + class cursorTargetDistance { + displayName = $STR_ACE_NameTags_Arg_directDistance; + description = $STR_ACE_NameTags_Arg_directDistance_Desc; + typeName = "NUMBER"; + defaultValue = 20; + }; + class allowDifferentSides { + displayName = $STR_ACE_NameTags_Arg_differentSides; + description = $STR_ACE_NameTags_Arg_differentSides_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + class enableSoundWaves { + displayName = $STR_ACE_NameTags_Arg_soundWaves; + description = $STR_ACE_NameTags_Arg_soundWaves_Desc; + typeName = "BOOL"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = $STR_ACE_NameTags_ModuleDesc; + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/XEH_postInit.sqf b/TO_MERGE/cse/sys_nametags/XEH_postInit.sqf new file mode 100644 index 0000000000..97b6926c5b --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/XEH_postInit.sqf @@ -0,0 +1,66 @@ +/** + * XEH_postInit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated server. + +#include "script_component.hpp" + +// Settings +if (isNil QUOTE(ACE_NameTagsModule)) then { + GVAR(INDIRECT_TAGS_DISTANCE) = 7.5; + GVAR(DIRECT_TAG_DISTANCE) = 20; + GVAR(ENABLE_SOUNDWAVES) = false; + GVAR(ALLOW_OWN_SIDE_ONLY) = true; + GVAR(ENABLE_MODULE) = true; +}; + +// In case the module has been placed and the enable setting has been put to false +if (!GVAR(ENABLE_MODULE)) exitwith {}; + +// Client side options +// TODO Implement a framework for adjusting client side settings. +GVAR(DRAW_TAG_ICONS) = true; +GVAR(ENABLE_INDIRECT) = false; +GVAR(TAG_DISPLAY_COLOR) = [1,1,1,1]; +GVAR(SHOW_SOUNDWAVES) = false; +GVAR(DISPLAY_RANK) = false; + +// If the distance values are set incorrectly, ensure we handle this +if (GVAR(DIRECT_TAG_DISTANCE) < GVAR(INDIRECT_TAGS_DISTANCE)) then { + GVAR(DIRECT_TAG_DISTANCE) = GVAR(INDIRECT_TAGS_DISTANCE); +}; + +// If both are below 1m, exit because they will not show up. +if (GVAR(DIRECT_TAG_DISTANCE) < 1) exitwith {}; + +// Draw the icons for each nametag +// TODO Look into replacement with cutRsc instead of icon3d +addMissionEventHandler ["Draw3D", FUNC(drawNameTags)]; + +if (GVAR(ENABLE_SOUNDWAVES)) then { + + GVAR(SOUNDWAVE_ICONS) = [QUOTE(PATHTOF(data\soundwaves\soundwave1.paa)),QUOTE(PATHTOF(data\soundwaves\soundwave2.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave3.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave4.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave5.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave6.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave7.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave8.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave9.paa)), QUOTE(PATHTOF(data\soundwaves\soundwave_silent.paa))]; + + // TODO Implement function for checking if an addon is loaded + //if (["task_force_radio"] call ace_fnc_isModLoaded_F) then { + if (isnil "TFAR_fnc_isSpeaking") then { + TFAR_fnc_isSpeaking = { if (!isnil "TF_tangent_lr_pressed") then {(TF_tangent_lr_pressed || TF_tangent_sw_pressed || TF_tangent_dd_pressed)} else { false }; }; + }; + //}; + + // TODO Move to unscheduled environment with PFH + [] spawn { + waituntil{ + waituntil {alive player}; + /*ACE_player*/ player call FUNC(handleSpeaking); + !GVAR(ENABLE_SOUNDWAVES); // exit when the soundwaves have been disabled + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/XEH_preInit.sqf b/TO_MERGE/cse/sys_nametags/XEH_preInit.sqf new file mode 100644 index 0000000000..702a785859 --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/XEH_preInit.sqf @@ -0,0 +1,17 @@ +/** + * XEH_preInit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +PREP(drawNameTags); +PREP(findNearbyUnits); +PREP(handleSpeaking); +PREP(allowSide); +PREP(initalizeModule); diff --git a/TO_MERGE/cse/sys_nametags/config.cpp b/TO_MERGE/cse/sys_nametags/config.cpp new file mode 100644 index 0000000000..8a90482389 --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/config.cpp @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ACE_gui","ACE_main"}; + version = VERSION; + author[] = {$STR_ACE_Core_ACETeam}; + authorUrl = "http://ACEmod.com"; // TODO website link? + }; +}; + +class CfgAddons { + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgEventHandlers.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/data/empty.paa b/TO_MERGE/cse/sys_nametags/data/empty.paa new file mode 100644 index 0000000000..a354c7eb38 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/empty.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/module_icon.paa b/TO_MERGE/cse/sys_nametags/data/module_icon.paa new file mode 100644 index 0000000000..1710ef74c9 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/module_icon.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave1.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave1.paa new file mode 100644 index 0000000000..ce4f85eb69 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave1.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave2.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave2.paa new file mode 100644 index 0000000000..0bc59cde24 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave2.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave3.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave3.paa new file mode 100644 index 0000000000..39f3e8e95b Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave3.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave4.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave4.paa new file mode 100644 index 0000000000..7ab8b6d944 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave4.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave5.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave5.paa new file mode 100644 index 0000000000..f3e98d47aa Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave5.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave6.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave6.paa new file mode 100644 index 0000000000..3f29976c9f Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave6.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave7.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave7.paa new file mode 100644 index 0000000000..e705c70b42 Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave7.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave8.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave8.paa new file mode 100644 index 0000000000..e6027d878a Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave8.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave9.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave9.paa new file mode 100644 index 0000000000..91ddfd02df Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave9.paa differ diff --git a/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave_silent.paa b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave_silent.paa new file mode 100644 index 0000000000..27f34b38ab Binary files /dev/null and b/TO_MERGE/cse/sys_nametags/data/soundwaves/soundwave_silent.paa differ diff --git a/TO_MERGE/cse/sys_nametags/functions/fnc_allowSide.sqf b/TO_MERGE/cse/sys_nametags/functions/fnc_allowSide.sqf new file mode 100644 index 0000000000..d28c9a336d --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/functions/fnc_allowSide.sqf @@ -0,0 +1,15 @@ +/** + * fn_allowSide_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: side + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +if (GVAR(ALLOW_OWN_SIDE_ONLY)) exitwith { + _this == playerSide; /* side ACE_player */ +}; +((_this getFriend playerSide /* side ACE_player */ ) >= 0.6); \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/functions/fnc_drawNameTags.sqf b/TO_MERGE/cse/sys_nametags/functions/fnc_drawNameTags.sqf new file mode 100644 index 0000000000..da05c477e4 --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/functions/fnc_drawNameTags.sqf @@ -0,0 +1,71 @@ +/** + * fn_drawNameTags_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" +#define FONT "EtelkaMonospacePro" + +private ["_cursor","_soundWaves", "_nameOfUnit","_pos","_color", "_nearbyUnits", "_iconOptions", "_iconSets", "_unit", "_colorOfIcon", "_nearObj"]; +if (visibleMap || !GVAR(DRAW_TAG_ICONS)) exitwith {}; + +_nearObj = if (isNull curatorCamera) then {/* ACE_player */ if (isNull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) then { player} else {(missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull]) }; } else { curatorCamera }; + +if (GVAR(ENABLE_INDIRECT)) then { + { + _nameOfUnit = _x select 0; + _pos = _x select 1; + _color = _x select 2; + _unit = _x select 3; + _iconDrawn = QUOTE(PATHTOF(data\empty.paa)); + if (_unit getvariable [QGVAR(isSpeaking),false] && GVAR(SHOW_SOUNDWAVES)) then { + _iconDrawn = (GVAR(SOUNDWAVE_ICONS) select ((round(random (count GVAR(SOUNDWAVE_ICONS) - 1))))); + }; + drawIcon3D [_iconDrawn,_color, _pos, 2, 2, 1 ,toUpper _nameOfUnit, 1, 0.03, FONT]; + false; + }count (_nearObj call FUNC(findNearbyUnits)); +}; + +_cursor = cursortarget; +if (_cursor == _cursor && isTouchingGround _cursor) then { + if (_cursor isKindOf "CAManBase" && ((_cursor distance _nearObj) < GVAR(DIRECT_TAG_DISTANCE)) && ((side _cursor) call FUNC(allowSide))) then { + + // TODO Improve this switch statement + _pos = visiblePositionASL _cursor; + switch (stance _cursor) do { + case "STAND": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+2]; + }; + case "CROUCH": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+1.5]; + }; + case "PRONE": { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2)+0.5]; + }; + default { + _pos set [2, ((_cursor modelToWorld [0,0,0]) select 2) + 1.5]; + }; + }; + _color = +GVAR(TAG_DISPLAY_COLOR); + + _nameOfUnit = name _cursor; //[_cursor] call FUNC(getName); // TODO Implement a getName function + // TODO implement module checking + /*if (ACE_NameTags_SYS_MEDICAL_SYSTEM_ENABLED_TAGS) then { + _status = [_cursor] call FUNC(getTriageStatus_CMS); + if ((_status select 1) >0) then { + _nameOfUnit = _nameOfUnit + " ["+ (_status select 0) + "]"; + _color = _status select 2; + }; + };*/ + _iconDrawn = QUOTE(PATHTOF(data\empty.paa)); + if (_unit getvariable [QGVAR(isSpeaking),false] && GVAR(SHOW_SOUNDWAVES)) then { + _iconDrawn = (GVAR(SOUNDWAVE_ICONS) select ((round(random (count GVAR(SOUNDWAVE_ICONS) - 1))))); + }; + drawIcon3D [_iconDrawn,_color, _pos, 2, 2, 1 ,toUpper _nameOfUnit, 1, 0.03, FONT]; + + }; +}; diff --git a/TO_MERGE/cse/sys_nametags/functions/fnc_findNearbyUnits.sqf b/TO_MERGE/cse/sys_nametags/functions/fnc_findNearbyUnits.sqf new file mode 100644 index 0000000000..122823c46c --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/functions/fnc_findNearbyUnits.sqf @@ -0,0 +1,65 @@ +/** + * fn_findNearbyUnits_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_info", "_nameOfUnit", "_color", "_isTalking", "_pos", "_nearest"]; +_info = []; +if (alive player) then { + _nearest = (_this nearEntities [["CAManBase"], GVAR(INDIRECT_TAGS_DISTANCE)]); + { + if (_x != _this && (vehicle _x == _x) && isTouchingGround _X) then { + if (lineIntersects [eyePos _this, eyePos _x, _x, _this]) exitwith{}; + if ((side _x) call FUNC(allowSide) && !(_x == cursortarget)) then { + _nameOfUnit = name _x; + if (_x getvariable ["ACE_isDead",false]) then { // TODO, how do we check for dead units? + _nameOfUnit = _unit getvariable ["ACE_name","Unknown"]; // TODO is there are function to get the name of a unit? + }; + _pos = visiblePositionASL _x; + + // TODO This can be done better + switch (stance _x) do { + case "STAND": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2)+2]; + }; + case "CROUCH": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2)+1.5]; + }; + case "PRONE": { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2) + 0.5]; + }; + default { + _pos set [2, ((_x modelToWorld [0,0,0]) select 2) + 1.5]; + }; + }; + + _color = +GVAR(TAG_DISPLAY_COLOR); + _color set [3, 0]; + _isTalking = (_x getvariable [QGVAR(isSpeaking),false]); + + // TODO implement module checking + /*if (ACE_NameTags_SYS_MEDICAL_SYSTEM_ENABLED_TAGS) then { + _status = [_x] call FUNC(getTriageStatus_CMS; + if ((_status select 1) >0) then { + _nameOfUnit = _nameOfUnit + " ["+ (_status select 0) + "]"; + _color = _status select 2; + }; + };*/ + if (GVAR(DISPLAY_RANK)) then { + _nameOfUnit = (rank _x) + " " + _nameOfUnit; + }; + _color set [3,(1-((_x distance _this) / GVAR(INDIRECT_TAGS_DISTANCE))) + 0.05]; + _info pushback [_nameOfUnit, _pos, _color, _x]; + }; + }; + }foreach _nearest; +}; + +_info; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/functions/fnc_handleSpeaking.sqf b/TO_MERGE/cse/sys_nametags/functions/fnc_handleSpeaking.sqf new file mode 100644 index 0000000000..a61f810969 --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/functions/fnc_handleSpeaking.sqf @@ -0,0 +1,40 @@ +/** + * fn_handleSpeaking_TAGS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +// TODO Implement a check mod loaded function +#define ACTION_PUSH_TO_TALK_PRESSED (inputAction "PushToTalk" > 0) +#define ACTION_TFAR_RADIO_ACTIVE false // [] call {if (["task_force_radio"] call FUNC(isModLoaded_F)) then {player call TFAR_fnc_isSpeaking} else { false };} +#define ACTION_ACRE_RADIO_ACTIVE false // [] call {if (["acre_api"] call FUNC(isModLoaded_F)) then {[player] call ACRE_api_fnc_isBroadcasting} else { false };} + +private ["_unit"]; +_unit = _this select 0; + +if (_unit != player /* _unit != ACE_Player */) exitwith {}; + +// TODO check mod loaded function +/*if (["task_force_radio"] call FUNC(isModLoaded_F)) then { + waituntil {!isnil "TF_tangent_lr_pressed"}; +};*/ + +waituntil { + if (ACTION_TFAR_RADIO_ACTIVE || ACTION_PUSH_TO_TALK_PRESSED || ACTION_ACRE_RADIO_ACTIVE) then { + if !(_unit getvariable [QGVAR(isSpeaking), false]) then { + _unit setvariable [QGVAR(isSpeaking), true, true]; + }; + } else { + if (_unit getvariable [QGVAR(isSpeaking), false]) then { + _unit setvariable [QGVAR(isSpeaking), false, true]; + }; + }; + !(alive _unit) /* _unit != ACE_Player */ +}; + +_unit setvariable [QGVAR(isSpeaking),nil,true]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/functions/fnc_initalizeModule.sqf b/TO_MERGE/cse/sys_nametags/functions/fnc_initalizeModule.sqf new file mode 100644 index 0000000000..7db37789db --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/functions/fnc_initalizeModule.sqf @@ -0,0 +1,24 @@ +/** + * fnc_initalizeModule.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +if (!hasInterface) exitwith {}; // No need for this module on HC or dedicated server. + +private ["_logic"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + // TODO default values should be defined somewhere through an include, so they are the same in CfgVehicles and here. + GVAR(ENABLE_MODULE) = _logic getvariable ["enableModule", false]; + GVAR(INDIRECT_TAGS_DISTANCE) = _logic getvariable ["indirectDistance", 7.5]; + GVAR(DIRECT_TAG_DISTANCE) = _logic getvariable ["cursorTargetDistance", 20]; + GVAR(ALLOW_OWN_SIDE_ONLY) = !(_logic getvariable ["allowDifferentSides", false]); + GVAR(ENABLE_SOUNDWAVES) = _logic getvariable ["enableSoundWaves", false]; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/script_component.hpp b/TO_MERGE/cse/sys_nametags/script_component.hpp new file mode 100644 index 0000000000..4637f8de75 --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT nametags +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_NAMETAGS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_NAMETAGS + #define DEBUG_SETTINGS DEBUG_SETTINGS_NAMETAGS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_nametags/stringtable.xml b/TO_MERGE/cse/sys_nametags/stringtable.xml new file mode 100644 index 0000000000..53100d4ceb --- /dev/null +++ b/TO_MERGE/cse/sys_nametags/stringtable.xml @@ -0,0 +1,43 @@ + + + + + + Name Tags [ACE] + + + Enable Name Tags + + + Enable the name tags + + + Indirect Distance + + + Distance for indirect Tags + + + Target Distance + + + Distance for the direct Tag (Cursortarget) + + + Enable Soundwaves + + + Enable Soundwaves when a player is speaking + + + Allow Different sides + + + Allow name tags for all friendly sides, instead of only player side + + + Adjust the name tags settings. + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/CfgFunctions.h b/TO_MERGE/cse/sys_vehicles/CfgFunctions.h new file mode 100644 index 0000000000..edaf4839e6 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/CfgFunctions.h @@ -0,0 +1,17 @@ +class CfgFunctions { + class CSE { + class VehicleInteraction + { + file = "cse\cse_sys_vehicles\functions"; + class openMenu_VEH { recompile = 1; }; + class onMenuOpen_VEH { recompile = 1; }; + class displayOptions_VEH { recompile = 1; }; + class updateInformationList_VEH { recompile = 1; }; + class getSelectedData_VEH { recompile = 1; }; + class getCrewOptions_VEH { recompile = 1; }; + class getCargoOptions_VEH { recompile = 1; }; + class getRepairOptions_VEH { recompile = 1; }; + class replaceBatteryDarter_VEH { recompile = 1; }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_vehicles/CfgWeapons.h b/TO_MERGE/cse/sys_vehicles/CfgWeapons.h new file mode 100644 index 0000000000..135aad0972 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/CfgWeapons.h @@ -0,0 +1,26 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + + class cse_battery: ItemCore + { + scope=2; + displayName="Battery"; + model="\cse\cse_sys_vehicles\equipment\battery_darter.p3d"; + picture="\cse\cse_sys_vehicles\equipment\img\battery_dartery.paa"; + descriptionShort="Battery"; + class ItemInfo: InventoryItem_Base_F + { + mass=0.01; + type=201; + }; + }; + + class cse_battery_darter: cse_battery + { + displayName="Darter Battery"; + model="\cse\cse_sys_vehicles\equipment\battery_darter.p3d"; + picture="\cse\cse_sys_vehicles\equipment\img\battery_darter.paa"; + descriptionShort="Darter Battery"; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_vehicles/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..435bc34323 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/Combat_Space_Enhancement.h @@ -0,0 +1 @@ +class Combat_Space_Enhancement {}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/UI.h b/TO_MERGE/cse/sys_vehicles/UI.h new file mode 100644 index 0000000000..e5276de4b6 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/UI.h @@ -0,0 +1,2 @@ +#include "ui\define.hpp" +#include "ui\menu.hpp" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/config.cpp b/TO_MERGE/cse/sys_vehicles/config.cpp new file mode 100644 index 0000000000..c99c763b90 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/config.cpp @@ -0,0 +1,26 @@ +#define _ARMA_ +class CfgPatches +{ + class cse_sys_vehicles + { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.1; + requiredAddons[] = {"cse_gui","cse_main"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class cse_sys_vehicles { + list[] = {"cse_sys_vehicles"}; + }; + }; +}; +#include "CfgFunctions.h" +#include "UI.h" +#include "Combat_Space_Enhancement.h" + +#include "CfgWeapons.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/data/icons/icon_cargo.paa b/TO_MERGE/cse/sys_vehicles/data/icons/icon_cargo.paa new file mode 100644 index 0000000000..dd82cbbad3 Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/data/icons/icon_cargo.paa differ diff --git a/TO_MERGE/cse/sys_vehicles/data/icons/icon_crew.paa b/TO_MERGE/cse/sys_vehicles/data/icons/icon_crew.paa new file mode 100644 index 0000000000..b5d8d0fa7a Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/data/icons/icon_crew.paa differ diff --git a/TO_MERGE/cse/sys_vehicles/data/icons/icon_repair.paa b/TO_MERGE/cse/sys_vehicles/data/icons/icon_repair.paa new file mode 100644 index 0000000000..54b61f6b10 Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/data/icons/icon_repair.paa differ diff --git a/TO_MERGE/cse/sys_vehicles/equipment/battery_darter.p3d b/TO_MERGE/cse/sys_vehicles/equipment/battery_darter.p3d new file mode 100644 index 0000000000..2768e0d1e7 Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/equipment/battery_darter.p3d differ diff --git a/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter.rvmat b/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter.rvmat new file mode 100644 index 0000000000..397e78345c --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter.rvmat @@ -0,0 +1,68 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.70399898,0.70399898,0.70399898,0}; +specularPower=70; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter_co.paa b/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter_co.paa new file mode 100644 index 0000000000..f50a36ca01 Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/equipment/data/battery_darter_co.paa differ diff --git a/TO_MERGE/cse/sys_vehicles/equipment/img/battery_darter.paa b/TO_MERGE/cse/sys_vehicles/equipment/img/battery_darter.paa new file mode 100644 index 0000000000..a3ba2cdf80 Binary files /dev/null and b/TO_MERGE/cse/sys_vehicles/equipment/img/battery_darter.paa differ diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_displayOptions_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_displayOptions_VEH.sqf new file mode 100644 index 0000000000..8d2debb604 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_displayOptions_VEH.sqf @@ -0,0 +1,56 @@ +/** + * fn_displayOptions_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#define START_IDC 20 +#define END_IDC 27 +#define AMOUNT_OF_ENTRIES (count _entries) + +private ["_name","_display","_ctrl","_counter","_code"]; + +_name = _this select 0; +if (isDedicated) exitwith{}; +_entries = switch (_name) do { + case "crew": {[_name] call cse_fnc_getCrewOptions_VEH}; + case "cargo": {[_name] call cse_fnc_getCargoOptions_VEH}; + case "repair": {[_name] call cse_fnc_getRepairOptions_VEH}; + default {[]}; +}; +CSE_LATEST_DISPLAY_OPTION_MENU_VEH = _name; + +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_vehicleMenu'; +for [{_x=START_IDC},{_x <= END_IDC},{_x=_x+1}] do { + _ctrl = (_display displayCtrl (_x)); + _ctrl ctrlSetText ""; + //_ctrl ctrlSetPosition[-100,-100]; + _ctrl ctrlShow false; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + _ctrl ctrlSetTooltip ""; + _ctrl ctrlCommit 0; +}; + +_counter = 0; +{ + //player sidechat format["TRIGGERED: %1",_x]; + if (_counter > END_IDC) exitwith {}; + _ctrl = (_display displayCtrl (START_IDC + _counter)); + if (!(_counter > AMOUNT_OF_ENTRIES)) then { + _ctrl ctrlSetText (_x select 0); + _code = format["[CSE_SYS_VEHICLE_INTERACTION_TARGET,PLAYER] call { %1 };",(_x select 1)]; + _ctrl ctrlSetEventHandler ["ButtonClick", _code]; + _ctrl ctrlSetTooltip (_x select 2); + _ctrl ctrlShow true; + } else { + _ctrl ctrlSetText ""; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + }; + _ctrl ctrlCommit 0; + _counter = _counter + 1; +}foreach _entries; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_getCargoOptions_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_getCargoOptions_VEH.sqf new file mode 100644 index 0000000000..1712a4025b --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_getCargoOptions_VEH.sqf @@ -0,0 +1,24 @@ +/** + * fn_getCargoOptions_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; + +//if (CSE_SYS_VEHICLE_INTERACTION_TARGET != (vehicle player)) then { + if !(CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "Man") then { + if (!isNull([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH)) then { + + _return set [count _return, ["Unload Cargo","CloseDialog 0; [([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH),CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_unloadObject_LOG;","Unload the current selected cargo"]]; + } else { + _return set [count _return, ["Unload Cargo","hint 'You have to select an item in the list first!';","Unload the current selected cargo"]]; + }; + }; +//}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_getCrewOptions_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_getCrewOptions_VEH.sqf new file mode 100644 index 0000000000..7a6c3562f0 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_getCrewOptions_VEH.sqf @@ -0,0 +1,33 @@ +/** + * fn_getCrewOptions_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return","_selectedTarget", "_casList"]; +_return = []; + +CSE_fnc_dummy = {}; +if !(CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "CaManBase") then { + _selectedTarget = ([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH); + if (!isNull _selectedTarget) then { + if (["cse_sys_medical"] call cse_fnc_isModuleEnabled_F) then { + if (!([_selectedTarget] call cse_fnc_isAwake)) then { + _return pushback ["Unload Casualty","[player,([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH)] call cse_fnc_unload_CMS;","Unload Casualty"]; + }; + _return pushback ["Medical Menu","private ['_cmsTarget']; _cmsTarget = ([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH); closeDialog 314436; [_cmsTarget] call cse_fnc_openMenu_CMS;","Open the CMS Medical Menu for selected unit"]; + }; + + if (["cse_sys_advanced_interaction"] call cse_fnc_isModuleEnabled_F) then { + if ([_selectedTarget] call cse_fnc_isArrested) then { + _return pushback ["Unload Detainee","[player,([CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_getSelectedData_VEH)] call cse_fnc_unload_AIM;","Unload Detainee"]; + }; + }; + }; +}; + +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_getRepairOptions_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_getRepairOptions_VEH.sqf new file mode 100644 index 0000000000..5fb8bc681d --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_getRepairOptions_VEH.sqf @@ -0,0 +1,22 @@ +/** + * fn_getRepairOptions_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_return"]; +_return = []; + +if (CSE_SYS_VEHICLE_INTERACTION_TARGET != (vehicle player)) then { + if (CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "CAR") then { + //_return set [count _return, ["Replace Tires","[_this select 0,_this select 1] call CSE_fnc_dummy;","Replace the tires of this vehicle"]]; + }; + if ((CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "B_UAV_01_F" || CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "O_UAV_01_F" || CSE_SYS_VEHICLE_INTERACTION_TARGET isKindOf "G_UAV_01_F") && ([player, "cse_battery_darter"] call cse_fnc_hasItem) && (fuel CSE_SYS_VEHICLE_INTERACTION_TARGET < 1)) then { + _return pushback ["Replace Battery","[_this select 0,_this select 1] call cse_fnc_replaceBatteryDarter_veh;","Replace battery of the Darter"]; + }; +}; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_getSelectedData_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_getSelectedData_VEH.sqf new file mode 100644 index 0000000000..3080093114 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_getSelectedData_VEH.sqf @@ -0,0 +1,30 @@ +/** + * fn_getSelectedData_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_veh","_curSelected", "_return","_loaded","_crew"]; +_veh = _this select 0; + _curSelected = lbCurSel 212; + _return = ObjNull; + + if (_curSelected > -1) then { + if (CSE_LATEST_DISPLAY_OPTION_MENU_VEH == "cargo") then { + _loaded = _veh getvariable ["cse_logistics_loadedCargo_LOG",[]]; + if (_curSelected >= count _loaded) exitwith{}; + _return = _loaded select _curSelected; + }; + + + if (CSE_LATEST_DISPLAY_OPTION_MENU_VEH == "crew") then { + _crew = crew _veh; + if (_curSelected >= count _crew) exitwith{}; + _return = _crew select _curSelected; + }; + }; +_return \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_onMenuOpen_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_onMenuOpen_VEH.sqf new file mode 100644 index 0000000000..08cc1c6099 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_onMenuOpen_VEH.sqf @@ -0,0 +1,61 @@ +/** + * fn_onMenuOpen_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +_this spawn { + if (isnil "CSE_LATEST_DISPLAY_OPTION_MENU_VEH") then { + CSE_LATEST_DISPLAY_OPTION_MENU_VEH = "crew"; + }; + CSE_VEHICLE_INTERACTION_MENU_OPEN = true; + private ["_display","_target","_previous"]; + _target = CSE_SYS_VEHICLE_INTERACTION_TARGET; + [CSE_LATEST_DISPLAY_OPTION_MENU_VEH,_target] call cse_fnc_displayOptions_VEH; + + // 11 till 18 + disableSerialization; + _display = uiNamespace getVariable 'cse_sys_vehicleMenu'; + (_display displayCtrl 11) ctrlSetTooltip "Crew"; + (_display displayCtrl 12) ctrlSetTooltip "Cargo"; + (_display displayCtrl 13) ctrlSetTooltip "Damages & Repair"; + + (_display displayCtrl 1) ctrlSetText format["%1",(getText(configFile >> "Cfgvehicles" >> typeof _target >> "displayName"))]; + + cse_fnc_updateIcons_VEH = { + private ["_display","_startIDC","_idc","_options","_name","_amount"]; + disableSerialization; + _display = uiNamespace getVariable 'cse_sys_vehicleMenu'; + _startIDC = 111; + + _options = ["crew","cargo","repair"]; // temp from 118 to 111 (ONLY NEED THIS ONCE FOR NOW); + for "_idc" from _startIDC to 118 step 1 do + { + if (count _options <= (_idc - 111)) exitwith{}; + _name = _options select (_idc - 111); + _amount = switch (_name) do { + case "crew": {crew CSE_SYS_VEHICLE_INTERACTION_TARGET}; + case "cargo": {CSE_SYS_VEHICLE_INTERACTION_TARGET getvariable ["cse_logistics_loadedCargo_LOG",[]]}; + case "repair": {[_name] call cse_fnc_getRepairOptions_VEH}; + case "advanced": {[]}; + default {[]}; + }; + if ((count _amount) > 0) then { + (_display displayCtrl _idc) ctrlSettextColor [1,1,1,1]; + } else { + (_display displayCtrl _idc) ctrlSettextColor [0.4,0.4,0.4,1]; + }; + }; + }; + + ["cse_onMenuOpen_Veh", "onEachFrame", { + [CSE_LATEST_DISPLAY_OPTION_MENU_VEH] call cse_fnc_displayOptions_VEH; + [CSE_SYS_VEHICLE_INTERACTION_TARGET] call cse_fnc_updateInformationList_VEH; + [] call cse_fnc_updateIcons_VEH; + }, [_display]] call BIS_fnc_addStackedEventHandler; + +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_openMenu_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_openMenu_VEH.sqf new file mode 100644 index 0000000000..dd98511136 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_openMenu_VEH.sqf @@ -0,0 +1,26 @@ +/** + * fn_openMenu_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_target"]; +if (count _this > 0) then { + _target = _this select 0; + +} else { + _target = cursortarget; +}; +if (player == _target) exitwith{}; +CSE_SYS_VEHICLE_INTERACTION_TARGET = _target; +[player,_target] call cse_fnc_registerInteractingWith; +createDialog "cse_sys_vehicleMenu"; + +[_target] spawn { + waituntil {sleep 0.1; !dialog}; + [player,_this select 0] call cse_fnc_unregisterInteractingWith; +}; diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_replaceBatteryDarter_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_replaceBatteryDarter_VEH.sqf new file mode 100644 index 0000000000..94039db703 --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_replaceBatteryDarter_VEH.sqf @@ -0,0 +1,21 @@ +/** + * fn_replaceBatteryDarter_VEH.sqf + * @Descr: REplace the darter battery + * @Author: Glowbal + * + * @Arguments: [darter OBJECT, unit UNIT] + * @Return: bool + * @PublicAPI: false + */ + +private ["_uav", "_unit"]; +_uav = _this select 0; +_unit = _this select 1; + +if !(_uav isKindOf "B_UAV_01_F" || _uav isKindOf "O_UAV_01_F" || _uav isKindOf "G_UAV_01_F") exitwith {false;}; +if !([_unit, "cse_battery_darter"] call cse_fnc_hasItem) exitwith {false;}; + +[_unit, "cse_battery_darter"] call cse_fnc_useItem; +_uav setFuel 1; + +true; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/functions/fn_updateInformationList_VEH.sqf b/TO_MERGE/cse/sys_vehicles/functions/fn_updateInformationList_VEH.sqf new file mode 100644 index 0000000000..366be83a0f --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/functions/fn_updateInformationList_VEH.sqf @@ -0,0 +1,52 @@ +/** + * fn_updateInformationList_VEH.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +private ["_veh","_counter","_loaded","_cmsEnabled","_status","_crew", "_display"]; +_veh = _this select 0; + +disableSerialization; +_display = uiNamespace getVariable 'cse_sys_vehicleMenu'; +if (isNil "_display") exitwith {}; +if (isNull _display) exitwith {}; + +_listBox = (_display displayCtrl 212); + +_returnList = []; +if (CSE_LATEST_DISPLAY_OPTION_MENU_VEH == "cargo") exitwith { + lbclear _listBox; + _returnList = _veh getvariable ["cse_logistics_loadedCargo_LOG",[]]; + { + _listBox lbadd (getText(configFile >> "Cfgvehicles" >> typeof _x >> "displayName")); + }foreach _returnList; +}; + +if (CSE_LATEST_DISPLAY_OPTION_MENU_VEH == "crew") exitwith { + _returnList = crew _veh; + _cmsEnabled = ["cse_sys_medical"] call cse_fnc_isModuleEnabled_F; + lbclear _listBox; + { + if (_cmsEnabled) then { + _status = [_x] call cse_fnc_getTriageStatus_CMS; + if ((_status select 1) >0) then { + _nameOfUnit = ([_x] call cse_fnc_getName) + " ["+ (_status select 0) + "]"; + _listBox lbadd _nameOfUnit; + _listBox lbSetColor [_foreachIndex, _status select 2]; + } else { + _listBox lbadd ([_x] call cse_fnc_getName); + }; + } else { + _listBox lbadd ([_x] call cse_fnc_getName); + }; + }foreach _returnList; + +// waituntil{!(crew _veh isEqualTo _returnList)}; +}; + +_returnList; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/init.sqf b/TO_MERGE/cse/sys_vehicles/init.sqf new file mode 100644 index 0000000000..11e767557e --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/init.sqf @@ -0,0 +1,38 @@ +/** + * init.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +waituntil {!isnil "cse_main"}; +waituntil {!isnil "cse_fnc_defineVariable"}; + +cse_fnc_interactWithVehicle_Condition = { +private ["_return"]; + _return = false; + if (((_this select 0) distance (_this select 1) < 15)) then { + if (((_this select 1) isKindOf "Car") || ((_this select 1) isKindOf "Air") || ((_this select 1) isKindOf "Tank")) then { + _return = true; + }; + }; + _return +}; + +_entries = [ + ["Vehicle", {(_this call cse_fnc_interactWithVehicle_Condition) && (vehicle player == player)}, CSE_ICON_PATH + "icon_vehicle.paa", + { + closeDialog 0; + [_this select 1] call cse_fnc_openMenu_VEH; + }, "Vehicle Interaction"], + + ["Vehicle", {(vehicle player != player)}, CSE_ICON_PATH + "icon_vehicle.paa", + { + closeDialog 0; + [vehicle player] call cse_fnc_openMenu_VEH; + }, "Vehicle Interaction"] +]; +["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/stringtable.xml b/TO_MERGE/cse/sys_vehicles/stringtable.xml new file mode 100644 index 0000000000..8b718b1eab --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/TO_MERGE/cse/sys_vehicles/ui/define.hpp b/TO_MERGE/cse/sys_vehicles/ui/define.hpp new file mode 100644 index 0000000000..c521de470f --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/ui/define.hpp @@ -0,0 +1,797 @@ + +#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/sys_vehicles/ui/menu.hpp b/TO_MERGE/cse/sys_vehicles/ui/menu.hpp new file mode 100644 index 0000000000..4fa0ab7eaa --- /dev/null +++ b/TO_MERGE/cse/sys_vehicles/ui/menu.hpp @@ -0,0 +1,278 @@ +class cse_sys_vehicleMenu { + idd = 314436; + movingEnable = false; + onLoad = "uiNamespace setVariable ['cse_sys_vehicleMenu', _this select 0]; ['cse_onMenuOpen_Veh', true] call cse_fnc_gui_blurScreen; [_this select 0] call cse_fnc_onMenuOpen_VEH; "; + onUnload = "CSE_VEHICLE_INTERACTION_MENU_OPEN = false; ['cse_onMenuOpen_Veh', false] call cse_fnc_gui_blurScreen; ['cse_onMenuOpen_Veh', 'onEachFrame'] call BIS_fnc_removeStackedEventHandler;"; + + class controlsBackground { + class HeaderBackground: cse_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + //moving = 1; + }; + class CenterBackground: HeaderBackground { + /*x = 0.138; + y = 0.17; + w = 1.2549; + h = 0.836601;*/ + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + //text = "#(argb,8,8,3)color(0,0,0,0.65)"; + //text = "cse\cse_sys_medical\data\ui_background.paa"; + text = "#(argb,8,8,3)color(0,0,0,0.9)"; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + /*class BottomBackground: CenterBackground { + y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + };*/ + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + + class IconsBackGroundBar: cse_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + //text = "#(argb,8,8,3)color(0,0,0,0.4)"; + text ="cse\cse_sys_medical\data\cse_background_img.paa"; + colorText[] = {1, 1, 1, 0.0}; + //moving = 1; + }; + class CatagoryLeft: HeaderName { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + //colorText[] = {0.6, 0.7, 1.0, 1}; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = "ACTIONS & OVERVIEW"; + }; + class CatagoryCenter: CatagoryLeft { + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "ACTIONS"; + }; + class CatagoryRight: CatagoryCenter{ + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "VEHICLE"; + }; + class Line: cse_gui_backgroundBase { + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(1,1,1,0.5)"; + }; + + + + class BtnIconLeft1: cse_gui_buttonBase { + idc = 11; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = "['crew'] call cse_fnc_displayOptions_VEH;"; + }; + class BtnIconLeft2: BtnIconLeft1 { + idc = 12; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['cargo'] call cse_fnc_displayOptions_VEH;"; + }; + class BtnIconLeft3: BtnIconLeft1 { + idc = 13; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = "['repair'] call cse_fnc_displayOptions_VEH;"; + }; + class BtnIconLeft4: BtnIconLeft1 { + idc = 14; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = ""; + }; + class BtnIconLeft5: BtnIconLeft1 { + idc = 15; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = ""; + }; + class BtnIconLeft6: BtnIconLeft1 { + idc = 16; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = ""; + }; + class BtnIconLeft7: BtnIconLeft1 { + idc = 17; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = ""; + }; + class BtnIconLeft8: BtnIconLeft1 { + idc = 18; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = ""; + }; + class iconImg1: cse_gui_backgroundBase { + idc = 111; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + colorBackground[] = {0,0,0,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = "cse\cse_sys_vehicles\data\icons\icon_crew.paa"; + }; + class iconImg2: iconImg1 { + idc = 112; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_vehicles\data\icons\icon_cargo.paa"; + }; + class iconImg3: iconImg1 { + idc = 113; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = "cse\cse_sys_vehicles\data\icons\icon_repair.paa"; + }; + class iconImg4: iconImg1 { + idc = 114; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = ""; + }; + class iconImg5: iconImg1 { + idc = 115; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = ""; + }; + class iconImg6: iconImg1 { + idc = 116; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = ""; + }; + class iconImg7: iconImg1 { + idc = 117; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = ""; + }; + class iconImg8: iconImg1 { + idc = 118; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = ""; + }; + + + class informationList: cse_gui_listBoxBase { + idc = 212; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {1,1, 1, 1.0}; + colorSelect[] = {1,1, 1, 1.0}; + colorSelect2[] = {1,1, 1, 1.0}; + colorSelectBackground[] = {0, 0, 0, 1.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.7}; + }; + + + + class BtnMenu1: BtnIconLeft1 { + idc = 20; + x = "13.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "11.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = ""; + }; + class BtnMenu2: BtnMenu1 { + idc = 21; + y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu3: BtnMenu1 { + idc = 22; + y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu4: BtnMenu1 { + idc = 23; + y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text =""; + }; + class BtnMenu5: BtnMenu1 { + idc = 24; + y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu6: BtnMenu1 { + idc = 25; + y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu7: BtnMenu1 { + idc = 26; + y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu8: BtnMenu1 { + idc = 27; + y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/CfgFunctions.h b/TO_MERGE/cse/sys_weaponheat/CfgFunctions.h new file mode 100644 index 0000000000..876d69d6c6 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/CfgFunctions.h @@ -0,0 +1,27 @@ +class CfgFunctions { + class CSE { + class WeaponHeat { + file = "cse\cse_sys_weaponheat\functions"; + class canSwapBarrel_wh { recompile = 1; }; + class clearMalfunction_wh { recompile = 1; }; + class generateMalfunctions_wh { recompile = 1; }; + class generateHeatHaze_wh { recompile = 1; }; + class generateSmoke_wh { recompile = 1; }; + class getBarrelMass_wh { recompile = 1; }; + class getBarrelTemperature_wh { recompile = 1; }; + class getBulletMass_wh { recompile = 1; }; + class getIn_wh { recompile = 1; }; + class getOut_wh { recompile = 1; }; + class handleWeaponHeat_wh { recompile = 1; }; + class jamWeapon_wh { recompile = 1; }; + class put_wh { recompile = 1; }; + class registerBarrelExchangeActions_wh { recompile = 1; }; + class setBarrelTemperature_wh { recompile = 1; }; + class swapBarrel_wh { recompile = 1; }; + class take_wh { recompile = 1; }; + class removeParticleEffectHeat_WH { recompile = 1; }; + class addParticleEffectHeat_WH { recompile = 1; }; + class setParticleEffectHeat_WH { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/CfgSounds.h b/TO_MERGE/cse/sys_weaponheat/CfgSounds.h new file mode 100644 index 0000000000..9e38b28878 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/CfgSounds.h @@ -0,0 +1,33 @@ +class CfgSounds +{ + class cse_weaponheat_barrel_exchange + { + name="cse_weaponheat_barrel_exchange"; + sound[]={"\cse\cse_sys_weaponheat\sound\barrel_exchange.wav",1,1}; + titles[]={}; + }; + class cse_jamming_rifle + { + name="cse_jamming_rifle"; + sound[]={"\cse\cse_sys_weaponheat\sound\jamming_rifle.wav",1,1}; + titles[]={}; + }; + class cse_jamming_pistol + { + name="cse_jamming_pistol"; + sound[]={"\cse\cse_sys_weaponheat\sound\jamming_pistol.wav",1,1}; + titles[]={}; + }; + class cse_fixing_rifle + { + name="cse_fixing_rifle"; + sound[]={"\cse\cse_sys_weaponheat\sound\fixing_rifle.wav",1,1}; + titles[]={}; + }; + class cse_fixing_pistol + { + name="cse_fixing_pistol"; + sound[]={"\cse\cse_sys_weaponheat\sound\fixing_pistol.wav",1,1}; + titles[]={}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/CfgVehicles.h b/TO_MERGE/cse/sys_weaponheat/CfgVehicles.h new file mode 100644 index 0000000000..0716bea9c5 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/CfgVehicles.h @@ -0,0 +1,46 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_sys_weaponheat: Module_F { + scope = 2; + displayName = "Weapon Heat [CSE]"; + icon = "\cse\cse_main\data\cse_rifle_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + class genericSpareBarrel { + displayName = "Generic Spare Barrel"; + description = "Allow players to use a generic spare barrel that fits all weapons."; + typeName = "BOOL"; + defaultValue = true; + }; + }; + class ModuleDescription { + description = "Weapon heating"; + }; + }; + + class Item_Base_F; + class cse_sparebarrelbagItem: Item_Base_F + { + scope = 2; + scopeCurator = 2; + displayName = "Spare Barrel Bag"; + author = "Combat Space Enhancement"; + vehicleClass = "Items"; + class TransportItems + { + class cse_sparebarrelbag + { + name = "cse_sparebarrelbag"; + count = 1; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/CfgWeapons.h b/TO_MERGE/cse/sys_weaponheat/CfgWeapons.h new file mode 100644 index 0000000000..361a1652c1 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/CfgWeapons.h @@ -0,0 +1,49 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class cse_sparebarrelbag: ItemCore + { + scope=2; + displayName="Spare Barrel Bag"; + // TODO: Replace the place holders + model="\cse\cse_sys_weaponheat\equipment\barrel_m16.p3d"; + picture="\cse\cse_sys_weaponheat\equipment\img\barrel_m16.paa"; + descriptionShort="Spare Barrel Bag"; + class ItemInfo: InventoryItem_Base_F + { + mass=40; + type=201; + }; + }; + + class cse_barrel_m16: cse_sparebarrelbag + { + displayName="M16 Spare Barrel"; + descriptionShort="M16 Spare Barrel"; + model="\cse\cse_sys_weaponheat\equipment\barrel_m16.p3d"; + picture="\cse\cse_sys_weaponheat\equipment\img\barrel_m16.paa"; + }; + + class cse_barrel_ak74: cse_sparebarrelbag + { + displayName="AK Spare Barrel"; + descriptionShort="AK Spare Barrel"; + model="\cse\cse_sys_weaponheat\equipment\barrel_ak74.p3d"; + picture="\cse\cse_sys_weaponheat\equipment\img\barrel_ak74.paa"; + }; + + class Rifle_Base_F; + class arifle_MX_Base_F; + class arifle_MX_SW_F: arifle_MX_Base_F + { + cse_exchangeableBarrel = 1; + }; + class LMG_Zafir_F: Rifle_Base_F + { + cse_exchangeableBarrel = 1; + }; + class LMG_Mk200_F: Rifle_Base_F + { + cse_exchangeableBarrel = 1; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_weaponheat/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..70239b39c0 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/Combat_Space_Enhancement.h @@ -0,0 +1,18 @@ +class Combat_Space_Enhancement { + class CfgModules { + class cse_sys_weaponheat { + init = "call compile preprocessFile 'cse\cse_sys_weaponheat\init_sys_weaponheat.sqf';"; + name = "Weapon Heating"; + class EventHandlers { + class AllVehicles { + GetIn = "call cse_fnc_getIn_wh; false"; + GetOut = "call cse_fnc_getOut_wh; false"; + }; + + class CAManBase { + killed = "[_this select 1] call cse_fnc_removeParticleEffectHeat_WH;"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/config.cpp b/TO_MERGE/cse/sys_weaponheat/config.cpp new file mode 100644 index 0000000000..415f7c322a --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/config.cpp @@ -0,0 +1,25 @@ +class CfgPatches { + class cse_sys_weaponheat { + units[] = {"cse_sparebarrelbagItem"}; + weapons[] = {}; + requiredVersion = 1.0; + requiredAddons[] = {"cse_f_eh","cse_main", "A3_Weapons_F", "A3_Weapons_F_Rifles_MX"}; + version = "0.10.0_rc"; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + }; +}; + +class cse_sys_weaponheat { + class PreloadAddons { + class cse_sys_weaponheat { + list[] = {"cse_sys_weaponheat"}; + }; + }; +}; + +#include "CfgVehicles.h" +#include "CfgWeapons.h" +#include "CfgSounds.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/barrel_ak74.p3d b/TO_MERGE/cse/sys_weaponheat/equipment/barrel_ak74.p3d new file mode 100644 index 0000000000..cffce0919b Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/barrel_ak74.p3d differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/barrel_m16.p3d b/TO_MERGE/cse/sys_weaponheat/equipment/barrel_m16.p3d new file mode 100644 index 0000000000..ac893e24e5 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/barrel_m16.p3d differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74.rvmat b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74.rvmat new file mode 100644 index 0000000000..b96145eaea --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74.rvmat @@ -0,0 +1,22 @@ +ambient[]={0.80000001,0.80000001,0.80000001,0}; +diffuse[]={0.80000001,0.80000001,0.80000001,0}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,0}; +specular[]={0.2,0.2,0.2,0}; +specularPower=10.6; +renderFlags[]= +{ + "NoAlphaWrite" +}; +PixelShaderID="Glass"; +VertexShaderID="Glass"; +class Stage1 +{ + texture="#(argb,8,8,3)color(1,1,1,0.9)"; + uvSource="none"; +}; +class Stage2 +{ + texture="a3\data_f\env_chrome_co.paa"; + uvSource="none"; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74_co.paa b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74_co.paa new file mode 100644 index 0000000000..de0d49a31b Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_ak74_co.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16.rvmat b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16.rvmat new file mode 100644 index 0000000000..c5b74bc7d7 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16.rvmat @@ -0,0 +1,92 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.703999,0.703999,0.703999,0.000000}; +specularPower=70.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 +{ + texture="cse\cse_sys_weaponheat\equipment\data\barrel_m16_nohq.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 +{ + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 +{ + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 +{ + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 +{ + texture="#(argb,8,8,3)color(0,0.05,1,1,SMDI)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 +{ + texture="#(ai,32,128,1)fresnel(0.98,1.02)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 +{ + texture="cse\cse_sys_weaponheat\equipment\data\env_co.tga"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_co.paa b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_co.paa new file mode 100644 index 0000000000..a3494a0f25 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_co.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_nohq.paa b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_nohq.paa new file mode 100644 index 0000000000..f53a424eb6 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/data/barrel_m16_nohq.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/data/env_co.paa b/TO_MERGE/cse/sys_weaponheat/equipment/data/env_co.paa new file mode 100644 index 0000000000..77645347b5 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/data/env_co.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_ak74.paa b/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_ak74.paa new file mode 100644 index 0000000000..93b3b8a37c Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_ak74.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_m16.paa b/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_m16.paa new file mode 100644 index 0000000000..92b4f2fc8b Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/equipment/img/barrel_m16.paa differ diff --git a/TO_MERGE/cse/sys_weaponheat/functions/defines.h b/TO_MERGE/cse/sys_weaponheat/functions/defines.h new file mode 100644 index 0000000000..e7cf47b9d1 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/defines.h @@ -0,0 +1,16 @@ +#define PI 3.14159265 +#define ABSOLUTE_ZERO_IN_CELSIUS -273.15 +#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) +#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) +#define CENTIMETER(i) (i * 2.54) +#define STEFAN_BOLTZMANN_CONSTANT 0.00000005670373 // W / (m^2 * K^4) +#define HEAT_TRANSFER_COEFFICIENT_STEEL 25.0 // W / (m^2 * K) +#define HEAT_CAPACITY_STEEL 0.466 // J / (g * K) + +// Source: http://www.engineeringtoolbox.com/emissivity-coefficients-d_447.html +#define EMISSIVITY_STAINLESS_STEEL 0.54 + +// Source http://www.azom.com/properties.aspx?ArticleID=965 +// We have taken the average density for this +// (7.85 + 8.06 / 2) min + max / 2 +#define DENSITY_STAINLESS_STEEL 7.955 // g / cm^3 \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_addParticleEffectHeat_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_addParticleEffectHeat_wh.sqf new file mode 100644 index 0000000000..cb324f892b --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_addParticleEffectHeat_wh.sqf @@ -0,0 +1,31 @@ +/** + * fn_addParticleEffectsHeat_wh.sqf + * @Descr: Adds a heat effect for the units weapon. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: PARTICLE The particleeffect object + * @PublicAPI: false + */ + +private ["_unit", "_currentParticleEffect", "_weaponDirection", "_particleEffect", "_rightHandPosition"]; +_unit = _this select 0; + +_currentParticleEffect = _unit getvariable "cse_particleEffect_Heat_WH"; +if (!isnil "_currentParticleEffect") exitwith {_currentParticleEffect}; +_rightHandPosition = ATLtoASL (_unit modelToWorld (_unit selectionPosition "RightHand")); + +_weaponDirection = _unit weaponDirection _weapon; + +_dummyObj = "cse_LogicDummy" createVehicleLocal [0,0,0]; +_dummyObj attachTo [_unit, _weaponDirection vectorMultiply 0.2, "LeftHand"]; + +_particleEffect = "#particlesource" createVehicle (getPos _dummyObj); +_particleEffect setParticleCircle [0, [0, 0, 0]]; +_particleEffect setParticleRandom [0.2, [0, 0, 0], [0.0, 0.0, 0], 0.1, 0.1, [0, 0, 0, 0], 0, 0]; +_particleEffect setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract",1, 0, 1, 0], "", "Billboard", 3, 0.1, [0, 0, 0], [0, 0, 0.0], 0, 0.5, 0.5, 0.1, [1.0], [[1, 0.7, 0.7, 0.0]], [1], 0, 0, "", "", _dummyObj]; +_particleEffect setDropInterval 0.04; + +_unit setvariable ["cse_particleEffect_Heat_WH", _particleEffect]; +_unit setvariable ["cse_particleEffect_Heat_dummyObj_WH", _dummyObj]; +_particleEffect; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_canSwapBarrel_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_canSwapBarrel_wh.sqf new file mode 100644 index 0000000000..3e1480cee4 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_canSwapBarrel_wh.sqf @@ -0,0 +1,10 @@ +private ["_unit", "_weapon"]; +_unit = _this select 0; +_weapon = _this select 1; + +if (getNumber(configFile >> "CfgWeapons" >> _weapon >> "cse_exchangeableBarrel") != 1) exitWith { false }; + +if ([_unit, getText(configFile >> "CfgWeapons" >> _weapon >> "cse_spareBarrel")] call cse_fnc_hasItem) exitWith { true }; +if (cse_genericSpareBarrel_wh && [_unit, "cse_sparebarrelbag"] call cse_fnc_hasItem) exitWith { true }; + +false diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_clearMalfunction_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_clearMalfunction_wh.sqf new file mode 100644 index 0000000000..9223a16969 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_clearMalfunction_wh.sqf @@ -0,0 +1,32 @@ +/** + * fn_jamWeapon_wh.sqf + * @Descr: Clears the malfunction of a given unit/weapon/muzzle combination + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: nil + * @PublicAPI: true + */ + +#define SUCCESS_RATE 0.9 + +private ["_unit", "_weapon", "_muzzle"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +if ((currentMuzzle _unit) != _muzzle) exitWith {}; +if (_unit getVariable["CSE_ClearingMalfunction", false]) exitWith {}; +if (!(_unit getVariable[format["CSE_Malfunction_%1_%2", _weapon, _muzzle], false])) exitWith {}; + +// Beginning of the procedure to clear the malfunction +_unit setVariable["CSE_ClearingMalfunction", true, false]; + +_unit playActionNow "reloadMagazine"; +sleep 2; // TODO: This should depend on the weapon type (maybe consider the weapon mass) +if (SUCCESS_RATE > random 1) then { + _unit setVariable [format["CSE_Malfunction_%1_%2", _weapon, _muzzle], false, !(_unit isKindOf "Man")]; +}; + +// End of the procedure to clear the malfunction +_unit setVariable["CSE_ClearingMalfunction", false, false]; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_generateHeatHaze_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateHeatHaze_wh.sqf new file mode 100644 index 0000000000..0bcfe6e90e --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateHeatHaze_wh.sqf @@ -0,0 +1,35 @@ +#define MAX_TEMP_HEAT_EFFECT 1000 + +private ["_unit", "_weapon", "_muzzle", "_ammo", "_malfunctionRate"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_ammo = _this select 3; +_barrelTemperature = _this select 4; + +if (_unit getVariable[format["cse_weaponHeat_TemperatureEffects_%1_%2", _weapon, _muzzle], false]) exitWith {}; + +if (_barrelTemperature >= 100) then { + _unit setvariable [format["cse_weaponHeat_TemperatureEffects_%1_%2", _weapon, _muzzle], true]; + + [_unit, _weapon, _muzzle, _ammo] spawn { + _unit = _this select 0; + _weapon = _this select 1; + _muzzle = _this select 2; + _ammo = _this select 3; + + _particleEffect = [_unit] call cse_fnc_addParticleEffectHeat_WH; + _currentTemp = [_unit, _weapon, _muzzle, _ammo] call cse_fnc_getBarrelTemperature_wh; + while {_currentTemp >= 100 && alive _unit} do { + _currentTemp = [_unit, _weapon, _muzzle, _ammo] call cse_fnc_getBarrelTemperature_wh; + if (currentWeapon _unit == _weapon) then { + _percentage = 0 max (_currentTemp / MAX_TEMP_HEAT_EFFECT) min 1; + [_unit, _percentage] call cse_fnc_setParticleEffectHeat_WH; + } else { + [_unit, 0] call cse_fnc_setParticleEffectHeat_WH; + }; + sleep 1; + }; + [_unit] call cse_fnc_removeParticleEffectHeat_WH; + }; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_generateMalfunctions_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateMalfunctions_wh.sqf new file mode 100644 index 0000000000..991e6a02cf --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateMalfunctions_wh.sqf @@ -0,0 +1,53 @@ +/** + * fn_generateMalfunctions_wh.sqf + * @Descr: Generates weapon malfunctions based on barrel temperature and weapon cleanness + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING, barrelTemperature NUMBER] + * @Return: nil + * @PublicAPI: false + */ + + +#define MALFUNCTION_BASE_RATE 0.0001 // Base rate 1 : 10000 + +private ["_unit", "_weapon", "_muzzle", "_malfunctionRate"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_barrelTemperature = _this select 3; + +if (_unit getVariable[format["CSE_Malfunction_%1_%2", _weapon, _muzzle], false]) exitWith { + switch (getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")) do { + case 1: { + playSound3d["\cse\cse_sys_weaponheat\sound\jamming_rifle.wav", _unit, false, getPos _unit, 1.5, 1, 10]; + }; + case 2: { + playSound3d["\cse\cse_sys_weaponheat\sound\jamming_pistol.wav", _unit, false, getPos _unit, 1.5, 1, 10]; + }; + default { + + }; + }; + +}; + +_malfunctionRate = MALFUNCTION_BASE_RATE max (_barrelTemperature / 1500)^4; + +// TODO: Add consideration of weapon cleanness + +if (_malfunctionRate > random 1) then { + [_unit, _weapon, _muzzle] call cse_fnc_jamWeapon_wh; + + switch (getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")) do { + case 1: { + playSound3d["\cse\cse_sys_weaponheat\sound\jamming_rifle.wav", _unit, false, getPos _unit, 15, 1, 10]; + }; + case 2: { + playSound3d["\cse\cse_sys_weaponheat\sound\jamming_pistol.wav", _unit, false, getPos _unit, 15, 1, 10]; + }; + default { + + }; + }; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_generateSmoke_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateSmoke_wh.sqf new file mode 100644 index 0000000000..a9a7f2c048 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_generateSmoke_wh.sqf @@ -0,0 +1,29 @@ +/** + * fn_generateSmoke_wh.sqf + * @Descr: Generates a smoke effect based on barrel temperature + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING, _bullet OBJECT, barrelTemperature NUMBER] + * @Return: nil + * @PublicAPI: false + */ + + +private ["_unit", "_weapon", "_muzzle", "_bullet", "_bulletPosition", "_weaponDirection", "_intensity", "_particlePosition", "_distance"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_bullet = _this select 3; +_barrelTemperature = _this select 4; + +if (_barrelTemperature < 80) exitWith {}; + +_bulletPosition = getPosATL _bullet; +_weaponDirection = _unit weaponDirection _weapon; +_intensity = (_barrelTemperature / 2000) min 0.3; + +{ + _distance = 0.05 + random 0.27; + _particlePosition = _bulletPosition vectorAdd (_weaponDirection vectorMultiply _distance); + drop ["\A3\data_f\missileSmoke", "", "Billboard", 1, 1.5,_particlePosition, [0, 0, 0], 1, 7.0, 5.5, 0.075,[0.28, 0.33, 0.37], [[.5, .5, .5, _intensity], [.6, .6, .6,_intensity*0.2]], [random 1,random 1,random 1], 0, 0, "", "", ""]; +} forEach [0, 1]; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelMass_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelMass_wh.sqf new file mode 100644 index 0000000000..1c638f3ec0 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelMass_wh.sqf @@ -0,0 +1,31 @@ +/** + * fn_getBarrelMass_wh.sqf + * @Descr: Calculates the mass of the barrel + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: barrel mass in gramm + * @PublicAPI: false + */ + + +private ["_unit", "_weapon", "_muzzle", "_barrelMass"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +_barrelMass = 0.40 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass")) * 50; // estimated barrel mass in gramm +if (_barrelMass == 0) then { + // TODO: Find a way to estimate the barrel mass in this case + _barrelMass = 4000; + if (!(_unit isKindOf "Man")) then { + _barrelMass = _barrelMass * 10; + }; +}; +switch (_weapon) do { + case (primaryWeapon _unit) : { _barrelMass = 1000 max _barrelMass }; + case (secondaryWeapon _unit) : { _barrelMass = 2000 max _barrelMass }; + case (handgunWeapon _unit) : { _barrelMass = 400 max _barrelMass }; +}; + +_barrelMass diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelTemperature_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelTemperature_wh.sqf new file mode 100644 index 0000000000..c9c01d50b7 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBarrelTemperature_wh.sqf @@ -0,0 +1,62 @@ +/** + * fn_getBarrelTemperature_wh.sqf + * @Descr: Calculates the current barrel temperature + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING, ammo STRING] + * @Return: barrel temperature in degree celsius + * @PublicAPI: true + */ + + +#include "defines.h" + +private ["_unit", "_weapon", "_muzzle", "_ammo", "_barrelMass", "_barrelLength", "_barrelCaliber", "_area", "_barrelDiameter", "_ambientTemperature", "_barrelTemperature", "_lastUpdateTime", "_deltaTime", "_simulationStep", "_fluidVelocity", "_dynamicHeatTransferCoefficient"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_ammo = _this select 3; + +_barrelMass = [_unit, _weapon, _muzzle] call cse_fnc_getBarrelMass_wh; +_barrelSurface = _barrelMass * 0.00015; // Rough estimation based on barrel mass only + +_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "AB_barrelLength"); +_barrelCaliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "AB_caliber"); +if (_barrelLength > 0 && _barrelCaliber > 0) then { + // Estimate barrel surface based on barrel mass and barrel length and barrel caliber + _area = _barrelMass / (DENSITY_STAINLESS_STEEL * PI * CENTIMETER(_barrelLength)); + _barrelDiameter = sqrt(CENTIMETER(_barrelCaliber)^2 + 4 * _area); + + _barrelSurface = _barrelDiameter * PI * CENTIMETER(_barrelLength); + _barrelSurface = _barrelSurface / 10000; // convert from m^2 to cm^2 +}; + +_ambientTemperature = 15; +if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + _ambientTemperature = ((getPosASL _unit) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; +}; + +_barrelTemperature = _unit getVariable [format["CSE_BarrelTemperature_%1", _weapon], _ambientTemperature]; +_lastUpdateTime = _unit getVariable [format["CSE_BarrelUpdateTime_%1", _weapon], diag_tickTime]; + +_deltaTime = diag_tickTime - _lastUpdateTime; + +while {_deltaTime > 0} do { + _simulationStep = (_deltaTime min 1); // max step size 1 second + + // TODO: Do we want conductive heat transfer from the barrel to other parts of the weapon? + + // Source: https://de.wikipedia.org/wiki/W%C3%A4rme%C3%BCbergangskoeffizient + // Source: https://en.wikipedia.org/wiki/Combined_forced_and_natural_convection + _fluidVelocity = vectorMagnitude (wind vectorDiff (velocity _unit)); + _dynamicHeatTransferCoefficient = 12 * sqrt(_fluidVelocity) + 2; + // Source: https://en.wikipedia.org/wiki/Convective_heat_transfer + _barrelTemperature = _barrelTemperature - (HEAT_TRANSFER_COEFFICIENT_STEEL + _dynamicHeatTransferCoefficient) * _barrelSurface * (_barrelTemperature - _ambientTemperature) / (HEAT_CAPACITY_STEEL * _barrelMass) * _simulationStep; + + // Source: https://en.wikipedia.org/wiki/Thermal_radiation + _barrelTemperature = _barrelTemperature - EMISSIVITY_STAINLESS_STEEL * STEFAN_BOLTZMANN_CONSTANT * _barrelSurface * (KELVIN(_barrelTemperature)^4 - KELVIN(_ambientTemperature)^4) / (HEAT_CAPACITY_STEEL * _barrelMass) * _simulationStep; + + _deltaTime = _deltaTime - _simulationStep; +}; + +_barrelTemperature diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_getBulletMass_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBulletMass_wh.sqf new file mode 100644 index 0000000000..3075e2be18 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_getBulletMass_wh.sqf @@ -0,0 +1,25 @@ +/** + * fn_getBulletMass_wh.sqf + * @Descr: Calculates the mass of the bullet + * @Author: Ruthberg + * + * @Arguments: ammo STRING + * @Return: bullet mass in gramm + * @PublicAPI: false + */ + + +private ["_ammo", "_bulletMass", "_caliber"]; +_ammo = _this; + +_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "AB_bulletMass"); +if (_bulletMass == 0) then { + // Try to estimate the mass based on BIS caliber + // B_762x51_Ball: caliber 1.0 <--> 7.62 NATO M80: bullet mass 147 grain (9.46064086 g) + _caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "caliber"); + _bulletMass = _muzzleVelocity / 850 * _caliber * 9.46064086; +} else { + _bulletMass = _bulletMass * 0.06479891; +}; + +_bulletMass diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_getIn_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_getIn_wh.sqf new file mode 100644 index 0000000000..000261f184 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_getIn_wh.sqf @@ -0,0 +1,9 @@ +private ["_vehicle", "_position", "_unit", "_handle"]; +_vehicle = _this select 0; +_position = _this select 1; +_unit = _this select 2; + +if (_unit != player) exitWith {}; +_handle = _vehicle addEventHandler ["Fired", {_this call cse_fnc_handleWeaponHeat_wh}]; + +_vehicle setVariable ["cse_weapon_heat_fired_event_handler", _handle]; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_getOut_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_getOut_wh.sqf new file mode 100644 index 0000000000..f734099eb7 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_getOut_wh.sqf @@ -0,0 +1,12 @@ +private ["_vehicle", "_position", "_unit", "_handle"]; +_vehicle = _this select 0; +_position = _this select 1; +_unit = _this select 2; + +if (_unit != player) exitWith {}; +_handle = _vehicle getVariable "cse_weapon_heat_fired_event_handler"; + +if (!isNil "_handle") then { + _vehicle removeEventHandler ["Fired", _handle]; + _vehicle setVariable ["cse_weapon_heat_fired_event_handler", nil]; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_handleWeaponHeat_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_handleWeaponHeat_wh.sqf new file mode 100644 index 0000000000..7ac712917b --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_handleWeaponHeat_wh.sqf @@ -0,0 +1,54 @@ +/** + * fn_handleWeaponHeat_wh.sqf + * @Descr: Is expected to be triggered by the fired eventhandler from BI. + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + * + * Params: + * 1. unit: Object - Object the event handler is assigned to + * 2. weapon: String - Fired weapon + * 3. muzzle: String - Muzzle that was used + * 4. mode: String - Current mode of the fired weapon + * 5. ammo: String - Ammo used + * 6. magazine: String - magazine name which was used + * 7. projectile: Object - Object of the projectile that was shot (Arma 2: OA and onwards) + */ + +#include "defines.h" + +private ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_bullet", "_barrelTemperature", "_muzzleVelocity", "_barrelMass", "_bulletMass", "_caliber", "_kineticEnergy"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_mode = _this select 3; +_ammo = _this select 4; +_magazine = _this select 5; +_bullet = _this select 6; + +if (!(isPlayer _unit) || !local _unit) exitWith {}; +if (!(_bullet isKindOf "BulletBase")) exitWith {}; + +_barrelTemperature = [_unit, _weapon, _muzzle, _ammo] call cse_fnc_getBarrelTemperature_wh; + +_muzzleVelocity = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +_barrelMass = [_unit, _weapon, _muzzle] call cse_fnc_getBarrelMass_wh; +_bulletMass = _ammo call cse_fnc_getBulletMass_wh; + +_kineticEnergy = 0.5 * (_bulletMass / 1000) * _muzzleVelocity^2; // in J + +if (_kineticEnergy > 0 && _barrelMass > 0) then { + _barrelTemperature = _barrelTemperature + _kineticEnergy / (HEAT_CAPACITY_STEEL * _barrelMass); + [_unit, _weapon, _muzzle, _barrelTemperature] call cse_fnc_setBarrelTemperature_wh; +}; + +[_unit, _weapon, _muzzle, _barrelTemperature] call cse_fnc_generateMalfunctions_wh; +[_unit, _weapon, _muzzle, _ammo, _barrelTemperature] call cse_fnc_generateHeatHaze_wh; +[_unit, _weapon, _muzzle, _bullet, _barrelTemperature] call cse_fnc_generateSmoke_wh; + +// TODO: High barrel temperature side effects +// cooking off? +// fire (particle effects)? +// glowing barrel at very high temperatures? \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_jamWeapon_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_jamWeapon_wh.sqf new file mode 100644 index 0000000000..a47e907cb8 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_jamWeapon_wh.sqf @@ -0,0 +1,38 @@ +/** + * fn_jamWeapon_wh.sqf + * @Descr: Adds a malfunction to the given unit/weapon/muzzle combination + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: nil + * @PublicAPI: true + */ + +private ["_unit", "_weapon", "_muzzle", "_ID"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; + +_unit setVariable[format["CSE_Malfunction_%1_%2", _weapon, _muzzle], true, !(_unit isKindOf "CaManBase")]; +_ID = format["CSE_Malfunction_ID_%1_%2_%3", _unit, _weapon, _muzzle]; + +[_ID, [_unit, _weapon, _muzzle, _ID], { + private ["_unit", "_weapon", "_muzzle", "_ID"]; + _unit = _this select 0; + + // necessary to prefent weapon jam from resetting when jumping in and out of vehicles. + if (vehicle _unit == _unit) then { + _weapon = _this select 1; + _muzzle = _this select 2; + _ID = _this select 3; + + if (!(_unit getVariable[format["CSE_Malfunction_%1_%2", _weapon, _muzzle], false]) || !(_weapon in (weapons (vehicle _unit)))) exitWith { + _unit setVariable[format["CSE_Malfunction_%1_%2", _weapon, _muzzle], nil, !(_unit isKindOf "CaManBase")]; // clean up the malfunction variable. + [_ID] call cse_fnc_removeTaskFromPool_F; + }; + + if (currentWeapon _unit == _weapon && currentMuzzle _unit == _muzzle) then { + (vehicle _unit) setWeaponReloadingTime [_unit, _muzzle, 1]; + }; + }; +}] call cse_fnc_addTaskToPool_f; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_put_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_put_wh.sqf new file mode 100644 index 0000000000..1b3c28d7bf --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_put_wh.sqf @@ -0,0 +1,19 @@ +private ["_unit", "_container", "_item", "_itemCargo", "_ambientTemperature", "_spareBarrelTemperature", "_spareBarrelUpdateTime"]; +_unit = _this select 0; +_container = _this select 1; +_item = _this select 2; + +if (_unit != player) exitWith {}; +if (!([configFile >> "CfgWeapons" >> _item, "cse_sparebarrelbag"] call cse_fnc_inheritsFrom)) exitWith {}; +if (_container == uniformContainer player || _container == vestContainer player || _container == backpackContainer player) exitWith {}; + +_ambientTemperature = 15; +if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + _ambientTemperature = ((getPosASL _unit) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; +}; + +_spareBarrelTemperature = _unit getVariable [format["CSE_BarrelTemperature_%1", _item], _ambientTemperature]; +_spareBarrelUpdateTime = _unit getVariable [format["CSE_BarrelUpdateTime_%1", _item], diag_tickTime]; + +_container setVariable [format["CSE_BarrelTemperature_%1", _item], _spareBarrelTemperature, true]; +_container setVariable [format["CSE_BarrelUpdateTime_%1", _item], _spareBarrelUpdateTime, true]; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_registerBarrelExchangeActions_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_registerBarrelExchangeActions_wh.sqf new file mode 100644 index 0000000000..5ccdf7e726 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_registerBarrelExchangeActions_wh.sqf @@ -0,0 +1,26 @@ +if (isDedicated) exitwith{}; +CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\"; + +cse_exchangeBarrelDisplaySubMenu = { + [_this] call cse_fnc_Debug; + + private ["_subMenus"]; + _subMenus = []; + + if ([player, currentWeapon player, currentMuzzle player] call cse_fnc_canSwapBarrel_wh) then { + _subMenus pushBack ["Swap barrel", CSE_ICON_PATH + "icon_swap_barrels.paa", { + closeDialog 0; + [player, currentWeapon player, currentMuzzle player] spawn cse_fnc_swapBarrel_wh; + }, true, "Swaps out the barrel"]; + }; + + [_this select 3, _subMenus, _this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true] call cse_fnc_openRadialSecondRing_GUI; +}; + + +_entries = [ + ["Weapon", {([player, currentWeapon player, currentMuzzle player] call cse_fnc_canSwapBarrel_wh)}, CSE_ICON_PATH + "icon_lines_horizontal_s.paa", cse_exchangeBarrelDisplaySubMenu, "Shows available weapon interactions"] +]; +["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F; + + diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_removeParticleEffectHeat_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_removeParticleEffectHeat_wh.sqf new file mode 100644 index 0000000000..cda3d4b85a --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_removeParticleEffectHeat_wh.sqf @@ -0,0 +1,26 @@ +/** + * fn_removeParticleEffectHeat_wh.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL Whatever or not a particle effect has been removed + * @PublicAPI: false + */ + +private ["_unit", "_currentParticleEffect"]; +_unit = _this select 0; + +_currentParticleEffect = _unit getvariable "cse_particleEffect_Heat_WH"; +if (!isnil "_currentParticleEffect") exitwith { + deleteVehicle _currentParticleEffect; + _unit setvariable ["cse_particleEffect_Heat_WH", nil]; + + _dummyObj = _unit getvariable "cse_particleEffect_Heat_dummyObj_WH"; + deleteVehicle _dummyObj; + _unit setvariable ["cse_particleEffect_Heat_dummyObj_WH", nil]; + + true +}; + +false diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_setBarrelTemperature_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_setBarrelTemperature_wh.sqf new file mode 100644 index 0000000000..ccf67a5987 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_setBarrelTemperature_wh.sqf @@ -0,0 +1,19 @@ +/** + * fn_setBarrelTemperature_wh.sqf + * @Descr: Calculates the current barrel temperature + * @Author: Ruthberg + * + * @Arguments: [unit OBJECT, weapon STRING, muzzle STRING] + * @Return: barrel temperature in degree celsius + * @PublicAPI: true + */ + + +private ["_unit", "_weapon", "_muzzle", "_barrelTemperature"]; +_unit = _this select 0; +_weapon = _this select 1; +_muzzle = _this select 2; +_barrelTemperature = _this select 3; + +_unit setVariable [format["CSE_BarrelTemperature_%1", _weapon], _barrelTemperature, !(_unit isKindOf "Man")]; +_unit setVariable [format["CSE_BarrelUpdateTime_%1" , _weapon], diag_tickTime, !(_unit isKindOf "Man")]; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_setParticleEffectHeat_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_setParticleEffectHeat_wh.sqf new file mode 100644 index 0000000000..a7735a7cdc --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_setParticleEffectHeat_wh.sqf @@ -0,0 +1,11 @@ + +private ["_unit", "_percentage", "_currentParticleEffect", "_dummyObj"]; +_unit = _this select 0; +_percentage = _this select 1; + +_currentParticleEffect = _unit getvariable "cse_particleEffect_Heat_WH"; +if (!isnil "_currentParticleEffect") then { + _dummyObj = _unit getvariable "cse_particleEffect_Heat_dummyObj_WH"; + _dummyObj attachTo [_unit, (_unit weaponDirection _weapon) vectorMultiply 0.2, "LeftHand"]; + _particleEffect setParticleParams [["\A3\data_f\ParticleEffects\Universal\Refract",1, 0, 1, 0], "", "Billboard", 1, 1.0, [0, 0, 0], [0, 0, 0.0], 0, 0.5, 0.5, 0.1, [1.0], [[1, 0.7, 0.7, 0.5 * _percentage]], [1], 0, 0, "", "", _dummyObj]; +}; diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_swapBarrel_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_swapBarrel_wh.sqf new file mode 100644 index 0000000000..f15ce020c7 --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_swapBarrel_wh.sqf @@ -0,0 +1,48 @@ +private ["_unit", "_weapon"]; +_unit = _this select 0; +_weapon = _this select 1; + +if (!([_unit, _weapon] call cse_fnc_canSwapBarrel_wh)) exitWith {}; +if (vehicle _unit != _unit && {driver (vehicle _unit) == _unit || commander (vehicle _unit) == _unit || gunner (vehicle _unit) == _unit}) exitWith {}; + +if (vehicle _unit == _unit && currentWeapon _unit != "" && !(weaponLowered _unit) && (stance _unit != "PRONE")) then { + _unit action ["WeaponOnBack", _unit]; + waitUntil { weaponLowered _unit }; // probably evil +}; + +[_unit, _weapon] spawn { + private ["_unit", "_weapon", "_spareBarrel", "_ambientTemperature", "_barrelTemperature", "_barrelUpdateTime", "_spareBarrelTemperature", "_spareBarrelUpdateTime"]; + _unit = _this select 0; + _weapon = _this select 1; + + CSE_ORIGINAL_POSITION_BARREL_EXCHANGE_EQ = getPos _unit; + // TODO: Prohibit the player from using his weapon during the barrel exchange progress + CSE_CONDITION_BARREL_EXCHANGE_EQ = {((vehicle _unit != _unit && driver (vehicle _unit) != _unit && commander (vehicle _unit) != _unit && gunner (vehicle _unit) != _unit) || (((getPos _unit) distance CSE_ORIGINAL_POSITION_BARREL_EXCHANGE_EQ) < 1 && (weaponLowered _unit || stance _unit == "PRONE")))}; + + // TODO: Play animation + playSound "cse_weaponheat_barrel_exchange"; + _barrelExchangeSuccess = [15, CSE_CONDITION_BARREL_EXCHANGE_EQ] call cse_fnc_gui_loadingBar; + + if (_barrelExchangeSuccess) then { + _spareBarrel = getText(configFile >> "CfgWeapons" >> _weapon >> "cse_spareBarrel"); + if (!([_unit, _spareBarrel] call cse_fnc_hasItem)) then { + _spareBarrel = "cse_sparebarrelbag"; + }; + _ambientTemperature = 15; + if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + _ambientTemperature = ((getPosASL _unit) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; + }; + + _barrelTemperature = _unit getVariable [format["CSE_BarrelTemperature_%1", _weapon], _ambientTemperature]; + _barrelUpdateTime = _unit getVariable [format["CSE_BarrelUpdateTime_%1", _weapon], diag_tickTime]; + + _spareBarrelTemperature = _unit getVariable [format["CSE_BarrelTemperature_%1", _spareBarrel], _ambientTemperature]; + _spareBarrelUpdateTime = _unit getVariable [format["CSE_BarrelUpdateTime_%1", _spareBarrel], diag_tickTime]; + + _unit setVariable [format["CSE_BarrelTemperature_%1", _weapon], _spareBarrelTemperature]; + _unit setVariable [format["CSE_BarrelUpdateTime_%1", _weapon], _spareBarrelUpdateTime]; + + _unit setVariable [format["CSE_BarrelTemperature_%1", _spareBarrel], _barrelTemperature]; + _unit setVariable [format["CSE_BarrelUpdateTime_%1", _spareBarrel], _barrelUpdateTime]; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_weaponheat/functions/fn_take_wh.sqf b/TO_MERGE/cse/sys_weaponheat/functions/fn_take_wh.sqf new file mode 100644 index 0000000000..8052b6180d --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/functions/fn_take_wh.sqf @@ -0,0 +1,35 @@ +private ["_unit", "_container", "_item", "_itemCargo", "_spareBarrelCount", "_ambientTemperature", "_spareBarrelTemperature", "_spareBarrelUpdateTime"]; +_unit = _this select 0; +_container = _this select 1; +_item = _this select 2; + +if (_unit != player) exitWith {}; +if (!([configFile >> "CfgWeapons" >> _item, "cse_sparebarrelbag"] call cse_fnc_inheritsFrom)) exitWith {}; +if (_container == uniformContainer player || _container == vestContainer player || _container == backpackContainer player) exitWith {}; + +_itemCargo = getItemCargo _container; +_spareBarrelCount = 0; +{ + if (_x == _item) exitWith { + _spareBarrelCount = (_itemCargo select 1) select _forEachIndex; + }; +} forEach (_itemCargo select 0); + +_ambientTemperature = 15; +if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + _ambientTemperature = ((getPosASL _unit) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; +}; + +_spareBarrelTemperature = _ambientTemperature; +_spareBarrelUpdateTime = diag_tickTime; + +if (_spareBarrelCount == 0) then { + // Assume that we took an already used spare barrel + _spareBarrelTemperature = _container getVariable [format["CSE_BarrelTemperature_%1", _item], _ambientTemperature]; + _spareBarrelUpdateTime = _container getVariable [format["CSE_BarrelUpdateTime_%1", _item], diag_tickTime]; + _container setVariable [format["CSE_BarrelTemperature_%1", _item], nil]; + _container setVariable [format["CSE_BarrelUpdateTime_%1", _item], nil]; +}; + +_unit setVariable [format["CSE_BarrelTemperature_%1", _item], _spareBarrelTemperature]; +_unit setVariable [format["CSE_BarrelUpdateTime_%1", _item], _spareBarrelUpdateTime]; diff --git a/TO_MERGE/cse/sys_weaponheat/init_sys_weaponheat.sqf b/TO_MERGE/cse/sys_weaponheat/init_sys_weaponheat.sqf new file mode 100644 index 0000000000..3b7c664e9e --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/init_sys_weaponheat.sqf @@ -0,0 +1,31 @@ +if (!hasInterface) exitWith {}; +waitUntil {!isNil "cse_gui" && !isNil "cse_main"}; +waitUntil {!isNull player}; + +player addEventHandler ["Fired", {_this call cse_fnc_handleWeaponHeat_wh}]; +player addEventHandler ["Take", {_this call cse_fnc_take_wh}]; +player addEventHandler ["Put", {_this call cse_fnc_put_wh}]; + +cse_sys_weaponheat = true; +cse_genericSpareBarrel_wh = true; + +_args = _this; +{ + _value = _x select 1; + if (!isNil "_value") then { + _name = _x select 0; + if (_name == "genericSpareBarrel") exitWith { + cse_genericSpareBarrel_wh = _value; + }; + }; +} forEach _args; + +// Clear Malfunction +["cse_weaponheat_clear_malfunction", (["cse_weaponheat_clear_malfunction","action",[20, 0,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [player, currentWeapon player, currentMuzzle player] call cse_fnc_clearMalfunction_wh; + }] call cse_fnc_addKeyBindingForAction_F; + +["cse_weaponheat_clear_malfunction","action", "Clear Malfunction", "Clear Malfunction"] call cse_fnc_settingsDefineDetails_F; + +call cse_fnc_registerBarrelExchangeActions_wh; diff --git a/TO_MERGE/cse/sys_weaponheat/sound/barrel_exchange.wav b/TO_MERGE/cse/sys_weaponheat/sound/barrel_exchange.wav new file mode 100644 index 0000000000..5d3391099a Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/sound/barrel_exchange.wav differ diff --git a/TO_MERGE/cse/sys_weaponheat/sound/fixing_pistol.wav b/TO_MERGE/cse/sys_weaponheat/sound/fixing_pistol.wav new file mode 100644 index 0000000000..d765edd274 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/sound/fixing_pistol.wav differ diff --git a/TO_MERGE/cse/sys_weaponheat/sound/fixing_rifle.wav b/TO_MERGE/cse/sys_weaponheat/sound/fixing_rifle.wav new file mode 100644 index 0000000000..7f0a640670 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/sound/fixing_rifle.wav differ diff --git a/TO_MERGE/cse/sys_weaponheat/sound/jamming_pistol.wav b/TO_MERGE/cse/sys_weaponheat/sound/jamming_pistol.wav new file mode 100644 index 0000000000..f7b48fa3e1 Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/sound/jamming_pistol.wav differ diff --git a/TO_MERGE/cse/sys_weaponheat/sound/jamming_rifle.wav b/TO_MERGE/cse/sys_weaponheat/sound/jamming_rifle.wav new file mode 100644 index 0000000000..d44507d01c Binary files /dev/null and b/TO_MERGE/cse/sys_weaponheat/sound/jamming_rifle.wav differ diff --git a/TO_MERGE/cse/sys_weaponheat/stringtable.xml b/TO_MERGE/cse/sys_weaponheat/stringtable.xml new file mode 100644 index 0000000000..e7f8b63e1a --- /dev/null +++ b/TO_MERGE/cse/sys_weaponheat/stringtable.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/addons/ai/CfgAISkill.hpp b/addons/ai/CfgAISkill.hpp new file mode 100644 index 0000000000..dfa0299509 --- /dev/null +++ b/addons/ai/CfgAISkill.hpp @@ -0,0 +1,27 @@ + +/* + * Documentation: + * https://community.bistudio.com/wiki/AI_Sub-skills + * + * The idea here is to reduce the AI's godlike aiming + * capabilties while retaining it's high intelligence. + * The AI should be smart enough to move through a town, + * but also be 'human' in their reaction time and aim. + * + * Note: All these values can still be adjusted via + * scripts, these arrays just change what 0 & 1 + * are for setSkill. + */ + +class CfgAISkill { + aimingAccuracy[] = {0,0, 1,0.8}; // {0,0,1,1}; v1.26 defaults + aimingShake[] = {0,0, 1,0.6}; // {0,0,1,1}; + aimingSpeed[] = {0,0, 1,0.7}; // {0,0.5,1,1}; + commanding[] = {0,0, 1,0.8}; // {0,0,1,1}; + courage[] = {0,0, 1,0.7}; // {0,0,1,1}; + endurance[] = {0,0, 1,0.7}; // {0,0,1,1}; + general[] = {0,0, 1,0.9}; // {0,0,1,1}; + reloadSpeed[] = {0,0, 1,0.8}; // {0,0,1,1}; + spotDistance[] = {0,0, 1,0.9}; // {0,0.2,1,0.4}; + spotTime[] = {0,0, 1,0.7}; // {0,0,1,0.7}; +}; diff --git a/addons/ai/CfgWeapons.hpp b/addons/ai/CfgWeapons.hpp new file mode 100644 index 0000000000..ff25e53c22 --- /dev/null +++ b/addons/ai/CfgWeapons.hpp @@ -0,0 +1,575 @@ + +// weapon config changes, by commy2 + +/* documentation: +aiDispersionCoefX = 1.0 Dispersion multiplier for AI units (axis X - left to right). +aiDispersionCoefY = 1.0 Dispersion multiplier for AI units (axis Y - top-down). +aiRateOfFire = 5.0 Delay between shots at given aiRateOfFireDistance. +aiRateOfFireDistance = 500 At shorter distance delay (aiRateOfFire) goes linearly to zero. +*/ + +class Mode_SemiAuto; +class Mode_Burst; +class Mode_FullAuto; + +class CfgWeapons { + + // rifles + class RifleCore; + class Rifle: RifleCore { + aiDispersionCoefX = 6; + aiDispersionCoefY = 6; + }; + + class Rifle_Base_F: Rifle {}; + class Rifle_Long_Base_F: Rifle_Base_F {}; + + // MX + class arifle_MX_Base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.5; + midRange = 300; // 200; + midRangeProbab = 0.5; // 0.7; + }; + + class FullAuto; + class fullauto_medium: FullAuto { + minRange = 20; // 2; + burst = "3 + round random 5"; //3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 500; + minRange = 400; + minRangeProbab = 0.1; + midRange = 500; + midRangeProbab = 0.2; + maxRange = 600; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: Single { + aiRateOfFireDistance = 700; // 600; + minRange = 120; // 2; + maxRange = 700; // 600; + }; + + class single_far_optics2: single_medium_optics1 { + aiRateOfFireDistance = 900; // 700; + minRange = 200; // 100; + maxRange = 900; // 700; + }; + }; + + // MX carbine + class arifle_MXC_F: arifle_MX_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Single { + minRange = 120; // 2; + minRangeProbab = 0.5; // 0.3; + midRange = 250; // 150; + midRangeProbab = 0.3; // 0.5; + }; + + class FullAuto; + class fullauto_medium: fullauto_medium { + minRange = 20; // 2; + burst = "3 + round random 5"; //3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 400; + minRange = 300; + minRangeProbab = 0.1; + midRange = 400; + midRangeProbab = 0.2; + maxRange = 500; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: single_medium_optics1 { + aiRateOfFireDistance = 600; // 500; + minRange = 120; // 2; + maxRange = 600; // 500; + }; + + class single_far_optics2: single_medium_optics1 { + aiRateOfFireDistance = 800; // 700; + minRange = 200; // 100; + maxRange = 800; // 700; + }; + }; + + //class arifle_MX_F: arifle_MX_Base_F {}; + //class arifle_MX_GL_F: arifle_MX_Base_F {}; + + // MX machine gun + class arifle_MXM_F: arifle_MX_Base_F { + class Single: Single { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.5; + midRange = 350; // 250; + midRangeProbab = 0.5; // 0.7; + }; + + class fullauto_medium: fullauto_medium { + minRange = 20; // 2; + burst = "3 + round random 5"; //3; + }; + + class single_medium_optics1: single_medium_optics1 { + aiRateOfFireDistance = 700; // 600; + minRange = 120; // 2; + maxRange = 750; // 650; + }; + + class single_far_optics2: single_far_optics2 { + aiRateOfFireDistance = 900; // 800; + minRange = 200; // 100; + maxRange = 900; // 800; + }; + }; + + // MX sniper rifle + class arifle_MX_SW_F: arifle_MX_Base_F { + aiDispersionCoefY = 24.0; + aiDispersionCoefX = 21.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; // 2; + }; + + class close; + class medium; + class AGM_Burst_far: medium { + aiRateOfFire = 6.0; + aiRateOfFireDistance = 900; + minRange = 500; + minRangeProbab = 0.1; + midRange = 700; + midRangeProbab = 0.2; + maxRange = 900; + maxRangeProbab = 0.2; + burst = "3 + round random 5"; + }; + + class far_optic1: close { + aiRateOfFireDistance = 750; // 650; + maxRange = 750; // 650; + }; + + class far_optic2: far_optic1 { + maxRange = 1100; // 900; + aiRateOfFireDistance = 1100;// 900; + }; + }; + + // Katiba + class arifle_Katiba_Base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.5; + midRange = 300; // 200; + midRangeProbab = 0.5; // 0.7; + }; + + class FullAuto; + class fullauto_medium: FullAuto { + minRange = 20; // 2; + burst = "3 + round random 5"; //3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 500; + minRange = 400; + minRangeProbab = 0.1; + midRange = 500; + midRangeProbab = 0.2; + maxRange = 600; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: Single { + aiRateOfFireDistance = 700; // 600; + minRange = 120; // 2; + maxRange = 700; // 600; + }; + + class single_far_optics2: single_medium_optics1 { + aiRateOfFireDistance = 900; // 800; + minRange = 200; // 100; + maxRange = 900; // 800; + }; + }; + + // Katiba carbine + class arifle_Katiba_C_F: arifle_Katiba_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Single { + minRange = 120; // 2; + minRangeProbab = 0.5; // 0.3; + midRange = 250; // 150; + midRangeProbab = 0.3; // 0.7; + }; + + //class FullAuto: FullAuto {}; + + class fullauto_medium: fullauto_medium { + minRange = 20; // 2; + maxRange = 150; //100; + burst = "3 + round random 5"; //3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 400; + minRange = 300; + minRangeProbab = 0.1; + midRange = 400; + midRangeProbab = 0.2; + maxRange = 500; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: single_medium_optics1 { + minRange = 120; // 2; + maxRange = 600; // 500; + }; + + class single_medium_optics2: single_medium_optics1 { + aiRateOfFireDistance = 800; // 700; + minRange = 200; // 100; + maxRange = 800; // 700; + }; + }; + + // F2002 + class mk20_base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.5; + midRange = 250; // 150; + midRangeProbab = 0.5; // 0.7; + }; + + class FullAuto: Mode_FullAuto { + minRange = 0; //2; + }; + + class fullauto_medium: FullAuto { + minRange = 20; // 2; + maxRange = 150; // 100; + burst = "3 + round random 5"; // 3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 500; + minRange = 400; + minRangeProbab = 0.1; + midRange = 500; + midRangeProbab = 0.2; + maxRange = 600; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: Single { + aiRateOfFireDistance = 600; // 500; + minRange = 120; // 5; + maxRange = 600; // 500; + }; + + class single_far_optics2: single_medium_optics1 { + aiRateOfFireDistance = 800; // 700; + minRange = 200; // 100; + maxRange = 800; // 700; + }; + }; + + // F2002 carbine + class arifle_Mk20C_F: mk20_base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Single { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.5; + midRange = 250; // 150; + midRangeProbab = 0.5; // 0.7; + maxRange = 350; // 250; + }; + + class FullAuto: FullAuto { + minRange = 0; //2; + }; + + class single_medium_optics1: single_medium_optics1 { + aiRateOfFireDistance = 600; // 500; + minRange = 120; // 5; + maxRange = 550; // 450; + }; + + //class single_medium_optics2: single_medium_optics1 {}; + class fullauto_medium: fullauto_medium { + minRange = 20; //2; + burst = "3 + round random 5"; //3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 400; + minRange = 300; + minRangeProbab = 0.1; + midRange = 400; + midRangeProbab = 0.2; + maxRange = 500; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + }; + + // TAR-20 + class Tavor_base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; //2; + minRangeProbab = 0.7; //0.5; + midRange = 250; //150; + midRangeProbab = 0.5; //0.7; + maxRange = 350; //250; + }; + + class FullAuto: Mode_FullAuto { + minRange = 0; //2; + }; + + class fullauto_medium: FullAuto { + minRange = 20; // 2; + maxRange = 150; // 100; + burst = "3 + round random 5"; // 3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 400; + minRange = 300; + minRangeProbab = 0.1; + midRange = 400; + midRangeProbab = 0.2; + maxRange = 500; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: Single { + aiRateOfFireDistance = 600; // 500; + minRange = 120; // 5; + maxRange = 550; // 450; + }; + + class single_medium_optics2: single_medium_optics1 { + aiRateOfFireDistance = 700; // 600; + minRange = 200; // 100; + maxRange = 700; // 600; + }; + }; + + // TAR-21 + class arifle_TRG21_F: Tavor_base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Single { + minRange = 120; // 2; + minRangeProbab = 0.7; // 0.3; + midRange = 300; // 200; + midRangeProbab = 0.5; // 0.7; + maxRange = 400; // 300; + }; + + class FullAuto: FullAuto { + minRange = 0; //2; + }; + + class fullauto_medium: fullauto_medium { + minRange = 20; // 2; + maxRange = 150; // 100; + burst = "3 + round random 5"; // 3; + }; + + class AGM_Burst_far: fullauto_medium { + aiRateOfFire = 2.0; + aiRateOfFireDistance = 400; + minRange = 300; + minRangeProbab = 0.1; + midRange = 400; + midRangeProbab = 0.2; + maxRange = 500; + maxRangeProbab = 0.2; + burst = "2 + round random 3"; + }; + + class single_medium_optics1: single_medium_optics1 { + aiRateOfFireDistance = 700; // 600; + minRange = 120; // 2; + maxRange = 600; // 500; + }; + + class single_medium_optics2: single_medium_optics1 { + aiRateOfFireDistance = 800; // 700; + minRange = 200; // 100; + maxRange = 800; // 700; + }; + }; + + // sub machine guns + + // SDAR + class SDAR_base_F: Rifle_Base_F { + aiDispersionCoefY = 28.0; + aiDispersionCoefX = 20.0; + + class Single: Mode_SemiAuto { + minRange = 10; //2; + }; + + class Burst: Mode_Burst { + minRange = 5; //1; + }; + }; + + // PD2000 + class pdw2000_base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Mode_SemiAuto { + minRange = 100; //2; + }; + + class Burst: Mode_Burst { + minRange = 50; //1; + }; + }; + + // Vector + class SMG_01_Base: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Mode_SemiAuto { + minRange = 50; //2; + }; + + class Burst: Mode_Burst { + minRange = 25; //2; + }; + }; + + // Scorpion EVO + class SMG_02_base_F: Rifle_Base_F { + aiDispersionCoefY = 18.0; + aiDispersionCoefX = 12.0; + + class Single: Mode_SemiAuto { + minRange = 50; //2; + }; + + class Burst: Mode_Burst { + minRange = 25; //2; + }; + }; + + // machine guns + + // Stoner + class LMG_Mk200_F: Rifle_Long_Base_F { + aiDispersionCoefY = 24.0; + aiDispersionCoefX = 21.0; + modes[] += {"AGM_Burst_far"}; + + class medium; + class AGM_Burst_far: medium { + aiRateOfFire = 6.0; + aiRateOfFireDistance = 900; + minRange = 500; + minRangeProbab = 0.1; + midRange = 700; + midRangeProbab = 0.2; + maxRange = 900; + maxRangeProbab = 0.2; + burst = "3 + round random 5"; + }; + + class far_optic1: medium { + maxRange = 750; // 650; + }; + + class far_optic2: far_optic1 { + maxRange = 1100; // 900; + aiRateOfFireDistance = 1100;// 900; + }; + }; + + // Negev + class LMG_Zafir_F: Rifle_Long_Base_F { + aiDispersionCoefY = 23.0; + aiDispersionCoefX = 19.0; + modes[] += {"AGM_Burst_far"}; + + class Single: Mode_SemiAuto { + minRange = 120; // 2; + }; + + class close; + class medium; + class AGM_Burst_far: medium { + aiRateOfFire = 6.0; + aiRateOfFireDistance = 900; + minRange = 500; + minRangeProbab = 0.1; + midRange = 700; + midRangeProbab = 0.2; + maxRange = 900; + maxRangeProbab = 0.2; + burst = "3 + round random 5"; + }; + + class far_optic1: close { + maxRange = 800; //700; + }; + + class far_optic2: far_optic1 { + maxRange = 1200; //1000; + }; + }; +}; diff --git a/addons/ai/config.cpp b/addons/ai/config.cpp index 5e1264d418..fdcb6afe9d 100644 --- a/addons/ai/config.cpp +++ b/addons/ai/config.cpp @@ -1,617 +1,16 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi", "commy2"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"KoffeinFlummi","commy2"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; }; -/* - * Documentation: - * https://community.bistudio.com/wiki/AI_Sub-skills - * - * The idea here is to reduce the AI's godlike aiming - * capabilties while retaining it's high intelligence. - * The AI should be smart enough to move through a town, - * but also be 'human' in their reaction time and aim. - * - * Note: All these values can still be adjusted via - * scripts, these arrays just change what 0 & 1 - * are for setSkill. - */ - -class CfgAISkill { - aimingAccuracy[] = {0,0, 1,0.8}; // {0,0,1,1}; v1.26 defaults - aimingShake[] = {0,0, 1,0.6}; // {0,0,1,1}; - aimingSpeed[] = {0,0, 1,0.7}; // {0,0.5,1,1}; - commanding[] = {0,0, 1,0.8}; // {0,0,1,1}; - courage[] = {0,0, 1,0.7}; // {0,0,1,1}; - endurance[] = {0,0, 1,0.7}; // {0,0,1,1}; - general[] = {0,0, 1,0.9}; // {0,0,1,1}; - reloadSpeed[] = {0,0, 1,0.8}; // {0,0,1,1}; - spotDistance[] = {0,0, 1,0.9}; // {0,0.2,1,0.4}; - spotTime[] = {0,0, 1,0.7}; // {0,0,1,0.7}; -}; - -// weapon config changes, by commy2 - -/* documentation: -aiDispersionCoefX = 1.0 Dispersion multiplier for AI units (axis X - left to right). -aiDispersionCoefY = 1.0 Dispersion multiplier for AI units (axis Y - top-down). -aiRateOfFire = 5.0 Delay between shots at given aiRateOfFireDistance. -aiRateOfFireDistance = 500 At shorter distance delay (aiRateOfFire) goes linearly to zero. -*/ - -class Mode_SemiAuto; -class Mode_Burst; -class Mode_FullAuto; - -class CfgWeapons { - - // rifles - class RifleCore; - class Rifle: RifleCore { - aiDispersionCoefX = 6; - aiDispersionCoefY = 6; - }; - - class Rifle_Base_F: Rifle {}; - class Rifle_Long_Base_F: Rifle_Base_F {}; - - // MX - class arifle_MX_Base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.5; - midRange = 300; // 200; - midRangeProbab = 0.5; // 0.7; - }; - - class FullAuto; - class fullauto_medium: FullAuto { - minRange = 20; // 2; - burst = "3 + round random 5"; //3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 500; - minRange = 400; - minRangeProbab = 0.1; - midRange = 500; - midRangeProbab = 0.2; - maxRange = 600; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: Single { - aiRateOfFireDistance = 700; // 600; - minRange = 120; // 2; - maxRange = 700; // 600; - }; - - class single_far_optics2: single_medium_optics1 { - aiRateOfFireDistance = 900; // 700; - minRange = 200; // 100; - maxRange = 900; // 700; - }; - }; - - // MX carbine - class arifle_MXC_F: arifle_MX_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Single { - minRange = 120; // 2; - minRangeProbab = 0.5; // 0.3; - midRange = 250; // 150; - midRangeProbab = 0.3; // 0.5; - }; - - class FullAuto; - class fullauto_medium: fullauto_medium { - minRange = 20; // 2; - burst = "3 + round random 5"; //3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 400; - minRange = 300; - minRangeProbab = 0.1; - midRange = 400; - midRangeProbab = 0.2; - maxRange = 500; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: single_medium_optics1 { - aiRateOfFireDistance = 600; // 500; - minRange = 120; // 2; - maxRange = 600; // 500; - }; - - class single_far_optics2: single_medium_optics1 { - aiRateOfFireDistance = 800; // 700; - minRange = 200; // 100; - maxRange = 800; // 700; - }; - }; - - //class arifle_MX_F: arifle_MX_Base_F {}; - //class arifle_MX_GL_F: arifle_MX_Base_F {}; - - // MX machine gun - class arifle_MXM_F: arifle_MX_Base_F { - class Single: Single { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.5; - midRange = 350; // 250; - midRangeProbab = 0.5; // 0.7; - }; - - class fullauto_medium: fullauto_medium { - minRange = 20; // 2; - burst = "3 + round random 5"; //3; - }; - - class single_medium_optics1: single_medium_optics1 { - aiRateOfFireDistance = 700; // 600; - minRange = 120; // 2; - maxRange = 750; // 650; - }; - - class single_far_optics2: single_far_optics2 { - aiRateOfFireDistance = 900; // 800; - minRange = 200; // 100; - maxRange = 900; // 800; - }; - }; - - // MX sniper rifle - class arifle_MX_SW_F: arifle_MX_Base_F { - aiDispersionCoefY = 24.0; - aiDispersionCoefX = 21.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; // 2; - }; - - class close; - class medium; - class AGM_Burst_far: medium { - aiRateOfFire = 6.0; - aiRateOfFireDistance = 900; - minRange = 500; - minRangeProbab = 0.1; - midRange = 700; - midRangeProbab = 0.2; - maxRange = 900; - maxRangeProbab = 0.2; - burst = "3 + round random 5"; - }; - - class far_optic1: close { - aiRateOfFireDistance = 750; // 650; - maxRange = 750; // 650; - }; - - class far_optic2: far_optic1 { - maxRange = 1100; // 900; - aiRateOfFireDistance = 1100;// 900; - }; - }; - - // Katiba - class arifle_Katiba_Base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.5; - midRange = 300; // 200; - midRangeProbab = 0.5; // 0.7; - }; - - class FullAuto; - class fullauto_medium: FullAuto { - minRange = 20; // 2; - burst = "3 + round random 5"; //3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 500; - minRange = 400; - minRangeProbab = 0.1; - midRange = 500; - midRangeProbab = 0.2; - maxRange = 600; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: Single { - aiRateOfFireDistance = 700; // 600; - minRange = 120; // 2; - maxRange = 700; // 600; - }; - - class single_far_optics2: single_medium_optics1 { - aiRateOfFireDistance = 900; // 800; - minRange = 200; // 100; - maxRange = 900; // 800; - }; - }; - - // Katiba carbine - class arifle_Katiba_C_F: arifle_Katiba_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Single { - minRange = 120; // 2; - minRangeProbab = 0.5; // 0.3; - midRange = 250; // 150; - midRangeProbab = 0.3; // 0.7; - }; - - //class FullAuto: FullAuto {}; - - class fullauto_medium: fullauto_medium { - minRange = 20; // 2; - maxRange = 150; //100; - burst = "3 + round random 5"; //3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 400; - minRange = 300; - minRangeProbab = 0.1; - midRange = 400; - midRangeProbab = 0.2; - maxRange = 500; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: single_medium_optics1 { - minRange = 120; // 2; - maxRange = 600; // 500; - }; - - class single_medium_optics2: single_medium_optics1 { - aiRateOfFireDistance = 800; // 700; - minRange = 200; // 100; - maxRange = 800; // 700; - }; - }; - - // F2002 - class mk20_base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.5; - midRange = 250; // 150; - midRangeProbab = 0.5; // 0.7; - }; - - class FullAuto: Mode_FullAuto { - minRange = 0; //2; - }; - - class fullauto_medium: FullAuto { - minRange = 20; // 2; - maxRange = 150; // 100; - burst = "3 + round random 5"; // 3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 500; - minRange = 400; - minRangeProbab = 0.1; - midRange = 500; - midRangeProbab = 0.2; - maxRange = 600; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: Single { - aiRateOfFireDistance = 600; // 500; - minRange = 120; // 5; - maxRange = 600; // 500; - }; - - class single_far_optics2: single_medium_optics1 { - aiRateOfFireDistance = 800; // 700; - minRange = 200; // 100; - maxRange = 800; // 700; - }; - }; - - // F2002 carbine - class arifle_Mk20C_F: mk20_base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Single { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.5; - midRange = 250; // 150; - midRangeProbab = 0.5; // 0.7; - maxRange = 350; // 250; - }; - - class FullAuto: FullAuto { - minRange = 0; //2; - }; - - class single_medium_optics1: single_medium_optics1 { - aiRateOfFireDistance = 600; // 500; - minRange = 120; // 5; - maxRange = 550; // 450; - }; - - //class single_medium_optics2: single_medium_optics1 {}; - class fullauto_medium: fullauto_medium { - minRange = 20; //2; - burst = "3 + round random 5"; //3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 400; - minRange = 300; - minRangeProbab = 0.1; - midRange = 400; - midRangeProbab = 0.2; - maxRange = 500; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - }; - - // TAR-20 - class Tavor_base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; //2; - minRangeProbab = 0.7; //0.5; - midRange = 250; //150; - midRangeProbab = 0.5; //0.7; - maxRange = 350; //250; - }; - - class FullAuto: Mode_FullAuto { - minRange = 0; //2; - }; - - class fullauto_medium: FullAuto { - minRange = 20; // 2; - maxRange = 150; // 100; - burst = "3 + round random 5"; // 3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 400; - minRange = 300; - minRangeProbab = 0.1; - midRange = 400; - midRangeProbab = 0.2; - maxRange = 500; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: Single { - aiRateOfFireDistance = 600; // 500; - minRange = 120; // 5; - maxRange = 550; // 450; - }; - - class single_medium_optics2: single_medium_optics1 { - aiRateOfFireDistance = 700; // 600; - minRange = 200; // 100; - maxRange = 700; // 600; - }; - }; - - // TAR-21 - class arifle_TRG21_F: Tavor_base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Single { - minRange = 120; // 2; - minRangeProbab = 0.7; // 0.3; - midRange = 300; // 200; - midRangeProbab = 0.5; // 0.7; - maxRange = 400; // 300; - }; - - class FullAuto: FullAuto { - minRange = 0; //2; - }; - - class fullauto_medium: fullauto_medium { - minRange = 20; // 2; - maxRange = 150; // 100; - burst = "3 + round random 5"; // 3; - }; - - class AGM_Burst_far: fullauto_medium { - aiRateOfFire = 2.0; - aiRateOfFireDistance = 400; - minRange = 300; - minRangeProbab = 0.1; - midRange = 400; - midRangeProbab = 0.2; - maxRange = 500; - maxRangeProbab = 0.2; - burst = "2 + round random 3"; - }; - - class single_medium_optics1: single_medium_optics1 { - aiRateOfFireDistance = 700; // 600; - minRange = 120; // 2; - maxRange = 600; // 500; - }; - - class single_medium_optics2: single_medium_optics1 { - aiRateOfFireDistance = 800; // 700; - minRange = 200; // 100; - maxRange = 800; // 700; - }; - }; - - // sub machine guns - - // SDAR - class SDAR_base_F: Rifle_Base_F { - aiDispersionCoefY = 28.0; - aiDispersionCoefX = 20.0; - - class Single: Mode_SemiAuto { - minRange = 10; //2; - }; - - class Burst: Mode_Burst { - minRange = 5; //1; - }; - }; - - // PD2000 - class pdw2000_base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Mode_SemiAuto { - minRange = 100; //2; - }; - - class Burst: Mode_Burst { - minRange = 50; //1; - }; - }; - - // Vector - class SMG_01_Base: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Mode_SemiAuto { - minRange = 50; //2; - }; - - class Burst: Mode_Burst { - minRange = 25; //2; - }; - }; - - // Scorpion EVO - class SMG_02_base_F: Rifle_Base_F { - aiDispersionCoefY = 18.0; - aiDispersionCoefX = 12.0; - - class Single: Mode_SemiAuto { - minRange = 50; //2; - }; - - class Burst: Mode_Burst { - minRange = 25; //2; - }; - }; - - // machine guns - - // Stoner - class LMG_Mk200_F: Rifle_Long_Base_F { - aiDispersionCoefY = 24.0; - aiDispersionCoefX = 21.0; - modes[] += {"AGM_Burst_far"}; - - class medium; - class AGM_Burst_far: medium { - aiRateOfFire = 6.0; - aiRateOfFireDistance = 900; - minRange = 500; - minRangeProbab = 0.1; - midRange = 700; - midRangeProbab = 0.2; - maxRange = 900; - maxRangeProbab = 0.2; - burst = "3 + round random 5"; - }; - - class far_optic1: medium { - maxRange = 750; // 650; - }; - - class far_optic2: far_optic1 { - maxRange = 1100; // 900; - aiRateOfFireDistance = 1100;// 900; - }; - }; - - // Negev - class LMG_Zafir_F: Rifle_Long_Base_F { - aiDispersionCoefY = 23.0; - aiDispersionCoefX = 19.0; - modes[] += {"AGM_Burst_far"}; - - class Single: Mode_SemiAuto { - minRange = 120; // 2; - }; - - class close; - class medium; - class AGM_Burst_far: medium { - aiRateOfFire = 6.0; - aiRateOfFireDistance = 900; - minRange = 500; - minRangeProbab = 0.1; - midRange = 700; - midRangeProbab = 0.2; - maxRange = 900; - maxRangeProbab = 0.2; - burst = "3 + round random 5"; - }; - - class far_optic1: close { - maxRange = 800; //700; - }; - - class far_optic2: far_optic1 { - maxRange = 1200; //1000; - }; - }; -}; +#include "CfgAISkill.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/ai/script_component.hpp b/addons/ai/script_component.hpp index 46602db75c..7e95e38573 100644 --- a/addons/ai/script_component.hpp +++ b/addons/ai/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_AI - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_AI - #define DEBUG_SETTINGS DEBUG_ENABLED_AI + #define DEBUG_SETTINGS DEBUG_ENABLED_AI #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/attach/CfgEventHandlers.hpp b/addons/attach/CfgEventHandlers.hpp index 8af0265fe2..5eca7fa129 100644 --- a/addons/attach/CfgEventHandlers.hpp +++ b/addons/attach/CfgEventHandlers.hpp @@ -1,5 +1,5 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); }; }; \ No newline at end of file diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index 311aa874ec..5efadc1f68 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -1,7 +1,8 @@ #include "script_component.hpp" -PREPF(attach); -PREPF(canAttach); -PREPF(canDetach); -PREPF(detach); -PREPF(openAttachUI); \ No newline at end of file +PREP(attach); +PREP(canAttach); +PREP(canDetach); +PREP(detach); +PREP(detachDelayFix); +PREP(openAttachUI); \ No newline at end of file diff --git a/addons/attach/config.cpp b/addons/attach/config.cpp index c5054ebd6e..c7948fc323 100644 --- a/addons/attach/config.cpp +++ b/addons/attach/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {"AGM_IR_Strobe_Item"}; requiredVersion = 0.60; - requiredAddons[] = {AGM_Core, AGM_Interaction}; + requiredAddons[] = {"ace_common", "ace_interaction"}; version = "0.95"; versionStr = "0.95"; versionAr[] = {0,95,0}; @@ -53,7 +53,7 @@ class CfgVehicles { }; class GVAR(Detach) { displayName = "$STR_AGM_Attach_Detach"; - condition = QUOTE( [_player] call FUNC(canDetach ); + condition = QUOTE( [_player] call FUNC(canDetach) ); statement = QUOTE( [_player] call FUNC(detach) ); exceptions[] = {"AGM_Drag_isNotDragging"}; showDisabled = 0; diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index b4cf675096..0c96e6f8ca 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -29,27 +29,27 @@ switch true do { case (_itemName == "AGM_IR_Strobe_Item") : { _attachedItem = "AGM_IR_Strobe_Effect" createVehicle [0,0,0]; _attachedItem attachTo [_unit,[0,-0.11,0.16],"pilot"];//makes it attach to the head a bit better, shoulder is not good for visibility - eRazeri - [localize "STR_AGM_Attach_IrStrobe_Attached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrStrobe_Attached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "B_IR_Grenade") : { _attachedItem = "B_IRStrobe" createVehicle [0,0,0]; _attachedItem attachTo [_unit,[-0.05,0,0.12],"rightshoulder"]; - [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "O_IR_Grenade") : { _attachedItem = "O_IRStrobe" createVehicle [0,0,0]; _attachedItem attachTo [_unit,[-0.05,0,0.12],"rightshoulder"]; - [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "I_IR_Grenade") : { _attachedItem = "I_IRStrobe" createVehicle [0,0,0]; _attachedItem attachTo [_unit,[-0.05,0,0.12],"rightshoulder"]; - [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrGrenade_Attached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}) : { _attachedItem = _itemName createVehicle [0,0,0]; _attachedItem attachTo [_unit,[-0.05,0,0.12],"rightshoulder"]; - [localize "STR_AGM_Attach_Chemlight_Attached"] call EFUNC(core,displayTextStructured);; + [localize "STR_AGM_Attach_Chemlight_Attached"] call EFUNC(common,displayTextStructured);; }; default { if (true) exitWith {}; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 415429440b..07d1eda906 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -16,6 +16,7 @@ private ["_unit", "_itemName", "_count", "_attachedItem"]; _unit = _this select 0; _itemName = _unit getVariable [QGVAR(ItemName), ""]; +_attachedItem = _unit getVariable [QGVAR(Item), objNull]; // Check if unit has an attached item if (_itemName == "") exitWith {}; @@ -24,24 +25,18 @@ if (_itemName == "") exitWith {}; _count = (count items _unit) + (count magazines _unit); _unit addItem _itemName; if ((count items _unit) + (count magazines _unit) <= _count) exitWith { - [localize "STR_AGM_Attach_Inventory_Full"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_Inventory_Full"] call EFUNC(common,displayTextStructured); }; if (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") then { // Hack for dealing with X_IR_Grenade effect not dissapearing on deleteVehicle - [_unit getVariable QGVAR(Item), _unit] spawn { - _attachedItem = _this select 0; - _unit = _this select 1; - detach _attachedItem; - _attachedItem setPos [getPos _unit select 0, getPos _unit select 1, (getPos _unit select 2) -1000]; - sleep 0.5; - deleteVehicle _attachedItem; - }; -} -else -{ + detach _attachedItem; + _attachedItem setPos [getPos _unit select 0, getPos _unit select 1, ((getPos _unit select 2) - 1000)]; + // Delete attached item after 0.5 seconds + [FUNC(detachFix), 0.5, [_attachedItem, (time + 0.5)]] call CBA_fnc_addPerFrameHandler; +} else { // Delete attached item - deleteVehicle (_unit getVariable QGVAR(Item)); + deleteVehicle _attachedItem; }; // Reset unit variables @@ -51,13 +46,13 @@ _unit setVariable [QGVAR(Item),nil, true]; // Display message switch true do { case (_itemName == "AGM_IR_Strobe_Item") : { - [localize "STR_AGM_Attach_IrStrobe_Detached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrStrobe_Detached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == "I_IR_Grenade") : { - [localize "STR_AGM_Attach_IrGrenade_Detached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_IrGrenade_Detached"] call EFUNC(common,displayTextStructured); }; case (_itemName == "Chemlight_blue" or {_itemName == "Chemlight_green"} or {_itemName == "Chemlight_red"} or {_itemName == "Chemlight_yellow"}) : { - [localize "STR_AGM_Attach_Chemlight_Detached"] call EFUNC(core,displayTextStructured); + [localize "STR_AGM_Attach_Chemlight_Detached"] call EFUNC(common,displayTextStructured); }; default { if (true) exitWith {}; diff --git a/addons/attach/functions/fnc_detachDelayFix.sqf b/addons/attach/functions/fnc_detachDelayFix.sqf new file mode 100644 index 0000000000..b84761c9fe --- /dev/null +++ b/addons/attach/functions/fnc_detachDelayFix.sqf @@ -0,0 +1,22 @@ +/* + Name: ACE_attach_fnc_detachFix + + Author: Pabst Mirror + + Description: + Waits then deletes the object. Fixes IR_Grenade's effect not disapearing. + + Parameters: + 0: ARRAY - [OBJECT - item, NUMBER - time to wait until] + 1: NUMBER - CBA's PerFrameHandler ID +*/ + +_attachedItem = (_this select 0) select 0; +_waitUntilTime = (_this select 0) select 1; + +if (time < _waitUntilTime) exitWith {}; + +deleteVehicle _attachedItem; + +//Remove the frame handler +[(_this select 1)] call cba_fnc_removePerFrameHandler; diff --git a/addons/attach/functions/script_component.hpp b/addons/attach/functions/script_component.hpp new file mode 100644 index 0000000000..b28de85182 --- /dev/null +++ b/addons/attach/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\attach\script_component.hpp" \ No newline at end of file diff --git a/addons/common/$PBOPREFIX$ b/addons/common/$PBOPREFIX$ new file mode 100644 index 0000000000..a119c03af5 --- /dev/null +++ b/addons/common/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\common \ No newline at end of file diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp new file mode 100644 index 0000000000..34119a3407 --- /dev/null +++ b/addons/common/CfgEventHandlers.hpp @@ -0,0 +1,42 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + serverInit = QUOTE(call COMPILE_FILE(scripts\readParameters) ); + disableModuload = true; + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit) ); + disableModuload = true; + }; +}; + +class Extended_InitPost_EventHandlers { + class All { + class GVAR(executePersistent) { + init = QUOTE([_this select 0] call FUNC(executePersistent) ); + }; + }; + class CAManBase { + class GVAR(setName) { + init = QUOTE(if (local (_this select 0)) then { _this call FUNC(setName) }; ); + }; + class GVAR(forceWalk) { + init = QUOTE(if (local (_this select 0)) then { _this call FUNC(applyForceWalkStatus); }; ); + }; + }; +}; + +class Extended_Respawn_EventHandlers { + class All { + class GVAR(restoreVariablesJIP) { + respawn = QUOTE(_this call FUNC(restoreVariablesJIP) ); + }; + class GVAR(setName) { + respawn = QUOTE(_this call FUNC(setName) ); + }; + }; +}; diff --git a/addons/common/CfgMagazines.hpp b/addons/common/CfgMagazines.hpp new file mode 100644 index 0000000000..815ab6db9f --- /dev/null +++ b/addons/common/CfgMagazines.hpp @@ -0,0 +1,10 @@ + +class CfgMagazines { + class CA_Magazine; + class ACE_FakeMagazine: CA_Magazine { + descriptionShort = ""; + displayName = ""; + displayNameShort = ""; + count = 0; + }; +}; diff --git a/addons/common/CfgSounds.hpp b/addons/common/CfgSounds.hpp new file mode 100644 index 0000000000..d564f6717d --- /dev/null +++ b/addons/common/CfgSounds.hpp @@ -0,0 +1,7 @@ + +class CfgSounds { + class ACE_Sound_Click { + sound[] = {PATHTOF(sounds\ACE_click.wav), 1, 1, 200}; + titles[] = {}; + }; +}; diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp new file mode 100644 index 0000000000..8ed770d786 --- /dev/null +++ b/addons/common/CfgVehicles.hpp @@ -0,0 +1,109 @@ + +class CfgVehicles { + /*class Man; + class CAManBase: Man { + // @todo + class UserActions { + class ACE_Fire { + displayName = ""; + priority = -99; + available = 1; + radius = 2.5; + radiusView = 0; + position = ""; + showWindow = 0; + showIn3D = 0; + onlyForPlayer = 1; + shortcut = "DefaultAction"; + condition = "call ACE_Common_UserActionFireCondition"; + statement = "call ACE_Common_UserActionFire"; + userActionID = 100; + }; + }; + };*/ + + // += needs a non inherited entry in that class, otherwise it simply overwrites + //#include + + class Module_F; + class ACE_ModuleCheckPBOs: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Check PBOs"; + function = "ACE_Common_fnc_moduleCheckPBOs"; + scope = 2; + isGlobal = 1; + icon = QUOTE(PATHTOF(UI\IconCheckPBO_ca.paa)); + class Arguments { + class Action { + displayName = "Action"; + description = "What to do with people who do not have the right PBOs?"; + class values { + class WarnOnce { + default = 1; + name = "Warn once"; + value = 0; + }; + class Warn { + name = "Warn (permanent)"; + value = 1; + }; + class Kick { + name = "Kick"; + value = 2; + }; + }; + }; + class CheckAll { + displayName = "Check all addons"; + description = "Check all addons instead of only those of ACE?"; + typeName = "BOOL"; + class values { + class WarnOnce { + default = 1; + name = "No"; + value = 0; + }; + class Warn { + name = "Yes"; + value = 1; + }; + }; + }; + class Whitelist { + displayName = "Whitelist"; + description = "What addons are allowed regardless?"; + typeName = "STRING"; + class values { + default = "[]"; + }; + }; + }; + }; + + class ACE_ModuleLSDVehicles: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "LSD Vehicles"; + function = "ACE_Common_fnc_moduleLSDVehicles"; + scope = 2; + isGlobal = 1; + class Arguments { + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_Common_MiscItems"; + transportMaxWeapons = 9001; + transportMaxMagazines = 9001; + transportMaxItems = 9001; + maximumload = 2000; + + class TransportWeapons {}; + class TransportMagazines {}; + class TransportItems {}; + class TransportBackpacks {}; + }; +}; diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp new file mode 100644 index 0000000000..5df5d75da8 --- /dev/null +++ b/addons/common/CfgWeapons.hpp @@ -0,0 +1,20 @@ + +class CfgWeapons { + class ItemCore; + class ACE_ItemCore: ItemCore { + type = 4096;//4; + detectRange = -1; + simulation = "ItemMineDetector"; + }; + + class Rifle_Base_F; + class ACE_FakePrimaryWeapon: Rifle_Base_F { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + displayName = ""; + picture = ""; + model = ""; + magazines[] = {"ACE_FakeMagazine"}; + scope = 2; + }; +}; diff --git a/addons/common/DefaultItems.hpp b/addons/common/DefaultItems.hpp new file mode 100644 index 0000000000..539eb3beff --- /dev/null +++ b/addons/common/DefaultItems.hpp @@ -0,0 +1,1030 @@ +/* + +Autoexported while playing the unmodded game. + + +A = "_c = _x >> 'items'; isArray _c" configClasses (configFile >> "CfgVehicles"); + +B = []; {B set [_forEachIndex, inheritsFrom _x]} forEach A; +E = B - A; + +C = []; {C set [_forEachIndex, getArray (_x >> "items")]} forEach A; +D = []; {D set [_forEachIndex, getArray (_x >> "respawnItems")]} forEach A; + +{A set [_forEachIndex, configName _x]} forEach A; +{B set [_forEachIndex, configName _x]} forEach B; +{E set [_forEachIndex, configName _x]} forEach E; + +diag_log text "====================="; + +{ + diag_log text format ["class %1;", _x]; +} forEach E; + +{ + diag_log text format ["class %1: %2 {", _x, B select _forEachIndex]; + _s = str (C select _forEachIndex); _s = toString (toArray _s - [91,93]); + diag_log text format [" items[] = {%1};", _s]; + _s = str (D select _forEachIndex); _s = toString (toArray _s - [91,93]); + diag_log text format [" respawnItems[] = {%1};", _s]; + diag_log text "};"; +} forEach A; + +*/ + +class SoldierWB; +class SoldierGB; +class SoldierEB; +class C_man_1; +class B_Soldier_base_F: SoldierWB { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_02_f: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_03_f: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_04_f: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_05_f: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_RangeMaster_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_lite_F: B_Soldier_03_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_GL_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AR_F: B_Soldier_02_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_SL_F: B_Soldier_03_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_TL_F: B_Soldier_03_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_M_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_LAT_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_medic_F: B_Soldier_02_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_repair_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_exp_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Helipilot_F: B_Soldier_04_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_A_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AT_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AA_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_engineer_F: B_Soldier_03_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_crew_F: B_Soldier_03_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_officer_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Competitor_F: B_RangeMaster_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Pilot_F: B_Soldier_05_f { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_helicrew_F: B_Helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_PG_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_UAV_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class b_soldier_unarmed_f: B_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_diver_base_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_diver_F: B_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_diver_TL_F: B_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_diver_exp_F: B_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_recon_base: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_LAT_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_exp_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_medic_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_TL_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_M_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_recon_JTAC_F: B_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_sniper_base_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_spotter_F: B_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_sniper_F: B_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_SF_Captain_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_Protagonist_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_Engineer_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_Colonel_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_Pilot_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Story_Tank_Commander_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class b_soldier_survival_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_CTRG_soldier_GL_LAT_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_CTRG_soldier_engineer_exp_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_CTRG_soldier_M_medic_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_CTRG_soldier_AR_A_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_support_base_F: B_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AAR_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AAT_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_soldier_AAA_F: B_soldier_AAT_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_support_MG_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_support_GMG_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_support_Mort_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_support_AMG_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_support_AMort_F: B_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_base_F: SoldierGB { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_lite_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_SL_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_TL_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_AR_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_medic_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_engineer_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_exp_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_GL_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_M_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_LAT_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Soldier_A_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_officer_F: I_G_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_F: I_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_F: I_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_lite_F: I_G_Soldier_lite_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_lite_F: I_G_Soldier_lite_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_SL_F: I_G_Soldier_SL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_SL_F: I_G_Soldier_SL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_TL_F: I_G_Soldier_TL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_TL_F: I_G_Soldier_TL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_AR_F: I_G_Soldier_AR_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_AR_F: I_G_Soldier_AR_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_medic_F: I_G_medic_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_medic_F: I_G_medic_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_engineer_F: I_G_engineer_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_engineer_F: I_G_engineer_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_exp_F: I_G_Soldier_exp_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_exp_F: I_G_Soldier_exp_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_GL_F: I_G_Soldier_GL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_GL_F: I_G_Soldier_GL_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_M_F: I_G_Soldier_M_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_M_F: I_G_Soldier_M_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_LAT_F: I_G_Soldier_LAT_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_LAT_F: I_G_Soldier_LAT_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_Soldier_A_F: I_G_Soldier_A_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_Soldier_A_F: I_G_Soldier_A_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_G_officer_F: I_G_officer_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_G_officer_F: I_G_officer_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class i_g_soldier_unarmed_f: I_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class b_g_soldier_unarmed_f: B_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class o_g_soldier_unarmed_f: O_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class i_g_survivor_F: I_G_Soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class b_g_survivor_F: B_G_Soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class o_g_survivor_F: O_G_Soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class I_G_Story_Protagonist_F: B_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_Story_SF_Captain_F: B_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_resistanceLeader_F: I_G_Story_Protagonist_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_G_resistanceCommander_F: I_G_Story_Protagonist_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_base_F: SoldierGB { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_02_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_03_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_04_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_soldier_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_lite_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_A_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_GL_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AR_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_SL_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_TL_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_M_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_LAT_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AT_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AA_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_medic_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_repair_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_exp_F: I_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_engineer_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_crew_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_helipilot_F: I_Soldier_03_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_pilot_F: I_Soldier_04_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_helicrew_F: I_helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_officer_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Story_Colonel_F: I_officer_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_soldier_UAV_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class i_soldier_unarmed_f: I_soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_diver_base_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_diver_F: I_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_diver_exp_F: I_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_diver_TL_F: I_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_sniper_base_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Spotter_F: I_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Sniper_F: I_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_support_base_F: I_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AAR_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AAT_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_Soldier_AAA_F: I_Soldier_AAT_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_support_MG_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_support_GMG_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_support_Mort_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_support_AMG_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_support_AMort_F: I_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_base_F: SoldierEB { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_officer_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_02_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_lite_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_GL_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AR_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_SL_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_TL_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldier_M_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_LAT_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_medic_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldier_repair_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldier_exp_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_helipilot_F: O_Soldier_02_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_A_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AT_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AA_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_engineer_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_crew_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Pilot_F: O_helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_helicrew_F: O_helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldier_PG_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Story_Colonel_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Story_CEO_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldier_UAV_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class o_soldier_unarmed_f: O_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_diver_base_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_diver_F: O_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_diver_TL_F: O_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_diver_exp_F: O_Soldier_diver_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_sniper_base_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_spotter_F: O_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_sniper_F: O_Soldier_sniper_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_recon_base: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_M_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_LAT_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_medic_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_exp_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_JTAC_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_recon_TL_F: O_Soldier_recon_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_support_base_F: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AAR_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AAT_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_AAA_F: O_Soldier_AAT_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_support_MG_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_support_GMG_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_support_Mort_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_support_AMG_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_support_AMort_F: O_Soldier_support_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_Soldier_Urban_base: O_Soldier_base_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AR_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AAR_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_LAT_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AT_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AAT_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AA_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_AAA_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_TL_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_SoldierU_SL_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_medic_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_repair_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_exp_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_engineer_U_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_M_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_soldierU_A_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_SoldierU_GL_F: O_Soldier_Urban_base { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class C_Marshal_F: B_RangeMaster_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class B_Soldier_VR_F: B_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class O_Soldier_VR_F: O_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class I_Soldier_VR_F: I_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class C_Soldier_VR_F: C_man_1 { + items[] = {}; + respawnItems[] = {}; +}; +class B_Protagonist_VR_F: B_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class O_Protagonist_VR_F: O_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class I_Protagonist_VR_F: I_Soldier_base_F { + items[] = {}; + respawnItems[] = {}; +}; +class B_UAV_AI: B_Helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class O_UAV_AI: O_helipilot_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class I_UAV_AI: O_UAV_AI { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class Underwear_F: B_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class b_survivor_F: B_Soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class o_survivor_F: O_Soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class i_survivor_F: I_soldier_F { + items[] = {}; + respawnItems[] = {}; +}; +class b_soldier_universal_f: B_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class b_g_soldier_universal_f: B_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class o_soldier_universal_f: O_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class o_g_soldier_universal_f: O_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class i_soldier_universal_f: I_soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; +class i_g_soldier_universal_f: I_G_Soldier_F { + items[] = {"FirstAidKit"}; + respawnItems[] = {"FirstAidKit"}; +}; diff --git a/addons/common/FixAnimations.hpp b/addons/common/FixAnimations.hpp new file mode 100644 index 0000000000..d389391ba1 --- /dev/null +++ b/addons/common/FixAnimations.hpp @@ -0,0 +1,35 @@ + +class CfgMovesBasic; +class CfgMovesMaleSdr: CfgMovesBasic { + class AgonyBase; + class AgonyBaseRfl; + class StandBase; + + class States { + class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase { + canReload = 0; + }; + class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl { + canReload = 0; + }; + + class AmovPpneMstpSnonWnonDnon_injured; + class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured { + canReload = 0; + }; + class AmovPpneMstpSrasWrflDnon_injured; + class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured { + canReload = 0; + }; + + class LadderCivilStatic: StandBase { + ACE_isLadder = 1; + }; + }; +}; diff --git a/addons/common/FixPickup.hpp b/addons/common/FixPickup.hpp new file mode 100644 index 0000000000..79ddf77026 --- /dev/null +++ b/addons/common/FixPickup.hpp @@ -0,0 +1,13 @@ + +class CfgActions { + class None; + class TakeWeapon: None { + show = 0; + }; + class TakeItem: None { + show = 0; + }; + class TakeMagazine: None { + show = 0; + }; +}; diff --git a/addons/common/HintConfig.hpp b/addons/common/HintConfig.hpp new file mode 100644 index 0000000000..3e3493a8ba --- /dev/null +++ b/addons/common/HintConfig.hpp @@ -0,0 +1,76 @@ +// by commy2 + +class RscStructuredText; +class RscMapControl; + +class RscTitles { + class ACE_RscHint { + idd = -1; + onLoad = "uiNamespace setVariable ['ACE_ctrlHint', (_this select 0) displayCtrl 1];"; + movingEnable = false; + duration = 4; + fadeIn = 0.2; + fadeOut = 0.2; + name = "ACE_RscHint"; + + class controls { + class HintBox: RscStructuredText { + idc = 1; + text = ""; + size = "1 / 40 / (getResolution select 5)"; + sizeEx = 1; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0.5}; + x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW; + y = safeZoneY + 0.2 * safezoneH; + w = 0.2 * safeZoneW; + h = 0.1 * SafeZoneH; + }; + }; + }; + class ACE_RscErrorHint { + idd = -1; + onLoad = "uiNamespace setVariable ['ACE_ctrlErrorHint', (_this select 0) displayCtrl 1];"; + movingEnable = false; + duration = 999999; + fadeIn = 0.2; + fadeOut = 0.2; + name = "ACE_RscErrorHint"; + + class controls { + class HintBox: RscStructuredText { + idc = 1; + text = ""; + size = "1 / 40 / (getResolution select 5)"; + sizeEx = 1; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0.8, 0, 0, 0.5}; + x = 0.3 * safeZoneW + safeZoneX; + y = 0.4 * safezoneH + safeZoneY; + w = 0.4 * safeZoneW; + h = 0.2 * SafeZoneH; + }; + }; + }; + class ACE_EventHandlerHelper: ACE_Rsc_Display_Base { + idd = -1; + class controls { + class CameraView: RscMapControl { + onDraw = "if (cameraView != uiNamespace getVariable 'ACE_EventHandler_CameraMode') then {uiNamespace setVariable ['ACE_EventHandler_CameraMode', cameraView]; {[uiNamespace getVariable 'ACE_EventHandler_CameraMode'] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_CameraMode') select 2);};"; + idc = -1; + w = 0; + h = 0; + }; + }; + }; + class ACE_EventHandlerHelper2: ACE_Rsc_Display_Base { + class controls { + class MapMarkerCreated: RscMapControl { + onDraw = "if (count allMapMarkers != uiNamespace getVariable 'ACE_EventHandler_MapMarker') then {if (count allMapMarkers > uiNamespace getVariable 'ACE_EventHandler_MapMarker') then {{[allMapMarkers select count allMapMarkers - 1] call _x; nil} count ((missionNamespace getVariable 'ACE_EventHandler_MapMarker') select 2);}; uiNamespace setVariable ['ACE_EventHandler_MapMarker', count allMapMarkers];};"; + idc = -1; + w = 0; + h = 0; + }; + }; + }; +}; diff --git a/addons/common/MainMenu.hpp b/addons/common/MainMenu.hpp new file mode 100644 index 0000000000..d10ff5deda --- /dev/null +++ b/addons/common/MainMenu.hpp @@ -0,0 +1,103 @@ + +class ACE_Tile_Base { + class Attributes { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; + class AttributesImage { + font = "PuristaMedium"; + color = "#E5E5E5"; + align = "left"; + }; + class HitZone { + left = 0.0; + top = 0.0; + right = 0.0; + bottom = 0.0; + }; + class ShortcutPos { + left = 0; + top = 0; + w = 0; + h = 0; + }; + class TextPos { + left = 0.01; + top = 0; + right = 0; + bottom = 0; + }; + action = "(findDisplay 49) closeDisplay 0; 0 spawn ACE_Common_openMenu;"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + color2[] = {0,0,0,1}; + color[] = {1,1,1,1}; + //colorBackground2[] = {0.75,0.75,0.75,1}; + //colorBackground[] = {0,0,0,0.8}; + colorBackground[] = {1, 0.647, 0, 0.5}; + colorBackground2[] = {1, 0.647, 0, 0.5}; + colorBackgroundFocused[] = {1, 1, 1, 0}; + colorDisabled[] = {1,1,1,0.25}; + colorFocused[] = {0,0,0,1}; + colorText[] = {1,1,1,1}; + default = 0; + font = "PuristaMedium"; + idc = -1; + period = 1.2; + periodFocus = 1.2; + periodOver = 1.2; + shadow = 0; + shortcuts[] = {}; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; + style = "0x02 + 0xC0"; + text = "$STR_ACE_Common_Options"; + textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; + tooltip = ""; + tooltipColorBox[] = {1,1,1,1}; + tooltipColorShade[] = {0,0,0,0.65}; + tooltipColorText[] = {1,1,1,1}; + type = 16; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "(0.1 * safezoneH + safezoneY) + 1.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; +}; + +class RscStandardDisplay; + +/*class RscDisplayMain: RscStandardDisplay { + class controls { + class ACE_Tile : ACE_Tile_Base {}; + }; +};*/ +class RscDisplayMPInterrupt: RscStandardDisplay { + class controls { + class ACE_Tile : ACE_Tile_Base {}; + }; +}; +class RscDisplayInterrupt: RscStandardDisplay { + class controls { + class ACE_Tile : ACE_Tile_Base {}; + }; +}; +class RscDisplayInterruptEditor3D: RscStandardDisplay { + class controls { + class ACE_Tile : ACE_Tile_Base {}; + }; +}; +class RscDisplayInterruptEditorPreview: RscStandardDisplay { + class controls { + class ACE_Tile : ACE_Tile_Base {}; + }; +}; diff --git a/addons/common/MenuConfig.hpp b/addons/common/MenuConfig.hpp new file mode 100644 index 0000000000..4d84bfb78b --- /dev/null +++ b/addons/common/MenuConfig.hpp @@ -0,0 +1,927 @@ + +#define HSPACE 0.3 +#define VSPACE 0.3 +#define BORDER 0.1 + +class ACE_Common_Interactive_Button_Base { + tooltip = ""; + action = ""; + + idc = -1; + access = 0; + style = 0; + type = 1; + text = ""; + font = "PuristaMedium"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + shadow = 2; + + x = 0; + y = 0; + w = 0; + h = 0; + + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + borderSize = 0; + + colorText[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,1}; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundDisabled[] = {0,0,0,0.8}; + colorBackgroundActive[] = {1,1,1,0.8}; + colorFocused[] = {0,0,0,0}; + colorShadow[] = {0,0,0,0}; + colorBorder[] = {1,1,1,0.8}; + + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; +}; + +#define HSPACE2 0.05 +#define VSPACE2 0.05 +#define BORDER 0.1 + +class ACE_Common_Text_Button_Base { + idc = 2; + moving = 0; + text = ""; + font = "PuristaMedium"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + lineSpacing = 0; + access = 0; + type = 0; + style = 2 + 0x800; + size = 1; + colorBackground[] = {0,0,0,0.8}; + colorText[] = {1,1,1,1}; + x = 0; + y = 0; + w = 0; + h = 0; +}; + +class ACE_Common_OptionsMenu_Dialog { + idd = -1; + movingEnable = true; + onLoad = "_dlgMenuDialog = _this select 0; for '_a' from 20 to 32 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 100 to 119 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 200 to 219 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 300 to 319 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 400 to 419 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 500 to 519 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['ACE_Common_MenuDialog', _dlgMenuDialog];"; + objects[] = {}; + + class controlsBackground { + class Background { + idc = 1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0 + 0x800; + size = 1; + //colorBackground[] = {0, 0.265, 0, 0.5}; + colorBackground[] = {0, 0, 0, 0.5}; + colorText[] = {0, 0, 0, 0}; + x = HSPACE2 / 2 * safezoneW + safezoneX; + y = VSPACE2 / 2 * safezoneH + safezoneY; + w = (1 - 2 * HSPACE2 / 2) * safezoneW; + h = (1 - 2 * VSPACE2 / 2) * safezoneH; + }; + + class Header { + idc = 2; + moving = 0; + text = "$STR_ACE_Common_Options"; + font = "PuristaMedium"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + lineSpacing = 0; + access = 0; + type = 0; + style = 1 + 0x800; + size = 1; + //colorBackground[] = {0,0,0,0}; + colorBackground[] = {1, 0.647, 0, 0.5}; + colorText[] = {1,1,1,1}; + x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; + w = 4.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class ACE_Logo : ACE_Common_Interactive_Button_Base { + action = "closeDialog 0;"; + type = 0; + style = 48; + onMouseEnter = "hint ('_' + str(_this))"; + tooltip = ""; + text = "";//"\ACE_common\rsc\bwlogo.paa"; + idc = 2; + x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 0.5 * 0.1)) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 1.0 / 16 * safezoneW; + h = 1.0 / 9 * safezoneH; + }; + }; + + class controls { + class Text_Button0 : ACE_Common_Text_Button_Base { + idc = 100; + style = 0 + 0x800; + x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 4.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Text_Button1 : Text_Button0 { + idc = 101; + y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button2 : Text_Button0 { + idc = 102; + y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button3 : Text_Button0 { + idc = 103; + y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button4 : Text_Button0 { + idc = 104; + y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button5 : Text_Button0 { + idc = 105; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button6 : Text_Button0 { + idc = 106; + y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button7 : Text_Button0 { + idc = 107; + y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button8 : Text_Button0 { + idc = 108; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button9 : Text_Button0 { + idc = 109; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button10 : Text_Button0 { + idc = 110; + y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button11 : Text_Button0 { + idc = 111; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button12 : Text_Button0 { + idc = 112; + y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button13 : Text_Button0 { + idc = 113; + y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button14 : Text_Button0 { + idc = 114; + y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button15 : Text_Button0 { + idc = 115; + y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button16 : Text_Button0 { + idc = 116; + y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button17 : Text_Button0 { + idc = 117; + y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button18 : Text_Button0 { + idc = 118; + y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Button19 : Text_Button0 { + idc = 119; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + }; + + ////////////////////////////////////////////////// + + class Interactive_Button0 : ACE_Common_Interactive_Button_Base { + action = "ACE_Common_keySet = -1; [0] spawn ACE_Common_editKey"; + sizeEx = "0.8 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + idc = 200; + style = 2 + 0x800; + x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 3.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_Button1 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [1] spawn ACE_Common_editKey"; + idc = 201; + y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button2 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [2] spawn ACE_Common_editKey"; + idc = 202; + y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button3 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [3] spawn ACE_Common_editKey"; + idc = 203; + y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button4 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [4] spawn ACE_Common_editKey"; + idc = 204; + y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button5 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [5] spawn ACE_Common_editKey"; + idc = 205; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button6 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [6] spawn ACE_Common_editKey"; + idc = 206; + y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button7 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [7] spawn ACE_Common_editKey"; + idc = 207; + y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button8 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [8] spawn ACE_Common_editKey"; + idc = 208; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button9 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [9] spawn ACE_Common_editKey"; + idc = 209; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button10 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [10] spawn ACE_Common_editKey"; + idc = 210; + y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button11 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [11] spawn ACE_Common_editKey"; + idc = 211; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button12 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [12] spawn ACE_Common_editKey"; + idc = 212; + y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button13 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [13] spawn ACE_Common_editKey"; + idc = 213; + y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button14 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [14] spawn ACE_Common_editKey"; + idc = 214; + y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button15 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [15] spawn ACE_Common_editKey"; + idc = 215; + y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button16 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [16] spawn ACE_Common_editKey"; + idc = 216; + y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button17 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [17] spawn ACE_Common_editKey"; + idc = 217; + y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button18 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [18] spawn ACE_Common_editKey"; + idc = 218; + y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Button19 : Interactive_Button0 { + action = "ACE_Common_keySet = -1; [19] spawn ACE_Common_editKey"; + idc = 219; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + }; + + ////////////////////////////////////////////////// + + class Interactive_Checkbox0 : Text_Button0 { + action = "hint '0'"; + idc = 300; + //type = 0; + style = 48; + text = QUOTE(PATHTOF(UI\box_unchecked_ca.paa)); + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 0.3 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_Checkbox1 : Interactive_Checkbox0 { + action = ""; + idc = 301; + y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox2 : Interactive_Checkbox0 { + action = ""; + idc = 302; + y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox3 : Interactive_Checkbox0 { + action = ""; + idc = 303; + y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox4 : Interactive_Checkbox0 { + action = ""; + idc = 304; + y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox5 : Interactive_Checkbox0 { + action = ""; + idc = 305; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox6 : Interactive_Checkbox0 { + action = ""; + idc = 306; + y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox7 : Interactive_Checkbox0 { + action = ""; + idc = 307; + y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox8 : Interactive_Checkbox0 { + action = ""; + idc = 308; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox9 : Interactive_Checkbox0 { + action = ""; + idc = 309; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox10 : Interactive_Checkbox0 { + action = ""; + idc = 310; + y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox11 : Interactive_Checkbox0 { + action = ""; + idc = 311; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox12 : Interactive_Checkbox0 { + action = ""; + idc = 312; + y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox13 : Interactive_Checkbox0 { + action = ""; + idc = 313; + y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox14 : Interactive_Checkbox0 { + action = ""; + idc = 314; + y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox15 : Interactive_Checkbox0 { + action = ""; + idc = 315; + y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox16 : Interactive_Checkbox0 { + action = ""; + idc = 316; + y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox17 : Interactive_Checkbox0 { + action = ""; + idc = 317; + y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox18 : Interactive_Checkbox0 { + action = ""; + idc = 318; + y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_Checkbox19 : Interactive_Checkbox0 { + action = ""; + idc = 319; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + }; + + ////////////////////////////////////////////////// + + class Text_Checkbox0 : Text_Button0 { + idc = 400; + x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 4.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Text_Checkbox1 : Text_Checkbox0 { + idc = 401; + y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox2 : Text_Checkbox0 { + idc = 402; + y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox3 : Text_Checkbox0 { + idc = 403; + y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox4 : Text_Checkbox0 { + idc = 404; + y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox5 : Text_Checkbox0 { + idc = 405; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox6 : Text_Checkbox0 { + idc = 406; + y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox7 : Text_Checkbox0 { + idc = 407; + y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox8 : Text_Checkbox0 { + idc = 408; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox9 : Text_Checkbox0 { + idc = 409; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox10 : Text_Checkbox0 { + idc = 410; + y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox11 : Text_Checkbox0 { + idc = 411; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox12 : Text_Checkbox0 { + idc = 412; + y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox13 : Text_Checkbox0 { + idc = 413; + y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox14 : Text_Checkbox0 { + idc = 414; + y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox15 : Text_Checkbox0 { + idc = 415; + y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox16 : Text_Checkbox0 { + idc = 416; + y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox17 : Text_Checkbox0 { + idc = 417; + y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox18 : Text_Checkbox0 { + idc = 418; + y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; + }; + + class Text_Checkbox19 : Text_Checkbox0 { + idc = 419; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + }; + + ////////////////////////////////////////////////// + + class Interactive_CheckboxButton0 : ACE_Common_Interactive_Button_Base { + action = "[0] call ACE_Common_toggleState"; + idc = 500; + colorBackground[] = {0, 0, 0, 0}; + colorBackgroundActive[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; + w = 0.3 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_CheckboxButton1 : Interactive_CheckboxButton0 { + action = "[1] call ACE_Common_toggleState"; + idc = 501; + y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton2 : Interactive_CheckboxButton0 { + action = "[2] call ACE_Common_toggleState"; + idc = 502; + y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton3 : Interactive_CheckboxButton0 { + action = "[3] call ACE_Common_toggleState"; + idc = 503; + y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton4 : Interactive_CheckboxButton0 { + action = "[4] call ACE_Common_toggleState"; + idc = 504; + y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton5 : Interactive_CheckboxButton0 { + action = "[5] call ACE_Common_toggleState"; + idc = 505; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton6 : Interactive_CheckboxButton0 { + action = "[6] call ACE_Common_toggleState"; + idc = 506; + y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton7 : Interactive_CheckboxButton0 { + action = "[7] call ACE_Common_toggleState"; + idc = 507; + y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton8 : Interactive_CheckboxButton0 { + action = "[8] call ACE_Common_toggleState"; + idc = 508; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton9 : Interactive_CheckboxButton0 { + action = "[9] call ACE_Common_toggleState"; + idc = 509; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton10 : Interactive_CheckboxButton0 { + action = "[10] call ACE_Common_toggleState"; + idc = 510; + y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton11 : Interactive_CheckboxButton0 { + action = "[11] call ACE_Common_toggleState"; + idc = 511; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton12 : Interactive_CheckboxButton0 { + action = "[12] call ACE_Common_toggleState"; + idc = 512; + y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton13 : Interactive_CheckboxButton0 { + action = "[13] call ACE_Common_toggleState"; + idc = 513; + y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton14 : Interactive_CheckboxButton0 { + action = "[14] call ACE_Common_toggleState"; + idc = 514; + y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton15 : Interactive_CheckboxButton0 { + action = "[15] call ACE_Common_toggleState"; + idc = 515; + y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton16 : Interactive_CheckboxButton0 { + action = "[16] call ACE_Common_toggleState"; + idc = 516; + y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton17 : Interactive_CheckboxButton0 { + action = "[17] call ACE_Common_toggleState"; + idc = 517; + y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton18 : Interactive_CheckboxButton0 { + action = "[18] call ACE_Common_toggleState"; + idc = 518; + y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; + }; + + class Interactive_CheckboxButton19 : Interactive_CheckboxButton0 { + action = "[19] call ACE_Common_toggleState"; + idc = 519; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + }; + + ////////////////////////////////////////////////// + + class TextBox_KeyChange : Text_Button0 { + text = ""; + idc = 20; + style = 2 + 0x800; + x = (6 * 0.1) * safezoneW + safezoneX; + y = (8 * 0.04) * safezoneH + safezoneY; + w = (6.0 / 16 - HSPACE2 / 2) * safezoneW; + h = (3.0 / 9 - VSPACE2 / 2) * safezoneH; + }; + + /*class TextBox_Key_Shift : TextBox_KeyChange { + text = "$STR_ACE_Common_Shift"; + idc = 21; + colorText[] = {0.25,0.25,0.25,1}; + colorBackground[] = {0,0,0,0}; + x = (3 / 4 * HSPACE2 + 5.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class TextBox_Key_Control : TextBox_Key_Shift { + text = "$STR_ACE_Common_Ctrl"; + idc = 22; + x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_Alt : TextBox_Key_Shift { + text = "$STR_ACE_Common_Alt"; + idc = 23; + x = (3 / 4 * HSPACE2 + 7.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + };*/ + + class TextBox_Key_Shift : Interactive_Button0 { + action = "ACE_Common_keyNewTemp = [42, [false, false, false], 42];"; + text = "$STR_ACE_Common_Shift"; + sizeEx = "0.7 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + idc = 21; + colorText[] = {1,1,1,1}; + colorBackground[] = {0,0,0,0}; + x = (3 / 4 * HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + w = 1.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class TextBox_Key_Control : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [29, [false, false, false], 29];"; + text = "$STR_ACE_Common_Ctrl"; + idc = 22; + x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_Alt : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [56, [false, false, false], 56];"; + text = "$STR_ACE_Common_Alt"; + idc = 23; + x = (3 / 4 * HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_Shift_Right : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [54, [false, false, false], 54];"; + text = "$STR_ACE_Common_Shift_Right"; + idc = 27; + x = (3 / 4 * HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_Control_Right : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [157, [false, false, false], 157];"; + text = "$STR_ACE_Common_Ctrl_Right"; + idc = 28; + x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_Alt_Right : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [184, [false, false, false], 184];"; + text = "$STR_ACE_Common_Alt_Right"; + idc = 29; + x = (3 / 4 * HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Action : TextBox_KeyChange { + text = ""; + idc = 30; + colorText[] = {1,1,1,1}; + colorBackground[] = {0,0,0,0}; + sizeEx = "0.8 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class TextBox_Key_Default : TextBox_Key_Shift { + action = "call ACE_Common_keysetDefault"; + text = "$STR_ACE_Common_KeyDefault"; + idc = 31; + x = (3 / 4 * HSPACE2 + 8.25 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key_None : TextBox_Key_Shift { + action = "ACE_Common_keyNewTemp = [0, [false, false, false], 0];"; + text = "$STR_ACE_Common_KeyNone"; + idc = 32; + x = (3 / 4 * HSPACE2 + 8.25 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; + }; + + class TextBox_Key : TextBox_KeyChange { + text = ""; + idc = 24; + colorText[] = {1,1,1,1}; + colorBackground[] = {0,0,0,0}; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + x = (3 / 4 * HSPACE2 + 6.75 * 0.1 - 2.0 / 16) * safezoneW + safezoneX; + y = (VSPACE2 + 8.5 * 0.04) * safezoneH + safezoneY; + w = 6.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonV : Interactive_Button0 { + action = "ACE_Common_keySet = 1"; + text = "$STR_ACE_Common_Save"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + idc = 25; + colorBackground[] = {0,0,0,0}; + x = (HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonW : Interactive_ButtonV { + action = "ACE_Common_keySet = -1"; + text = "$STR_ACE_Common_Cancel"; + idc = 26; + x = (HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonX : Interactive_Button0 { + action = "ACE_Common_keySave = 1; closeDialog 0"; + text = "$STR_ACE_Common_Save"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + idc = 10; + x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 2.5 * 0.1)) * safezoneW + safezoneX; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonY : Interactive_Button0 { + action = "ACE_Common_keySave = -1; closeDialog 0"; + text = "$STR_ACE_Common_Cancel"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + idc = 11; + x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 1 * 0.1)) * safezoneW + safezoneX; + y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonA : ACE_Common_Interactive_Button_Base { + action = "false call ACE_Common_nextKeys"; + text = "$STR_ACE_Common_Prev"; + idc = 12; + style = 2 + 0x800; + x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; + y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; + w = 1.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + + class Interactive_ButtonB : Interactive_ButtonA { + action = "true call ACE_Common_nextKeys"; + text = "$STR_ACE_Common_Next"; + idc = 13; + x = (HSPACE2 + 3 * 0.1 + 2.0 / 16) * safezoneW + safezoneX; + }; + + class Interactive_ButtonC : ACE_Common_Text_Button_Base { + text = ""; + idc = 14; + style = 2 + 0x800; + x = (HSPACE2 + 3 * 0.1 + 1.25 / 16) * safezoneW + safezoneX; + y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; + w = 0.5 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; + }; + }; +}; diff --git a/addons/common/NoVoice.hpp b/addons/common/NoVoice.hpp new file mode 100644 index 0000000000..a34e30c08e --- /dev/null +++ b/addons/common/NoVoice.hpp @@ -0,0 +1,228 @@ + +class RadioProtocolBase { + class Words; +}; + +class ACE_RadioProtocolNoRadio: RadioProtocolBase { + class CuratorWaypointPlaced; + class CuratorWaypointPlacedAttack; + class CuratorObjectPlaced; + class curatorObjectDestroyed; + class curatorModuleCAS; + class SentFireNoTarget_1; + class SentSupportRequestRGCASBombing; + class SentNoTargetDefault; + class SentEngageNoTargetDefault; + class SentFireNoTargetDefault; + class SentAttackNoTargetDefault; + class SentEnemyDetectedMedium; + class SentEnemyDetectedLong; + class SentEnemyDetectedDangerClose; + class SentEnemyDetectedClose; + class SentEnemyDetectedVeryLong; + class SentIsLeaderDefault; + class SentCommandCompletedDefault; + class SentFireReadyDefault; + class SentCommandFailedDefault; + class SentDestinationUnreacheableDefault; + class SentObjectDestroyedDefault; + class SentObjectDestroyedUnknownDefault; + class SentClearDefault; + class SentRepeatCommandDefault; + class SentWhereAreYouDefault; + class SentReportStatusDefault; + class SentNotifyAttackDefault; + class SentNotifyAttackSubgroupDefault; + class SentConfirmMoveDefault; + class SentConfirmAttackDefault; + class SentConfirmOtherDefault; + class SentUnitKilledDefault; + class SentHealthCriticalDefault; + class SentHealthNormalDefault; + class SentReturnToFormationDefault; + class SentLooseFormationDefault; + class SentCmdFollowMeDefault; + class SelectCmdMoveSentenceClose; + class SelectCmdMoveSentenceVeryClose; + class SelectCmdMoveSentenceFar; + class SentEnemyDetectedMediumStealth; + class SentSupportConfirmDefault; + class SelectCmdMoveSentenceClose_1; + class SelectCmdMoveSentenceVeryClose_1; + class SelectCmdMoveSentenceFar_1; + class SentSupportRequestRGCASHelicopter; + class SentSupportRequestRGSupplyDrop; + class SentSupportRequestRGUAV; + class SentSupportRequestRGArty; + class SentSupportRequestRGTransport; + class SentRequestAcknowledgedSGCASBombing; + class SentRequestAcknowledgedSGCASHelicopter; + class SentRequestAcknowledgedSGSupplyDrop; + class SentRequestAcknowledgedSGUAV; + class SentRequestAcknowledgedSGArty; + class SentRequestAcknowledgedTransport; + class SentUnitDestroyedHQCASBombing; + class SentUnitDestroyedHQCASHelicopter; + class SentUnitDestroyedHQSupplyDrop; + class SentUnitDestroyedHQUAV; + class SentUnitDestroyedHQArty; + class SentUnitDestroyedHQTransport; + class SentRequestAccomplishedSGCASBombing; + class SentRequestAccomplishedSGCASHelicopter; + class SentRequestAccomplishedSGSupplyDrop; + class SentRequestAccomplishedSGUAV; + class SentRequestAccomplishedSGArty; + class SentRequestAccomplishedSGTransport; + class SentSupportAddedDuringMission; + class SentArtySGSupportRoundsComplete; + class SentTransportSGWelcomeAboard; + class SentTransportSGLZCoordinatesSelected; + class SelectCmdMoveSentenceLocation; + class SelectCmdMoveSentenceMedium; + class SentEnemyDetectedLongStealth; + class SentEnemyDetectedDangerCloseStealth; + class SentEnemyDetectedCloseStealth; + class SentEnemyDetectedVeryLongStealth; + class SentEngageDefault; + class SelectCmdMoveSentenceLocation_1; + class SelectCmdMoveSentenceMedium_1; + class SentBehaviourSafeDefault; + class SentBehaviourAwareDefault; + class SentBehaviourCombatDefault; + class SentOpenFireDefault; + class SentCeaseFireInsideGroupDefault; + class SentCeaseFireDefault; + class SentEngageStealth; + class SentFireNoTargetStealth; + class SentAttackNoTargetStealth; + class SentNoTargetStealth; + class SentEngageNoTargetStealth; + class SelectCmdMoveSentenceCloseStealth; + class SelectCmdMoveSentenceVeryCloseStealth; + class SelectCmdMoveSentenceFarStealth; + class SelectCmdMoveSentenceLocationStealth; + class SelectCmdMoveSentenceMediumStealth; + class SentReturnToFormationStealth; + class SentLooseFormationStealth; + class SentCmdFollowMeStealth; + class SentOpenFireStealth; + class SentCeaseFireInsideGroupStealth; + class SentBehaviourSafeStealth; + class SentBehaviourAwareStealth; + class SentBehaviourCombatStealth; + class SentSupportConfirmStealth; + class SentCommandFailedStealth; + class SentObjectDestroyedStealth; + class SentObjectDestroyedUnknownStealth; + class SentCommandCompletedStealth; + class SentFireReadyStealth; + class SentIsLeaderStealth; + class SentDestinationUnreacheableStealth; + class SentClearStealth; + class SentRepeatCommandStealth; + class SentWhereAreYouStealth; + class SentReportStatusStealth; + class SentNotifyAttackStealth; + class SentNotifyAttackSubgroupStealth; + class SentConfirmMoveStealth; + class SentConfirmAttackStealth; + class SentConfirmOtherStealth; + class SentUnitKilledStealth; + class SentHealthCriticalStealth; + class SentHealthNormalStealth; + class SentGenReinforcementsConfirmed; + class SentGenReinforcementsRejected; + class SentGenReinforcementsArrived; + class SentGenLeavingAO; + class SentGenTime; + class SentGenLosing; + class SentGenLost; + class SentGenComplete; + class SentGenCmdSeize; + class SentGenCmdDefend; + class SentGenCmdRTB; + class SentGenCmdTargetNeutralize; + class SentGenCmdTargetProtect; + class SentGenCmdTargetEscort; + class SentGenCmdTargetFind; + class SentGenIncoming; + class SentGenBaseUnlockRespawn; + class SentGenBaseUnlockVehicle; + class SentGenBaseSideFriendlyWEST; + class SentFXBreathingSlow; + class SentFXBreathingFast; + class SentFXHit; + class SentFXDeath; + class SentFXHurt; + class SentFXEffort; + class SentFXDrowning; + class SentCeaseFireDefault_1; + class SentGenBaseSideFriendlyEAST; + class SentGenBaseSideFriendlyGUER; + class SentGenBaseSideEnemyWEST; + class SentGenBaseSideEnemyEAST; + class SentGenBaseSideEnemyGUER; + class SentTargetDefault; + class SentTargetStealth; + class Dummy; + class Words: Words { + grid_zero[] = {}; + grid_one[] = {}; + grid_two[] = {}; + grid_three[] = {}; + grid_four[] = {}; + grid_five[] = {}; + grid_six[] = {}; + grid_seven[] = {}; + grid_eight[] = {}; + grid_nine[] = {}; + grid_zero_2[] = {}; + grid_one_2[] = {}; + grid_two_2[] = {}; + grid_three_2[] = {}; + grid_four_2[] = {}; + grid_five_2[] = {}; + grid_six_2[] = {}; + grid_seven_2[] = {}; + grid_eight_2[] = {}; + grid_nine_2[] = {}; + grid_zero_3[] = {}; + grid_one_3[] = {}; + grid_two_3[] = {}; + grid_three_3[] = {}; + grid_four_3[] = {}; + grid_five_3[] = {}; + grid_six_3[] = {}; + grid_seven_3[] = {}; + grid_eight_3[] = {}; + grid_nine_3[] = {}; + Ready[] = {}; + Waiting[] = {}; + StandingBy[] = {}; + /*IAmReady[] = {}; + ReadyForOrders[] = {}; + AwaitingOrders[] = {};*/ + }; +}; + +class CfgVoice { + class ACE_NoVoice { + author = "$STR_ACE_Common_ACETeam"; + protocol = "ACE_RadioProtocolNoRadio"; + variants[] = {1}; + directories[] = {"",""}; + identityTypes[] = {"Default"}; + scope = 2; + voiceType = ""; + icon = "\a3\Ui_f\data\Map\Markers\Flags\nato_ca.paa"; + displayName = "$STR_ACE_Common_NoVoice"; + }; +}; +class CfgVoiceTypes { + class ACE_NoVoice { + name = "$STR_ACE_Common_NoVoice"; + voices[] = {"ACE_NoVoice","ACE_NoVoice","ACE_NoVoice"}; + preview = "ACE_NoVoice"; + alternative = ""; + }; +}; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp new file mode 100644 index 0000000000..873aeac73c --- /dev/null +++ b/addons/common/ProgressScreen.hpp @@ -0,0 +1,94 @@ + +class ACE_Common_ProgressBar_Dialog { + idd = -1; + movingEnable = false; + onLoad = "uiNamespace setVariable ['ACE_Common_ctrlProgressBar', (_this select 0) displayCtrl 1]; uiNamespace setVariable ['ACE_Common_ctrlProgressBarTitle', (_this select 0) displayCtrl 2];"; + objects[] = {}; + + class controlsBackground { + class Background { + idc = -1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0.1}; + colorText[] = {0, 0, 0, 0}; + x = "safezoneX"; + y = "safezoneY"; + w = "safezoneW"; + h = "safezoneH"; + }; + + class Progress_Bar { + idc = 1; + moving = 0; + text = ""; + font = "PuristaMedium"; + sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; + lineSpacing = 0; + access = 0; + type = 0; + style = 2; + size = 1; + colorBackground[] = {1, 0.647, 0, 0.5}; + colorText[] = {1,1,1,1}; + x = "safezoneX + 0.1 * safezoneW"; + y = "safezoneY + 0.2 * safezoneH"; + w = "0.0 * safezoneW"; + h = "0.01 * safezoneH"; + }; + + class Title_Bar : Progress_Bar { + idc = 2; + //type = 13; + //size = 1; + colorBackground[] = {0, 0, 0, 0}; + x = "safezoneX + 0.1 * safezoneW"; + y = "safezoneY + 0.1 * safezoneH"; + w = "0.8 * safezoneW"; + h = "0.05 * safezoneH"; + /*class Attributes { + font = "TahomaB"; + color = "#000000"; + align = "center"; + valign = "middle"; + shadow = false; + shadowColor = "#ff0000"; + size = "1"; + };*/ + }; + }; +}; + +class ACE_Common_DisableMouse_Dialog { + idd = -1; + movingEnable = false; + onLoad = "uiNamespace setVariable ['ACE_Common_dlgDisableMouse', _this select 0];"; + objects[] = {}; + class controlsBackground { + class Background { + idc = -1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0};//0.5 + colorText[] = {0, 0, 0, 0}; + x = "safezoneX"; + y = "safezoneY"; + w = "safezoneW"; + h = "safezoneH"; + }; + }; +}; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp new file mode 100644 index 0000000000..1a4950b022 --- /dev/null +++ b/addons/common/RscInfoType.hpp @@ -0,0 +1,27 @@ + +class RscInGameUI { + class RscUnitInfo; + class RscUnitInfoSoldier: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgSoldier', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoSoldier', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + }; + class RscUnitInfoTank: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgVehicle', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoVehicle', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + }; + class RscUnitInfoAir: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgAircraft', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAircraft', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + }; + class RscUnitInfoShip: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgShip', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoShip', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + }; + class RscUnitInfoParachute: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgParachute', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoParachute', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + }; +}; + +class RscDisplayInventory { + onLoad = "[""onLoad"",_this,""RscDisplayInventory"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; {_this call _x} forEach ((missionNamespace getVariable ['ACE_onLoadInventory', [-1, [], []]]) select 2);"; +}; + +class RscDisplayChannel { + onLoad = QUOTE(_this call GVAR(onLoadRscDisplayChannel)); +}; diff --git a/addons/core/UI/IconCheckPBO_ca.paa b/addons/common/UI/IconCheckPBO_ca.paa similarity index 100% rename from addons/core/UI/IconCheckPBO_ca.paa rename to addons/common/UI/IconCheckPBO_ca.paa diff --git a/addons/core/UI/blank_CO.paa b/addons/common/UI/blank_CO.paa similarity index 100% rename from addons/core/UI/blank_CO.paa rename to addons/common/UI/blank_CO.paa diff --git a/addons/core/UI/box_checked_ca.paa b/addons/common/UI/box_checked_ca.paa similarity index 100% rename from addons/core/UI/box_checked_ca.paa rename to addons/common/UI/box_checked_ca.paa diff --git a/addons/core/UI/box_unchecked_ca.paa b/addons/common/UI/box_unchecked_ca.paa similarity index 100% rename from addons/core/UI/box_unchecked_ca.paa rename to addons/common/UI/box_unchecked_ca.paa diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf new file mode 100644 index 0000000000..1476f775c0 --- /dev/null +++ b/addons/common/XEH_postInit.sqf @@ -0,0 +1,69 @@ +// ACE - Common +#include "script_component.hpp" + +QGVAR(remoteFnc) addPublicVariableEventHandler { + (_this select 1) call FUNC(execRemoteFnc); +}; + +[missionNamespace] call FUNC(executePersistent); + +// check previous version number from profile +_currentVersion = getText (configFile >> "CfgPatches" >> "ACE_Common" >> "version"); +_previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; + +if (_currentVersion != _previousVersion) then { + // do something + + profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion]; +}; + +0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); + +// everything that only player controlled machines need, goes below this +if (!hasInterface) exitWith {}; + +call COMPILE_FILE(scripts\assignedItemFix); + +GVAR(keyInput) = COMPILE_FILE(scripts\keyInput); +GVAR(keyRelease) = COMPILE_FILE(scripts\keyRelease); +GVAR(editKey) = COMPILE_FILE(scripts\editKey); +GVAR(openMenu) = COMPILE_FILE(scripts\openMenu); +GVAR(closeMenu) = COMPILE_FILE(scripts\closeMenu); +GVAR(nextKeys) = COMPILE_FILE(scripts\nextKeys); +GVAR(toggleState) = COMPILE_FILE(scripts\toggleState); + +[false] call FUNC(setKeyDefault); + +GVAR(keyStates) = []; +GVAR(keyTimes) = []; +for "_index" from 0 to 300 do { + GVAR(keyStates) set [_index, 0]; + GVAR(keyTimes) set [_index, -1]; +}; + +call COMPILE_FILE(scripts\KeyInput\initCanInteractFunction); +call COMPILE_FILE(scripts\KeyInput\initKeys); +call COMPILE_FILE(scripts\KeyInput\initScrollWheel); + +0 spawn { + while {true} do { + waitUntil {!isNull (findDisplay 46)}; sleep 0.1; + findDisplay 46 displayAddEventHandler ["KeyDown", QUOTE( _this call GVAR(onKeyDown) )]; + findDisplay 46 displayAddEventHandler ["KeyUp", QUOTE( _this call GVAR(onKeyUp) )]; + findDisplay 46 displayAddEventHandler ["MouseZChanged", QUOTE( _this call GVAR(onScrollWheel) )]; + [false] call FUNC(disableUserInput); + waitUntil {isNull (findDisplay 46)}; + }; +}; + +enableCamShake true; + +// Set the name for the current player +[missionNamespace, "playerChanged", { + if (alive (_this select 0)) then { + [_this select 0] call FUNC(setName) + }; + if (alive (_this select 1)) then { + [_this select 1] call FUNC(setName) + }; +}] call FUNC(addCustomEventhandler); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf new file mode 100644 index 0000000000..e59894c370 --- /dev/null +++ b/addons/common/XEH_preInit.sqf @@ -0,0 +1,153 @@ +// by commy2 +#include "script_component.hpp" + +// ACE Common Function +PREP(addActionEventHandler); +PREP(addActionMenuEventHandler); +PREP(addCameraEventHandler); +PREP(addCustomEventHandler); +PREP(addInfoDisplayEventHandler); +PREP(addMapMarkerCreatedEventHandler); +PREP(addInventoryDisplayLoadedEventHandler); +PREP(addScrollWheelEventHandler); +PREP(adminKick); +PREP(ambientBrightness); +PREP(applyForceWalkStatus); +PREP(binarizeNumber); +PREP(callCustomEventHandlers); +PREP(callCustomEventHandlersGlobal); +PREP(canGetInPosition); +PREP(canInteractWith); +PREP(canUseWeapon); +PREP(changeProjectileDirection); +PREP(checkPBOs); +PREP(claim); +PREP(closeDialogIfTargetMoves); +PREP(codeToLetter); +PREP(codeToString); +PREP(convertKeyCode); +PREP(currentChannel); +PREP(disableUserInput); +PREP(displayText); +PREP(displayTextPicture); +PREP(displayTextStructured); +PREP(doAnimation); +PREP(endRadioTransmission); +PREP(execPersistentFnc); +PREP(execRemoteFnc); +PREP(executePersistent); +PREP(filter); +PREP(fixLoweredRifleAnimation); +PREP(getCaptivityStatus); +PREP(getConfigCommander); +PREP(getConfigGunner); +PREP(getDefaultAnim); +PREP(getDoorTurrets); +PREP(getForceWalkStatus); +PREP(getHitPoints); +PREP(getHitPointsWithSelections); +PREP(getInPosition); +PREP(getMarkerType); +PREP(getName); +PREP(getNumberFromMissionSQM); +PREP(getPitchBankYaw); +PREP(getStringFromMissionSQM); +PREP(getTargetAzimuthAndInclination); +PREP(getTargetDistance); +PREP(getTargetObject); +PREP(getTurretCommander); +PREP(getTurretConfigPath); +PREP(getTurretCopilot); +PREP(getTurretGunner); +PREP(getTurretIndex); +PREP(getTurrets); +PREP(getTurretsFFV); +PREP(getTurretsOther); +PREP(getUavControlPosition); +PREP(getVehicleCargo); +PREP(getVehicleCodriver); +PREP(getVehicleCrew); +PREP(getWeaponAzimuthAndInclination); +PREP(getWeaponType); +PREP(getWindDirection); +PREP(goKneeling); +PREP(hadamardProduct); +PREP(interpolateFromArray); +PREP(inTransitionAnim); +PREP(isAutoWind); +PREP(isEngineer); +PREP(isEOD); +PREP(isInBuilding); +PREP(isMedic); +PREP(isPlayer); +PREP(isTurnedOut); +PREP(letterToCode); +PREP(map); +PREP(moduleCheckPBOs); +PREP(moduleLSDVehicles); +PREP(muteUnit); +PREP(numberToDigits); +PREP(numberToDigitsString); +PREP(onLoadRscDisplayChannel); +PREP(owned); +PREP(player); +PREP(playerSide); +PREP(progressBar); +PREP(queueAnimation); +PREP(readBooleanParameterFromModule); +PREP(readNumericParameterFromModule); +PREP(removeActionEventHandler); +PREP(removeActionMenuEventHandler); +PREP(removeCameraEventHandler); +PREP(removeCustomEventHandler); +PREP(removeInfoDisplayEventHandler); +PREP(removeInventoryDisplayLoadedEventHandler); +PREP(removeMapMarkerCreatedEventHandler); +PREP(removeScrollWheelEventHandler); +PREP(restoreVariablesJIP); +PREP(revertKeyCodeLocalized); +PREP(sanitizeString); +PREP(serverLog); +PREP(setCaptivityStatus); +PREP(setForceWalkStatus); +PREP(setKeyDefault); +PREP(setName); +PREP(setParameter); +PREP(setPitchBankYaw); +PREP(setVariableJIP); +PREP(stringToColoredText); +PREP(subString); +PREP(toBin); +PREP(toBitmask); +PREP(toHex); +PREP(toNumber); +PREP(unmuteUnit); + +// ACE_Debug +PREP(exportConfig); +PREP(getChildren); +PREP(getDisplayConfigName); +PREP(log); +PREP(logControls); +PREP(logDisplays); +PREP(monitor); +PREP(showUser); + +// ACE_CuratorFix +PREP(addUnloadEventhandler); +PREP(fixCrateContent); + +// Loop to update the ACE_player variable +ACE_player = player; +if (hasInterface) then { + ["ACE_CheckForPlayerChange", "onEachFrame", { + if !(ACE_player isEqualTo (missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player])) then { + _this = ACE_player; + + ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player]; + uiNamespace setVariable ["ACE_player", ACE_player]; + + [missionNamespace, "playerChanged", [ACE_player, _this]] call FUNC(callCustomEventHandlers); + }; + }] call BIS_fnc_addStackedEventHandler; +}; diff --git a/addons/common/config.cpp b/addons/common/config.cpp new file mode 100644 index 0000000000..771511ac04 --- /dev/null +++ b/addons/common/config.cpp @@ -0,0 +1,82 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Box_Misc"}; + weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_main"}; + author[] = {"KoffeinFlummi"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgSounds.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" + +class ACE_Rsc_Display_Base { + idd = -1; + type = 0; + style = 48; + name = ""; + duration = 999999; + fadeIn = 0; + fadeOut = 0; + font = "TahomaB"; + size = 1; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; +}; + +class ACE_Rsc_Control_Base { + idc = 1; + type = 0; + style = 48; + access = 0; + lineSpacing = 0; + moving = 1; + text = ""; + size = 1; + sizeEx = 0; + font = "TahomaB"; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; + x = 0; + y = 0; + w = 0; + h = 0; +}; + +class GVAR(canInteractConditions) { + class GVAR(notOnMap) { + condition = "!visibleMap"; + }; +}; + +class GVAR(Options) { + class enableNumberHotkeys { + displayName = "$STR_ACE_Common_EnableNumberHotkeys"; + default = 1; + }; +}; + +#include +#include +#include +#include + +/* +class RscControlsGroupNoScrollbars; +class RscAttributeInventory: RscControlsGroupNoScrollbars { + onSetFocus = "[_this,""RscAttributeInventory"",'CuratorCommon'] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute""); _this select 0 call ACE_CuratorFix_fnc_addUnloadEventhandler;"; +}; +*/ + +#include +#include +#include +#include diff --git a/addons/core/data/agm_default.rvmat b/addons/common/data/agm_default.rvmat similarity index 100% rename from addons/core/data/agm_default.rvmat rename to addons/common/data/agm_default.rvmat diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf new file mode 100644 index 0000000000..e540bde53f --- /dev/null +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -0,0 +1,70 @@ +/* + * Author: commy2 + * + * Add an addAction event to a unit. Used to handle multiple addAction events. Global arguments, local effects. Does only work for player controlled units. + * + * Argument: + * 0: Unit the action should be assigned to (Object) + * 1: Name of the action, e.g. "DefaultAction" (String) + * 2: Condition (Code or String) + * 3: Code to execute (Code or String) + * + * Return value: + * ID of the action (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; + +_unit = _this select 0; +_action = _this select 1; +_condition = _this select 2; +_statement = _this select 3; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_name = format ["ACE_Action_%1", _action]; + +_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; + +_actionID = _actionsVar select 0; +_actions = _actionsVar select 1; + +_id = (_actions select 0) + 1; +_actionIDs = _actions select 1; +_actions = _actions select 2; + +_actionIDs pushBack _id; +_actions pushBack [_condition, _statement]; + +// first action to add, unit needs addAction command +if (_actionID == -1) then { + private "_addAction"; + + _addAction = call compile format [ + "[ + '', + {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, + nil, + -1, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; _actions = (_this getVariable '%2') select 1 select 2; _count = count _actions; _index = 0; _return = false; while {_index < _count && {!_return}} do {_return = [_target, _this] call ((_actions select _index) select 0); _index = _index + 1}; _return"" + ]", + _action, + _name + ]; + + _actionID = _unit addAction _addAction; +}; + +_unit setVariable [_name, [_actionID, [_id, _actionIDs, _actions]], false]; + +_id diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf new file mode 100644 index 0000000000..6878f78575 --- /dev/null +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -0,0 +1,86 @@ +/* + * Author: commy2 + * + * Add an addAction event to a unit. Used to handle multiple addAction events and add a action to the mouse wheel menu. Global arguments, local effects. Does only work for player controlled units. + * + * Argument: + * 0: Unit the action should be assigned to (Object) + * 1: Menu title of the action (String) + * 2: Name of the action, e.g. "DefaultAction" (String) + * 3: Condition (Code or String) + * 4: Code to execute by the action (Code or String) + * 5: Condition for the menu action (Code or String) + * 6: Code to execute from the menu (Code or String) + * 7: Priority of the action (Number, optional default: 0) + * + * Return value: + * ID of the action (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; + +_unit = _this select 0; +_displayName = _this select 1; +_action = _this select 2; +_condition = _this select 3; +_statement = _this select 4; +_condition2 = _this select 5; +_statement2 = _this select 6; +_priority = _this select 7; + +if (isNil "_priority") then {_priority = 0}; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +if (typeName _condition2 == "STRING") then { + _condition2 = compile _condition2; +}; + +if (typeName _statement2 == "STRING") then { + _statement2 = compile _statement2; +}; + +_name = format ["ACE_ActionMenu_%1", _action]; + +_actionsVar = _unit getVariable [_name, [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_nameVar = format ["%1_ID%2", _name, _id]; +missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]]; + +_actionIDs pushBack _id; + +_addAction = call compile format [ + "[ + '%2', + {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, + nil, + %4, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" + ]", + _action, + _displayName, + _nameVar, + _priority +]; + +_actionID = _unit addAction _addAction; + +_actions pushBack [_actionID, _nameVar]; + +_unit setVariable [_name, [_id, _actionIDs, _actions], false]; + +_id diff --git a/addons/common/functions/fnc_addCameraEventHandler.sqf b/addons/common/functions/fnc_addCameraEventHandler.sqf new file mode 100644 index 0000000000..b0aaeac8e0 --- /dev/null +++ b/addons/common/functions/fnc_addCameraEventHandler.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 + * + * Add a camera view event handler. The event script is called when the camera view changes. + * The argument of the called function is stored in the _this variable and has as first element the new camera mode. Possible arguments are ["INTERNAL"], ["EXTERNAL"], ["GUNNER"] and ["GROUP"]. + * + * Argument: + * 0: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_statement = _this select 0; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +if (_id == 0) then { + uiNamespace setVariable ["ACE_EventHandler_CameraMode", cameraView]; + (QGVAR(EventHandlerHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(EventHandlerHelper), "PLAIN"]; +}; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addCustomEventHandler.sqf b/addons/common/functions/fnc_addCustomEventHandler.sqf new file mode 100644 index 0000000000..975a191942 --- /dev/null +++ b/addons/common/functions/fnc_addCustomEventHandler.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 + * + * Add a custom event to a unit. The event scripts are called by FUNC(callCustomEventHandlers). + * + * Argument: + * 0: Object the event should be assigned to or namespace (Object OR Namespace) + * 1: Name of the event (String) + * 2: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_object", "_type", "_statement", "_name", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_object = _this select 0; +_type = _this select 1; +_statement = _this select 2; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_name = format ["ACE_CustomEventHandlers_%1", _type]; + +_actionsVar = _object getVariable [_name, [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +_object setVariable [_name, [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addInfoDisplayEventHandler.sqf b/addons/common/functions/fnc_addInfoDisplayEventHandler.sqf new file mode 100644 index 0000000000..08258db97d --- /dev/null +++ b/addons/common/functions/fnc_addInfoDisplayEventHandler.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * + * Add a unit info type handler. + * + * Argument: + * 0: Type. Can be "Soldier", "Vehicle", "Aircraft", "Ship", "Parachute" or "Any". "Any" will execute for any compatible display (String) + * 1: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_type", "_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_type = format ["ACE_onLoadInfo%1", _this select 0]; +_statement = _this select 1; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_actionsVar = missionNamespace getVariable [_type, [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +missionNamespace setVariable [_type, [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addInventoryDisplayLoadedEventHandler.sqf b/addons/common/functions/fnc_addInventoryDisplayLoadedEventHandler.sqf new file mode 100644 index 0000000000..a7b83c1f1b --- /dev/null +++ b/addons/common/functions/fnc_addInventoryDisplayLoadedEventHandler.sqf @@ -0,0 +1,33 @@ +/* + * Author: commy2 + * + * Add an inventory display opened handler. + * + * Argument: + * 0: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_statement = _this select 0; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +missionNamespace setVariable ["ACE_onLoadInventory", [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf new file mode 100644 index 0000000000..10631265bc --- /dev/null +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -0,0 +1,38 @@ +/* + * Author: commy2 + * + * Add a map marker creation event handler. + * + * Argument: + * 0: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_statement = _this select 0; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +if (_id == 0) then { + uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; + ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; +}; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +missionNamespace setVariable ["ACE_EventHandler_MapMarker", [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf new file mode 100644 index 0000000000..07ff213133 --- /dev/null +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -0,0 +1,33 @@ +/* + * Author: commy2 + * + * Add an event handler that executes every time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. Argument will be [Interval] where 'Interval' is a number. + * + * Argument: + * 0: Code to execute (Code or String) + * + * Return value: + * ID of the event script (used to remove it later). + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_statement = _this select 0; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack _statement; + +missionNamespace setVariable ["ACE_EventHandler_ScrollWheel", [_id, _actionIDs, _actions]]; + +_id diff --git a/addons/common/functions/fnc_addUnloadEventhandler.sqf b/addons/common/functions/fnc_addUnloadEventhandler.sqf new file mode 100644 index 0000000000..4d279c0f7a --- /dev/null +++ b/addons/common/functions/fnc_addUnloadEventhandler.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_dlg"; + +disableSerialization; +_dlg = ctrlParent _this; + +_dlg displayAddEventHandler ["unload", { + if (_this select 1 == 1) then { + [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); + }; +}]; diff --git a/addons/common/functions/fnc_adminKick.sqf b/addons/common/functions/fnc_adminKick.sqf new file mode 100644 index 0000000000..ad8b133064 --- /dev/null +++ b/addons/common/functions/fnc_adminKick.sqf @@ -0,0 +1,8 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_name"; + +_name = name (_this select 0); + +[_name, "{if (serverCommandAvailable '#kick') then {serverCommand format['#kick %1', _this]}}"] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf new file mode 100644 index 0000000000..2ab3be4834 --- /dev/null +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -0,0 +1,14 @@ +/* + * Author: commy2, idea by Falke + * + * Returns a brightness value depending on the sun and moon state. Ranges from 0 to 1 (dark ... bright). + * + * Argument: + * None. + * + * Return value: + * Ambient brightness (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +sunOrMoon * sunOrMoon + moonIntensity/5 min 1 diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf new file mode 100644 index 0000000000..c090c236db --- /dev/null +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -0,0 +1,25 @@ +/* +Name: FUNC(applyForceWalkStatus) + +Author: Pabst Mirror + +Description: + Applys the forceWalk status of an unit. Called from Extended_InitPost_EventHandlers. + +Parameters: + 0: OBJECT - Unit + +Returns: + None + +Example: + [ACE_Player] call FUNC(applyForceWalkStatus) +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_forceWalkNumber"]; + +_unit = _this select 0; +_forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; + +_unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf new file mode 100644 index 0000000000..bba135b9b9 --- /dev/null +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -0,0 +1,38 @@ +/* + * Author: commy2 + * + * Get a binary equivalent of a decimal number. + * + * Argument: + * 0: Decimal Number (Number) + * 1: Minimum length of the returned Array, note: returned array can be larger (Number, optional default 8) + * + * Return value: + * Booleans (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_number", "_minLength", "_array", "_index", "_rest"]; + +_number = round (_this select 0); +_minLength = _this select 1; + +if (isNil "_minLength") then {_minLength = 8}; + +_array = []; +_array resize _minLength; + +for "_index" from 0 to (_minLength - 1) do { + _array set [_index, false]; +}; + +_index = 0; + +while {_number > 0} do { + _rest = _number mod 2; + _number = floor (_number / 2); + + _array set [_index, _rest == 1]; + _index = _index + 1; +}; +_array diff --git a/addons/common/functions/fnc_callCustomEventHandlers.sqf b/addons/common/functions/fnc_callCustomEventHandlers.sqf new file mode 100644 index 0000000000..9d2b7c2370 --- /dev/null +++ b/addons/common/functions/fnc_callCustomEventHandlers.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * + * Execute all custom event script assigned to this object. + * + * Argument: + * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace) + * 1: Name of the event (String) + * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to]) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_object", "_type", "_argument", "_name", "_actions"]; + +_object = _this select 0; +_type = _this select 1; +_argument = _this select 2; + +if (isNil "_argument") then {_argument = [_object]}; + +_name = format ["ACE_CustomEventHandlers_%1", _type]; + +_actions = (_object getVariable [_name, [-1, [], []]]) select 2; + +{ + _argument call _x; nil; +} count _actions; +nil diff --git a/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf b/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf new file mode 100644 index 0000000000..5333a2e065 --- /dev/null +++ b/addons/common/functions/fnc_callCustomEventHandlersGlobal.sqf @@ -0,0 +1,16 @@ +/* + * Author: commy2 + * + * Execute all custom event script assigned to this object on every machine. + * + * Argument: + * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace) + * 1: Name of the event (String) + * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to]) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +[_this, QUOTE(FUNC(callCustomEventHandlers)), 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf new file mode 100644 index 0000000000..9aaaa4518a --- /dev/null +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -0,0 +1,263 @@ +/* + * Author: commy2 + * + * Is the unit able to enter the vehicle in the given position? + * + * Arguments: + * 0: Unit to enter the vehicle (Object) + * 1: The vehicle to be entered (Object) + * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) + * 3: Check current distance to vehicles memory point? (Bool, optional default: false) + * 4: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. + * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) + * + * Return Value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} +#define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} + +private ["_unit", "_vehicle", "_position", "_checkDistance", "_index"]; + +_this resize 5; + +_unit = _this select 0; +_vehicle = _this select 1; +_position = toLower (_this select 2); +_checkDistance = _this select 3; +_index = _this select 4; // optional, please don't use + +if (isNil "_checkDistance") then {_checkDistance = false}; +if (isNil "_index") then {_index = -1}; + +// general +if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; + +private ["_config", "_turret", "_radius", "_selectionPosition", "_selectionPosition2", "_enemiesInVehicle", "_return"]; + +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; +_turret = []; + +_radius = 0; + +_enemiesInVehicle = false; //Possible Side Restriction +{ + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; +} forEach crew _vehicle; + +_return = false; +switch (_position) do { + case "driver" : { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + + if (_vehicle isKindOf "Tank") then { + _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; + }; + + _return = CANGETINDRIVER; + }; + + case "pilot" : { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + + _return = CANGETINDRIVER; + }; + + case "gunner" : { + private "_turretConfig"; + _turret = [typeOf _vehicle] call FUNC(getTurretGunner); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "commander" : { + private "_turretConfig"; + _turret = [typeOf _vehicle] call FUNC(getTurretCommander); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "copilot" : { + private "_turretConfig"; + _turret = [typeOf _vehicle] call FUNC(getTurretCopilot); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "turret" : { + private ["_turrets", "_turretConfig"]; + _turrets = [typeOf _vehicle] call FUNC(getTurretsOther); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "ffv" : { + private ["_turrets", "_turretConfig"]; + _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + default {}; +}; + +private "_fnc_isInRange"; +_fnc_isInRange = { + if (_radius == 0) exitWith {true}; + + private ["_unitPosition", "_distance"]; + _unitPosition = getPos _unit; + + _distance = _unitPosition distance (_vehicle modelToWorld _selectionPosition); + + if (!isNil "_selectionPosition2") then { + _distance = _distance min (_unitPosition distance (_vehicle modelToWorld _selectionPosition2)); + }; + + _distance < _radius +}; + +// if you want into the cargo and you can't, then check ffv turrets aswell +if (_position == "cargo") exitWith { + if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { + [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); + } +}; + +_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange} + +//_enemiesInVehicle diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf new file mode 100644 index 0000000000..741c1474b4 --- /dev/null +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -0,0 +1,11 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_target", "_owner"]; + +_unit = _this select 0; +_target = _this select 1; + +_owner = _target getVariable ["ACE_isUsedBy", objNull]; + +isNull _owner || {_unit == _owner} || {!isPlayer _owner} diff --git a/addons/common/functions/fnc_canUseWeapon.sqf b/addons/common/functions/fnc_canUseWeapon.sqf new file mode 100644 index 0000000000..4c686089df --- /dev/null +++ b/addons/common/functions/fnc_canUseWeapon.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +// returns true if the unit is on foot or in a ffv position + +private ["_unit", "_config"]; + +_unit = _this select 0; + +if (_unit == vehicle _unit) exitWith {true}; + +_config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit; + +isClass _config +&& {getNumber (_config >> "canPullTrigger") == 1} diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf new file mode 100644 index 0000000000..43ff5243de --- /dev/null +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -0,0 +1,61 @@ +/* + * Author: commy2 + * + * Adjust a projectiles velocity and dir + up vector. + * + * Argument: + * 0: Projectile (Object, CfgAmmo) + * 1: Adjust azimuth this much. (Number) + * 2: Adjust inclination this much. (Number) + * 3: Adjust projectile speed this much. In m/s. (Number, optional default: 0 m/s) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; + +_projectile = _this select 0; +_adjustDir = _this select 1; +_adjustUp = _this select 2; +_adjustSpeed = _this select 3; + +if (isNil "_adjustSpeed") then { + _adjustSpeed = 0; +}; + +["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log); + +// get old direction vector +_vdir = vectorDir _projectile; + +// get azimuth and inclination and apply corrections +_dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; +_up = sqrt ((_vdir select 1) ^ 2 + (_vdir select 0) ^ 2) atan2 - (_vdir select 2) + _adjustUp; + +// get new direction vector (this is a unit vector) +_vdir = [ + sin _dir * sin _up, + cos _dir * sin _up, + - cos _up +]; + +// get best up vector +_l = sqrt ((_vdir select 0) ^ 2 + (_vdir select 1) ^ 2); if (_l == 0) then {diag_log text format ["[ACE] ERROR: %1, %2, %3, %4, %5, %6, %7", _projectile, _adjustDir, _adjustUp, vectorDir _projectile, _vdir, _dir, _up]}; +_r = -(_vdir select 2) / _l; + +_vup = [ + (_vdir select 0) * _r, + (_vdir select 1) * _r, + _l +]; + +// get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. +_vel = _vdir vectorMultiply _adjustSpeed + vectorMagnitude velocity _projectile; + +// set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. +_projectile setVectorDirAndUp [_vdir, _vup]; + +// set new speed vector +_projectile setVelocity _vel; diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf new file mode 100644 index 0000000000..42f71ba8bd --- /dev/null +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -0,0 +1,40 @@ +/* + * Author: commy2 + * + * Used to execute the checkPBOs module without placing the module. Don't use this together with the module. + * + * Argument: + * 0: Mode (Number) + * 0: Warn once + * 1: Warn permanently + * 2: Kick + * 1: Check all PBOs? (Boolean, optional default: "[]") + * 2: Whitelist (String, optinal default: false) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_mode", "_checkAll", "_whitelist", "_logic"]; + +_this resize 3; + +_mode = _this select 0; +_checkAll = _this select 1; +_whitelist = _this select 2; + +if (isNil "_checkAll") then { + _checkAll = false; +}; + +if (isNil "_whitelist") then { + _whitelist = "[]"; +}; + +_logic = "Logic" createVehicleLocal [0,0,0]; +_logic setVariable ["Action", _mode]; +_logic setVariable ["CheckAll", _checkAll]; +_logic setVariable ["Whitelist", _whitelist]; +[_logic, [], true] call FUNC(moduleCheckPBOs); +deleteVehicle _logic; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf new file mode 100644 index 0000000000..3da556fe9f --- /dev/null +++ b/addons/common/functions/fnc_claim.sqf @@ -0,0 +1,28 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_target", "_lockTarget", "_owner"]; + +_unit = _this select 0; +_target = _this select 1; +_lockTarget = _this select 2; + +if (isNil "_lockTarget") then {_lockTarget = false}; + +_owner = _target getVariable ["ACE_isUsedBy", objNull]; + +if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { + diag_log text "[ACE] ERROR: Claiming already owned object."; +}; + +_target setVariable ["ACE_isUsedBy", _unit, true]; + +if (_lockTarget) then { + if (!isNull _unit) then { + [_target, "{_locked = locked _this; _this setVariable ['ACE_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc); + } else { + [_target, "{_this lock (_this getVariable ['ACE_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc); + }; +}; + +//systemChat str locked _target; systemChat str (_target getVariable ['ACE_lockStatus', locked _target]); diff --git a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf new file mode 100644 index 0000000000..417adffdf3 --- /dev/null +++ b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf @@ -0,0 +1,48 @@ +/* + * Author: commy2 + * + * Closes the current dialog if the target moves, changes vehicle etc. + * + * Arguments: + * 0: Target unit + * 1: Ignore the unit being dead? (Optional, default: No) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + +_this spawn { + _target = _this select 0; + _ignoreDead = _this select 1; + if (isNil "_ignoreDead") then {_ignoreDead = false}; + + _vehicleTarget = vehicle _target; + _vehiclePlayer = vehicle ACE_player; + _inVehicle = _target != _vehicleTarget; + + _position = getPosASL _target; + + _fnc_check = { + // either unit changed vehicles + if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; + if (_vehicleTarget != vehicle _target) exitWith {True}; + + // target died + if (!alive _target && {!_ignoreDead}) exitWith {True}; + + // player fell unconscious + if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; + + // target moved (outside of vehicle) + (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) + }; + + waitUntil { + if (call _fnc_check) then { + closeDialog 0; + call ACE_Interaction_fnc_hideMenu; + }; + (isNil "ACE_Interaction_MainButton" && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open + }; +}; diff --git a/addons/common/functions/fnc_codeToLetter.sqf b/addons/common/functions/fnc_codeToLetter.sqf new file mode 100644 index 0000000000..31e7241e16 --- /dev/null +++ b/addons/common/functions/fnc_codeToLetter.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf new file mode 100644 index 0000000000..fa7187cae9 --- /dev/null +++ b/addons/common/functions/fnc_codeToString.sqf @@ -0,0 +1,24 @@ +/* + * Author: commy2 + * + * Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string. + * + * Argument: + * 0: Code (Code or String) + * + * Return value: + * Code (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private "_function"; + +_function = _this select 0; + +if (typeName _function == "STRING") exitWith {_function}; + +_function = toArray str _function; +_function set [0, -1]; +_function set [count _function - 1, -1]; +_function = toString (_function - [-1]); +_function diff --git a/addons/common/functions/fnc_convertKeyCode.sqf b/addons/common/functions/fnc_convertKeyCode.sqf new file mode 100644 index 0000000000..67c316fda8 --- /dev/null +++ b/addons/common/functions/fnc_convertKeyCode.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * Get a key code used in ACE key input eh. + * + * Argument: + * 0: Arma DIK code (Number) + * 1: Key state for shift left and shift right key (Bool) + * 2: Key state for ctrl left and ctrl right key (Bool) + * 3: Key state for alt and alt gr key (Bool) + * + * Return value: + * Key code (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] + +private "_key"; + +_key = _this select 0; + +if (_key in KEY_MODIFIERS) exitWith {_key}; + +if (_this select 1) then {_key = _key + 0.1}; +if (_this select 2) then {_key = _key + 0.2}; +if (_this select 3) then {_key = _key + 0.4}; + +_key diff --git a/addons/common/functions/fnc_currentChannel.sqf b/addons/common/functions/fnc_currentChannel.sqf new file mode 100644 index 0000000000..15fd89a464 --- /dev/null +++ b/addons/common/functions/fnc_currentChannel.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * + * Returns the current radio / chat / marker channel. + * + * Argument: + * NONE. + * + * Return value: + * The current channel. Can be "group", "side", "global", "command", "vehicle" or "direct" (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"] +#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"] + +CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable ["ACE_currentChannel", ""])) max 0 diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf new file mode 100644 index 0000000000..324f02d1b1 --- /dev/null +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -0,0 +1,91 @@ +/* + * Author: commy2 + * + * Disables key input. ESC can still be pressed to open the menu. + * + * Argument: + * 0: True to disable key inputs, false to re-enable them (Bool) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_state", "_dlg"]; + +_state = _this select 0; + +if (_state) then { + disableSerialization; + + if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; + if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {}; + + // end TFAR and ACRE2 radio transmissions + 0 spawn FUNC(endRadioTransmission); + + // Close map + if (visibleMap && {!(player getVariable ["ACE_canSwitchUnits", false])}) then {openMap false}; + + closeDialog 0; + createDialog QGVAR(DisableMouse_Dialog); + + _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); + + _dlg displayAddEventHandler ["KeyDown", { + _key = _this select 1; + + if (_key == 1 && {alive player}) then { + createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); + + disableSerialization; + _dlg = finddisplay 49; + _dlg displayAddEventHandler ["KeyDown", { + _key = _this select 1; + !(_key == 1) + }]; + + for "_index" from 100 to 2000 do { + (_dlg displayCtrl _index) ctrlEnable false; + }; + + _ctrl = _dlg displayctrl 103; + _ctrl ctrlSetEventHandler ["buttonClick", "while {!isNull (uiNamespace getVariable ['GVAR(dlgDisableMouse)', displayNull])} do {closeDialog 0}; failMission 'LOSER'; [false] call FUNC(disableUserInput);"]; + _ctrl ctrlEnable true; + _ctrl ctrlSetText "ABORT"; + _ctrl ctrlSetTooltip "Abort."; + + _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); + _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; player setDamage 1; [false] call FUNC(disableUserInput);"]; + _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); + _ctrl ctrlSetText "RESPAWN"; + _ctrl ctrlSetTooltip "Respawn."; + }; + + if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; teamSwitch};//_acc = accTime; teamSwitch; setAccTime _acc}; + if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openCuratorInterface}; + if (_key in actionKeys "ShowMap" && {player getVariable ["ACE_canSwitchUnits", false]}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openMap true}; + + if (serverCommandAvailable "#missions" || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then { + if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { + _key = 0; + }; + }; + + _key > 0 + }]; + _dlg displayAddEventHandler ["KeyUp", {true}]; + + ["ACE_DisableUserInput", "onEachFrame", { + if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { + ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + [true] call FUNC(disableUserInput); + }; + }] call BIS_fnc_addStackedEventHandler; +} else { + if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { + ["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; +}; diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf new file mode 100644 index 0000000000..36feff14c0 --- /dev/null +++ b/addons/common/functions/fnc_displayText.sqf @@ -0,0 +1,53 @@ +/* + * Author: commy2 + * + * Display a message. + * + * Argument: + * 0: Message (String) + * 1: Play a clicking sound (Bool, optional default: false) + * 2: How long before hiding the message in seconds (Number, optional default: 2 sec) + * 3: Priority, higher priority messages will override lesser important ones (Number, optional default: 0) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define DEFAULT_PLAY_SOUND false +#define DEFAULT_DELAY 2 +#define DEFAULT_PRIORITY 0 + +if (isNil QGVAR(lastHint)) then { + GVAR(lastHint) = [0, 0]; +}; + +_this resize 4; + +_this spawn { + private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; + + _text = _this select 0; + _sound = _this select 1; + _delay = _this select 2; + _priority = _this select 3; + + _lastHintTime = GVAR(lastHint) select 0; + _lastHintPriority = GVAR(lastHint) select 1; + + if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; + if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; + if (isNil "_delay") then {_delay = DEFAULT_DELAY}; + if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; + + _time = time; + if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { + hintSilent _text; + if (_sound) then {playSound "ACE_Sound_Click"}; + GVAR(lastHint) set [0, _time]; + GVAR(lastHint) set [1, _priority]; + + sleep _delay; + if (_time == GVAR(lastHint) select 0) then {hintSilent ""}; + }; +}; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf new file mode 100644 index 0000000000..4b9a0255af --- /dev/null +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Display a structured text with image. + * + * Argument: + * 0: Text (Anything) + * 1: Image (String) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_text", "_image"]; + +_text = _this select 0; +_image = _this select 1; + +if (typeName _text != "TEXT") then { + _text = parseText format ["%1", _text]; +}; + +_text = composeText [ + parseText format ["", _image], + lineBreak, + _text +]; + +[_text] call FUNC(displayTextStructured); diff --git a/addons/common/functions/fnc_displayTextStructured.sqf b/addons/common/functions/fnc_displayTextStructured.sqf new file mode 100644 index 0000000000..aed3f0555a --- /dev/null +++ b/addons/common/functions/fnc_displayTextStructured.sqf @@ -0,0 +1,48 @@ +/* + * Author: commy2 + * + * Display a structured text. + * + * Argument: + * 0: Text (Anything) + * 1: Size of the textbox (Number, optional default: 1) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_text", "_size", "_isShown", "_ctrlHint"]; + +_text = _this select 0; +_size = _this select 1; + +if (isNil "_size") then {_size = 1}; + +if (typeName _text != "TEXT") then { + _text = composeText [lineBreak, parseText format ["%1", _text]]; +}; + +_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]); + +("ACE_RscHint" call BIS_fnc_rscLayer) cutRsc ["ACE_RscHint", "PLAIN", 0, true]; + +disableSerialization; +_ctrlHint = uiNamespace getVariable "ACE_ctrlHint"; + +_ctrlHint ctrlSetPosition [ + safeZoneW + safeZoneX - 0 * safezoneW, + safeZoneY + 0.2 * safezoneH, + 0.2 * safeZoneW, + _size * 0.1 * SafeZoneH +]; +_ctrlHint ctrlCommit 0; + +_ctrlHint ctrlSetStructuredText _text; +_ctrlHint ctrlSetPosition [ + safeZoneW + safeZoneX - 0.2 * safezoneW, + safeZoneY + 0.2 * safezoneH, + 0.2 * safeZoneW, + _size * 0.1 * SafeZoneH +]; +_ctrlHint ctrlCommit ([0.2, 0] select _isShown); diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf new file mode 100644 index 0000000000..fb1483fcd1 --- /dev/null +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -0,0 +1,77 @@ +/* + * Author: commy2 + * + * Execute an animation. This is used to not break things like the unconsciousness animation. + * + * Argument: + * 0: Unit (Object) + * 1: Animation (String) + * 2: Priority of the animation. (Number, optional default: 0) + * 0: PlayMove + * 1: PlayMoveNow + * 2: SwitchMove (no transitional animation, doesn't overwrite priority 1) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_animation", "_priority", "_force"]; + +_unit = _this select 0; +_animation = _this select 1; +_priority = _this select 2; +_force = False; + +// no animation given +if (isNil "_animation") exitWith { + diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent]; +}; + +if (isNil "_priority") then { + _priority = 0; +}; +if (count _this > 3) then { + _force = _this select 3; +}; + +// don't overwrite more important animations +if (_unit getVariable ["ACE_isUnconscious", false] && {!_force}) exitWith { + if (_animation != "Unconscious") then { + [_unit, "Unconscious", 2] call FUNC(doAnimation); + }; +}; + +// don't go unconscious if the unit isn't unconscious +if (_animation == "Unconscious" && {!(_unit getVariable ["ACE_isUnconscious", false])}) exitWith {}; + +// switchMove "" no longer works in dev 1.37 +if (_animation == "") then { + _animation = [_unit] call FUNC(getDefaultAnim); +}; + +switch (_priority) do { + case 0 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + }; + case 1 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + }; + case 2 : { + // Execute on all machines. SwitchMove has local effects. + [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + default {}; +}; + +["Anim", [_priority, _animation]] call FUNC(log); diff --git a/addons/common/functions/fnc_endRadioTransmission.sqf b/addons/common/functions/fnc_endRadioTransmission.sqf new file mode 100644 index 0000000000..5d6ffe19b0 --- /dev/null +++ b/addons/common/functions/fnc_endRadioTransmission.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571 + * + * Arguments: + * None. + * + * Return Value: + * None. + * + */ +#include "\z\ace\addons\common\script_component.hpp" + +// ACRE +if (isClass (configFile >> "CfgPatches" >> "acre_main")) then { + [-1] call acre_core_fnc_handleMultiPttKeyPressUp; + [0] call acre_core_fnc_handleMultiPttKeyPressUp; + [1] call acre_core_fnc_handleMultiPttKeyPressUp; + [2] call acre_core_fnc_handleMultiPttKeyPressUp; +}; + +// TFAR +if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { + call TFAR_fnc_onSwTangentReleased; + call TFAR_fnc_onAdditionalSwTangentReleased; + call TFAR_fnc_onLRTangentReleased; + call TFAR_fnc_onAdditionalLRTangentReleased; + call TFAR_fnc_onDDTangentReleased; +}; diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf new file mode 100644 index 0000000000..542466d60c --- /dev/null +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -0,0 +1,53 @@ +/* + * Author: commy2 + * + * Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1). + * + * Argument: + * 0: Function arguments (Array) + * 1: Function to execute, has to be defined on the remote machine first (String) + * 2: Namespace to save that variable in (Object or Namespace) + * 3: Name. Will overwrite previously defined functions with that name (String) + * + * Return value: + * Nothing. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_arguments", "_function", "_unit", "_name"]; + +GVAR(remoteFnc) = _this; + +_arguments = _this select 0; +_function = call compile (_this select 1); +_unit = _this select 2; +_name = _this select 3; + +["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); + +// execute function on every currently connected machine +[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); + +// save persistent function for JIP +private ["_persistentFunctions", "_index"]; + +_persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []]; + +// find index to overwrite function with the same name, add to end otherwise +_index = count _persistentFunctions; +{ + if (_x select 2 == _name) exitWith { + _index = _forEachIndex; + }; +} forEach _persistentFunctions; + +// set new value +_persistentFunctions set [_index, [_arguments, _function, _name]]; + +// broadcast variable +if (typeName _unit == "NAMESPACE") then { + ACE_PersistentFunctions = _persistentFunctions; + publicVariable "ACE_PersistentFunctions"; +} else { + _unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true]; +}; diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf new file mode 100644 index 0000000000..e4091bf2f6 --- /dev/null +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -0,0 +1,71 @@ +/* + * Author: commy2 + * + * Execute a function on a remote machine in mp. + * + * Argument: + * 0: Function arguments (Array) + * 1: Function to execute, has to be defined on the remote machine first (String) + * 2: The function will be executed where this unit is local OR the mode were this function should be executed. (Object OR Number, optional default: 2) + * Mode 0: execute on this machine only + * Mode 1: execute on server + * Mode 2: execute on all clients + server + * Mode 3: execute on dedicated only + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_arguments", "_function", "_unit", "_id"]; + +GVAR(remoteFnc) = _this; + +_arguments = _this select 0; +_function = call compile (_this select 1); +_unit = _this select 2; + +if (isNil "_unit") then { + _unit = 2; +}; + +["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); + +if (typeName _unit == "SCALAR") exitWith { + switch (_unit) do { + case 0 : { + _arguments call _function; + }; + case 1 : { + if (isServer) then { + _arguments call _function; + } else { + publicVariableServer QGVAR(remoteFnc); + }; + }; + case 2 : { + _arguments call _function; + + GVAR(remoteFnc) set [2, 0]; + publicVariable QGVAR(remoteFnc); + }; + case 3 : { + if (isDedicated) then { + _arguments call _function; + } else { + if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; + }; + }; + }; +}; + +if (local _unit) then { + _arguments call _function; +} else { + if (isServer) then { + _id = owner _unit; + _id publicVariableClient QGVAR(remoteFnc); + } else { + publicVariableServer QGVAR(remoteFnc); + }; +}; diff --git a/addons/common/functions/fnc_executePersistent.sqf b/addons/common/functions/fnc_executePersistent.sqf new file mode 100644 index 0000000000..8e8f7375b0 --- /dev/null +++ b/addons/common/functions/fnc_executePersistent.sqf @@ -0,0 +1,16 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_target"; + +_target = _this select 0; + +{ + if (isNil "_x") then { + diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; + } else { + if (typeName _x == "ARRAY") then { + [_x select 0, _target] call (_x select 1); + }; + }; +} forEach (_target getVariable ["ACE_PersistentFunctions", []]); diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf new file mode 100644 index 0000000000..3b157f0a81 --- /dev/null +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -0,0 +1,69 @@ +// by commy2 +/* + usage: + + (configFile >> "CfgAmmo") call FUNC(exportConfig); +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private "_fnc_logEntries"; + +_fnc_logEntries = { + private ["_c", "_d", "_p", "_t", "_e"]; + + _c = _this select 0; + _d = _this select 1; + + _p = inheritsFrom _c; + + _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; + for "_a" from 1 to _d do { + _t = " " + _t; + }; + diag_log text _t; + + _e = []; + for "_i" from 0 to (count _c - 1) do { + private ["_e1, _e2"]; + _e1 = _c select _i; + + _e2 = switch (true) do { + case (isNumber _e1): {getNumber _e1}; + case (isText _e1): {getText _e1}; + case (isArray _e1): {getArray _e1}; + case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; + }; + + if (typeName _e2 != "BOOL") then { + if (typeName _e2 == "ARRAY") then { + _e2 = toArray str _e2; + { + if (_x == toArray "[" select 0) then { + _e2 set [_forEachIndex, toArray "{" select 0]; + }; + if (_x == toArray "]" select 0) then { + _e2 set [_forEachIndex, toArray "}" select 0]; + }; + } forEach _e2; + _e2 = toString _e2; + _t = format ["%1[] = %2;", configName _e1, _e2]; + } else { + _t = format ["%1 = %2;", configName _e1, str _e2]; + }; + for "_a" from 0 to _d do { + _t = " " + _t; + }; + diag_log text _t; + }; + }; + + _t = "};"; + for "_a" from 1 to _d do { + _t = " " + _t; + }; + diag_log text _t; + diag_log text ""; + +}; + +[_this, 0] call _fnc_logEntries; diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf new file mode 100644 index 0000000000..3d61c7559e --- /dev/null +++ b/addons/common/functions/fnc_filter.sqf @@ -0,0 +1,34 @@ +/* + * Author: KoffeinFlummi, commy2 + * + * Filters array and removes every element not fitting the condition + * + * Arguments: + * 0: Array to be filtered. + * 1: Code to be evaluated. + * + * Return Value: + * Final array + * + * Usage: + * [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4] + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_code", "_newArray", "_index"]; + +_array = _this select 0; +_code = _this select 1; + +if (isNil "_array") exitWith { + diag_log text format ["[ACE] ERROR: No array for function filter in %1", _fnc_scriptNameParent]; + [] +}; + +_newArray = []; +for "_index" from 0 to (count _array - 1) do { + if ((_array select _index) call _code) then { + _newArray pushBack (_array select _index); + }; +}; +_newArray diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf new file mode 100644 index 0000000000..d6e7f91cc6 --- /dev/null +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -0,0 +1,34 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_crate", "_weapons", "_items"]; + +_crate = _this select 0; + +// get all weapons inside the crate +_weapons = weaponCargo _crate; +_items = []; + +// if the "weapon" is supposed to be an item, move those from the weapon array to the item array +{ + if (getText (configFile >> "CfgWeapons" >> _x >> "simulation") == "ItemMineDetector") then { + _weapons set [_forEachIndex, ""]; + _items pushBack _x; + }; +} forEach _weapons; + +_weapons = _weapons - [""]; + +// exit now if everything is fine +if (count _items == 0) exitWith {}; + +// otherwise clear weapon cargo and re-add items and weapons +clearWeaponCargoGlobal _crate; + +{ + _crate addWeaponCargoGlobal [_x, 1]; +} forEach _weapons; + +{ + _crate addItemCargoGlobal [_x, 1]; +} forEach _items; diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf new file mode 100644 index 0000000000..2a5a5d1224 --- /dev/null +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -0,0 +1,10 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"}) then { + [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); +}; diff --git a/addons/common/functions/fnc_getCaptivityStatus.sqf b/addons/common/functions/fnc_getCaptivityStatus.sqf new file mode 100644 index 0000000000..857d78d5b1 --- /dev/null +++ b/addons/common/functions/fnc_getCaptivityStatus.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * Return the captivity status of an unit. + * + * Argument: + * 0: Unit (Object) + * + * Return value: + * Reasons, why the unit is a captive. An empty array is returned if the unit is not a captive (Array of Strings) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; + +_unit = _this select 0; + +_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; + +_unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber); + +_unitCaptivityReasons = []; +{ + if (_unitCaptivityStatus select _forEachIndex) then { + _unitCaptivityReasons pushBack _x; + }; +} forEach _captivityReasons; + +_unitCaptivityReasons diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf new file mode 100644 index 0000000000..4fcf7af2fb --- /dev/null +++ b/addons/common/functions/fnc_getChildren.sqf @@ -0,0 +1,11 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_name", "_cfgClass", "_classes"]; + +_name = _this select 0; +_cfgClass = _this select 1; + +_classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); +_classes = [_classes, {configName _this}] call FUNC(map); +_classes diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf new file mode 100644 index 0000000000..bb65331228 --- /dev/null +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -0,0 +1,21 @@ +/* + * Author: commy2 + * + * Get the commander config of a vehicles turret. + * + * Argument: + * 0: vehicle type (String) + * + * Return value: + * Commander config (Config) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_turret"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> _vehicle; +_turret = [_vehicle] call FUNC(getTurretCommander); + +[_config, _turret] call FUNC(getTurretConfigPath) diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf new file mode 100644 index 0000000000..e4708599d8 --- /dev/null +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -0,0 +1,21 @@ +/* + * Author: commy2 + * + * Get the gunner config of a vehicles turret. + * + * Argument: + * 0: vehicle type (String) + * + * Return value: + * Gunner config (Config) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_turret"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> _vehicle; +_turret = [_vehicle] call FUNC(getTurretGunner); + +[_config, _turret] call FUNC(getTurretConfigPath) diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf new file mode 100644 index 0000000000..99636e36e7 --- /dev/null +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -0,0 +1,29 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_anim", "_stance"]; + +_unit = _this select 0; +_anim = toLower (animationState _unit); + +// stance is broken for some animations. +_stance = stance _unit; +if (_anim find "ppne" == 4) then { + _stance = "PRONE"; +}; +if (_anim find "pknl" == 4) then { + _stance = "CROUCH"; +}; +if (_anim find "perc" == 4) then { + _stance = "STAND"; +}; + +_anim = format ["AmovP%1M%2S%3W%4D%5", + ["erc", "knl", "pne"] select (["STAND", "CROUCH", "PRONE"] find _stance) max 0, + ["stp", "run"] select (vectorMagnitude velocity _unit > 1), + [["ras", "low"] select weaponLowered _unit, "non"] select (currentWeapon _unit == ""), + ["non", "rfl", "lnr", "pst", "bin"] select (["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0, + ["non", _anim select [count _anim - 1, 1]] select (_anim select [count _anim - 2, 2] in ["df", "db", "dl", "dr"]) +]; + +["", _anim] select isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> _anim) diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf new file mode 100644 index 0000000000..38623ff333 --- /dev/null +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_configName", "_index"]; + +_configName = ""; + +for "_index" from 0 to (count configFile - 1) do { + _config = configFile select _index; + if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { + _configName = configName _config; + }; +}; + +_configName diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf new file mode 100644 index 0000000000..02d9dd6978 --- /dev/null +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -0,0 +1,31 @@ +/* + * Author: bux578 + * + * Gets the turret index of door gunners + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret indexes of the door gunner. Empty array means no gunner position. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicleType", "_turrets", "_doorTurrets", "_config"]; + +_vehicleType = _this select 0; + +_turrets = [_vehicleType] call FUNC(getTurrets); + +_doorTurrets = []; + +{ + _config = configFile >> "CfgVehicles" >> _vehicleType; + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { + _doorTurrets pushBack _x; + }; +} forEach _turrets; + +_doorTurrets diff --git a/addons/common/functions/fnc_getForceWalkStatus.sqf b/addons/common/functions/fnc_getForceWalkStatus.sqf new file mode 100644 index 0000000000..3d762b1cdd --- /dev/null +++ b/addons/common/functions/fnc_getForceWalkStatus.sqf @@ -0,0 +1,37 @@ +/* +Name: FUNC(getForceWalkStatus) + +Author: Pabst Mirror (from captivity by commy2) + +Description: + Returns reasons why the unit is forceWalk-ing, empty if not forced. + +Parameters: + 0: OBJECT - Unit + +Returns: + ARRAY(of strings) - Reason why the unit is force walking + +Example: + [ACE_Player] call FUNC(getForceWalkStatus) +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; + +_unit = _this select 0; + +_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; + +_unitForceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; + +_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber); + +_unitForceWalkReasons = []; +{ + if (_unitForceWalkStatus select _forEachIndex) then { + _unitForceWalkReasons pushBack _x; + }; +} forEach _forceWalkReasons; + +_unitForceWalkReasons diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf new file mode 100644 index 0000000000..2b6c157891 --- /dev/null +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -0,0 +1,56 @@ +/* + * Author: commy2 + * + * Returns all hitpoints of any vehicle. Non unique hitpoints in turrets are ignored. + * + * Arguments: + * 0: A vehicle, not the classname (Object) + * + * Return Value: + * The hitpoints (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_hitpoints"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +_hitpoints = []; + +// get all classes that can contain hitpoints +private "_hitpointClasses"; +_hitpointClasses = [_config >> "HitPoints"]; +{ + private "_class"; + _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; + + if (isClass _class) then { + _hitpointClasses pushBack _class; + }; + +} forEach allTurrets _vehicle; + +// iterate through all classes with hitpoints and their parents +{ + private "_class"; + _class = _x; + + while {isClass _class} do { + + for "_i" from 0 to (count _class - 1) do { + private "_entry"; + _entry = configName (_class select _i); + + if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then { + _hitpoints pushBack _entry; + }; + }; + + _class = inheritsFrom _class; + }; + +} forEach _hitpointClasses; + +_hitpoints diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf new file mode 100644 index 0000000000..f48489b130 --- /dev/null +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -0,0 +1,60 @@ +/* + * Author: commy2 + * + * Returns all hitpoints and their selections of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. + * + * Arguments: + * 0: A vehicle, not the classname (Object) + * + * Return Value: + * The hitpoints with selections. Format: [hitpoints, selections]. They correspond by index. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_hitpoints", "_selections"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; + +_hitpoints = []; +_selections = []; + +// get all classes that can contain hitpoints +private "_hitpointClasses"; +_hitpointClasses = [_config >> "HitPoints"]; +{ + private "_class"; + _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; + + if (isClass _class) then { + _hitpointClasses pushBack _class; + }; + +} forEach allTurrets _vehicle; + +// iterate through all classes with hitpoints and their parents +{ + private "_class"; + _class = _x; + + while {isClass _class} do { + + for "_i" from 0 to (count _class - 1) do { + private ["_entry", "_selection"]; + + _entry = configName (_class select _i); + _selection = getText (_class select _i >> "name"); + + if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { + _hitpoints pushBack _entry; + _selections pushBack _selection; + }; + }; + + _class = inheritsFrom _class; + }; + +} forEach _hitpointClasses; + +[_hitpoints, _selections] diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf new file mode 100644 index 0000000000..4cc7705b3c --- /dev/null +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -0,0 +1,248 @@ +/* + * Author: commy2 + * + * Move unit into given vehicle position. Or switch to that position if the unit is already inside the vehicle. + * + * Arguments: + * 0: Unit to enter the vehicle (Object) + * 1: The vehicle to be entered (Object) + * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) + * 3: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. + * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) + * + * Return Value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} +#define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} + +private ["_unit", "_vehicle", "_position", "_index"]; + +_unit = _this select 0; +_vehicle = _this select 1; +_position = toLower (_this select 2); +_index = _this select 3; // optional, please don't use + +if (isNil "_index") then {_index = -1}; + +// general +if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; + +private ["_config", "_turret", "_isInside", "_script", "_enemiesInVehicle"]; + +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; +_turret = []; + +_isInside = vehicle _unit == _vehicle; + +_script = {}; +_enemiesInVehicle = false; //Possible Side Restriction +{ + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; +} forEach crew _vehicle; + +switch (_position) do { + case "driver" : { + if (CANGETINDRIVER) then { + _script = [ + {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; + + case "pilot" : { + if (CANGETINDRIVER) then { + _script = [ + {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + _position = "driver"; + }; + }; + + case "gunner" : { + _turret = [typeOf _vehicle] call FUNC(getTurretGunner); + + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; + + case "commander" : { + _turret = [typeOf _vehicle] call FUNC(getTurretCommander); + + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; + + case "copilot" : { + _turret = [typeOf _vehicle] call FUNC(getTurretCopilot); + + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + }; + }; + + case "turret" : { + private "_turrets"; + _turrets = [typeOf _vehicle] call FUNC(getTurretsOther); + + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "gunner"; + } else { + + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "gunner"; + }; + }; + }; + }; + + case "ffv" : { + private "_turrets"; + _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); + + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + } else { + + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + }; + }; + }; + }; + + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + default {}; +}; + +// this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. +private "_fnc_getInEH"; +_fnc_getInEH = { + private "_config"; + // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? + _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; + + if (isClass _config) then { + //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats + if !(_isInside) then { + [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); + }; + }; +}; + +// if you want into the cargo and you can't, then check ffv turrets aswell +if (_position == "cargo") exitWith { + if (_script isEqualTo {}) then { + [_unit, _vehicle, "ffv"] call FUNC(getInPosition); + } else { + call _script; + }; +}; + +call _script; + +/* + sleep 0.1; + if ((vehicle _unit) != _vehicle) then { + ["fn_getInPosition.sqf - Side Restriction, failed to move _unit into vehicle"] call bis_fnc_error; + _unit moveInAny _vehicle; //attempt to fail gracefully + }; +*/ diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf new file mode 100644 index 0000000000..cfcfcc420d --- /dev/null +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -0,0 +1,73 @@ +/* + * Author: KoffeinFlummi + * + * Get the apropriate marker for a group. + * + * Arguments: + * 0: Group + * + * Return Value: + * Marker Type (string) + */ +#include "\z\ace\addons\common\script_component.hpp" + +_group = _this select 0; +_leader = leader _group; +_vehicle = vehicle _leader; +_side = side _leader; + +if (_vehicle == _leader) exitWith { + if ( + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or + (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") + ) then { + ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + } else { + ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + }; +}; + +if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith { + ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; +if ( + (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportFuel") > 0) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportAmmo") > 0) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_canRepair") > 0) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_fuelCapacityCargo") > 0) + ) exitWith { + ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; + +if (_vehicle isKindOf "Plane") exitWith { + ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; +if (_vehicle isKindOf "Air") exitWith { + ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; + +if (_vehicle isKindOf "StaticMortar") exitWith { + ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; +if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith { + ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; + +if (_vehicle isKindOf "Car") exitWith { + ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; +if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith { + ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; +if (_vehicle isKindOf "Tank") exitWith { + ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; + +if (_vehicle isKindOf "Ship") exitWith { + ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) +}; + +// generic marker +["n_unknown", "b_unknown", "o_unknown"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf new file mode 100644 index 0000000000..3bc0663f51 --- /dev/null +++ b/addons/common/functions/fnc_getName.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2 + * + * Returns the name of the object. Used to prevent issues with the name command. + * + * Argument: + * 0: Object (Object) + * 1: Show effective commander name? (Bool, optinal default: false) + * + * Return value: + * The name. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_showEffective", "_name"]; + +_unit = _this select 0; +_showEffective = _this select 1; + +if (isNil "_showEffective") then { + _showEffective = false; +}; + +_name = ""; + +if (_unit isKindOf "CAManBase") then { + _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; +} else { + if (_showEffective) then { + _name = [effectiveCommander _unit] call FUNC(getName); + } else { + _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); + }; +}; + +_name diff --git a/addons/common/functions/fnc_getNumberFromMissionSQM.sqf b/addons/common/functions/fnc_getNumberFromMissionSQM.sqf new file mode 100644 index 0000000000..7251a253a6 --- /dev/null +++ b/addons/common/functions/fnc_getNumberFromMissionSQM.sqf @@ -0,0 +1,18 @@ +/* + * Author: commy2 + * + * Get a number from the mission.sqm file. Mission has to be saved in the Editor. + * + * Argument: + * 0: Path of the entry in the mission.sqm (Array) + * + * Return value: + * Value of the entry. Note: If the entry does not exist, it might return 0 or an entry with the same name of another class! (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private "_number"; + +_number = _this call FUNC(getStringFromMissionSQM); + +parseNumber _number; diff --git a/addons/common/functions/fnc_getPitchBankYaw.sqf b/addons/common/functions/fnc_getPitchBankYaw.sqf new file mode 100644 index 0000000000..3758b42931 --- /dev/null +++ b/addons/common/functions/fnc_getPitchBankYaw.sqf @@ -0,0 +1,14 @@ +/* + * Author: KoffeinFlummi + * + * Returns [pitch, bank, yaw] for given vehicle in degrees. + * + * Arguments: + * 0: Unit/Vehicle + * + * Return Value: + * [pitch, bank, yaw] + */ +#include "\z\ace\addons\common\script_component.hpp" + +((_this select 0) call BIS_fnc_getPitchBank) + [getDir (_this select 0)] diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf new file mode 100644 index 0000000000..1fb22e51c8 --- /dev/null +++ b/addons/common/functions/fnc_getStringFromMissionSQM.sqf @@ -0,0 +1,58 @@ +/* + * Author: commy2 + * + * Get a string from the mission.sqm file. Mission has to be saved in the Editor. The string cannot contain the ; character. + * + * Argument: + * 0: Path of the entry in the mission.sqm (Array) + * + * Return value: + * Value of the entry. Note: If the entry does not exist, it might return an empty string or an entry with the same name of another class! (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_path", "_mission", "_a", "_class", "_index", "_array", "_b", "_entry"]; + +_path = _this; + +if (missionName == "") exitWith {""}; +_mission = toArray toLower loadFile "mission.sqm"; +_mission resize 65536; +{ + if (_x < 33) then { + _mission set [_forEachIndex, -1]; + } +} forEach _mission; +_mission = toString (_mission - [-1]); + +{_path set [_forEachIndex, toLower _x]} forEach _path; + +for "_a" from 0 to (count _path - 2) do { + _class = format ["class%1{", _path select _a]; + + _index = _mission find _class; + + _array = toArray _mission; + for "_b" from 0 to (_index + count toArray _class - 1) do { + _array set [_b, -1]; + }; + _array = _array - [-1]; + + _mission = toString _array; +}; + +_entry = format ["%1=", _path select (count _path - 1)]; +_index = _mission find _entry; +if (_index == -1) exitWith {""}; + +_array = toArray _mission; +for "_b" from 0 to (_index + count toArray _entry - 1) do { + _array set [_b, -1]; +}; +_mission = toString (_array - [-1]); + +_index = _mission find ";"; + +_mission = toArray _mission; +_mission resize _index; +format ["%1", toString _mission]; diff --git a/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf new file mode 100644 index 0000000000..0327a38f5d --- /dev/null +++ b/addons/common/functions/fnc_getTargetAzimuthAndInclination.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Get players viewing direction and slope + * + * Argument: + * None. + * + * Return value: + * 0: Azimuth (Number) + * 1: Inclination or 'slope' (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_position", "_direction", "_azimuth", "_inclination"]; + +_position = ATLToASL positionCameraToWorld [0, 0, 0]; +_direction = ATLToASL positionCameraToWorld [0, 0, 1]; + +_azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); +_inclination = asin ((_direction select 2) - (_position select 2)); + +if (_azimuth < 0) then {_azimuth = _azimuth + 360}; + +[_azimuth, _inclination] diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf new file mode 100644 index 0000000000..d30e880d21 --- /dev/null +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -0,0 +1,49 @@ +/* + * Author: commy2 + * + * Get the distance to the next object the player is looking at. Used for laser distance measurements. + * + * Argument: + * 0: How accurate will the measurement be? In meters. (Number) + * 1: Maximal distance to measure. (Number) + * 2: Minimal distance to measure. (optional, Number) + * + * Return value: + * Measured distance in meters. Can return maximal or minimal distance (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_interval", "_maxDistance", "_minDistance", "_position", "_laser", "_line", "_distance", "_iteration"]; + +_interval = _this select 0; +_maxDistance = _this select 1; +_minDistance = _this select 2; + +_position = ATLToASL positionCameraToWorld [0, 0, 0]; +_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; + +_laser = + _position; +_line = [_position, _laser]; + +_distance = _maxDistance; +_iteration = _distance; + +while { + _iteration > _interval / 2 +} do { + _iteration = _iteration / 2; + + _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; + _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; + _line set [1, _laser]; + + _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration); +}; + +_distance = _interval * round (_distance / _interval); + +_distance = _distance min _maxDistance; + +if !(isNil "_minDistance") then {_distance = _distance max _minDistance}; + +_distance diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf new file mode 100644 index 0000000000..5ad46b4f85 --- /dev/null +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -0,0 +1,26 @@ +/* + * Author: commy2 + * + * Get the nearest object the player is looking at. Used for laser designator instead of cursorTarget. + * + * Argument: + * 0: Maximal distance to search. (Number) + * + * Return value: + * Nearest object directly in line of sight, if none objNull (Object) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_maxDistance", "_position", "_laser", "_intersects"]; + +_maxDistance = _this select 0; + +_position = ATLToASL positionCameraToWorld [0, 0, 0]; +_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; + +_laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance]; +_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; + +_intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; + +if (count _intersects == 0) then {objNull} else {_intersects select 0} diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf new file mode 100644 index 0000000000..ed68cbd7c5 --- /dev/null +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Get the turret index of a vehicles commander. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret index of the vehicles commander. Empty array means no observer position. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_turrets", "_turret", "_config"]; + +_vehicle = _this select 0; + +_turrets = [_vehicle] call FUNC(getTurrets); + +_turret = []; +{ + _config = configFile >> "CfgVehicles" >> _vehicle; + + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if (getNumber (_config >> "primaryObserver") == 1) exitWith { + _turret = _x; + }; +} forEach _turrets; +_turret diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf new file mode 100644 index 0000000000..2d8f099ac8 --- /dev/null +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 + * + * Get the config path of a vehicles turret. + * + * Argument: + * 0: vehicles config (Config) + * 1: Turret index (Array) + * + * Return value: + * Turret config (Config) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"]; + +_config = _this select 0; +_turretIndex = _this select 1; + +for "_index" from 0 to (count _turretIndex - 1) do { + _config = _config >> "Turrets"; + + _offset = 0; + _config2 = _config select 0; + + _foundClasses = 0; + for "_a" from 0 to (count _config - 1) do { + if (isClass _config2) then { + _foundClasses = _foundClasses + 1; + } else { + _offset = _offset + 1; + }; + _config2 = _config select (_turretIndex select _index) + _offset; + + if (_foundClasses == _turretIndex select _index) exitWith {}; + }; + _config = _config2; +}; +_config diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf new file mode 100644 index 0000000000..ab31245777 --- /dev/null +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Get the turret index of a vehicles copilot. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret index of the vehicles gunner. Empty array means no copilot position. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_turrets", "_turret", "_config"]; + +_vehicle = _this select 0; + +_turrets = [_vehicle] call FUNC(getTurrets); + +_turret = []; +{ + _config = configFile >> "CfgVehicles" >> _vehicle; + + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { + _turret = _x; + }; +} forEach _turrets; +_turret diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf new file mode 100644 index 0000000000..4aeac062bc --- /dev/null +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Get the turret index of a vehicles gunner. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret index of the vehicles gunner. Empty array means no gunner position. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_turrets", "_turret", "_config"]; + +_vehicle = _this select 0; + +_turrets = [_vehicle] call FUNC(getTurrets); + +_turret = []; +{ + _config = configFile >> "CfgVehicles" >> _vehicle; + + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if (getNumber (_config >> "primaryGunner") == 1) exitWith { + _turret = _x; + }; +} forEach _turrets; +_turret diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf new file mode 100644 index 0000000000..dca0581279 --- /dev/null +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * + * Get the turret index of a units current turret. + * + * Argument: + * 0: Unit, not the vehicle (as in not a car but the player) (Object) + * + * Return value: + * Turret index array or config path. E.g: [0] for gunner or [0,0] for commander. Returns empty array if unit is not in a turret. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_vehicle", "_turrets", "_units", "_index"]; + +_unit = _this select 0; +_vehicle = vehicle _unit; + +//_turrets = [typeOf _vehicle] call FUNC(getTurrets); +_turrets = allTurrets [_vehicle, true]; + +_units = []; +{ + _units pushBack (_vehicle turretUnit _x); +} forEach _turrets; + +_index = _units find _unit; + +if (_index == -1) exitWith {[]}; + +_turrets select _index; diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf new file mode 100644 index 0000000000..2fa93678c3 --- /dev/null +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -0,0 +1,53 @@ +/* + * Author: commy2 + * + * Get all turret indicies of a vehicle. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * All turret index arrays of the vehicle. E.g: [[0], [0,0]] (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_type", "_config", "_turrets", "_fnc_addTurret"]; + +_type = _this select 0; + +_varName = format ["ACE_CachedTurrets_%1", _type]; +_turrets = + (uiNamespace getVariable _varName); + +if (!isNil "_turrets") exitWith {_turrets}; + +_config = configFile >> "CfgVehicles" >> _type; + +_turrets = []; +_fnc_addTurret = { + private ["_config", "_path", "_count", "_offset", "_index", "_path2", "_config2"]; + + _config = _this select 0; + _path = _this select 1; + + _config = _config >> "Turrets"; + _count = count _config; + + _offset = 0; + for "_index" from 0 to (_count - 1) do { + _path2 = _path + [_index - _offset]; + _config2 = _config select _index; + + if (isClass _config2) then { + _turrets pushBack _path2; + [_config2, _path2] call _fnc_addTurret; + } else { + _offset = _offset + 1; + }; + }; +}; + +[_config, []] call _fnc_addTurret; + +uiNamespace setVariable [_varName, _turrets]; + +_turrets diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf new file mode 100644 index 0000000000..f4c800a5b0 --- /dev/null +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Get the turret indices of ffv turrets. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_turrets", "_turret", "_config"]; + +_vehicle = _this select 0; + +_turrets = [_vehicle] call FUNC(getTurrets); + +_turret = []; +{ + _config = configFile >> "CfgVehicles" >> _vehicle; + + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if (getNumber (_config >> "isPersonTurret") == 1) then { + _turret pushBack _x; + }; +} forEach _turrets; +_turret diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf new file mode 100644 index 0000000000..ccb16f1102 --- /dev/null +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Get the turret indices of other turrets (not gunner, commander, copilot or ffv). + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Turret index of the vehicles gunner. Empty array means no other turrets. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_turrets", "_turret", "_config"]; + +_vehicle = _this select 0; + +_turrets = [_vehicle] call FUNC(getTurrets); + +_turret = []; +{ + _config = configFile >> "CfgVehicles" >> _vehicle; + + _config = [_config, _x] call FUNC(getTurretConfigPath); + + if ( getNumber (_config >> "isCopilot") != 1 + && {getNumber (_config >> "primaryGunner") != 1} + && {getNumber (_config >> "primaryObserver") != 1} + && {getNumber (_config >> "isPersonTurret") != 1} + ) then { + _turret pushBack _x; + }; +} forEach _turrets; +_turret diff --git a/addons/common/functions/fnc_getUavControlPosition.sqf b/addons/common/functions/fnc_getUavControlPosition.sqf new file mode 100644 index 0000000000..9e255efea3 --- /dev/null +++ b/addons/common/functions/fnc_getUavControlPosition.sqf @@ -0,0 +1,32 @@ +/* +Name: FUNC(getUavControlPosition) + +Author: Pabst Mirror + +Description: + Gets the seat position of a UAV that the unit is activly controlling. + "" - not connected to anything or not activly controling + "DRIVER" + "GUNNER" + +Parameters: + 0: OBJECT - Unit + +Returns: + STRING - Position in the UAV that is currently being controled by the unit. + +Example: + [ACE_Player] call FUNC(getUavControlPosition) +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_uav", "_positionArray", "_playerIndex"]; + +_unit = _this select 0; +_uav = getConnectedUAV _unit; +if (isNull _uav) exitWith {""}; +_positionArray = UAVControl _uav; +_playerIndex = _positionArray find _unit; +if (_playerIndex == -1) exitWith {""}; + +_positionArray select (_playerIndex + 1) diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf new file mode 100644 index 0000000000..e5b0f235e7 --- /dev/null +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -0,0 +1,28 @@ +/* + * Author: commy2 + * + * Get the vehicle cargo positions. Codrivers and ffv positions are not listed. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Vehicle cargo positions. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_cargo", "_codrivers"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> _vehicle; + +_cargo = []; +_codrivers = getArray (_config >> "cargoIsCoDriver"); + +for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { + if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; +}; +_cargo diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf new file mode 100644 index 0000000000..901a40ea2f --- /dev/null +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -0,0 +1,28 @@ +/* + * Author: commy2 + * + * Get the vehicle codriver positions. + * + * Argument: + * 0: Vehicle type (String) + * + * Return value: + * Vehicle codriver positions. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_config", "_cargo", "_codrivers"]; + +_vehicle = _this select 0; + +_config = configFile >> "CfgVehicles" >> _vehicle; + +_cargo = []; +_codrivers = getArray (_config >> "cargoIsCoDriver"); + +for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { + if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; +}; +_cargo diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf new file mode 100644 index 0000000000..bdbeb1cf22 --- /dev/null +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -0,0 +1,37 @@ +/* + * Author: commy2 + * + * Returns array of crew member objects. + * + * Argument: + * 0: Vehicle (Object) + * 1: Slot types. Can contain "driver", "commander", "gunner", "turret", "cargo" and "ffv". Case sensitive (Array) + * + * Return value: + * Crew (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_vehicle", "_types", "_crew"]; + +_vehicle = _this select 0; +_types = _this select 1; + +_crew = []; + +// iterate through all crew members +{ + // this unit is in a ffv position. check if we search for ffv. + if (_x select 4) then { + if ("ffv" in _types) then { + _crew pushBack (_x select 0); + }; + } else { + // otherwise check if we search for that type. toLower, because fullCrew returns "driver" vs. "Turret". + if (toLower (_x select 1) in _types) then { + _crew pushBack (_x select 0); + }; + }; +} forEach fullCrew _vehicle; + +_crew diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf new file mode 100644 index 0000000000..13b94d607d --- /dev/null +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -0,0 +1,26 @@ +/* + * Author: commy2 + * + * Get players weapon direction and slope + * + * Argument: + * 0: Weapon name (String) + * + * Return value: + * 0: Azimuth (Number) + * 1: Inclination or 'slope' (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_weapon", "_direction", "_azimuth", "_inclination"]; + +_weapon = _this select 0; + +_direction = ACE_player weaponDirection _weapon; + +_azimuth = (_direction select 0) atan2 (_direction select 1); +_inclination = asin (_direction select 2); + +if (_azimuth < 0) then {_azimuth = _azimuth + 360}; + +[_azimuth, _inclination] diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf new file mode 100644 index 0000000000..b95a4c389f --- /dev/null +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -0,0 +1,30 @@ +/* + * Author: commy2 + * + * Check what kind of weapon the given class name is. (primary, secondary or handgun) + * + * Argument: + * 0: Class name of the weapon (String) + * + * Return value: + * Slot index of the given class name, 1: primary, 2: secondary, 3: handgun, else: -1 (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_weapon", "_type", "_index"]; + +_weapon = _this select 0; + +_type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); + +_index = 0; +while {!(_type select _index) && {_index < 16}} do { + _index = _index + 1; +}; + +switch (_index) do { + case 0 : {1}; + case 1 : {3}; + case 2 : {2}; + default {-1}; +} diff --git a/addons/common/functions/fnc_getWindDirection.sqf b/addons/common/functions/fnc_getWindDirection.sqf new file mode 100644 index 0000000000..c6618d9958 --- /dev/null +++ b/addons/common/functions/fnc_getWindDirection.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * + * Get the compass direction the wind is blowing from. + * + * Argument: + * None. + * + * Return value: + * Wind direction. (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +switch (round (windDir / 360 * 16)) do { + case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; + case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; + case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; + case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; + case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; + case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; + case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; + case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; + case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; + case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; + case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; + case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; + case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; + case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; + case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; + default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; +}; diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf new file mode 100644 index 0000000000..846aac4712 --- /dev/null +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -0,0 +1,32 @@ +/* + * Author: commy2 + * + * Abhocken! Unit goes kneeling if not prone already and lowers weapon. Try, throw, catch because I'm bored. + * + * Argument: + * 0: Unit (Object) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +try { + if (_unit == vehicle _unit) then { + switch (currentWeapon _unit) do { + case "" : {throw "AmovPknlMstpSnonWnonDnon"}; + case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; + case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; + case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; + case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; + }; + }; +} catch { + if (stance _unit != "PRONE") then { + [_unit, _exception] call FUNC(doAnimation); + }; +}; diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf new file mode 100644 index 0000000000..c7011db943 --- /dev/null +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -0,0 +1,25 @@ +/* + * Author: KoffeinFlummi + * + * Returns the Hadamard Product of two vectors. + * (x hadamard y) = [x1*y1, x2*y2, x3*y3] + * + * Arguments: + * 0: Vector 1 + * 1: Vector 2 + * + * Return Value: + * Hadamard Product + */ +#include "\z\ace\addons\common\script_component.hpp" + +_vector1 = _this select 0; +_vector2 = _this select 1; + +_newVector = []; + +for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do { + _newVector = _newVector + [(_vector1 select _i) * (_vector2 select _i)]; +}; + +_newVector diff --git a/addons/common/functions/fnc_inTransitionAnim.sqf b/addons/common/functions/fnc_inTransitionAnim.sqf new file mode 100644 index 0000000000..8dad063660 --- /dev/null +++ b/addons/common/functions/fnc_inTransitionAnim.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "looped") == 0 diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf new file mode 100644 index 0000000000..79b5f2eff3 --- /dev/null +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -0,0 +1,12 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_value", "_min", "_max"]; + +_array = _this select 0; +_value = _this select 1; + +_min = _array select floor _value; +_max = _array select ceil _value; + +_min + (_max - _min) * (_value % 1) diff --git a/addons/common/functions/fnc_isAutoWind.sqf b/addons/common/functions/fnc_isAutoWind.sqf new file mode 100644 index 0000000000..87099a23e7 --- /dev/null +++ b/addons/common/functions/fnc_isAutoWind.sqf @@ -0,0 +1,14 @@ +/* + * Author: commy2 + * + * Check if wind is set on auto. + * + * Argument: + * None. + * + * Return value: + * This mission has automatic wind? (Bool) + */ +#include "\z\ace\addons\common\script_component.hpp" + +["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf new file mode 100644 index 0000000000..7cc185c773 --- /dev/null +++ b/addons/common/functions/fnc_isEOD.sqf @@ -0,0 +1,27 @@ +/* + Name: FUNC(isEOD) + + Author: Garth de Wet (LH) + + Description: + Checks whether the passed unit is an explosive specialist. + Either through config entry: "canDeactivateMines" + or + unit setVariable ["ACE_isEOD", true] + + Parameters: + 0: OBJECT - Unit to check if is a specialist + + Returns: + BOOLEAN + + Example: + _isSpecialist = [player] call FUNC(isEOD); +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +_unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf new file mode 100644 index 0000000000..fa4d12cef6 --- /dev/null +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -0,0 +1,18 @@ +/* + * Author: marc_book, edited by commy2 + * + * Checks if a unit is an engineer. + * + * Arguments: + * 0: unit to be checked (object) + * + * Return Value: + * Bool: is the unit an engineer? + */ +#include "\z\ace\addons\common\script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +_unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf new file mode 100644 index 0000000000..0b69318f8a --- /dev/null +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -0,0 +1,46 @@ +/* + * Author: commy2 + * + * Check if the unit is in a building. Will return true if the unit is sitting in a bush. + * + * Argument: + * 0: Unit (Object) + * + * Return value: + * Is the unit in a building? (Bool) + */ +#include "\z\ace\addons\common\script_component.hpp" + +#define DISTANCE 10 + +private ["_unit", "_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; + +_unit = _this select 0; + +_position = eyePos _unit; +_positionX = _position select 0; +_positionY = _position select 1; +_positionZ = _position select 2; +_intersections = 0; + +if (lineIntersects [_position, [_positionX, _positionY, _positionZ + DISTANCE]]) then { + _intersections = _intersections + 1; +}; + +if (lineIntersects [_position, [_positionX + DISTANCE, _positionY, _positionZ]]) then { + _intersections = _intersections + 1; +}; + +if (lineIntersects [_position, [_positionX - DISTANCE, _positionY, _positionZ]]) then { + _intersections = _intersections + 1; +}; + +if (lineIntersects [_position, [_positionX, _positionY + DISTANCE, _positionZ]]) then { + _intersections = _intersections + 1; +}; + +if (lineIntersects [_position, [_positionX, _positionY - DISTANCE, _positionZ]]) then { + _intersections = _intersections + 1; +}; + +_intersections > 3 diff --git a/addons/common/functions/fnc_isMedic.sqf b/addons/common/functions/fnc_isMedic.sqf new file mode 100644 index 0000000000..dec244d0c0 --- /dev/null +++ b/addons/common/functions/fnc_isMedic.sqf @@ -0,0 +1,18 @@ +/* + * Author: KoffeinFlummi + * + * Checks if a unit is a medic. + * + * Arguments: + * 0: unit to be checked (object) + * + * Return Value: + * Bool: is unit medic? + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit"]; + +_unit = _this select 0; + +_unit getVariable ["ACE_isMedic", (getNumber(configFile >> "CfgVehicles" >> typeOf _unit >> "attendant") == 1)] diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf new file mode 100644 index 0000000000..05b8484a0c --- /dev/null +++ b/addons/common/functions/fnc_isPlayer.sqf @@ -0,0 +1,15 @@ +/* + * Author: bux578, commy2 + * + * Checks if a unit is a player / curator controlled unit. + * Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine) + * + * Arguments: + * 0: unit to be checked (object) + * + * Return Value: + * Bool: is unit a player? + */ +#include "\z\ace\addons\common\script_component.hpp" + +isPlayer (_this select 0) || {_this select 0 == call FUNC(player)} diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf new file mode 100644 index 0000000000..b467df6e1a --- /dev/null +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 + * + * Check if the unit is in a vehicle and turned out. + * + * Argument: + * 0: Unit, not the vehicle (Object) + * + * Return value: + * Is the unit turned out or not? Will return false if there is no option to turn out in the first place. (Bool) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; + +_unit = _this select 0; +_vehicle = vehicle _unit; +_config = configFile >> "CfgVehicles" >> typeOf _vehicle; +_animation = animationState _unit; + +if (_unit == driver _vehicle) then { + _action = getText (_config >> "driverAction"); + _inAction = getText (_config >> "driverInAction"); +} else { + _turretIndex = [_unit] call FUNC(getTurretIndex); + + _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); + + _action = getText (_config >> "gunnerAction"); + _inAction = getText (_config >> "gunnerInAction"); +}; + +if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false}; + +_animation = toArray _animation; +_animation resize (count toArray _action); +_animation = toString _animation; + +_animation == _action diff --git a/addons/common/functions/fnc_letterToCode.sqf b/addons/common/functions/fnc_letterToCode.sqf new file mode 100644 index 0000000000..d50f6b87df --- /dev/null +++ b/addons/common/functions/fnc_letterToCode.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +[-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/common/functions/fnc_log.sqf b/addons/common/functions/fnc_log.sqf new file mode 100644 index 0000000000..b778269845 --- /dev/null +++ b/addons/common/functions/fnc_log.sqf @@ -0,0 +1,30 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +if ((_this select 0) in (missionNamespace getVariable ["ACE_Debug", []])) then { + private ["_type", "_argument", "_function", "_showInGame"]; + + _this resize 4; + + _type = _this select 0; + _argument = _this select 1; + _function = _this select 2; + _showInGame = _this select 3; + + if (isNil "_function") then { + _function = {_this}; + }; + + if (isNil "_showInGame") then { + _showInGame = true; + }; + + private "_result"; + _result = _argument call _function; + + if (_showInGame) then { + systemChat format ["%1", _result]; + }; + + diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; +}; diff --git a/addons/common/functions/fnc_logControls.sqf b/addons/common/functions/fnc_logControls.sqf new file mode 100644 index 0000000000..39f611aa25 --- /dev/null +++ b/addons/common/functions/fnc_logControls.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_index"]; + +_array = []; + +for "_index" from 0 to 10000 do { + if (str (findDisplay _this displayCtrl _index) != "No control") then { + diag_log text str (findDisplay _this displayCtrl _index); + _array pushBack _index; + }; +}; + +_array; diff --git a/addons/common/functions/fnc_logDisplays.sqf b/addons/common/functions/fnc_logDisplays.sqf new file mode 100644 index 0000000000..2e1bbb4634 --- /dev/null +++ b/addons/common/functions/fnc_logDisplays.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_index"]; + +_array = []; + +for "_index" from 0 to 10000 do { + if (str (findDisplay _index) != "No Display") then { + diag_log text str findDisplay _index; + _array pushBack _index; + }; +}; + +_array; diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf new file mode 100644 index 0000000000..07062a795b --- /dev/null +++ b/addons/common/functions/fnc_map.sqf @@ -0,0 +1,31 @@ +/* + * Author: KoffeinFlummi, commy2 + * + * Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. + * + * Arguments: + * 0: Array to be thingied. + * 1: Code to be applied to every element. + * + * Return Value: + * Final array + * + * Usage: + * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_code"]; + +_array = + _this select 0; +_code = _this select 1; + +if (isNil "_array") exitWith { + diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent]; + [] +}; + +{ + _array set [_forEachIndex, _x call _code]; +} forEach _array; +_array diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf new file mode 100644 index 0000000000..5bb95ec463 --- /dev/null +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -0,0 +1,97 @@ +/* + * Author: KoffeinFlummi + * + * Initializes the check-PBOs module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +_mode = parseNumber (_logic getVariable "Action"); +_checkAll = _logic getVariable ["CheckAll", false]; +_whitelist = call compile (_logic getVariable ["Whitelist", "[]"]); + +if (isNil "_whitelist") then { + _whitelist = []; +}; + +_whitelist = [_whitelist, {toLower _this}] call FUNC(map); + +ACE_Version_CheckAll = _checkAll; +ACE_Version_Whitelist = _whitelist; + +if (!isServer) then { + [_mode, _checkAll, _whitelist] spawn { + _mode = _this select 0; + _checkAll = _this select 1; + _whitelist = _this select 2; + + waitUntil { + sleep 1; + !isNil "ACE_Version_ClientErrors" + }; + + _missingAddon = ACE_Version_ClientErrors select 0; + _missingAddonServer = ACE_Version_ClientErrors select 1; + _oldVersionClient = ACE_Version_ClientErrors select 2; + _oldVersionServer = ACE_Version_ClientErrors select 3; + + // Display error message. + if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { + _text = "[ACE] Version mismatch:

"; + _error = format ["ACE version mismatch: %1: ", profileName]; + + if (_missingAddon) then { + _text = _text + "Detected missing addon on client
"; + _error = _error + "Missing file(s); "; + }; + if (_missingAddonServer) then { + _text = _text + "Detected missing addon on server
"; + _error = _error + "Additional file(s); "; + }; + if (_oldVersionClient) then { + _text = _text + "Detected old client version
"; + _error = _error + "Older version; "; + }; + if (_oldVersionServer) then { + _text = _text + "Detected old server version
"; + _error = _error + "Newer version; "; + }; + + //[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + diag_log text _error; + + _text = composeText [lineBreak, parseText format ["%1", _text]]; + + _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; + _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; + + disableSerialization; + _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; + _ctrlHint ctrlSetStructuredText _text; + + if (_mode == 0) then { + sleep 10; + _rscLayer cutFadeOut 0.2; + }; + + if (_mode == 2) then { + sleep 10; + waitUntil {alive player}; + [player] call FUNC(adminKick); + }; + }; + }; +}; + +diag_log text format ["[ACE]: Check-PBOs Module Initialized. Mode: %1.", _mode]; diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf new file mode 100644 index 0000000000..0eba43a974 --- /dev/null +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -0,0 +1,47 @@ +/* + * Author: KoffeinFlummi + * + * Nothing to see here, move along. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +{ + _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); + if (_hiddenSelections > 0) then { + nul = [_x, _hiddenSelections] spawn { + _vehicle = _this select 0; + _hSCount = _this select 1; + _colors = [ + "#(argb,8,8,3)color(1,0,0,1,co)", + "#(argb,8,8,3)color(1,0.5,0,1,co)", + "#(argb,8,8,3)color(1,1,0,1,co)", + "#(argb,8,8,3)color(0,1,0,1,co)", + "#(argb,8,8,3)color(0,0,1,1,co)", + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", + "#(argb,8,8,3)color(0.5,0,1,1,co)" + ]; + _index = 0; + while {True} do { + for "_i" from 0 to (_hSCount - 1) do { + _vehicle setObjectTexture [_i, (_colors select _index)]; + }; + _index = (_index + 1) % 7; + sleep 0.02; + }; + }; + }; +} count _units; + +diag_log text "[ACE]: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."; diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf new file mode 100644 index 0000000000..325deeff14 --- /dev/null +++ b/addons/common/functions/fnc_monitor.sqf @@ -0,0 +1,11 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +terminate (missionNamespace getVariable [QGVAR(MonitorFnc), scriptNull]); + +GVAR(MonitorFnc) = _this spawn { + waitUntil { + hintSilent str (call _this); + false + }; +}; diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf new file mode 100644 index 0000000000..d0b21b777c --- /dev/null +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Mutes the unit. It won't trigger auto generated chat messages either. + * + * Argument: + * 0: Unit (Object) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_speaker"]; + +_unit = _this select 0; + +if (isNull _unit) exitWith {}; + +_speaker = speaker _unit; +if (_speaker == "ACE_NoVoice") exitWith {}; + +[0, "{(_this select 1) setSpeaker 'ACE_NoVoice'}", _unit, "ACE_Speaker"] call FUNC(execPersistentFnc); + +_unit setVariable ["ACE_OriginalSpeaker", _speaker, true]; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf new file mode 100644 index 0000000000..a95b051249 --- /dev/null +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -0,0 +1,44 @@ +/* + * Author: commy2 + * + * Transforms a number to an array of the correspondending digits. + * + * Argument: + * 0: Number to 'digitize' (Number) + * 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. (Number, optional) + * + * Return value: + * Digits. The maximum count is six digits. (Array) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_number", "_minLength", "_length", "_digits", "_index", "_count"]; + +_number = _this select 0; +_minLength = _this select 1; + +_number = _number min 999999; +_length = floor (log _number + 1); + +if !(isNil "_minLength") then {_length = (_length max _minLength) min 6}; + +_digits = []; + +if (_number < 1) exitWith { + for "_index" from 0 to (_length - 1) do { + _digits set [_index, 0]; + }; + _digits +}; + +while { + _count = count _digits; + _count < _length +} do { + _digit = floor (_number / (10 ^ (_length - _count - 1))); + { + _digit = _digit - _x * (10 ^ (_count - _forEachIndex)); + } forEach _digits; + _digits set [_count, _digit]; +}; +_digits diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf new file mode 100644 index 0000000000..88b457c0d8 --- /dev/null +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Transforms a number to an string of the correspondending digits. + * + * Argument: + * 0: Number to 'digitize' (Number) + * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional) + * + * Return value: + * Digits. The maximum length is six digits. (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_digits", "_count", "_string", "_index"]; + +_digits = _this call FUNC(numberToDigits); + +_count = count _digits; + +_string = ""; +for "_index" from 0 to (_count - 1) do { + _string = _string + str (_digits select _index); +}; +_string diff --git a/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf b/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf new file mode 100644 index 0000000000..b853dcfeeb --- /dev/null +++ b/addons/common/functions/fnc_onLoadRscDisplayChannel.sqf @@ -0,0 +1,24 @@ +/* + Name: FUNC(onLoadRscDisplayChannel) + + Author: Pabst Mirror, commy2 + + Description: + When the RscDisplayChannel is loaded, this will constantly uiNamespace variable "ACE_currentChannel" + with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open. + + Parameters: + 0: DISPLAY - RscDisplayChannel + + Returns: + Nothing +*/ +#include "\z\ace\addons\common\script_component.hpp" + +uiNamespace setVariable ["ACE_ctrlChannel", (_this select 0) displayCtrl 101]; + +["ACE_currentChannel", "onEachFrame", { + if (ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull]) != "") then { + uiNamespace setVariable ["ACE_currentChannel", ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull])]; + }; +}] call BIS_fnc_addStackedEventhandler; diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf new file mode 100644 index 0000000000..feeb223109 --- /dev/null +++ b/addons/common/functions/fnc_owned.sqf @@ -0,0 +1,8 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_object"; + +_object = _this select 0; + +!isNull (_object getVariable ["ACE_isUsedBy", objNull]) diff --git a/addons/common/functions/fnc_player.sqf b/addons/common/functions/fnc_player.sqf new file mode 100644 index 0000000000..7aba5a4c24 --- /dev/null +++ b/addons/common/functions/fnc_player.sqf @@ -0,0 +1,15 @@ +/* + * Author: bux578, commy2 + * + * Returns the player or curator controlled unit. + * Use this in INIT and RESPAWN eh scripts, because ACE_player isn't reset yet. + * + * Arguments: + * NONE. + * + * Return Value: + * Player controlled unit (object) + */ +#include "\z\ace\addons\common\script_component.hpp" + +missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player] diff --git a/addons/common/functions/fnc_playerSide.sqf b/addons/common/functions/fnc_playerSide.sqf new file mode 100644 index 0000000000..e1ee07750f --- /dev/null +++ b/addons/common/functions/fnc_playerSide.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +side group ACE_player diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf new file mode 100644 index 0000000000..59323bc3f3 --- /dev/null +++ b/addons/common/functions/fnc_progressBar.sqf @@ -0,0 +1,61 @@ +/* + * Author: commy2 + * + * Draw progress bar and execute given function if succesful. + * + * Argument: + * 0: Duration of the action (Number) + * 1: Arguments of the callback function (Array) + * 2: Callback function name (String) + * 3: Title of the loading bar (String) + * 4: Name of the function that is called when the action is aborted via ESC (String, optional) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +closeDialog 0; +createDialog QGVAR(ProgressBar_Dialog); + +_this spawn { + _time = _this select 0; + _arguments = _this select 1; + _function = call compile (_this select 2); + _title = _this select 3; + _function2 = call compile (_this select 4); + + disableSerialization; + _ctrlProgressBar = uiNamespace getVariable QGVAR(ctrlProgressBar); + _ctrlProgressBarTitle = uiNamespace getVariable QGVAR(ctrlProgressBarTitle); + + _ctrlProgressBar ctrlSetPosition [ + safezoneX + 0.1 * safezoneW, + safezoneY + 0.2 * safezoneH, + 0.8 * safezoneW, + 0.01 * safezoneH + ]; + _ctrlProgressBar ctrlCommit (_time / accTime); + + _ctrlProgressBarTitle ctrlSetText _title; + //_ctrlProgressBarTitle ctrlSetStructuredText _title; + + _time = time + _time; + waitUntil { + //make sure the progressBar is still open, not just any dialog + (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) || {!alive ACE_player} || {time > _time} + }; + + closeDialog 0; + + _progress = 1; + if (time > _time) then { + _arguments call _function; + } else { + [localize QUOTE(DOUBLES(STR,GVAR(ActionAborted)))] call FUNC(displayTextStructured); + if (!isNil "_function2") then { + _progress = 1 - ((_time - time) / (_this select 0)) max 0 min 1; + _arguments call _function2; + }; + }; +}; diff --git a/addons/common/functions/fnc_queueAnimation.sqf b/addons/common/functions/fnc_queueAnimation.sqf new file mode 100644 index 0000000000..73535e1d54 --- /dev/null +++ b/addons/common/functions/fnc_queueAnimation.sqf @@ -0,0 +1,10 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +terminate (missionNamespace getVariable [QGVAR(waitForAnimationHandle), scriptNull]); + +GVAR(waitForAnimationHandle) = _this spawn { + waitUntil {!([_this select 0] call FUNC(inTransitionAnim))}; + + _this call FUNC(doAnimation); +}; diff --git a/addons/common/functions/fnc_readBooleanParameterFromModule.sqf b/addons/common/functions/fnc_readBooleanParameterFromModule.sqf new file mode 100644 index 0000000000..a4cf2b6bc0 --- /dev/null +++ b/addons/common/functions/fnc_readBooleanParameterFromModule.sqf @@ -0,0 +1,28 @@ +/* + * Author: CAA-Picard + * + * Reads a boolean value from a module, sets de ACE_Parameter. Logs if parameters are missing in the module. + * + * Arguments: + * 0: Module (Object) + * 1: ACE_Parameter name (string) + * 2: Module parameter name (string) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + + private ["_logic", "_parameterName", "_moduleParameterName"]; + +_logic = _this select 0; +_parameterName = _this select 1; +_moduleParameterName = _this select 2; + +// Check if the parameter is defined in the module +if (isNil {_logic getVariable _moduleParameterName}) exitWith { + diag_log text format["[ACE]: Warning in %1 module: %2 parameter is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleParameterName]; +}; + +// Set the parameter +[_parameterName , if (_logic getVariable _moduleParameterName) then {1} else {0}] call FUNC(setParameter); diff --git a/addons/common/functions/fnc_readNumericParameterFromModule.sqf b/addons/common/functions/fnc_readNumericParameterFromModule.sqf new file mode 100644 index 0000000000..cdb2f2a409 --- /dev/null +++ b/addons/common/functions/fnc_readNumericParameterFromModule.sqf @@ -0,0 +1,34 @@ +/* + * Author: CAA-Picard + * + * Reads a numeric value from a module, sets de ACE_Parameter. Logs if parameters are missing in the module. + * + * Arguments: + * 0: Module (Object) + * 1: ACE_Parameter name (string) + * 2: Module parameter name (string) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + + private ["_logic", "_parameterName", "_moduleParameterName", "_value"]; + +_logic = _this select 0; +_parameterName = _this select 1; +_moduleParameterName = _this select 2; + +// Check if the parameter is defined in the module +if (isNil {_logic getVariable _moduleParameterName}) exitWith { + diag_log text format["[ACE]: Warning in %1 module: %2 parameter is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleParameterName] +}; + +// Check if the value is defined as string for backward compatibility +_value = _logic getVariable _moduleParameterName; +if (typeName _value == "STRING") then { + _value = parseNumber _value; +}; + +// Set the parameter +[_parameterName, _value] call FUNC(setParameter); diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf new file mode 100644 index 0000000000..5e5783dcc3 --- /dev/null +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -0,0 +1,50 @@ +/* + * Author: commy2 + * + * Remove an addAction event from a unit. + * + * Argument: + * 0: Unit the action is assigned to (Object) + * 1: Name of the action, e.g. "DefaultAction" (String) + * 2: ID of the action (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_action", "_id", "_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs", "_count"]; + +_unit = _this select 0; +_action = _this select 1; +_id = _this select 2; + +if (_id == -1) exitWith {}; + +_name = format ["ACE_Action_%1", _action]; + +_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; + +_actionID = _actionsVar select 0; +_actions = _actionsVar select 1; + +_currentID = _actions select 0; +_actionIDs = _actions select 1; +_actions = _actions select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []]; +_actions = _actions - [[]]; + +if (count _actions == 0) then { + _unit removeAction _actionID; + _actionID = -1; +}; + +_unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions]], false]; diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf new file mode 100644 index 0000000000..5614752aba --- /dev/null +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -0,0 +1,47 @@ +/* + * Author: commy2 + * + * Remove an addAction event from a unit. + * + * Argument: + * 0: Unit the action is assigned to (Object) + * 1: Name of the action, e.g. "DefaultAction" (String) + * 2: ID of the action (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_action", "_id", "_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; + +_unit = _this select 0; +_action = _this select 1; +_id = _this select 2; + +if (_id == -1) exitWith {}; + +_name = format ["ACE_ActionMenu_%1", _action]; + +_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; + +_currentID = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_action = _actions select _id; +_actionID = _action select 0; +_nameVar = _action select 1; + +missionNamespace setVariable [_nameVar, nil]; + +_actionIDs deleteAt _id; +_actions deleteAt _id; + +_unit removeAction _actionID; + +_unit setVariable [_name, [_currentID, _actionIDs, _actions], false]; diff --git a/addons/common/functions/fnc_removeCameraEventHandler.sqf b/addons/common/functions/fnc_removeCameraEventHandler.sqf new file mode 100644 index 0000000000..66c2382481 --- /dev/null +++ b/addons/common/functions/fnc_removeCameraEventHandler.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Remove a camera view event handler. + * + * Argument: + * 0: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_id = _this select 0; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_CameraMode", [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []];//{} +_actions = _actions - [[]];//[{}] + +missionNamespace setVariable ["ACE_EventHandler_CameraMode", [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_removeCustomEventHandler.sqf b/addons/common/functions/fnc_removeCustomEventHandler.sqf new file mode 100644 index 0000000000..419a349a72 --- /dev/null +++ b/addons/common/functions/fnc_removeCustomEventHandler.sqf @@ -0,0 +1,40 @@ +/* + * Author: commy2 + * + * Remove a custom event handler from an object. + * + * Argument: + * 0: Unit the event handler is assigned to or namespace (Object OR Namespace) + * 1: Name of the event (String) + * 2: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_object", "_type", "_id", "_name", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_object = _this select 0; +_type = _this select 1; +_id = _this select 2; + +_name = format ["ACE_CustomEventHandlers_%1", _type]; + +_actionsVar = _object getVariable [_name, [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []];//{} +_actions = _actions - [[]];//[{}] + +_object setVariable [_name, [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_removeInfoDisplayEventHandler.sqf b/addons/common/functions/fnc_removeInfoDisplayEventHandler.sqf new file mode 100644 index 0000000000..002c75364c --- /dev/null +++ b/addons/common/functions/fnc_removeInfoDisplayEventHandler.sqf @@ -0,0 +1,33 @@ +/* + * Author: commy2 + * + * Remove a unit info type event handler. + * + * Argument: + * 0: Type. Can be "Soldier", "Vehicle", "Aircraft" or "Parachute" (String) + * 1: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_type", "_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_type = format ["ACE_onLoadInfo%1", _this select 0]; +_id = _this select 1; + +_actionsVar = missionNamespace getVariable [_type, [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs deleteAt _id; +_actions deleteAt _id; + +missionNamespace setVariable [_type, [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_removeInventoryDisplayLoadedEventHandler.sqf b/addons/common/functions/fnc_removeInventoryDisplayLoadedEventHandler.sqf new file mode 100644 index 0000000000..64e6263d8b --- /dev/null +++ b/addons/common/functions/fnc_removeInventoryDisplayLoadedEventHandler.sqf @@ -0,0 +1,31 @@ +/* + * Author: commy2 + * + * Remove an inventory display opened handler. + * + * Argument: + * 0: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_id = _this select 0; + +_actionsVar = missionNamespace getVariable ["ACE_onLoadInventory", [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs deleteAt _id; +_actions deleteAt _id; + +missionNamespace setVariable ["ACE_onLoadInventory", [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf new file mode 100644 index 0000000000..aaba83a56c --- /dev/null +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Remove a map marker creation event handler. + * + * Argument: + * 0: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_id = _this select 0; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []];//{} +_actions = _actions - [[]];//[{}] + +missionNamespace setVariable ["ACE_EventHandler_MapMarker", [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf new file mode 100644 index 0000000000..4246360666 --- /dev/null +++ b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Remove a scroll wheel event handler. + * + * Argument: + * 0: ID of the event handler (Number) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; + +_id = _this select 0; + +_actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; + +_currentId = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []];//{} +_actions = _actions - [[]];//[{}] + +missionNamespace setVariable ["ACE_EventHandler_ScrollWheel", [_currentId, _actionIDs, _actions]]; diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf new file mode 100644 index 0000000000..2aaad78c81 --- /dev/null +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -0,0 +1,28 @@ +/* + * Author: commy2 + * + * Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP). + * + * Argument: + * 0: Object (Object) + * + * Return value: + * Nothing. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_respawnVariables"]; + +_unit = _this select 0; + +_respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; + +// yes those +_respawnVariables pushBack "ACE_PersistentFunctions"; + +{ + _unit setVariable [_x, _unit getVariable _x, true]; +} forEach _respawnVariables; + +// fix speaker after respawn +[_unit, format ["{_this setSpeaker '%1'}", speaker _unit], 2] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf new file mode 100644 index 0000000000..f30bf2bc82 --- /dev/null +++ b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf @@ -0,0 +1,39 @@ +/* + * Author: commy2 + * + * Revert a key code to a readible text. + * + * Argument: + * 0: Key code (Number) + * + * Return value: + * What input will result in the given key code? (String) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_keyCode", "_key", "_alt", "_ctrl", "_shft"]; + +_keyCode = _this select 0; + +_key = toString ((toArray keyName floor _keyCode) - [34]); + +_keyCode = round ((_keyCode % 1) * 10); + +switch (_keyCode) do { + case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; + case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; + default { + _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); + + _alt = "1" == toString [_keyCode select 0]; + _ctrl = "1" == toString [_keyCode select 1]; + _shift = "1" == toString [_keyCode select 2]; + + format ["%1%2%3%4", + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, + _key + ] + }; +}; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf new file mode 100644 index 0000000000..29809f4dca --- /dev/null +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -0,0 +1,42 @@ +/* + * Author: CAA-Picard, based on Killzone-Kid code + * + * Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text. + * + * Arguments: + * 0: Source string (String) + * 1: Remove html tags (Bool, optional) + * + * Return Value: + * Sanitized string + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_string", "_removeTags", "_array", "_arrayNew"]; + +_string = _this select 0; +_removeTags = _this select 1; +if (isNil "_removeTags") then {_removeTags = false}; + +_array = toArray _string; + +_arrayNew = []; +{ + switch _x do { + case 60 : { + _arrayNew = if (_removeTags) then {_arrayNew + toArray "<";} else {_arrayNew + [_x];}; + }; + case 62 : { + _arrayNew = if (_removeTags) then {_arrayNew + toArray ">";} else {_arrayNew + [_x];}; + }; + case 34 : { + }; + case 39 : { + }; + default { + _arrayNew = _arrayNew + [_x]; + }; + }; +} forEach _array; + +toString _arrayNew diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf new file mode 100644 index 0000000000..fedeb4fe88 --- /dev/null +++ b/addons/common/functions/fnc_serverLog.sqf @@ -0,0 +1,8 @@ +// by CAA-Picard +#include "\z\ace\addons\common\script_component.hpp" + +if (isServer) then { + diag_log _this; +} else { + [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); +}; diff --git a/addons/common/functions/fnc_setCaptivityStatus.sqf b/addons/common/functions/fnc_setCaptivityStatus.sqf new file mode 100644 index 0000000000..4c95926960 --- /dev/null +++ b/addons/common/functions/fnc_setCaptivityStatus.sqf @@ -0,0 +1,45 @@ +/* + * Author: commy2 + * + * Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive. + * + * Argument: + * 0: Unit (Object) + * 1: The reason of the captivity (String) + * 2: Is the reason still valid? True for setting this reason, false for removing it (Bool) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_reason", "_status", "_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; + +_unit = _this select 0; +_reason = _this select 1; +_status = _this select 2; + +_captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; + +// register new reason (these reasons are shared publicly, since units can change ownership, but keep their captivity status) +if !(_reason in _captivityReasons) then { + _captivityReasons pushBack _reason; + + ACE_captivityReasons = _captivityReasons; + publicVariable "ACE_captivityReasons"; +}; + +// get reasons why the unit is captive already and update to the new status +_unitCaptivityReasons = [_unit] call FUNC(getCaptivityStatus); + +_captivityReasonsBooleans = []; +{ + _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; +} forEach _captivityReasons; + +_captivityReasonsBooleans set [_captivityReasons find _reason, _status]; + +_bitmask = _captivityReasonsBooleans call FUNC(toBitmask); + +// actually apply the setCaptive command globaly +[[_unit, _bitmask], "{(_this select 0) setCaptive (_this select 1)}", _unit] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf new file mode 100644 index 0000000000..45aa6715ed --- /dev/null +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -0,0 +1,53 @@ +/* +Name: FUNC(setForceWalkStatus) + +Author: Pabst Mirror (from captivity by commy2) + +Description: + Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk. + Unit will force walk until all reasons are removed. + +Parameters: + 0: OBJECT - Unit + 1: STRING - Reason for forcing walking + 2: BOOL - Is the reason still valid. True to force walk, false to remove restriction. + +Returns: + None + +Example: + [ACE_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus) +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_reason", "_status", "_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; + +_unit = _this select 0; +_reason = _this select 1; +_status = _this select 2; + +_forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; + +// register new reason (these reasons are shared publicly, since units can change ownership, but keep their forceWalk status) +if !(_reason in _forceWalkReasons) then { + _forceWalkReasons pushBack _reason; + ACE_forceWalkReasons = _forceWalkReasons; + publicVariable "ACE_forceWalkReasons"; +}; + +// get reasons why the unit is forceWalking already and update to the new status +_unitForceWalkReasons = [_unit] call FUNC(getForceWalkStatus); + +_forceWalkReasonsBooleans = []; +{ + _forceWalkReasonsBooleans set [_forEachIndex, (_forceWalkReasons select _forEachIndex) in _unitForceWalkReasons]; +} forEach _forceWalkReasons; + +_forceWalkReasonsBooleans set [_forceWalkReasons find _reason, _status]; + +_bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); + +_unit setVariable ["ACE_forceWalkStatusNumber", _bitmaskNumber, true]; + +// actually apply the forceWalk command globaly +[[_unit], QUOTE(FUNC(applyForceWalkStatus)), _unit] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_setKeyDefault.sqf b/addons/common/functions/fnc_setKeyDefault.sqf new file mode 100644 index 0000000000..210e18e1c7 --- /dev/null +++ b/addons/common/functions/fnc_setKeyDefault.sqf @@ -0,0 +1,67 @@ +/* + * Author: commy2 + * + * Set all keys from the 'GVAR(Default_Keys)' base class that are missing in the current user profile. + * + * Argument: + * 1: Overwrite existing key binds? (Bool) + * + * Return value: + * None. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_overwrite", "_saveProfile", "_config", "_count", "_index", "_configFile", "_name", "_key", "_shft", "_ctrl", "_alt", "_keyCode", "_state"]; + +_overwrite = _this select 0; + +_saveProfile = false; + +_config = configFile >> QGVAR(Default_Keys); +_count = count _config; + +for "_index" from 0 to (_count - 1) do { + _configFile = _config select _index; + _name = format ["ACE_Key_%1", configName _configFile]; + _key = profileNamespace getVariable _name; + + if (isNil "_key" || {_overwrite}) then { + _key = getNumber (_configFile >> "Key"); + _shft = getNumber (_configFile >> "Shift") == 1; + _ctrl = getNumber (_configFile >> "Control") == 1; + _alt = getNumber (_configFile >> "Alt") == 1; + + _keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); + + profileNamespace setVariable [_name, _keyCode]; + _saveProfile = true; + }; +}; + +_config = configFile >> QGVAR(Options); +_count = count _config; + +for "_index" from 0 to (_count - 1) do { + _configFile = _config select _index; + _name = format ["ACE_%1", configName _configFile]; + _state = profileNamespace getVariable _name; + + if (isNil "_state" || {_overwrite}) then { + _state = getNumber (_configFile >> "default") == 1; + + profileNamespace setVariable [_name, _state]; + _saveProfile = true; + }; +}; + +if (_overwrite) then { + saveProfileNamespace; + diag_log text "[ACE]: Profile settings overwritten."; +} else { + if (_saveProfile) then { + saveProfileNamespace; + diag_log text "[ACE]: Encountered missing variable in profile namespace. Profile saved."; + } else { + diag_log text "[ACE]: No missing variables encountered in profile namespace."; + }; +}; diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf new file mode 100644 index 0000000000..3dfe18650a --- /dev/null +++ b/addons/common/functions/fnc_setName.sqf @@ -0,0 +1,26 @@ +/* + * Author: commy2 + * + * Sets the name variable of the object. Used to prevent issues with the name command. + * + * Argument: + * 0: Object (Object) + * + * Return value: + * Nothing. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_name"]; + +_unit = _this select 0; + +if (isNull _unit || {!alive _unit}) exitWith {}; + +if (_unit isKindOf "CAManBase") then { + _name = [name _unit, true] call FUNC(sanitizeString); + + //if (_name != _unit getVariable ["ACE_Name", ""]) then { + _unit setVariable ["ACE_Name", _name, true]; + //}; +}; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf new file mode 100644 index 0000000000..8ecccd9d71 --- /dev/null +++ b/addons/common/functions/fnc_setParameter.sqf @@ -0,0 +1,28 @@ +/* + * Author: CAA-Picard + * + * Sets the value of an ACE_Parameter and makes it public. + * + * Arguments: + * 0: Parameter name (string) + * 1: Value + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + + private ["_name", "_value"]; + +_name = _this select 0; +_value = _this select 1; + +// Hack to keep backward compatibility for the moment +if ((typeName (missionNamespace getVariable _name)) == "BOOL") then { + if ((typeName _value) == "SCALAR") then { + _value = _value > 0; + }; +}; + +missionNamespace setVariable [_name, _value]; +publicVariable _name; diff --git a/addons/common/functions/fnc_setPitchBankYaw.sqf b/addons/common/functions/fnc_setPitchBankYaw.sqf new file mode 100644 index 0000000000..8e8696d2b9 --- /dev/null +++ b/addons/common/functions/fnc_setPitchBankYaw.sqf @@ -0,0 +1,55 @@ +/* + * Taken From: + * https://community.bistudio.com/wiki/BIS_fnc_setPitchBank + * Edited By: + * KoffeinFlummi + * + * Arguments: + * 0: Unit/Vehicle + * 1: Pitch (degrees) + * 2: Yaw (degrees) + * 3: Bank (degrees) + * + * Return Value: + * None + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_object", "_aroundX", "_aroundY", "_aroundZ", "_dirX", "_dirY", "_dirZ", "_upX", "_upY", "_upZ", "_dir", "_up", "_dirXTemp", "_upXTemp"]; + +_object = _this select 0; +_aroundX = _this select 1; +_aroundY = _this select 2; +_aroundZ = (360 - (_this select 3)) - 360; + +_dirX = 0; +_dirY = 1; +_dirZ = 0; +_upX = 0; +_upY = 0; +_upZ = 1; +if (_aroundX != 0) then { + _dirY = cos _aroundX; + _dirZ = sin _aroundX; + _upY = -sin _aroundX; + _upZ = cos _aroundX; +}; +if (_aroundY != 0) then { + _dirX = _dirZ * sin _aroundY; + _dirZ = _dirZ * cos _aroundY; + _upX = _upZ * sin _aroundY; + _upZ = _upZ * cos _aroundY; +}; +if (_aroundZ != 0) then { + _dirXTemp = _dirX; + _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); + _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); + _upXTemp = _upX; + _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); + _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); +}; + +_dir = [_dirX,_dirY,_dirZ]; +_up = [_upX,_upY,_upZ]; + +_object setVectorDirAndUp [_dir,_up]; diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf new file mode 100644 index 0000000000..6f932079c5 --- /dev/null +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value. + * + * Argument: + * 0: Object (Object) + * 1: Variable name (String) + * 2: Any value (Anything) + * + * Return value: + * Nothing. + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_varName", "_value", "_respawnVariables"]; + +_unit = _this select 0; +_varName = _this select 1; +_value = _this select 2; + +_respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; + +if !(_varName in _respawnVariables) then { + _respawnVariables pushBack _varName; + _unit setVariable ["ACE_respawnVariables", _respawnVariables, true]; +}; + +_unit setVariable [_varName, _value, true]; diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf new file mode 100644 index 0000000000..3510cdc93f --- /dev/null +++ b/addons/common/functions/fnc_showUser.sqf @@ -0,0 +1,10 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private "_object"; + +GVAR(Debug_Object) = _this select 0; + +onEachFrame { + hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); +}; diff --git a/addons/common/functions/fnc_stringToColoredText.sqf b/addons/common/functions/fnc_stringToColoredText.sqf new file mode 100644 index 0000000000..90a8912f49 --- /dev/null +++ b/addons/common/functions/fnc_stringToColoredText.sqf @@ -0,0 +1,28 @@ +/* + * Author: commy2 + * + * Create a centered, colored text. + * + * Argument: + * 0: Text (Anything) + * 2: Color (Array) + * + * Return value: + * Text + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_string", "_color"]; + +_string = format ["%1", _this select 0]; +_color = _this select 1; + +_color = ( + [255 * (_color select 0), 2] call FUNC(toHex) +) + ( + [255 * (_color select 1), 2] call FUNC(toHex) +) + ( + [255 * (_color select 2), 2] call FUNC(toHex) +); + +parseText format ["%1", _string, _color]; diff --git a/addons/common/functions/fnc_subString.sqf b/addons/common/functions/fnc_subString.sqf new file mode 100644 index 0000000000..bf3cfa0156 --- /dev/null +++ b/addons/common/functions/fnc_subString.sqf @@ -0,0 +1,28 @@ +/* + * Author: KoffeinFlummi + * + * Returns a fraction of the given string, starting at a given index, with a given length. + * + * Arguments: + * 0: Source string + * 1: Starting index of new string + * 2: Length of the new string + * + * Return Value: + * String when successfull / False when not + */ +#include "\z\ace\addons\common\script_component.hpp" + +_string = _this select 0; +_index = _this select 1; +_length = _this select 2; + +_array = toArray _string; +if (_index < 0 or _length < 0 or _index + _length > (count _array) + 1) exitWith {false}; + +_arrayNew = []; +for "_i" from _index to (_index + _length - 1) do { + _arrayNew = _arrayNew + [(_array select _i)]; +}; + +toString _arrayNew diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf new file mode 100644 index 0000000000..0bfaf399ac --- /dev/null +++ b/addons/common/functions/fnc_toBin.sqf @@ -0,0 +1,38 @@ +/* +Author: commy2 + +Description: +Converts number to binary number + +Arguments: +A number + +Return Value: +A binary number, String +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_number", "_minLength", "_sign", "_bin", "_rest"]; + +_number = _this select 0; +_minLength = _this select 1; + +if (isNil "_minLength") then {_minLength = 1}; + +_sign = ["", "-"] select (_number < 0); + +_number = round abs _number; +_bin = ["", "0"] select (_number == 0); + +while {_number > 0} do { + _rest = str (_number mod 2); + _number = floor (_number / 2); + + _bin = _rest + _bin; +}; + +while {count toArray _bin < _minLength} do { + _bin = "0" + _bin; +}; + +_sign + _bin diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf new file mode 100644 index 0000000000..c628700645 --- /dev/null +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -0,0 +1,23 @@ +/* + * Author: commy2 + * + * Convert an array of booleans into a number. + * + * Argument: + * 0: Booleans (Array of Booleans) + * + * Return value: + * Bitmask (Number) + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_array", "_result"]; + +_array = _this; + +_result = 0; +{ + if (_x) then {_result = _result + 2 ^ _forEachIndex}; +} forEach _array; + +_result diff --git a/addons/common/functions/fnc_toHex.sqf b/addons/common/functions/fnc_toHex.sqf new file mode 100644 index 0000000000..521cf1ddce --- /dev/null +++ b/addons/common/functions/fnc_toHex.sqf @@ -0,0 +1,47 @@ +/* +Author: commy2 + +Description: +Converts number to hexadecimal number + +Arguments: +A number + +Return Value: +A hexadecimal number, String +*/ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_number", "_minLength", "_sign", "_hex", "_rest"]; + +_number = _this select 0; +_minLength = _this select 1; + +if (isNil "_minLength") then {_minLength = 1}; + +_sign = ["", "-"] select (_number < 0); + +_number = round abs _number; +_hex = ["", "0"] select (_number == 0); + +while {_number > 0} do { + _rest = _number mod 16; + _rest = switch _rest do { + case 10 : {"A"}; + case 11 : {"B"}; + case 12 : {"C"}; + case 13 : {"D"}; + case 14 : {"E"}; + case 15 : {"F"}; + default {str _rest}; + }; + _number = floor (_number / 16); + + _hex = _rest + _hex; +}; + +while {count toArray _hex < _minLength} do { + _hex = "0" + _hex; +}; + +_sign + _hex diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf new file mode 100644 index 0000000000..c9c0169b9d --- /dev/null +++ b/addons/common/functions/fnc_toNumber.sqf @@ -0,0 +1,25 @@ +/* + Name: FUNC(toNumber) + + Author(s): + Garth de Wet (LH) + + Description: + Takes a string/number and returns the number. + + Parameters: + 0: TYPE - Value to attempt to convert to number or if number simply return number. + + Returns: + NUMBER + + Example: + _number = ["102"] call FUNC(toNumber); +*/ +#include "\z\ace\addons\common\script_component.hpp" + +if (typeName (_this select 0) == "SCALAR") exitWith { + (_this select 0) +}; + +(parseNumber (_this select 0)) \ No newline at end of file diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf new file mode 100644 index 0000000000..ed8cff1032 --- /dev/null +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -0,0 +1,23 @@ +/* + * Author: commy2 + * + * Unmutes the unit. + * + * Argument: + * 0: Unit (Object) + * + * Return value: + * Nothing + */ +#include "\z\ace\addons\common\script_component.hpp" + +private ["_unit", "_speaker"]; + +_unit = _this select 0; + +if (isNull _unit) exitWith {}; + +_speaker = _unit getVariable ["ACE_OriginalSpeaker", ""]; +if (_speaker == "") exitWith {}; + +[0, format ["{(_this select 1) setSpeaker '%1'}", _speaker], _unit, "ACE_Speaker"] call FUNC(execPersistentFnc); diff --git a/addons/common/functions/script_component.hpp b/addons/common/functions/script_component.hpp new file mode 100644 index 0000000000..23da62b05c --- /dev/null +++ b/addons/common/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/script_component.hpp b/addons/common/script_component.hpp new file mode 100644 index 0000000000..1dcd2b379c --- /dev/null +++ b/addons/common/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT common +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL + +#ifdef DEBUG_ENABLED_COMMON + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_COMMON + #define DEBUG_SETTINGS DEBUG_ENABLED_COMMON +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/common/script_macros.hpp b/addons/common/script_macros.hpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/common/scripts/KeyInput/initCanInteractFunction.sqf b/addons/common/scripts/KeyInput/initCanInteractFunction.sqf new file mode 100644 index 0000000000..ed99ad18c8 --- /dev/null +++ b/addons/common/scripts/KeyInput/initCanInteractFunction.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"]; + +_function = "private '_exceptions'; _exceptions = _this; alive ACE_player"; + +_configFile = configFile >> QGVAR(canInteractConditions); +_count = count _configFile; + +for "_index" from 0 to (_count -1) do { + _config = _configFile select _index; + _configName = configName _config; + + _condition = getText (_config >> "condition"); + + _function = _function + format ["&& {%1 || {'%2' in _exceptions}}", _condition, _configName]; +}; + +GVAR(canInteract) = compileFinal _function; diff --git a/addons/common/scripts/KeyInput/initKeys.sqf b/addons/common/scripts/KeyInput/initKeys.sqf new file mode 100644 index 0000000000..c4a88ede68 --- /dev/null +++ b/addons/common/scripts/KeyInput/initKeys.sqf @@ -0,0 +1,72 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +_config = configFile >> QGVAR(Default_Keys); +_count = count _config; + +_header = format ["_keyCode = [_this select 1, _this select 2, _this select 3, _this select 4] call %1; _keyIndex = floor _keyCode; if (_keyIndex == 0) exitWith {false}; if (!(profileNamespace getVariable ['ACE_enableNumberHotkeys', true]) && {_keyIndex < 12} && {_keyIndex > 1} && {_keyCode mod 1 == 0}) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player; _isInput = false;", QUOTE(FUNC(convertKeyCode))]; +_headerUp = format ["_keyCode = _this select 1; _keyIndex = _keyCode; if (_keyIndex == 0) exitWith {false}; _time = time; _player = ACE_player; _vehicle = vehicle _player;"]; + +_handleDoubleTap = QUOTE(if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8};); +_handleHold = QUOTE(_allowHold = false; _disallowHold = false; if (GVAR(keyStates) select _keyIndex > 1) exitWith {false}; if (GVAR(keyStates) select _keyIndex > 0) then {_keyCode = _keyIndex + 0.9};); +_handleHoldUp = QUOTE(if (GVAR(keyStates) select _keyIndex > 1) then {_keyCode = _keyIndex + 0.9};); + +_debug = format ["if (!isNil 'ACE_Debug' && {'Keys' in ACE_Debug}) then {systemChat (str _keyCode + ' ' + str (%1 select _keyIndex))};", QGVAR(keyStates)]; + +_onKeyDown = "" + _debug; +_onKeyUp = "" + _debug; + +for "_index" from 0 to (_count - 1) do { + _configFile = _config select _index; + + _keyName = configName _configFile; + _condition = getText (_configFile >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _statement = getText (_configFile >> "statement"); + + _exceptions = getArray (_configFile >> "exceptions"); + _canInteract = format ["%1 call GVAR(canInteract)", _exceptions]; + + _conditionName = format ["ACE_Key_%1_Condition", _keyName]; + _statementName = format ["ACE_Key_%1_Statement", _keyName]; + missionNamespace setVariable [_conditionName, compileFinal _condition]; + missionNamespace setVariable [_statementName, compileFinal _statement]; + + _handleHolding = ["_disallowHold = true;", "_allowHold = true;"] select (getNumber (_configFile >> "allowHolding") == 1); + + if (_statement != "") then { + _entry = format ["if (_keyCode == profileNamespace getVariable 'ACE_Key_%1' && {call %2}) then {if (%4) then {call %3};%5 _isInput = true;};", _keyName, _conditionName, _statementName, _canInteract, _handleHolding]; + _onKeyDown = _onKeyDown + _entry; + }; + + _condition = getText (_configFile >> "conditionUp"); + if (_condition == "") then {_condition = "true"}; + + _statement = getText (_configFile >> "statementUp"); + + _conditionName = format ["ACE_Key_%1_ConditionUp", _keyName]; + _statementName = format ["ACE_Key_%1_StatementUp", _keyName]; + missionNamespace setVariable [_conditionName, compileFinal _condition]; + missionNamespace setVariable [_statementName, compileFinal _statement]; + + if (_statement != "") then { + _entry = format ["if (_keyCode == floor (profileNamespace getVariable 'ACE_Key_%1') && {call %2}) then {call %3; _isInput = true;};", _keyName, _conditionName, _statementName]; + _onKeyUp = _onKeyUp + _entry; + }; +}; + +_halt = format ["if (!(_allowHold) || {_disallowHold}) then {%1 set [_keyIndex, (%1 select _keyIndex) + 1]; %2 set [_keyIndex, _time];};", QGVAR(keyStates), QGVAR(keyTimes)]; +_haltUp = format ["%1 set [_keyIndex, 0];", QGVAR(keyStates)]; + +//_return = "_isInput"; +_return = "if (profileNamespace getVariable ['ACE_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_isInput}"; + +_repeat = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyDown + _return + "};"; +_repeatUp = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyUp + "};"; + +_onKeyDown = _header + _handleDoubleTap + _handleHold + _onKeyDown + _halt + _repeat + _return; +_onKeyUp = _headerUp + _onKeyUp + _haltUp + _repeatUp; //_headerUp + _handleHoldUp + _onKeyUp + _haltUp + _repeatUp; + +GVAR(onKeyDown) = compileFinal _onKeyDown; +GVAR(onKeyUp) = compileFinal _onKeyUp; diff --git a/addons/common/scripts/KeyInput/initScrollWheel.sqf b/addons/common/scripts/KeyInput/initScrollWheel.sqf new file mode 100644 index 0000000000..a55ebafa43 --- /dev/null +++ b/addons/common/scripts/KeyInput/initScrollWheel.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +GVAR(ScrollWheelFrame) = diag_frameno; + +GVAR(onScrollWheel) = { + _scroll = _this select 1; + + if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; + GVAR(ScrollWheelFrame) = diag_frameno; + + { + [_scroll] call _x; + } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); +}; diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf new file mode 100644 index 0000000000..d89200c3e1 --- /dev/null +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -0,0 +1,190 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +sleep 1; //wait for module + +_files = []; + +if (missionNamespace getVariable ["ACE_Version_CheckAll", false]) then { + { + if (toLower _x find "a3_" != 0 && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then { + _files pushBack _x; + }; + } forEach activatedAddons; +} else { + { + if (toLower _x find "ACE_" == 0) then { + _files pushBack _x; + }; + } forEach activatedAddons; +}; + +_versionMain = parseNumber getText (configFile >> "CfgPatches" >> "ACE_Common" >> "version"); + +_versions = []; +{ + _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); + _versions set [_forEachIndex, _version]; +} forEach _files; + +if (isServer) then { + diag_log text format ["[ACE] Server: ACE_Common is Version %1.", _versionMain]; + + { + if (toLower _x find "ACE_" == 0) then {// + _version = _versions select _forEachIndex; + if (_version != _versionMain) then { + diag_log text format ["[ACE] Server: %1 is Version %2.", _x, _version]; + }; + }; + } forEach _files; + + ACE_Version_ServerVersions = [_files, _versions]; + publicVariable "ACE_Version_ServerVersions"; +} else { + diag_log text format ["[ACE] Client: ACE_Common is Version %1.", _versionMain]; + + { + if (toLower _x find "ACE_" == 0) then {// + _version = _versions select _forEachIndex; + if (_version != _versionMain) then { + diag_log text format ["[ACE] Client: %1 is Version %2.", _x, _version]; + }; + }; + } forEach _files; + + ACE_Version_ClientVersions = [_files, _versions]; +}; + +// Begin client version check +if (!isServer) then { + // Wait for server to send the servers files and version numbers + waitUntil { + sleep 1; + !isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"} + }; + + _client = profileName; + + _files = ACE_Version_ClientVersions select 0; + _versions = ACE_Version_ClientVersions select 1; + + _serverFiles = ACE_Version_ServerVersions select 0; + _serverVersions = ACE_Version_ServerVersions select 1; + + // Compare client and server files and versions + _missingAddons = []; + _oldVersionsClient = []; + _oldVersionsServer = []; + { + _serverVersion = _serverVersions select _forEachIndex; + + _index = _files find _x; + if (_index == -1) then { + _missingAddons pushBack _x; + } else { + + _clientVersion = _versions select _index; + + if (_clientVersion < _serverVersion) then { + _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; + }; + + if (_clientVersion > _serverVersion) then { + _oldVersionsServer pushBack [_x, _clientVersion, _serverVersion]; + }; + }; + } forEach _serverFiles; + + // find client files which the server doesn't have + _missingAddonsServer = []; + { + _index = _serverFiles find _x; + if (_index == -1) then { + _missingAddonsServer pushBack _x; + } + } forEach _files; + + // display and log error messages + _fnc_cutComma = { + _string = _this; + _string = toArray _string; + + _count = count _string; + _string set [_count - 2, toArray "." select 0]; + _string set [_count - 1, -1]; + _string = _string - [-1]; + + toString _string; + }; + + _missingAddon = false; + if (count _missingAddons > 0) then { + _missingAddon = true; + + _error = format ["[ACE] %1: ERROR missing addon(s): ", _client]; + { + _error = _error + format ["%1, ", _x]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _missingAddons; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + _missingAddonServer = false; + if (count _missingAddonsServer > 0) then { + _missingAddonServer = true; + + _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client]; + { + _error = _error + format ["%1, ", _x]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _missingAddonsServer; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + _oldVersionClient = false; + if (count _oldVersionsClient > 0) then { + _oldVersionClient = true; + + _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client]; + { + _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _oldVersionsClient; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + _oldVersionServer = false; + if (count _oldVersionsServer > 0) then { + _oldVersionServer = true; + + _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; + { + _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _oldVersionsServer; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; +}; diff --git a/addons/common/scripts/assignedItemFix.sqf b/addons/common/scripts/assignedItemFix.sqf new file mode 100644 index 0000000000..77a1c410df --- /dev/null +++ b/addons/common/scripts/assignedItemFix.sqf @@ -0,0 +1,19 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +if (isNil "ACE_itemFix") then { + ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; + ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; + ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; + ACE_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; + ACE_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; + + ACE_itemFix = ["ACE_itemFix", "onEachFrame", { + _items = assignedItems ACE_player; + showMap (ACE_isMapEnabled && {"ItemMap" in _items}); + showCompass (ACE_isCompassEnabled && {"ItemCompass" in _items}); + showWatch (ACE_isWatchEnabled && {"ItemWatch" in _items}); + //showRadio (ACE_isRadioEnabled && {"ItemRadio" in _items}); + showGPS (ACE_isGPSEnabled && {"ItemGPS" in _items || {cameraOn == getConnectedUAV ACE_player}}); //If player is activly controling a UAV, showGPS controls showing the map (m key) + }] call BIS_fnc_addStackedEventHandler; +}; diff --git a/addons/common/scripts/closeMenu.sqf b/addons/common/scripts/closeMenu.sqf new file mode 100644 index 0000000000..88c8db10a0 --- /dev/null +++ b/addons/common/scripts/closeMenu.sqf @@ -0,0 +1,5 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +closeDialog 0; +[localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); diff --git a/addons/common/scripts/editKey.sqf b/addons/common/scripts/editKey.sqf new file mode 100644 index 0000000000..0f7518c758 --- /dev/null +++ b/addons/common/scripts/editKey.sqf @@ -0,0 +1,113 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +#define GRAY [0.25, 0.25, 0.25, 1] +#define WHITE [1, 1, 1, 1] +#define OFFSET_1 100 +#define OFFSET_2 200 + +waitUntil {isNil QGVAR(keyNewTemp)}; +GVAR(keyNewTemp) = []; + +GVAR(keySet) = 0; +_index = count GVAR(keyNew); + +disableSerialization; +_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); +_ctrlMenuDialog = _dlgMenuDialog displayCtrl (OFFSET_2 + (_this select 0)); +_action = GVAR(keyNames) select (_this select 0); +_displayName = getText (configFile >> QGVAR(Default_Keys) >> _action >> "displayName"); + +_keyCode = profileNamespace getVariable [format ["ACE_Key_%1", _action], 0];// +for "_index1" from 0 to (count GVAR(keyNew) - 1) do { + if (_action == (GVAR(keyNew) select _index1) select 0) then { + _keyCode = (GVAR(keyNew) select _index1) select 1; + } +}; +(_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized));//""; +/*(_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; +(_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; +(_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY;*/ + +for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow true}; +for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable false}; + +(_dlgMenuDialog displayCtrl 30) ctrlSetText _displayName; + +GVAR(keysetDefault) = compile format [ + "_configFile = configFile >> 'GVAR(Default_Keys)' >> '%1'; + _key = getNumber (_configFile >> 'Key'); + _shft = getNumber (_configFile >> 'Shift') == 1; + _ctrl = getNumber (_configFile >> 'Control') == 1; + _alt = getNumber (_configFile >> 'Alt') == 1; + + _keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); + + GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode];", + _action +]; + +_description = ctrlText _ctrlMenuDialog; +//_ctrlMenuDialog ctrlSetText ".."; + +_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this call GVAR(keyInput)"]; +_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this call GVAR(keyRelease)"]; + +waitUntil { + if (count GVAR(keyNewTemp) > 0) then { + _key = GVAR(keyNewTemp) select 0; + _keyModifier = GVAR(keyNewTemp) select 1; + //_keyCode = round (10 * ((GVAR(keyNewTemp) select 2) % 1)); + _keyCode = GVAR(keyNewTemp) select 2; + + (_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized)); + + /*_key = toString (toArray (keyName _key) - [34]); + + switch (_keyCode) do { + case 8 : { + (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]; + + (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; + (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; + (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; + }; + case 9 : { + (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]; + + (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; + (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; + (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; + }; + default { + (_dlgMenuDialog displayCtrl 24) ctrlSetText _key; + + (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 0)); + (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 1)); + (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 2)); + }; + };*/ + }; + GVAR(keySet) != 0 || + {!dialog} +}; + +for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable true}; +for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow false}; + +_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; +_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; + +if (GVAR(keySet) == 1 && {count GVAR(keyNewTemp) > 0}) then { + _keyCode = GVAR(keyNewTemp) select 2; + _description = [_keyCode] call FUNC(revertKeyCodeLocalized); + _ctrlMenuDialog ctrlSetText _description; + + GVAR(keyNew) set [_index, [_action, _keyCode]]; +} else { + _ctrlMenuDialog ctrlSetText _description; +}; + +GVAR(keySet) = -1; +GVAR(keyNewTemp) = nil; +GVAR(keysetDefault) = nil; diff --git a/addons/common/scripts/keyInput.sqf b/addons/common/scripts/keyInput.sqf new file mode 100644 index 0000000000..eab0e56448 --- /dev/null +++ b/addons/common/scripts/keyInput.sqf @@ -0,0 +1,26 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +#define FORBIDDEN_KEYS [42, 54, 29, 157, 56, 184, 0, 183, 197, 1] + +_key = _this select 1; +_shft = _this select 2; +_ctrl = _this select 3; +_alt =_this select 4; + +if (_key in FORBIDDEN_KEYS) exitWith {true}; + +_keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); + +_keyIndex = floor _keyCode; +_time = time; + +if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8}; +if (GVAR(keyStates) select _keyIndex > 1) exitWith {true}; +if (GVAR(keyStates) select _keyIndex > 0 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.9}; + +GVAR(keyStates) set [_keyIndex, (GVAR(keyStates) select _keyIndex) + 1]; +GVAR(keyTimes) set [_keyIndex, _time]; + +GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode]; +true diff --git a/addons/common/scripts/keyRelease.sqf b/addons/common/scripts/keyRelease.sqf new file mode 100644 index 0000000000..0d5542241d --- /dev/null +++ b/addons/common/scripts/keyRelease.sqf @@ -0,0 +1,6 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +_keyIndex = _this select 1; + +GVAR(keyStates) set [_keyIndex, 0]; diff --git a/addons/common/scripts/nextKeys.sqf b/addons/common/scripts/nextKeys.sqf new file mode 100644 index 0000000000..004c3de992 --- /dev/null +++ b/addons/common/scripts/nextKeys.sqf @@ -0,0 +1,123 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +#define OFFSET_1 100 +#define OFFSET_2 200 +#define OFFSET_3 300 +#define OFFSET_4 400 +#define OFFSET_5 500 + +_config = configFile >> QGVAR(Default_Keys); +_count = count _config; + +_countPages = ceil (_count / 20) + 1; + +GVAR(MenuPage) = GVAR(MenuPage) + ([-1, 1] select _this); + +if (GVAR(MenuPage) == - 1) then {GVAR(MenuPage) = _countPages - 1}; +if (GVAR(MenuPage) > _countPages - 1) then {GVAR(MenuPage) = 0}; + +disableSerialization; +_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); + +(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; + +if (GVAR(MenuPage) == _countPages - 1) then { + for "_index" from OFFSET_1 to (OFFSET_1 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; + for "_index" from OFFSET_2 to (OFFSET_2 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; + + _config = configFile >> QGVAR(Options); + _count = count _config; + + _offset = 0; + + for "_index" from 0 to (_count - 1 min 19) do { + _configFile = _config select _index + _offset; + _configName = configName _configFile; + _displayName = getText (_configFile >> "displayName"); + _state = profileNamespace getVariable format ["ACE_%1", _configName]; + + _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); + _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); + + _control1 ctrlSetText format [QUOTE(PATHTOF(UI\box_%1checked_ca.paa)), ["un", ""] select _state]; + _control2 ctrlSetText _displayName; + + _control1 ctrlShow true; + _control2 ctrlShow true; + _control3 ctrlShow true; + + GVAR(OptionNames) set [_index, _configName]; + }; + + for "_index" from _count to (_count + 19) do { + _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); + _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); + + _control1 ctrlShow false; + _control2 ctrlShow false; + _control3 ctrlShow false; + }; + +} else { + for "_index" from OFFSET_3 to (OFFSET_3 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; + for "_index" from OFFSET_4 to (OFFSET_4 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; + for "_index" from OFFSET_5 to (OFFSET_5 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; + + _offset = 20 * GVAR(MenuPage); + if (GVAR(MenuPage) == _countPages - 2) then { + _count = (_count - 1) % 20 + 1; + }; + + _updateNames = []; + _updateKeys = []; + { + _keyName = _x select 0; + _keyInput = _x select 1; + + _index = _updateNames find _keyName; + if (_index == -1) then {_index = count _updateKeys}; + + _updateNames set [_index, _keyName]; + _updateKeys set [_index, _keyInput]; + } forEach GVAR(keyNew); + + for "_index" from 0 to (_count - 1 min 19) do { + _configFile = _config select _index + _offset; + _keyName = configName _configFile; + _displayName = getText (_configFile >> "displayName"); + _isDisabled = getNumber (_configFile >> "disabled") == 1; + + _indexUpdate = _updateNames find _keyName; + _keyCode = if (_indexUpdate == -1) then { + profileNamespace getVariable format ["ACE_Key_%1", _keyName]; + } else { + _updateKeys select _indexUpdate; + }; + + _description = [_keyCode] call FUNC(revertKeyCodeLocalized); + + _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); + + _control1 ctrlSetText _displayName; + _control2 ctrlSetText _description; + + _control1 ctrlShow true; + _control2 ctrlShow true; + + GVAR(keyNames) set [_index, _keyName]; + }; + + for "_index" from _count to (_count + 19) do { + _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); + + _control1 ctrlShow false; + _control2 ctrlShow false; + }; + + GVAR(keySet) = -1; +}; diff --git a/addons/common/scripts/openMenu.sqf b/addons/common/scripts/openMenu.sqf new file mode 100644 index 0000000000..018c9f8ccb --- /dev/null +++ b/addons/common/scripts/openMenu.sqf @@ -0,0 +1,100 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +#define OFFSET_1 100 +#define OFFSET_2 200 + +closeDialog 0; +createDialog QGVAR(OptionsMenu_Dialog); + +GVAR(keyNew) = []; +GVAR(keySet) = -1; +GVAR(keySave) = 0; +GVAR(keyNames) = []; +GVAR(MenuPage) = 0; +GVAR(OptionNames) = []; +GVAR(OptionNamesNew) = []; +GVAR(OptionStatesNew) = []; + +disableSerialization; +_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); + +_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this select 1 > 1"]; +_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this select 1 > 1"]; + +_config = configFile >> QGVAR(Default_Keys); +_count = count _config; + +_countPages = ceil (_count / 20) + 1; +(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; + +for "_index" from 0 to (_count - 1 min 19) do { + _configFile = _config select _index; + _keyName = configName _configFile; + _displayName = getText (_configFile >> "displayName"); + _isDisabled = getNumber (_configFile >> "disabled") == 1; + + _keyCode = profileNamespace getVariable format ["ACE_Key_%1", _keyName]; + _description = [_keyCode] call FUNC(revertKeyCodeLocalized); + + _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); + + _control1 ctrlSetText _displayName; + _control2 ctrlSetText _description; + + _control1 ctrlShow true; + _control2 ctrlShow true; + + GVAR(keyNames) set [_index, _keyName]; +}; + +for "_index" from _count to 19 do { + _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); + _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); + + _control1 ctrlShow false; + _control2 ctrlShow false; +}; + +waitUntil {!dialog}; + +_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; +_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; + +if (GVAR(keySave) == 1) then { + _count0 = count GVAR(keyNew); + + for "_index" from 0 to (_count0 - 1) do { + _key = GVAR(keyNew) select _index; + _keyName = _key select 0; + _keyCode = _key select 1; + + profileNamespace setVariable [format ["ACE_Key_%1", _keyName], _keyCode]; + }; + + _count1 = count GVAR(OptionNamesNew); + + for "_index" from 0 to (_count1 - 1) do { + _name = GVAR(OptionNamesNew) select _index; + _state = GVAR(OptionStatesNew) select _index; + + profileNamespace setVariable [_name, _state]; + }; + + if (_count0 > 0 || {_count1 > 0}) then { + saveProfileNamespace; + [localize QUOTE(DOUBLES(STR,GVAR(ProfileSaved)))] call FUNC(displayTextStructured); + } else { + [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); + }; +} else { + [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); +}; + +GVAR(keyNewTemp) = nil; +GVAR(keyNames) = nil; +GVAR(MenuPage) = nil; +GVAR(OptionNames) = nil; +GVAR(OptionNamesNew) = nil; +GVAR(OptionStatesNew) = nil; diff --git a/addons/common/scripts/readParameters.sqf b/addons/common/scripts/readParameters.sqf new file mode 100644 index 0000000000..505776abd0 --- /dev/null +++ b/addons/common/scripts/readParameters.sqf @@ -0,0 +1,55 @@ +// by CAA-Picard +#include "\z\ace\addons\common\script_component.hpp" + +// Read ACE_Parameters from config and set them on the mission namespace +_config = configFile >> "ACE_Parameters_Numeric"; +_count = count _config; +for "_index" from 0 to (_count - 1) do { + _x = _config select _index; + + _name = configName _x; + _value = _x call bis_fnc_getcfgdata; + [_name, _value] call FUNC(setParameter); +}; + +_config = configFile >> "ACE_Parameters_Boolean"; +_count = count _config; +for "_index" from 0 to (_count - 1) do { + _x = _config select _index; + + _name = configName _x; + _value = _x call bis_fnc_getcfgdata; + [_name, _value > 0] call FUNC(setParameter); +}; + + +// Read ACE_Parameters from mission and set them on the mission namespace, replacing defaults if necesary +_config = missionConfigFile >> "ACE_Parameters"; +_count = count _config; +for "_index" from 0 to (_count - 1) do { + _x = _config select _index; + + _name = configName _x; + _value = _x call bis_fnc_getcfgdata; + [_name, _value] call FUNC(setParameter); +}; + +_config = missionConfigFile >> "ACE_Parameters_Numeric"; +_count = count _config; +for "_index" from 0 to (_count - 1) do { + _x = _config select _index; + + _name = configName _x; + _value = _x call bis_fnc_getcfgdata; + [_name, _value] call FUNC(setParameter); +}; + +_config = missionConfigFile >> "ACE_Parameters_Boolean"; +_count = count _config; +for "_index" from 0 to (_count - 1) do { + _x = _config select _index; + + _name = configName _x; + _value = _x call bis_fnc_getcfgdata; + [_name, _value > 0] call FUNC(setParameter); +}; diff --git a/addons/common/scripts/toggleState.sqf b/addons/common/scripts/toggleState.sqf new file mode 100644 index 0000000000..3643b00c19 --- /dev/null +++ b/addons/common/scripts/toggleState.sqf @@ -0,0 +1,18 @@ +// by commy2 +#include "\z\ace\addons\common\script_component.hpp" + +_index = _this select 0; + +_name = format ["ACE_%1", GVAR(OptionNames) select _index]; + +_index1 = GVAR(OptionNamesNew) find _name; +_state = if (_index1 == -1) then {_index1 = count GVAR(OptionNamesNew); !(profileNamespace getVariable _name)} else {!(GVAR(OptionStatesNew) select _index1)}; + +disableSerialization; +_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); + +_control = _dlgMenuDialog displayCtrl (300 + _index); +_control ctrlSetText format [QUOTE(PATHTOF(UI\box_%1checked_ca.paa)), ["un", ""] select _state]; + +GVAR(OptionNamesNew) set [_index1, _name]; +GVAR(OptionStatesNew) set [_index1, _state]; diff --git a/addons/core/sounds/AGM_click.wav b/addons/common/sounds/ACE_click.wav similarity index 100% rename from addons/core/sounds/AGM_click.wav rename to addons/common/sounds/ACE_click.wav diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml new file mode 100644 index 0000000000..cf4638c569 --- /dev/null +++ b/addons/common/stringtable.xml @@ -0,0 +1,467 @@ + + + + + + ACE-Team + ACE-Team + ACE-Team + ACE-Team + ACE-Team + ACE-Team + ĐĐ¾Đ¼Đ°Đ½Đ´Đ° ACE + ACE-Team + ACE-Team + ACE-Team + + + Save + Speichern + Guardar + Zapisz + Uložit + Sauvegarder + Đ¡Đ¾Ñ…Ñ€Đ°Đ½Đ¸Ñ‚ÑŒ + Salvar + MentĂ©s + Salva + + + Cancel + Abbrechen + Cancelar + Anuluj + ZruÅ¡it + Annuler + ĐÑ‚Đ¼ĐµĐ½Đ° + Cancelar + MĂ©gse + Annulla + + + ACE Options + ACE Optionen + Opciones ACE + Opcje ACE + ACE NastavenĂ­ + ACE Options + ACE ĐĐ°ÑÑ‚Ñ€Đ¾Đ¹ĐºĐ¸ + Opções do ACE + ACE OpciĂ³k + Opzioni ACE + + + Shift + Umschalt + Shift + Shift + Shift + Shift + Shift + Shift + Shift + Shift + + + Ctrl + Strg + Ctrl + Ctrl + Ctrl + Ctrl + Ctrl + Ctrl + Ctrl + Ctrl + + + Alt + Alt + Alt + Alt + Alt + Alt + Alt + Alt + Alt + Alt + + + Shift right + Umschalt rechts + Shift derecho + Prawy Shift + PravĂ½ Shift + Shift Droite + ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Shift + Shift da Direita + Jobb Shift + Shift destro + + + Ctrl right + Strg rechts + Ctrl derecho + Prawy Ctrl + PravĂ½ Ctrl + Ctrl Droite + ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Ctrl + Ctrl da Direita + Jobb Ctrl + Ctrl destro + + + Alt right + Alt Gr + Alt derecho + Prawy Alt + PravĂ½ Alt + Alt Droite + ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Alt + Alt da Direita + Alt Gr + Alt Gr + + + Default + Standard + Por defecto + DomyÅ›lne + VĂ½chozĂ­ + DĂ©faut + ĐŸĐ¾ ÑƒĐ¼Đ¾Đ»Ñ‡Đ°Đ½Đ¸Ñ + PadrĂ£o + AlapĂ©rtelmezett + Standard + + + None + Keiner + Ninguna + Brak + Å½Ă¡dnĂ½ + Aucun + Đе Đ½Đ°Đ·Đ½Đ°Ñ‡ĐµĐ½Đ¾ + Nenhuma + Semmi + Non assegnato + + + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + 2x %1 + + + Hold %1 + %1 halten + Mantener %1 + Przytrzymać %1 + Držet %1 + Tenir %1 + Đ£Đ´ĐµÑ€Đ¶Đ¸Đ²Đ°Ñ %1 + Segurar %1 + %1 NyomvatartĂ¡sa + Tieni premuto %1 + + + Profile saved + Profil gespeichert + Perfil guardado + Profil zapisany + Profil uložen + Profil sauvegardĂ© + ĐŸÑ€Đ¾Ñ„Đ¸Đ»ÑŒ ÑĐ¾Ñ…Ñ€Đ°Đ½ĐµĐ½ + Perfil salvo + Profil elmentve + Profilo salvato + + + Profile not saved + Profil nicht gespeichert + Perfil no guardado + Profil niezapisany + Profil neuložen + Profil non sauvegardĂ© + ĐŸÑ€Đ¾Ñ„Đ¸Đ»ÑŒ Đ½Đµ ÑĐ¾Ñ…Ñ€Đ°Đ½ĐµĐ½ + Perfil nĂ£o salvo + A profil nincs elmentve + Profilo non salvato + + + + N + N + N + N + S + N + Đ¡ + N + É + N + + + NNE + NNO + NNE + NNE + SSV + NNE + Đ¡Đ¡Đ’ + NNE + ÉÉK + NNE + + + NE + NO + NE + NE + SV + NE + Đ¡Đ’ + NE + ÉK + NE + + + ENE + ONO + ENE + ENE + VSV + ENE + Đ’Đ¡Đ’ + LNE + KÉK + ENE + + + E + O + E + E + V + E + Đ’ + L + K + E + + + ESE + OSO + ESE + ESE + VJV + ESE + ВЮВ + LSE + KDK + ESE + + + SE + SO + SE + SE + JV + SE + ЮВ + SE + DK + SE + + + SSE + SSO + SSE + SSE + JJV + SSE + ЮЮВ + SSE + DDK + SSE + + + S + S + S + S + J + S + Đ® + S + D + S + + + SSW + SSW + SSO + SSW + JJZ + SSO + ЮЮЗ + SSO + DDNy + SSO + + + SW + SW + SO + SW + JZ + SO + ЮЗ + SO + DNy + SO + + + WSW + WSW + OSO + WSW + ZJZ + OSO + ЗЮЗ + OSO + NyDNy + OSO + + + W + W + O + W + Z + O + Đ— + O + Ny + O + + + WNW + WNW + ONO + WNW + ZSZ + ONO + Đ—Đ¡Đ— + ONO + NyÉNy + ONO + + + NW + NW + NO + NW + SZ + NO + Đ¡Đ— + NO + ÉNy + NO + + + NNW + NNW + NNO + NNW + SSZ + NNO + Đ¡Đ¡Đ— + NNO + ÉÉNy + NNO + + + Action cancelled. + Aktion abgebrochen. + AcciĂ³n cancelada. + Przerwano czynność + Akce pÅ™eruÅ¡ena + Action annulĂ©e. + Đ”ĐµĐ¹ÑÑ‚Đ²Đ¸Đµ Đ¾Ñ‚Đ¼ĐµĐ½ĐµĐ½Đ¾. + AĂ§Ă£o cancelada. + Művelet megszakĂ­tva. + Azione cancellata. + + + < Prev + < ZurĂ¼ck + < Anterior. + < Poprzedni + < PÅ™edchozĂ­ + < PrĂ©c + < ĐŸÑ€ĐµĐ´. + < Anterior + < ElÅ‘zÅ‘ + < Prec + + + Next > + Weiter > + Siguiente > + NastÄ™pny > + DalÅ¡Ă­ > + Suivant > + Đ¡Đ»ĐµĐ´. > + PrĂ³ximo > + KövetkezÅ‘ > + Prossimo > + + + [ACE] Miscellaneous Items + [ACE] Verschiedenes + [ACE] Objetos varios + [ACE] RĂ³Å¼ne przedmioty + [ACE] OstatnĂ­ pÅ™edmÄ›ty + [ACE] Objets divers + [ACE] Đ Đ°Đ·Đ»Đ¸Ñ‡Đ½Ñ‹Đµ Đ¿Ñ€ĐµĐ´Đ¼ĐµÑ‚Ñ‹ + [ACE] Itens diversos + [ACE] EgyĂ©b tĂ¡rgyak + [ACE] Oggetti vari + + + Disable Command Menu + BefehlsmenĂ¼ ausschalten + Desactivar menĂº de mando + WyÅ‚Ä…cz menu dowodzenia + Vypnout velĂ­cĂ­ menu + DĂ©sactiver Menu Commande + Đ’Ñ‹ĐºĐ»ÑÑ‡Đ¸Ñ‚ÑŒ ĐºĐ¾Đ¼Đ°Đ½Đ´Đ½Đ¾Đµ Đ¼ĐµĐ½Ñ + Parancsnoki menĂ¼ kikapcsolĂ¡sa + + + Unknown + Unbekannt + Desconocido + Nieznany + NeznĂ¡mĂ½ + ĐĐµĐ¸Đ·Đ²ĐµÑÑ‚Đ½Đ¾ + Ismeretlen + + + No Voice + Keine Stimme + Sin voz + Brak gÅ‚osu + Å½Ă¡dnĂ½ hlas + Без Đ³Đ¾Đ»Đ¾ÑĐ° + Nincs hang + + + \ No newline at end of file diff --git a/addons/core/$PBOPREFIX$ b/addons/core/$PBOPREFIX$ deleted file mode 100644 index cf1ff42a75..0000000000 --- a/addons/core/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\core \ No newline at end of file diff --git a/addons/core/CfgEventHandlers.hpp b/addons/core/CfgEventHandlers.hpp deleted file mode 100644 index f6a948e941..0000000000 --- a/addons/core/CfgEventHandlers.hpp +++ /dev/null @@ -1,41 +0,0 @@ -class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); - serverInit = QUOTE(call compile preprocessFileLineNumbers PATHTOF(scripts\readParameters.sqf) ); - disableModuload = true; - }; -}; - -class Extended_PostInit_EventHandlers { - class ADDON { - init = QUOTE(call compile preprocessFileLineNumbers PATHTOF(XEH_postInit.sqf) ); - disableModuload = true; - }; -}; - -class Extended_InitPost_EventHandlers { - class All { - class GVAR(executePersistent) { - init = QUOTE([_this select 0] call FUNC(executePersistent) ); - }; - }; - class CAManBase { - class GVAR(setName) { - init = QUOTE(if (local (_this select 0)) then { _this call FUNC(setName) }; ); - }; - class GVAR(forceWalk) { - init = QUOTE(if (local (_this select 0)) then { _this call FUNC(applyForceWalkStatus); }; ); - }; - }; -}; - -class Extended_Respawn_EventHandlers { - class All { - class GVAR(restoreVariablesJIP) { - respawn = QUOTE(_this call FUNC(restoreVariablesJIP) ); - }; - class GVAR(setName) { - respawn = QUOTE(_this call FUNC(setName) ); - }; - }; -}; \ No newline at end of file diff --git a/addons/core/CfgFunctions.hpp b/addons/core/CfgFunctions.hpp deleted file mode 100644 index 1dba4f856d..0000000000 --- a/addons/core/CfgFunctions.hpp +++ /dev/null @@ -1,147 +0,0 @@ -class CfgFunctions { - class ADDON { - class ADDON { - file = PATHTOF(functions\); - class addActionEventHandler; - class addActionMenuEventHandler; - class addCameraEventHandler; - class addCustomEventHandler; - class addInfoDisplayEventHandler; - class addMapMarkerCreatedEventHandler; - class addInventoryDisplayLoadedEventHandler; - class addScrollWheelEventHandler; - class adminKick; - class ambientBrightness; - class applyForceWalkStatus; - class binarizeNumber; - class callCustomEventHandlers; - class callCustomEventHandlersGlobal; - class canGetInPosition; - class canInteractWith; - class canUseWeapon; - class changeProjectileDirection; - class checkPBOs; - class claim; - class closeDialogIfTargetMoves; - class codeToLetter; - class codeToString; - class convertKeyCode; - class currentChannel; - class disableUserInput; - class displayText; - class displayTextPicture; - class displayTextStructured; - class doAnimation; - class endRadioTransmission; - class execPersistentFnc; - class execRemoteFnc; - class executePersistent; - class filter; - class fixLoweredRifleAnimation; - class getCaptivityStatus; - class getConfigCommander; - class getConfigGunner; - class getDefaultAnim; - class getDoorTurrets; - class getForceWalkStatus; - class getHitPoints; - class getHitPointsWithSelections; - class getInPosition; - class getMarkerType; - class getName; - class getNumberFromMissionSQM; - class getPitchBankYaw; - class getStringFromMissionSQM; - class getTargetAzimuthAndInclination; - class getTargetDistance; - class getTargetObject; - class getTurretCommander; - class getTurretConfigPath; - class getTurretCopilot; - class getTurretGunner; - class getTurretIndex; - class getTurrets; - class getTurretsFFV; - class getTurretsOther; - class getUavControlPosition; - class getVehicleCargo; - class getVehicleCodriver; - class getVehicleCrew; - class getWeaponAzimuthAndInclination; - class getWeaponType; - class getWindDirection; - class goKneeling; - class hadamardProduct; - class interpolateFromArray; - class inTransitionAnim; - class isAutoWind; - class isEngineer; - class isEOD; - class isInBuilding; - class isMedic; - class isPlayer; - class isTurnedOut; - class letterToCode; - class map; - class moduleCheckPBOs; - class moduleLSDVehicles; - class muteUnit; - class numberToDigits; - class numberToDigitsString; - class onLoadRscDisplayChannel; - class owned; - class player; - class playerSide; - class progressBar; - class queueAnimation; - class readBooleanParameterFromModule; - class readNumericParameterFromModule; - class removeActionEventHandler; - class removeActionMenuEventHandler; - class removeCameraEventHandler; - class removeCustomEventHandler; - class removeInfoDisplayEventHandler; - class removeInventoryDisplayLoadedEventHandler; - class removeMapMarkerCreatedEventHandler; - class removeScrollWheelEventHandler; - class restoreVariablesJIP; - class revertKeyCodeLocalized; - class sanitizeString; - class serverLog; - class setCaptivityStatus; - class setForceWalkStatus; - class setKeyDefault; - class setName; - class setParameter; - class setPitchBankYaw; - class setVariableJIP; - class stringToColoredText; - class subString; - class toBin; - class toBitmask; - class toHex; - class toNumber; - class unmuteUnit; - }; - }; - class AGM_Debug { - class AGM_Debug { - file = PATHTOF(functions\Debug); - class exportConfig; - class getChildren; - class getDisplayConfigName; - class log; - class logControls; - class logDisplays; - class monitor; - class showUser; - }; - }; - class AGM_CuratorFix { - class AGM_CuratorFix { - file = PATHTOF(functions\CuratorFix); - class addUnloadEventhandler; - class fixCrateContent; - }; - }; -}; \ No newline at end of file diff --git a/addons/core/CfgSounds.hpp b/addons/core/CfgSounds.hpp deleted file mode 100644 index 3b7f0b091d..0000000000 --- a/addons/core/CfgSounds.hpp +++ /dev/null @@ -1,7 +0,0 @@ - -class CfgSounds { - class AGM_Sound_Click { - sound[] = {PATHTOF(sounds\AGM_click.wav), 1, 1, 200}; - titles[] = {}; - }; -}; \ No newline at end of file diff --git a/addons/core/CfgVehicles.hpp b/addons/core/CfgVehicles.hpp deleted file mode 100644 index e07e67f80b..0000000000 --- a/addons/core/CfgVehicles.hpp +++ /dev/null @@ -1,108 +0,0 @@ -class CfgVehicles { - /*class Man; - class CAManBase: Man { - // @todo - class UserActions { - class AGM_Fire { - displayName = ""; - priority = -99; - available = 1; - radius = 2.5; - radiusView = 0; - position = ""; - showWindow = 0; - showIn3D = 0; - onlyForPlayer = 1; - shortcut = "DefaultAction"; - condition = "call AGM_Core_UserActionFireCondition"; - statement = "call AGM_Core_UserActionFire"; - userActionID = 100; - }; - }; - };*/ - - // += needs a non inherited entry in that class, otherwise it simply overwrites - //#include - - class Module_F; - class AGM_ModuleCheckPBOs: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; - displayName = "Check PBOs"; - function = "AGM_Core_fnc_moduleCheckPBOs"; - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\IconCheckPBO_ca.paa); - class Arguments { - class Action { - displayName = "Action"; - description = "What to do with people who do not have the right PBOs?"; - class values { - class WarnOnce { - default = 1; - name = "Warn once"; - value = 0; - }; - class Warn { - name = "Warn (permanent)"; - value = 1; - }; - class Kick { - name = "Kick"; - value = 2; - }; - }; - }; - class CheckAll { - displayName = "Check all addons"; - description = "Check all addons instead of only those of AGM?"; - typeName = "BOOL"; - class values { - class WarnOnce { - default = 1; - name = "No"; - value = 0; - }; - class Warn { - name = "Yes"; - value = 1; - }; - }; - }; - class Whitelist { - displayName = "Whitelist"; - description = "What addons are allowed regardless?"; - typeName = "STRING"; - class values { - default = "[]"; - }; - }; - }; - }; - - class AGM_ModuleLSDVehicles: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; - displayName = "LSD Vehicles"; - function = "AGM_Core_fnc_moduleLSDVehicles"; - scope = 2; - isGlobal = 1; - class Arguments { - }; - }; - - class Box_NATO_Support_F; - class AGM_Box_Misc: Box_NATO_Support_F { - author = "$STR_AGM_Core_AGMTeam"; - displayName = "$STR_AGM_Core_MiscItems"; - transportMaxWeapons = 9001; - transportMaxMagazines = 9001; - transportMaxItems = 9001; - maximumload = 2000; - - class TransportWeapons {}; - class TransportMagazines {}; - class TransportItems {}; - class TransportBackpacks {}; - }; -}; \ No newline at end of file diff --git a/addons/core/CfgWeapons.hpp b/addons/core/CfgWeapons.hpp deleted file mode 100644 index 59bc47b502..0000000000 --- a/addons/core/CfgWeapons.hpp +++ /dev/null @@ -1,30 +0,0 @@ -class CfgWeapons { - class ItemCore; - class AGM_ItemCore: ItemCore { - type = 4096;//4; - detectRange = -1; - simulation = "ItemMineDetector"; - }; - - class Rifle_Base_F; - class AGM_FakePrimaryWeapon: Rifle_Base_F { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - displayName = ""; - picture = ""; - model = ""; - magazines[] = {"AGM_FakeMagazine"}; - scope = 2; - }; -}; - -class CfgMagazines { - class CA_Magazine; - - class AGM_FakeMagazine: CA_Magazine { - descriptionShort = ""; - displayName = ""; - displayNameShort = ""; - count = 0; - }; -}; \ No newline at end of file diff --git a/addons/core/DefaultItems.hpp b/addons/core/DefaultItems.hpp deleted file mode 100644 index e228fca522..0000000000 --- a/addons/core/DefaultItems.hpp +++ /dev/null @@ -1,1030 +0,0 @@ -/* - -Autoexported while playing the unmodded game. - - -A = "_c = _x >> 'items'; isArray _c" configClasses (configFile >> "CfgVehicles"); - -B = []; {B set [_forEachIndex, inheritsFrom _x]} forEach A; -E = B - A; - -C = []; {C set [_forEachIndex, getArray (_x >> "items")]} forEach A; -D = []; {D set [_forEachIndex, getArray (_x >> "respawnItems")]} forEach A; - -{A set [_forEachIndex, configName _x]} forEach A; -{B set [_forEachIndex, configName _x]} forEach B; -{E set [_forEachIndex, configName _x]} forEach E; - -diag_log text "====================="; - -{ - diag_log text format ["class %1;", _x]; -} forEach E; - -{ - diag_log text format ["class %1: %2 {", _x, B select _forEachIndex]; - _s = str (C select _forEachIndex); _s = toString (toArray _s - [91,93]); - diag_log text format [" items[] = {%1};", _s]; - _s = str (D select _forEachIndex); _s = toString (toArray _s - [91,93]); - diag_log text format [" respawnItems[] = {%1};", _s]; - diag_log text "};"; -} forEach A; - -*/ - -class SoldierWB; -class SoldierGB; -class SoldierEB; -class C_man_1; -class B_Soldier_base_F: SoldierWB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_02_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_03_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_04_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_05_f: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_RangeMaster_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_lite_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_GL_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AR_F: B_Soldier_02_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_SL_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_TL_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_M_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_LAT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_medic_F: B_Soldier_02_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_repair_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_exp_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Helipilot_F: B_Soldier_04_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_A_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AA_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_engineer_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_crew_F: B_Soldier_03_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_officer_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Competitor_F: B_RangeMaster_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Pilot_F: B_Soldier_05_f { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_helicrew_F: B_Helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_PG_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_UAV_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_soldier_unarmed_f: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_diver_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_TL_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_diver_exp_F: B_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_recon_base: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_LAT_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_exp_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_medic_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_TL_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_M_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_recon_JTAC_F: B_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_sniper_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_spotter_F: B_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_sniper_F: B_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_SF_Captain_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Protagonist_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Engineer_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Colonel_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Pilot_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Story_Tank_Commander_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_soldier_survival_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_GL_LAT_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_engineer_exp_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_M_medic_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_CTRG_soldier_AR_A_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_support_base_F: B_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAR_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAT_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_soldier_AAA_F: B_soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_MG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_GMG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_Mort_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_AMG_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_support_AMort_F: B_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_base_F: SoldierGB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_lite_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_SL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_TL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_AR_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_medic_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_engineer_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_exp_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_GL_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_M_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_LAT_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Soldier_A_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_officer_F: I_G_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_F: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_F: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_lite_F: I_G_Soldier_lite_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_lite_F: I_G_Soldier_lite_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_SL_F: I_G_Soldier_SL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_SL_F: I_G_Soldier_SL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_TL_F: I_G_Soldier_TL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_TL_F: I_G_Soldier_TL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_AR_F: I_G_Soldier_AR_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_AR_F: I_G_Soldier_AR_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_medic_F: I_G_medic_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_medic_F: I_G_medic_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_engineer_F: I_G_engineer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_engineer_F: I_G_engineer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_exp_F: I_G_Soldier_exp_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_exp_F: I_G_Soldier_exp_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_GL_F: I_G_Soldier_GL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_GL_F: I_G_Soldier_GL_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_M_F: I_G_Soldier_M_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_M_F: I_G_Soldier_M_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_LAT_F: I_G_Soldier_LAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_LAT_F: I_G_Soldier_LAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_Soldier_A_F: I_G_Soldier_A_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_Soldier_A_F: I_G_Soldier_A_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_G_officer_F: I_G_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_G_officer_F: I_G_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_soldier_unarmed_f: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_g_soldier_unarmed_f: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_g_soldier_unarmed_f: O_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_survivor_F: I_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class b_g_survivor_F: B_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class o_g_survivor_F: O_G_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_G_Story_Protagonist_F: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_Story_SF_Captain_F: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_resistanceLeader_F: I_G_Story_Protagonist_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_G_resistanceCommander_F: I_G_Story_Protagonist_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_base_F: SoldierGB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_02_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_03_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_04_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_soldier_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_lite_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_A_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_GL_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AR_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_SL_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_TL_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_M_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_LAT_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AT_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AA_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_medic_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_repair_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_exp_F: I_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_engineer_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_crew_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_helipilot_F: I_Soldier_03_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_pilot_F: I_Soldier_04_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_helicrew_F: I_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_officer_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Story_Colonel_F: I_officer_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_soldier_UAV_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_soldier_unarmed_f: I_soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_diver_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_exp_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_diver_TL_F: I_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_sniper_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Spotter_F: I_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Sniper_F: I_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_support_base_F: I_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAR_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAT_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_Soldier_AAA_F: I_Soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_MG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_GMG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_Mort_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_AMG_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_support_AMort_F: I_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_base_F: SoldierEB { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_officer_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_02_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_lite_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_GL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AR_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_SL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_TL_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_M_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_LAT_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_medic_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_repair_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_exp_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_helipilot_F: O_Soldier_02_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_A_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AT_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AA_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_engineer_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_crew_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Pilot_F: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_helicrew_F: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_PG_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Story_Colonel_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Story_CEO_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldier_UAV_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_soldier_unarmed_f: O_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_diver_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_TL_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_diver_exp_F: O_Soldier_diver_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_sniper_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_spotter_F: O_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_sniper_F: O_Soldier_sniper_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_recon_base: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_M_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_LAT_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_medic_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_exp_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_JTAC_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_recon_TL_F: O_Soldier_recon_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_support_base_F: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAR_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAT_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_AAA_F: O_Soldier_AAT_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_MG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_GMG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_Mort_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_AMG_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_support_AMort_F: O_Soldier_support_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_Soldier_Urban_base: O_Soldier_base_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AR_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAR_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_LAT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAT_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AA_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_AAA_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_TL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_SoldierU_SL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_medic_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_repair_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_exp_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_engineer_U_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_M_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_soldierU_A_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_SoldierU_GL_F: O_Soldier_Urban_base { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class C_Marshal_F: B_RangeMaster_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class B_Soldier_VR_F: B_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class O_Soldier_VR_F: O_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_Soldier_VR_F: I_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class C_Soldier_VR_F: C_man_1 { - items[] = {}; - respawnItems[] = {}; -}; -class B_Protagonist_VR_F: B_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class O_Protagonist_VR_F: O_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class I_Protagonist_VR_F: I_Soldier_base_F { - items[] = {}; - respawnItems[] = {}; -}; -class B_UAV_AI: B_Helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class O_UAV_AI: O_helipilot_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class I_UAV_AI: O_UAV_AI { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class Underwear_F: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_survivor_F: B_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class o_survivor_F: O_Soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class i_survivor_F: I_soldier_F { - items[] = {}; - respawnItems[] = {}; -}; -class b_soldier_universal_f: B_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class b_g_soldier_universal_f: B_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_soldier_universal_f: O_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class o_g_soldier_universal_f: O_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_soldier_universal_f: I_soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; -class i_g_soldier_universal_f: I_G_Soldier_F { - items[] = {"FirstAidKit"}; - respawnItems[] = {"FirstAidKit"}; -}; diff --git a/addons/core/FixAnimations.hpp b/addons/core/FixAnimations.hpp deleted file mode 100644 index 83353fe27d..0000000000 --- a/addons/core/FixAnimations.hpp +++ /dev/null @@ -1,35 +0,0 @@ - -class CfgMovesBasic; -class CfgMovesMaleSdr: CfgMovesBasic { - class AgonyBase; - class AgonyBaseRfl; - class StandBase; - - class States { - class AinjPfalMstpSnonWnonDnon_carried_Down: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWnonDnon_carried_Up: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWrflDnon_carried_Down: AgonyBase { - canReload = 0; - }; - class AinjPfalMstpSnonWrflDnon_carried_Up: AgonyBaseRfl { - canReload = 0; - }; - - class AmovPpneMstpSnonWnonDnon_injured; - class AinjPpneMstpSnonWnonDnon: AmovPpneMstpSnonWnonDnon_injured { - canReload = 0; - }; - class AmovPpneMstpSrasWrflDnon_injured; - class AinjPpneMstpSnonWrflDnon: AmovPpneMstpSrasWrflDnon_injured { - canReload = 0; - }; - - class LadderCivilStatic: StandBase { - AGM_isLadder = 1; - }; - }; -}; diff --git a/addons/core/FixPickup.hpp b/addons/core/FixPickup.hpp deleted file mode 100644 index 19ced78e96..0000000000 --- a/addons/core/FixPickup.hpp +++ /dev/null @@ -1,13 +0,0 @@ - -class CfgActions { - class None; - class TakeWeapon: None { - show = 0; - }; - class TakeItem: None { - show = 0; - }; - class TakeMagazine: None { - show = 0; - }; -}; diff --git a/addons/core/HintConfig.hpp b/addons/core/HintConfig.hpp deleted file mode 100644 index d600609ee5..0000000000 --- a/addons/core/HintConfig.hpp +++ /dev/null @@ -1,76 +0,0 @@ -// by commy2 - -class RscStructuredText; -class RscMapControl; - -class RscTitles { - class AGM_RscHint { - idd = -1; - onLoad = "uiNamespace setVariable ['AGM_ctrlHint', (_this select 0) displayCtrl 1];"; - movingEnable = false; - duration = 4; - fadeIn = 0.2; - fadeOut = 0.2; - name = "AGM_RscHint"; - - class controls { - class HintBox: RscStructuredText { - idc = 1; - text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; - colorText[] = {1, 1, 1, 1}; - colorBackground[] = {0, 0, 0, 0.5}; - x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW; - y = safeZoneY + 0.2 * safezoneH; - w = 0.2 * safeZoneW; - h = 0.1 * SafeZoneH; - }; - }; - }; - class AGM_RscErrorHint { - idd = -1; - onLoad = "uiNamespace setVariable ['AGM_ctrlErrorHint', (_this select 0) displayCtrl 1];"; - movingEnable = false; - duration = 999999; - fadeIn = 0.2; - fadeOut = 0.2; - name = "AGM_RscErrorHint"; - - class controls { - class HintBox: RscStructuredText { - idc = 1; - text = ""; - size = "1 / 40 / (getResolution select 5)"; - sizeEx = 1; - colorText[] = {1, 1, 1, 1}; - colorBackground[] = {0.8, 0, 0, 0.5}; - x = 0.3 * safeZoneW + safeZoneX; - y = 0.4 * safezoneH + safeZoneY; - w = 0.4 * safeZoneW; - h = 0.2 * SafeZoneH; - }; - }; - }; - class AGM_EventHandlerHelper: AGM_Rsc_Display_Base { - idd = -1; - class controls { - class CameraView: RscMapControl { - onDraw = "if (cameraView != uiNamespace getVariable 'AGM_EventHandler_CameraMode') then {uiNamespace setVariable ['AGM_EventHandler_CameraMode', cameraView]; {[uiNamespace getVariable 'AGM_EventHandler_CameraMode'] call _x; nil} count ((missionNamespace getVariable 'AGM_EventHandler_CameraMode') select 2);};"; - idc = -1; - w = 0; - h = 0; - }; - }; - }; - class AGM_EventHandlerHelper2: AGM_Rsc_Display_Base { - class controls { - class MapMarkerCreated: RscMapControl { - onDraw = "if (count allMapMarkers != uiNamespace getVariable 'AGM_EventHandler_MapMarker') then {if (count allMapMarkers > uiNamespace getVariable 'AGM_EventHandler_MapMarker') then {{[allMapMarkers select count allMapMarkers - 1] call _x; nil} count ((missionNamespace getVariable 'AGM_EventHandler_MapMarker') select 2);}; uiNamespace setVariable ['AGM_EventHandler_MapMarker', count allMapMarkers];};"; - idc = -1; - w = 0; - h = 0; - }; - }; - }; -}; diff --git a/addons/core/MainMenu.hpp b/addons/core/MainMenu.hpp deleted file mode 100644 index 785e789c8c..0000000000 --- a/addons/core/MainMenu.hpp +++ /dev/null @@ -1,103 +0,0 @@ - -class AGM_Tile_Base { - class Attributes { - font = "PuristaMedium"; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; - class AttributesImage { - font = "PuristaMedium"; - color = "#E5E5E5"; - align = "left"; - }; - class HitZone { - left = 0.0; - top = 0.0; - right = 0.0; - bottom = 0.0; - }; - class ShortcutPos { - left = 0; - top = 0; - w = 0; - h = 0; - }; - class TextPos { - left = 0.01; - top = 0; - right = 0; - bottom = 0; - }; - action = "(findDisplay 49) closeDisplay 0; 0 spawn AGM_Core_openMenu;"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - color2[] = {0,0,0,1}; - color[] = {1,1,1,1}; - //colorBackground2[] = {0.75,0.75,0.75,1}; - //colorBackground[] = {0,0,0,0.8}; - colorBackground[] = {1, 0.647, 0, 0.5}; - colorBackground2[] = {1, 0.647, 0, 0.5}; - colorBackgroundFocused[] = {1, 1, 1, 0}; - colorDisabled[] = {1,1,1,0.25}; - colorFocused[] = {0,0,0,1}; - colorText[] = {1,1,1,1}; - default = 0; - font = "PuristaMedium"; - idc = -1; - period = 1.2; - periodFocus = 1.2; - periodOver = 1.2; - shadow = 0; - shortcuts[] = {}; - size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; - style = "0x02 + 0xC0"; - text = "$STR_AGM_Core_Options"; - textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; - tooltip = ""; - tooltipColorBox[] = {1,1,1,1}; - tooltipColorShade[] = {0,0,0,0.65}; - tooltipColorText[] = {1,1,1,1}; - type = 16; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "(0.1 * safezoneH + safezoneY) + 1.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; -}; - -class RscStandardDisplay; - -/*class RscDisplayMain: RscStandardDisplay { - class controls { - class AGM_Tile : AGM_Tile_Base {}; - }; -};*/ -class RscDisplayMPInterrupt: RscStandardDisplay { - class controls { - class AGM_Tile : AGM_Tile_Base {}; - }; -}; -class RscDisplayInterrupt: RscStandardDisplay { - class controls { - class AGM_Tile : AGM_Tile_Base {}; - }; -}; -class RscDisplayInterruptEditor3D: RscStandardDisplay { - class controls { - class AGM_Tile : AGM_Tile_Base {}; - }; -}; -class RscDisplayInterruptEditorPreview: RscStandardDisplay { - class controls { - class AGM_Tile : AGM_Tile_Base {}; - }; -}; diff --git a/addons/core/MenuConfig.hpp b/addons/core/MenuConfig.hpp deleted file mode 100644 index 4e813ecc85..0000000000 --- a/addons/core/MenuConfig.hpp +++ /dev/null @@ -1,927 +0,0 @@ - -#define HSPACE 0.3 -#define VSPACE 0.3 -#define BORDER 0.1 - -class AGM_Core_Interactive_Button_Base { - tooltip = ""; - action = ""; - - idc = -1; - access = 0; - style = 0; - type = 1; - text = ""; - font = "PuristaMedium"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - shadow = 2; - - x = 0; - y = 0; - w = 0; - h = 0; - - offsetX = 0.003; - offsetY = 0.003; - offsetPressedX = 0.002; - offsetPressedY = 0.002; - borderSize = 0; - - colorText[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,1}; - colorBackground[] = {0,0,0,0.8}; - colorBackgroundDisabled[] = {0,0,0,0.8}; - colorBackgroundActive[] = {1,1,1,0.8}; - colorFocused[] = {0,0,0,0}; - colorShadow[] = {0,0,0,0}; - colorBorder[] = {1,1,1,0.8}; - - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; -}; - -#define HSPACE2 0.05 -#define VSPACE2 0.05 -#define BORDER 0.1 - -class AGM_Core_Text_Button_Base { - idc = 2; - moving = 0; - text = ""; - font = "PuristaMedium"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - lineSpacing = 0; - access = 0; - type = 0; - style = 2 + 0x800; - size = 1; - colorBackground[] = {0,0,0,0.8}; - colorText[] = {1,1,1,1}; - x = 0; - y = 0; - w = 0; - h = 0; -}; - -class AGM_Core_OptionsMenu_Dialog { - idd = -1; - movingEnable = true; - onLoad = "_dlgMenuDialog = _this select 0; for '_a' from 20 to 32 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 100 to 119 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 200 to 219 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 300 to 319 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 400 to 419 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; for '_a' from 500 to 519 do {(_dlgMenuDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['AGM_Core_MenuDialog', _dlgMenuDialog];"; - objects[] = {}; - - class controlsBackground { - class Background { - idc = 1; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0 + 0x800; - size = 1; - //colorBackground[] = {0, 0.265, 0, 0.5}; - colorBackground[] = {0, 0, 0, 0.5}; - colorText[] = {0, 0, 0, 0}; - x = HSPACE2 / 2 * safezoneW + safezoneX; - y = VSPACE2 / 2 * safezoneH + safezoneY; - w = (1 - 2 * HSPACE2 / 2) * safezoneW; - h = (1 - 2 * VSPACE2 / 2) * safezoneH; - }; - - class Header { - idc = 2; - moving = 0; - text = "$STR_AGM_Core_Options"; - font = "PuristaMedium"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - lineSpacing = 0; - access = 0; - type = 0; - style = 1 + 0x800; - size = 1; - //colorBackground[] = {0,0,0,0}; - colorBackground[] = {1, 0.647, 0, 0.5}; - colorText[] = {1,1,1,1}; - x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; - w = 4.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class AGM_Logo : AGM_Core_Interactive_Button_Base { - action = "closeDialog 0;"; - type = 0; - style = 48; - onMouseEnter = "hint ('_' + str(_this))"; - tooltip = ""; - text = "";//"\AGM_common\rsc\bwlogo.paa"; - idc = 2; - x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 0.5 * 0.1)) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 1.0 / 16 * safezoneW; - h = 1.0 / 9 * safezoneH; - }; - }; - - class controls { - class Text_Button0 : AGM_Core_Text_Button_Base { - idc = 100; - style = 0 + 0x800; - x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 4.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Text_Button1 : Text_Button0 { - idc = 101; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button2 : Text_Button0 { - idc = 102; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button3 : Text_Button0 { - idc = 103; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button4 : Text_Button0 { - idc = 104; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button5 : Text_Button0 { - idc = 105; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button6 : Text_Button0 { - idc = 106; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button7 : Text_Button0 { - idc = 107; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button8 : Text_Button0 { - idc = 108; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button9 : Text_Button0 { - idc = 109; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button10 : Text_Button0 { - idc = 110; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button11 : Text_Button0 { - idc = 111; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button12 : Text_Button0 { - idc = 112; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button13 : Text_Button0 { - idc = 113; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button14 : Text_Button0 { - idc = 114; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button15 : Text_Button0 { - idc = 115; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button16 : Text_Button0 { - idc = 116; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button17 : Text_Button0 { - idc = 117; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button18 : Text_Button0 { - idc = 118; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Button19 : Text_Button0 { - idc = 119; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - }; - - ////////////////////////////////////////////////// - - class Interactive_Button0 : AGM_Core_Interactive_Button_Base { - action = "AGM_Core_keySet = -1; [0] spawn AGM_Core_editKey"; - sizeEx = "0.8 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - idc = 200; - style = 2 + 0x800; - x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 3.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_Button1 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [1] spawn AGM_Core_editKey"; - idc = 201; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button2 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [2] spawn AGM_Core_editKey"; - idc = 202; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button3 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [3] spawn AGM_Core_editKey"; - idc = 203; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button4 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [4] spawn AGM_Core_editKey"; - idc = 204; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button5 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [5] spawn AGM_Core_editKey"; - idc = 205; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button6 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [6] spawn AGM_Core_editKey"; - idc = 206; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button7 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [7] spawn AGM_Core_editKey"; - idc = 207; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button8 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [8] spawn AGM_Core_editKey"; - idc = 208; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button9 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [9] spawn AGM_Core_editKey"; - idc = 209; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button10 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [10] spawn AGM_Core_editKey"; - idc = 210; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button11 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [11] spawn AGM_Core_editKey"; - idc = 211; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button12 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [12] spawn AGM_Core_editKey"; - idc = 212; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button13 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [13] spawn AGM_Core_editKey"; - idc = 213; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button14 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [14] spawn AGM_Core_editKey"; - idc = 214; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button15 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [15] spawn AGM_Core_editKey"; - idc = 215; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button16 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [16] spawn AGM_Core_editKey"; - idc = 216; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button17 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [17] spawn AGM_Core_editKey"; - idc = 217; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button18 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [18] spawn AGM_Core_editKey"; - idc = 218; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button19 : Interactive_Button0 { - action = "AGM_Core_keySet = -1; [19] spawn AGM_Core_editKey"; - idc = 219; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - }; - - ////////////////////////////////////////////////// - - class Interactive_Checkbox0 : Text_Button0 { - action = "hint '0'"; - idc = 300; - //type = 0; - style = 48; - text = PATHTOF(UI\box_unchecked_ca.paa); - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {1, 1, 1, 1}; - x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 0.3 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_Checkbox1 : Interactive_Checkbox0 { - action = ""; - idc = 301; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox2 : Interactive_Checkbox0 { - action = ""; - idc = 302; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox3 : Interactive_Checkbox0 { - action = ""; - idc = 303; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox4 : Interactive_Checkbox0 { - action = ""; - idc = 304; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox5 : Interactive_Checkbox0 { - action = ""; - idc = 305; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox6 : Interactive_Checkbox0 { - action = ""; - idc = 306; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox7 : Interactive_Checkbox0 { - action = ""; - idc = 307; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox8 : Interactive_Checkbox0 { - action = ""; - idc = 308; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox9 : Interactive_Checkbox0 { - action = ""; - idc = 309; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox10 : Interactive_Checkbox0 { - action = ""; - idc = 310; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox11 : Interactive_Checkbox0 { - action = ""; - idc = 311; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox12 : Interactive_Checkbox0 { - action = ""; - idc = 312; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox13 : Interactive_Checkbox0 { - action = ""; - idc = 313; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox14 : Interactive_Checkbox0 { - action = ""; - idc = 314; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox15 : Interactive_Checkbox0 { - action = ""; - idc = 315; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox16 : Interactive_Checkbox0 { - action = ""; - idc = 316; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox17 : Interactive_Checkbox0 { - action = ""; - idc = 317; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox18 : Interactive_Checkbox0 { - action = ""; - idc = 318; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Checkbox19 : Interactive_Checkbox0 { - action = ""; - idc = 319; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - }; - - ////////////////////////////////////////////////// - - class Text_Checkbox0 : Text_Button0 { - idc = 400; - x = (HSPACE2 + 0 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 4.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Text_Checkbox1 : Text_Checkbox0 { - idc = 401; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox2 : Text_Checkbox0 { - idc = 402; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox3 : Text_Checkbox0 { - idc = 403; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox4 : Text_Checkbox0 { - idc = 404; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox5 : Text_Checkbox0 { - idc = 405; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox6 : Text_Checkbox0 { - idc = 406; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox7 : Text_Checkbox0 { - idc = 407; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox8 : Text_Checkbox0 { - idc = 408; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox9 : Text_Checkbox0 { - idc = 409; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox10 : Text_Checkbox0 { - idc = 410; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox11 : Text_Checkbox0 { - idc = 411; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox12 : Text_Checkbox0 { - idc = 412; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox13 : Text_Checkbox0 { - idc = 413; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox14 : Text_Checkbox0 { - idc = 414; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox15 : Text_Checkbox0 { - idc = 415; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox16 : Text_Checkbox0 { - idc = 416; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox17 : Text_Checkbox0 { - idc = 417; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox18 : Text_Checkbox0 { - idc = 418; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Text_Checkbox19 : Text_Checkbox0 { - idc = 419; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - }; - - ////////////////////////////////////////////////// - - class Interactive_CheckboxButton0 : AGM_Core_Interactive_Button_Base { - action = "[0] call AGM_Core_toggleState"; - idc = 500; - colorBackground[] = {0, 0, 0, 0}; - colorBackgroundActive[] = {0, 0, 0, 0}; - colorText[] = {1, 1, 1, 1}; - x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 2 * 0.04) * safezoneH + safezoneY; - w = 0.3 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_CheckboxButton1 : Interactive_CheckboxButton0 { - action = "[1] call AGM_Core_toggleState"; - idc = 501; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton2 : Interactive_CheckboxButton0 { - action = "[2] call AGM_Core_toggleState"; - idc = 502; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton3 : Interactive_CheckboxButton0 { - action = "[3] call AGM_Core_toggleState"; - idc = 503; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton4 : Interactive_CheckboxButton0 { - action = "[4] call AGM_Core_toggleState"; - idc = 504; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton5 : Interactive_CheckboxButton0 { - action = "[5] call AGM_Core_toggleState"; - idc = 505; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton6 : Interactive_CheckboxButton0 { - action = "[6] call AGM_Core_toggleState"; - idc = 506; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton7 : Interactive_CheckboxButton0 { - action = "[7] call AGM_Core_toggleState"; - idc = 507; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton8 : Interactive_CheckboxButton0 { - action = "[8] call AGM_Core_toggleState"; - idc = 508; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton9 : Interactive_CheckboxButton0 { - action = "[9] call AGM_Core_toggleState"; - idc = 509; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton10 : Interactive_CheckboxButton0 { - action = "[10] call AGM_Core_toggleState"; - idc = 510; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton11 : Interactive_CheckboxButton0 { - action = "[11] call AGM_Core_toggleState"; - idc = 511; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton12 : Interactive_CheckboxButton0 { - action = "[12] call AGM_Core_toggleState"; - idc = 512; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton13 : Interactive_CheckboxButton0 { - action = "[13] call AGM_Core_toggleState"; - idc = 513; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton14 : Interactive_CheckboxButton0 { - action = "[14] call AGM_Core_toggleState"; - idc = 514; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton15 : Interactive_CheckboxButton0 { - action = "[15] call AGM_Core_toggleState"; - idc = 515; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton16 : Interactive_CheckboxButton0 { - action = "[16] call AGM_Core_toggleState"; - idc = 516; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton17 : Interactive_CheckboxButton0 { - action = "[17] call AGM_Core_toggleState"; - idc = 517; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton18 : Interactive_CheckboxButton0 { - action = "[18] call AGM_Core_toggleState"; - idc = 518; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton19 : Interactive_CheckboxButton0 { - action = "[19] call AGM_Core_toggleState"; - idc = 519; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - }; - - ////////////////////////////////////////////////// - - class TextBox_KeyChange : Text_Button0 { - text = ""; - idc = 20; - style = 2 + 0x800; - x = (6 * 0.1) * safezoneW + safezoneX; - y = (8 * 0.04) * safezoneH + safezoneY; - w = (6.0 / 16 - HSPACE2 / 2) * safezoneW; - h = (3.0 / 9 - VSPACE2 / 2) * safezoneH; - }; - - /*class TextBox_Key_Shift : TextBox_KeyChange { - text = "$STR_AGM_Core_Shift"; - idc = 21; - colorText[] = {0.25,0.25,0.25,1}; - colorBackground[] = {0,0,0,0}; - x = (3 / 4 * HSPACE2 + 5.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class TextBox_Key_Control : TextBox_Key_Shift { - text = "$STR_AGM_Core_Ctrl"; - idc = 22; - x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_Alt : TextBox_Key_Shift { - text = "$STR_AGM_Core_Alt"; - idc = 23; - x = (3 / 4 * HSPACE2 + 7.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - };*/ - - class TextBox_Key_Shift : Interactive_Button0 { - action = "AGM_Core_keyNewTemp = [42, [false, false, false], 42];"; - text = "$STR_AGM_Core_Shift"; - sizeEx = "0.7 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - idc = 21; - colorText[] = {1,1,1,1}; - colorBackground[] = {0,0,0,0}; - x = (3 / 4 * HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - w = 1.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class TextBox_Key_Control : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [29, [false, false, false], 29];"; - text = "$STR_AGM_Core_Ctrl"; - idc = 22; - x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_Alt : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [56, [false, false, false], 56];"; - text = "$STR_AGM_Core_Alt"; - idc = 23; - x = (3 / 4 * HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_Shift_Right : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [54, [false, false, false], 54];"; - text = "$STR_AGM_Core_Shift_Right"; - idc = 27; - x = (3 / 4 * HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_Control_Right : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [157, [false, false, false], 157];"; - text = "$STR_AGM_Core_Ctrl_Right"; - idc = 28; - x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_Alt_Right : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [184, [false, false, false], 184];"; - text = "$STR_AGM_Core_Alt_Right"; - idc = 29; - x = (3 / 4 * HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Action : TextBox_KeyChange { - text = ""; - idc = 30; - colorText[] = {1,1,1,1}; - colorBackground[] = {0,0,0,0}; - sizeEx = "0.8 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - x = (3 / 4 * HSPACE2 + 6.75 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class TextBox_Key_Default : TextBox_Key_Shift { - action = "call AGM_Core_keysetDefault"; - text = "$STR_AGM_Core_KeyDefault"; - idc = 31; - x = (3 / 4 * HSPACE2 + 8.25 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key_None : TextBox_Key_Shift { - action = "AGM_Core_keyNewTemp = [0, [false, false, false], 0];"; - text = "$STR_AGM_Core_KeyNone"; - idc = 32; - x = (3 / 4 * HSPACE2 + 8.25 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class TextBox_Key : TextBox_KeyChange { - text = ""; - idc = 24; - colorText[] = {1,1,1,1}; - colorBackground[] = {0,0,0,0}; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - x = (3 / 4 * HSPACE2 + 6.75 * 0.1 - 2.0 / 16) * safezoneW + safezoneX; - y = (VSPACE2 + 8.5 * 0.04) * safezoneH + safezoneY; - w = 6.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonV : Interactive_Button0 { - action = "AGM_Core_keySet = 1"; - text = "$STR_AGM_Core_Save"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - idc = 25; - colorBackground[] = {0,0,0,0}; - x = (HSPACE2 + 6 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonW : Interactive_ButtonV { - action = "AGM_Core_keySet = -1"; - text = "$STR_AGM_Core_Cancel"; - idc = 26; - x = (HSPACE2 + 7.5 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonX : Interactive_Button0 { - action = "AGM_Core_keySave = 1; closeDialog 0"; - text = "$STR_AGM_Core_Save"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - idc = 10; - x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 2.5 * 0.1)) * safezoneW + safezoneX; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonY : Interactive_Button0 { - action = "AGM_Core_keySave = -1; closeDialog 0"; - text = "$STR_AGM_Core_Cancel"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - idc = 11; - x = ((1 - 2 * HSPACE2 / 2) - (HSPACE2 + 1 * 0.1)) * safezoneW + safezoneX; - y = (VSPACE2 + 21 * 0.04) * safezoneH + safezoneY; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonA : AGM_Core_Interactive_Button_Base { - action = "false call AGM_Core_nextKeys"; - text = "$STR_AGM_Core_Prev"; - idc = 12; - style = 2 + 0x800; - x = (HSPACE2 + 3 * 0.1) * safezoneW + safezoneX; - y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; - w = 1.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - - class Interactive_ButtonB : Interactive_ButtonA { - action = "true call AGM_Core_nextKeys"; - text = "$STR_AGM_Core_Next"; - idc = 13; - x = (HSPACE2 + 3 * 0.1 + 2.0 / 16) * safezoneW + safezoneX; - }; - - class Interactive_ButtonC : AGM_Core_Text_Button_Base { - text = ""; - idc = 14; - style = 2 + 0x800; - x = (HSPACE2 + 3 * 0.1 + 1.25 / 16) * safezoneW + safezoneX; - y = (VSPACE2 + 0.5 * 0.04) * safezoneH + safezoneY; - w = 0.5 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; - }; - }; -}; diff --git a/addons/core/NoVoice.hpp b/addons/core/NoVoice.hpp deleted file mode 100644 index 15fb8440a5..0000000000 --- a/addons/core/NoVoice.hpp +++ /dev/null @@ -1,227 +0,0 @@ - -class RadioProtocolBase { - class Words; -}; -class AGM_RadioProtocolNoRadio: RadioProtocolBase { - class CuratorWaypointPlaced; - class CuratorWaypointPlacedAttack; - class CuratorObjectPlaced; - class curatorObjectDestroyed; - class curatorModuleCAS; - class SentFireNoTarget_1; - class SentSupportRequestRGCASBombing; - class SentNoTargetDefault; - class SentEngageNoTargetDefault; - class SentFireNoTargetDefault; - class SentAttackNoTargetDefault; - class SentEnemyDetectedMedium; - class SentEnemyDetectedLong; - class SentEnemyDetectedDangerClose; - class SentEnemyDetectedClose; - class SentEnemyDetectedVeryLong; - class SentIsLeaderDefault; - class SentCommandCompletedDefault; - class SentFireReadyDefault; - class SentCommandFailedDefault; - class SentDestinationUnreacheableDefault; - class SentObjectDestroyedDefault; - class SentObjectDestroyedUnknownDefault; - class SentClearDefault; - class SentRepeatCommandDefault; - class SentWhereAreYouDefault; - class SentReportStatusDefault; - class SentNotifyAttackDefault; - class SentNotifyAttackSubgroupDefault; - class SentConfirmMoveDefault; - class SentConfirmAttackDefault; - class SentConfirmOtherDefault; - class SentUnitKilledDefault; - class SentHealthCriticalDefault; - class SentHealthNormalDefault; - class SentReturnToFormationDefault; - class SentLooseFormationDefault; - class SentCmdFollowMeDefault; - class SelectCmdMoveSentenceClose; - class SelectCmdMoveSentenceVeryClose; - class SelectCmdMoveSentenceFar; - class SentEnemyDetectedMediumStealth; - class SentSupportConfirmDefault; - class SelectCmdMoveSentenceClose_1; - class SelectCmdMoveSentenceVeryClose_1; - class SelectCmdMoveSentenceFar_1; - class SentSupportRequestRGCASHelicopter; - class SentSupportRequestRGSupplyDrop; - class SentSupportRequestRGUAV; - class SentSupportRequestRGArty; - class SentSupportRequestRGTransport; - class SentRequestAcknowledgedSGCASBombing; - class SentRequestAcknowledgedSGCASHelicopter; - class SentRequestAcknowledgedSGSupplyDrop; - class SentRequestAcknowledgedSGUAV; - class SentRequestAcknowledgedSGArty; - class SentRequestAcknowledgedTransport; - class SentUnitDestroyedHQCASBombing; - class SentUnitDestroyedHQCASHelicopter; - class SentUnitDestroyedHQSupplyDrop; - class SentUnitDestroyedHQUAV; - class SentUnitDestroyedHQArty; - class SentUnitDestroyedHQTransport; - class SentRequestAccomplishedSGCASBombing; - class SentRequestAccomplishedSGCASHelicopter; - class SentRequestAccomplishedSGSupplyDrop; - class SentRequestAccomplishedSGUAV; - class SentRequestAccomplishedSGArty; - class SentRequestAccomplishedSGTransport; - class SentSupportAddedDuringMission; - class SentArtySGSupportRoundsComplete; - class SentTransportSGWelcomeAboard; - class SentTransportSGLZCoordinatesSelected; - class SelectCmdMoveSentenceLocation; - class SelectCmdMoveSentenceMedium; - class SentEnemyDetectedLongStealth; - class SentEnemyDetectedDangerCloseStealth; - class SentEnemyDetectedCloseStealth; - class SentEnemyDetectedVeryLongStealth; - class SentEngageDefault; - class SelectCmdMoveSentenceLocation_1; - class SelectCmdMoveSentenceMedium_1; - class SentBehaviourSafeDefault; - class SentBehaviourAwareDefault; - class SentBehaviourCombatDefault; - class SentOpenFireDefault; - class SentCeaseFireInsideGroupDefault; - class SentCeaseFireDefault; - class SentEngageStealth; - class SentFireNoTargetStealth; - class SentAttackNoTargetStealth; - class SentNoTargetStealth; - class SentEngageNoTargetStealth; - class SelectCmdMoveSentenceCloseStealth; - class SelectCmdMoveSentenceVeryCloseStealth; - class SelectCmdMoveSentenceFarStealth; - class SelectCmdMoveSentenceLocationStealth; - class SelectCmdMoveSentenceMediumStealth; - class SentReturnToFormationStealth; - class SentLooseFormationStealth; - class SentCmdFollowMeStealth; - class SentOpenFireStealth; - class SentCeaseFireInsideGroupStealth; - class SentBehaviourSafeStealth; - class SentBehaviourAwareStealth; - class SentBehaviourCombatStealth; - class SentSupportConfirmStealth; - class SentCommandFailedStealth; - class SentObjectDestroyedStealth; - class SentObjectDestroyedUnknownStealth; - class SentCommandCompletedStealth; - class SentFireReadyStealth; - class SentIsLeaderStealth; - class SentDestinationUnreacheableStealth; - class SentClearStealth; - class SentRepeatCommandStealth; - class SentWhereAreYouStealth; - class SentReportStatusStealth; - class SentNotifyAttackStealth; - class SentNotifyAttackSubgroupStealth; - class SentConfirmMoveStealth; - class SentConfirmAttackStealth; - class SentConfirmOtherStealth; - class SentUnitKilledStealth; - class SentHealthCriticalStealth; - class SentHealthNormalStealth; - class SentGenReinforcementsConfirmed; - class SentGenReinforcementsRejected; - class SentGenReinforcementsArrived; - class SentGenLeavingAO; - class SentGenTime; - class SentGenLosing; - class SentGenLost; - class SentGenComplete; - class SentGenCmdSeize; - class SentGenCmdDefend; - class SentGenCmdRTB; - class SentGenCmdTargetNeutralize; - class SentGenCmdTargetProtect; - class SentGenCmdTargetEscort; - class SentGenCmdTargetFind; - class SentGenIncoming; - class SentGenBaseUnlockRespawn; - class SentGenBaseUnlockVehicle; - class SentGenBaseSideFriendlyWEST; - class SentFXBreathingSlow; - class SentFXBreathingFast; - class SentFXHit; - class SentFXDeath; - class SentFXHurt; - class SentFXEffort; - class SentFXDrowning; - class SentCeaseFireDefault_1; - class SentGenBaseSideFriendlyEAST; - class SentGenBaseSideFriendlyGUER; - class SentGenBaseSideEnemyWEST; - class SentGenBaseSideEnemyEAST; - class SentGenBaseSideEnemyGUER; - class SentTargetDefault; - class SentTargetStealth; - class Dummy; - class Words: Words { - grid_zero[] = {}; - grid_one[] = {}; - grid_two[] = {}; - grid_three[] = {}; - grid_four[] = {}; - grid_five[] = {}; - grid_six[] = {}; - grid_seven[] = {}; - grid_eight[] = {}; - grid_nine[] = {}; - grid_zero_2[] = {}; - grid_one_2[] = {}; - grid_two_2[] = {}; - grid_three_2[] = {}; - grid_four_2[] = {}; - grid_five_2[] = {}; - grid_six_2[] = {}; - grid_seven_2[] = {}; - grid_eight_2[] = {}; - grid_nine_2[] = {}; - grid_zero_3[] = {}; - grid_one_3[] = {}; - grid_two_3[] = {}; - grid_three_3[] = {}; - grid_four_3[] = {}; - grid_five_3[] = {}; - grid_six_3[] = {}; - grid_seven_3[] = {}; - grid_eight_3[] = {}; - grid_nine_3[] = {}; - Ready[] = {}; - Waiting[] = {}; - StandingBy[] = {}; - /*IAmReady[] = {}; - ReadyForOrders[] = {}; - AwaitingOrders[] = {};*/ - }; -}; - -class CfgVoice { - class AGM_NoVoice { - author = "$STR_AGM_Core_AGMTeam"; - protocol = "AGM_RadioProtocolNoRadio"; - variants[] = {1}; - directories[] = {"",""}; - identityTypes[] = {"Default"}; - scope = 2; - voiceType = ""; - icon = "\a3\Ui_f\data\Map\Markers\Flags\nato_ca.paa"; - displayName = "$STR_AGM_Core_NoVoice"; - }; -}; -class CfgVoiceTypes { - class AGM_NoVoice { - name = "$STR_AGM_Core_NoVoice"; - voices[] = {"AGM_NoVoice","AGM_NoVoice","AGM_NoVoice"}; - preview = "AGM_NoVoice"; - alternative = ""; - }; -}; diff --git a/addons/core/ProgressScreen.hpp b/addons/core/ProgressScreen.hpp deleted file mode 100644 index f43b34db52..0000000000 --- a/addons/core/ProgressScreen.hpp +++ /dev/null @@ -1,94 +0,0 @@ - -class AGM_Core_ProgressBar_Dialog { - idd = -1; - movingEnable = false; - onLoad = "uiNamespace setVariable ['AGM_Core_ctrlProgressBar', (_this select 0) displayCtrl 1]; uiNamespace setVariable ['AGM_Core_ctrlProgressBarTitle', (_this select 0) displayCtrl 2];"; - objects[] = {}; - - class controlsBackground { - class Background { - idc = -1; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0.1}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - - class Progress_Bar { - idc = 1; - moving = 0; - text = ""; - font = "PuristaMedium"; - sizeEx = "1 / 40 / (getResolution select 5)";// * safezoneX / safezoneXAbs"; - lineSpacing = 0; - access = 0; - type = 0; - style = 2; - size = 1; - colorBackground[] = {1, 0.647, 0, 0.5}; - colorText[] = {1,1,1,1}; - x = "safezoneX + 0.1 * safezoneW"; - y = "safezoneY + 0.2 * safezoneH"; - w = "0.0 * safezoneW"; - h = "0.01 * safezoneH"; - }; - - class Title_Bar : Progress_Bar { - idc = 2; - //type = 13; - //size = 1; - colorBackground[] = {0, 0, 0, 0}; - x = "safezoneX + 0.1 * safezoneW"; - y = "safezoneY + 0.1 * safezoneH"; - w = "0.8 * safezoneW"; - h = "0.05 * safezoneH"; - /*class Attributes { - font = "TahomaB"; - color = "#000000"; - align = "center"; - valign = "middle"; - shadow = false; - shadowColor = "#ff0000"; - size = "1"; - };*/ - }; - }; -}; - -class AGM_Core_DisableMouse_Dialog { - idd = -1; - movingEnable = false; - onLoad = "uiNamespace setVariable ['AGM_Core_dlgDisableMouse', _this select 0];"; - objects[] = {}; - class controlsBackground { - class Background { - idc = -1; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0};//0.5 - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - }; -}; diff --git a/addons/core/RscInfoType.hpp b/addons/core/RscInfoType.hpp deleted file mode 100644 index c8d56aba7a..0000000000 --- a/addons/core/RscInfoType.hpp +++ /dev/null @@ -1,27 +0,0 @@ - -class RscInGameUI { - class RscUnitInfo; - class RscUnitInfoSoldier: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgSoldier', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoSoldier', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - }; - class RscUnitInfoTank: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgVehicle', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoVehicle', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - }; - class RscUnitInfoAir: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgAircraft', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAircraft', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - }; - class RscUnitInfoShip: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgShip', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoShip', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - }; - class RscUnitInfoParachute: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgParachute', _this select 0]; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoParachute', [-1, [], []]]) select 2); {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInfoAny', [-1, [], []]]) select 2); [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - }; -}; - -class RscDisplayInventory { - onLoad = "[""onLoad"",_this,""RscDisplayInventory"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; {_this call _x} forEach ((missionNamespace getVariable ['AGM_onLoadInventory', [-1, [], []]]) select 2);"; -}; - -class RscDisplayChannel { - onLoad = "_this call AGM_Core_fnc_onLoadRscDisplayChannel;"; -}; diff --git a/addons/core/XEH_postInit.sqf b/addons/core/XEH_postInit.sqf deleted file mode 100644 index 622bd66bc2..0000000000 --- a/addons/core/XEH_postInit.sqf +++ /dev/null @@ -1,61 +0,0 @@ -// BWA3 Realism - Core -// (C) 2013 KoffeinFlummi. See LICENSE. - -QGVAR(remoteFnc) addPublicVariableEventHandler { - (_this select 1) call FUNC(execRemoteFnc); -}; - -[missionNamespace] call FUNC(executePersistent); - -// check previous version number from profile -_currentVersion = getText (configFile >> "CfgPatches" >> "AGM_Core" >> "version"); -_previousVersion = profileNamespace getVariable ["AGM_VersionNumberString", ""]; - -if (_currentVersion != _previousVersion) then { - // do something - - profileNamespace setVariable ["AGM_VersionNumberString", _currentVersion]; -}; - -0 spawn compile preprocessFileLineNumbers PATHTOF(scripts\Version\checkVersionNumber.sqf); - -// everything that only player controlled machines need, goes below this -if (!hasInterface) exitWith {}; - -call compile preprocessFileLineNumbers PATHTOF(scripts\assignedItemFix.sqf); - -GVAR(keyInput) = compile preprocessFileLineNumbers PATHTOF(scripts\keyInput.sqf); -GVAR(keyRelease) = compile preprocessFileLineNumbers PATHTOF(scripts\keyRelease.sqf); -GVAR(editKey) = compile preprocessFileLineNumbers PATHTOF(scripts\editKey.sqf); -GVAR(openMenu) = compile preprocessFileLineNumbers PATHTOF(scripts\openMenu.sqf); -GVAR(closeMenu) = compile preprocessFileLineNumbers PATHTOF(scripts\closeMenu.sqf); -GVAR(nextKeys) = compile preprocessFileLineNumbers PATHTOF(scripts\nextKeys.sqf); -GVAR(toggleState) = compile preprocessFileLineNumbers PATHTOF(scripts\toggleState.sqf); - -[false] call FUNC(setKeyDefault); - -GVAR(keyStates) = []; -GVAR(keyTimes) = []; -for "_index" from 0 to 300 do { - GVAR(keyStates) set [_index, 0]; - GVAR(keyTimes) set [_index, -1]; -}; - -call compile preprocessFileLineNumbers PATHTOF(scripts\KeyInput\initCanInteractFunction.sqf); -call compile preprocessFileLineNumbers PATHTOF(scripts\KeyInput\initKeys.sqf); -call compile preprocessFileLineNumbers PATHTOF(scripts\KeyInput\initScrollWheel.sqf); - -0 spawn { - while {true} do { - waitUntil {!isNull (findDisplay 46)}; sleep 0.1; - findDisplay 46 displayAddEventHandler ["KeyDown", "_this call GVAR(onKeyDown)"]; - findDisplay 46 displayAddEventHandler ["KeyUp", "_this call GVAR(onKeyUp)"]; - findDisplay 46 displayAddEventHandler ["MouseZChanged", "_this call GVAR(onScrollWheel)"]; - [false] call FUNC(disableUserInput); - waitUntil {isNull (findDisplay 46)}; - }; -}; - -enableCamShake true; - -[missionNamespace, "playerChanged", "{if (alive (_this select 0)) then {[_this select 0] call FUNC(setName)}; if (alive (_this select 1)) then {[_this select 1] call FUNC(setName)};}"] call FUNC(addCustomEventhandler); diff --git a/addons/core/XEH_preInit.sqf b/addons/core/XEH_preInit.sqf deleted file mode 100644 index f117b2ffd7..0000000000 --- a/addons/core/XEH_preInit.sqf +++ /dev/null @@ -1,22 +0,0 @@ -// by commy2 - -AGM_player = player; - -if (hasInterface) then { - ["AGM_CheckForPlayerChange", "onEachFrame", { - if !(AGM_player isEqualTo (missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player])) then { - //if (AGM_player != missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player]) then { - _this = AGM_player; - - AGM_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player]; - uiNamespace setVariable ["AGM_player", AGM_player]; - - [missionNamespace, "playerChanged", [AGM_player, _this]] call FUNC(callCustomEventHandlers); - }; - }] call BIS_fnc_addStackedEventHandler; -}; - -// remove this for the release -/*if (isNil "AGM_Debug") then { - AGM_Debug = ["remote"]; -};*/ diff --git a/addons/core/config.cpp b/addons/core/config.cpp deleted file mode 100644 index e1a71e0103..0000000000 --- a/addons/core/config.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {"AGM_Box_Misc"}; - weapons[] = {"AGM_ItemCore", "AGM_FakePrimaryWeapon"}; - requiredVersion = 0.60; - requiredAddons[] = { - "ace_main" - }; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; -}; - -#include "CfgEventHandlers.hpp" -#include "CfgFunctions.hpp" -#include "CfgSounds.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" - -class CfgFactionClasses { - class PREFIX { - displayName = QUOTE(PREFIX); - priority = 0.1; - side = 7; - }; -}; - -class AGM_Rsc_Display_Base { - idd = -1; - type = 0; - style = 48; - name = ""; - duration = 999999; - fadeIn = 0; - fadeOut = 0; - font = "TahomaB"; - size = 1; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; -}; - -class AGM_Rsc_Control_Base { - idc = 1; - type = 0; - style = 48; - access = 0; - lineSpacing = 0; - moving = 1; - text = ""; - size = 1; - sizeEx = 0; - font = "TahomaB"; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; - x = 0; - y = 0; - w = 0; - h = 0; -}; - -class GVAR(canInteractConditions) { - class GVAR(notOnMap) { - condition = "!visibleMap"; - }; -}; - -class GVAR(Options) { - class enableNumberHotkeys { - displayName = "$STR_AGM_Core_EnableNumberHotkeys"; - default = 1; - }; -}; - -#include -#include -#include -#include - -/* -class RscControlsGroupNoScrollbars; -class RscAttributeInventory: RscControlsGroupNoScrollbars { - onSetFocus = "[_this,""RscAttributeInventory"",'CuratorCommon'] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute""); _this select 0 call AGM_CuratorFix_fnc_addUnloadEventhandler;"; -}; -*/ - -#include -#include -#include -#include diff --git a/addons/core/functions/CuratorFix/fn_addUnloadEventhandler.sqf b/addons/core/functions/CuratorFix/fn_addUnloadEventhandler.sqf deleted file mode 100644 index 583879848a..0000000000 --- a/addons/core/functions/CuratorFix/fn_addUnloadEventhandler.sqf +++ /dev/null @@ -1,12 +0,0 @@ -// by commy2 - -private "_dlg"; - -disableSerialization; -_dlg = ctrlParent _this; - -_dlg displayAddEventHandler ["unload", { - if (_this select 1 == 1) then { - [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call AGM_CuratorFix_fnc_fixCrateContent; - }; -}]; diff --git a/addons/core/functions/CuratorFix/fn_fixCrateContent.sqf b/addons/core/functions/CuratorFix/fn_fixCrateContent.sqf deleted file mode 100644 index e79e570c30..0000000000 --- a/addons/core/functions/CuratorFix/fn_fixCrateContent.sqf +++ /dev/null @@ -1,33 +0,0 @@ -// by commy2 - -private ["_crate", "_weapons", "_items"]; - -_crate = _this select 0; - -// get all weapons inside the crate -_weapons = weaponCargo _crate; -_items = []; - -// if the "weapon" is supposed to be an item, move those from the weapon array to the item array -{ - if (getText (configFile >> "CfgWeapons" >> _x >> "simulation") == "ItemMineDetector") then { - _weapons set [_forEachIndex, ""]; - _items pushBack _x; - }; -} forEach _weapons; - -_weapons = _weapons - [""]; - -// exit now if everything is fine -if (count _items == 0) exitWith {}; - -// otherwise clear weapon cargo and re-add items and weapons -clearWeaponCargoGlobal _crate; - -{ - _crate addWeaponCargoGlobal [_x, 1]; -} forEach _weapons; - -{ - _crate addItemCargoGlobal [_x, 1]; -} forEach _items; diff --git a/addons/core/functions/Debug/fn_exportConfig.sqf b/addons/core/functions/Debug/fn_exportConfig.sqf deleted file mode 100644 index 9c28c36451..0000000000 --- a/addons/core/functions/Debug/fn_exportConfig.sqf +++ /dev/null @@ -1,69 +0,0 @@ -// by commy2 - -/* - usage: - - (configFile >> "CfgAmmo") call AGM_Debug_fnc_exportConfig; -*/ - -private "_fnc_logEntries"; - -_fnc_logEntries = { - private ["_c", "_d", "_p", "_t", "_e"]; - - _c = _this select 0; - _d = _this select 1; - - _p = inheritsFrom _c; - - _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - - _e = []; - for "_i" from 0 to (count _c - 1) do { - private ["_e1, _e2"]; - _e1 = _c select _i; - - _e2 = switch (true) do { - case (isNumber _e1): {getNumber _e1}; - case (isText _e1): {getText _e1}; - case (isArray _e1): {getArray _e1}; - case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; - }; - - if (typeName _e2 != "BOOL") then { - if (typeName _e2 == "ARRAY") then { - _e2 = toArray str _e2; - { - if (_x == toArray "[" select 0) then { - _e2 set [_forEachIndex, toArray "{" select 0]; - }; - if (_x == toArray "]" select 0) then { - _e2 set [_forEachIndex, toArray "}" select 0]; - }; - } forEach _e2; - _e2 = toString _e2; - _t = format ["%1[] = %2;", configName _e1, _e2]; - } else { - _t = format ["%1 = %2;", configName _e1, str _e2]; - }; - for "_a" from 0 to _d do { - _t = " " + _t; - }; - diag_log text _t; - }; - }; - - _t = "};"; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - diag_log text ""; - -}; - -[_this, 0] call _fnc_logEntries; diff --git a/addons/core/functions/Debug/fn_getChildren.sqf b/addons/core/functions/Debug/fn_getChildren.sqf deleted file mode 100644 index c230713e36..0000000000 --- a/addons/core/functions/Debug/fn_getChildren.sqf +++ /dev/null @@ -1,10 +0,0 @@ -// by commy2 - -private ["_name", "_cfgClass", "_classes"]; - -_name = _this select 0; -_cfgClass = _this select 1; - -_classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); -_classes = [_classes, {configName _this}] call FUNC(map); -_classes diff --git a/addons/core/functions/Debug/fn_getDisplayConfigName.sqf b/addons/core/functions/Debug/fn_getDisplayConfigName.sqf deleted file mode 100644 index 57eba31cf0..0000000000 --- a/addons/core/functions/Debug/fn_getDisplayConfigName.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -private ["_configName", "_index"]; - -_configName = ""; - -for "_index" from 0 to (count configFile - 1) do { - _config = configFile select _index; - if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { - _configName = configName _config; - }; -}; - -_configName diff --git a/addons/core/functions/Debug/fn_log.sqf b/addons/core/functions/Debug/fn_log.sqf deleted file mode 100644 index b2a260a31f..0000000000 --- a/addons/core/functions/Debug/fn_log.sqf +++ /dev/null @@ -1,29 +0,0 @@ -// by commy2 - -if ((_this select 0) in (missionNamespace getVariable ["AGM_Debug", []])) then { - private ["_type", "_argument", "_function", "_showInGame"]; - - _this resize 4; - - _type = _this select 0; - _argument = _this select 1; - _function = _this select 2; - _showInGame = _this select 3; - - if (isNil "_function") then { - _function = {_this}; - }; - - if (isNil "_showInGame") then { - _showInGame = true; - }; - - private "_result"; - _result = _argument call _function; - - if (_showInGame) then { - systemChat format ["%1", _result]; - }; - - diag_log text format ["[AGM] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; -}; diff --git a/addons/core/functions/Debug/fn_logControls.sqf b/addons/core/functions/Debug/fn_logControls.sqf deleted file mode 100644 index d0037cce31..0000000000 --- a/addons/core/functions/Debug/fn_logControls.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -private ["_array", "_index"]; - -_array = []; - -for "_index" from 0 to 10000 do { - if (str (findDisplay _this displayCtrl _index) != "No control") then { - diag_log text str (findDisplay _this displayCtrl _index); - _array pushBack _index; - }; -}; - -_array; diff --git a/addons/core/functions/Debug/fn_logDisplays.sqf b/addons/core/functions/Debug/fn_logDisplays.sqf deleted file mode 100644 index 5d990b8042..0000000000 --- a/addons/core/functions/Debug/fn_logDisplays.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -private ["_array", "_index"]; - -_array = []; - -for "_index" from 0 to 10000 do { - if (str (findDisplay _index) != "No Display") then { - diag_log text str findDisplay _index; - _array pushBack _index; - }; -}; - -_array; diff --git a/addons/core/functions/Debug/fn_monitor.sqf b/addons/core/functions/Debug/fn_monitor.sqf deleted file mode 100644 index 6065e23837..0000000000 --- a/addons/core/functions/Debug/fn_monitor.sqf +++ /dev/null @@ -1,10 +0,0 @@ -// by commy2 - -terminate (missionNamespace getVariable ["AGM_Debug_MonitorFnc", scriptNull]); - -AGM_Debug_MonitorFnc = _this spawn { - waitUntil { - hintSilent str (call _this); - false - }; -}; diff --git a/addons/core/functions/Debug/fn_showUser.sqf b/addons/core/functions/Debug/fn_showUser.sqf deleted file mode 100644 index d01585c4dc..0000000000 --- a/addons/core/functions/Debug/fn_showUser.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 - -private "_object"; - -AGM_Debug_Object = _this select 0; - -onEachFrame { - hintSilent str (AGM_Debug_Object getVariable ["AGM_isUsedBy", objNull]); -}; diff --git a/addons/core/functions/fn_addActionEventHandler.sqf b/addons/core/functions/fn_addActionEventHandler.sqf deleted file mode 100644 index 8ea3267335..0000000000 --- a/addons/core/functions/fn_addActionEventHandler.sqf +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Author: commy2 - * - * Add an addAction event to a unit. Used to handle multiple addAction events. Global arguments, local effects. Does only work for player controlled units. - * - * Argument: - * 0: Unit the action should be assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: Condition (Code or String) - * 3: Code to execute (Code or String) - * - * Return value: - * ID of the action (used to remove it later). - */ - -private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; - -_unit = _this select 0; -_action = _this select 1; -_condition = _this select 2; -_statement = _this select 3; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_name = format ["AGM_Action_%1", _action]; - -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; - -_actionID = _actionsVar select 0; -_actions = _actionsVar select 1; - -_id = (_actions select 0) + 1; -_actionIDs = _actions select 1; -_actions = _actions select 2; - -_actionIDs pushBack _id; -_actions pushBack [_condition, _statement]; - -// first action to add, unit needs addAction command -if (_actionID == -1) then { - private "_addAction"; - - _addAction = call compile format [ - "[ - '', - {if (inputAction '%1' == 0) exitWith {}; {if (_this call (_x select 0)) then {_this call (_x select 1)}} forEach (((_this select 0) getVariable '%2') select 1 select 2)}, - nil, - -1, - false, - true, - '%1', - ""if (_this != AGM_player || {vehicle _this != _target}) exitWith {false}; _actions = (_this getVariable '%2') select 1 select 2; _count = count _actions; _index = 0; _return = false; while {_index < _count && {!_return}} do {_return = [_target, _this] call ((_actions select _index) select 0); _index = _index + 1}; _return"" - ]", - _action, - _name - ]; - - _actionID = _unit addAction _addAction; -}; - -_unit setVariable [_name, [_actionID, [_id, _actionIDs, _actions]], false]; - -_id diff --git a/addons/core/functions/fn_addActionMenuEventHandler.sqf b/addons/core/functions/fn_addActionMenuEventHandler.sqf deleted file mode 100644 index 9819c84271..0000000000 --- a/addons/core/functions/fn_addActionMenuEventHandler.sqf +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Author: commy2 - * - * Add an addAction event to a unit. Used to handle multiple addAction events and add a action to the mouse wheel menu. Global arguments, local effects. Does only work for player controlled units. - * - * Argument: - * 0: Unit the action should be assigned to (Object) - * 1: Menu title of the action (String) - * 2: Name of the action, e.g. "DefaultAction" (String) - * 3: Condition (Code or String) - * 4: Code to execute by the action (Code or String) - * 5: Condition for the menu action (Code or String) - * 6: Code to execute from the menu (Code or String) - * 7: Priority of the action (Number, optional default: 0) - * - * Return value: - * ID of the action (used to remove it later). - */ - -private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; - -_unit = _this select 0; -_displayName = _this select 1; -_action = _this select 2; -_condition = _this select 3; -_statement = _this select 4; -_condition2 = _this select 5; -_statement2 = _this select 6; -_priority = _this select 7; - -if (isNil "_priority") then {_priority = 0}; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -if (typeName _condition2 == "STRING") then { - _condition2 = compile _condition2; -}; - -if (typeName _statement2 == "STRING") then { - _statement2 = compile _statement2; -}; - -_name = format ["AGM_ActionMenu_%1", _action]; - -_actionsVar = _unit getVariable [_name, [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_nameVar = format ["%1_ID%2", _name, _id]; -missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _statement2]]; - -_actionIDs pushBack _id; - -_addAction = call compile format [ - "[ - '%2', - {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, - nil, - %4, - false, - true, - '%1', - ""if (_this != AGM_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" - ]", - _action, - _displayName, - _nameVar, - _priority -]; - -_actionID = _unit addAction _addAction; - -_actions pushBack [_actionID, _nameVar]; - -_unit setVariable [_name, [_id, _actionIDs, _actions], false]; - -_id diff --git a/addons/core/functions/fn_addCameraEventHandler.sqf b/addons/core/functions/fn_addCameraEventHandler.sqf deleted file mode 100644 index 281b0366ec..0000000000 --- a/addons/core/functions/fn_addCameraEventHandler.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Add a camera view event handler. The event script is called when the camera view changes. - * The argument of the called function is stored in the _this variable and has as first element the new camera mode. Possible arguments are ["INTERNAL"], ["EXTERNAL"], ["GUNNER"] and ["GROUP"]. - * - * Argument: - * 0: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_statement = _this select 0; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_CameraMode", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -if (_id == 0) then { - uiNamespace setVariable ["AGM_EventHandler_CameraMode", cameraView]; - ("AGM_EventHandlerHelper" call BIS_fnc_rscLayer) cutRsc ["AGM_EventHandlerHelper", "PLAIN"]; -}; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -missionNamespace setVariable ["AGM_EventHandler_CameraMode", [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_addCustomEventHandler.sqf b/addons/core/functions/fn_addCustomEventHandler.sqf deleted file mode 100644 index 55bcd722ae..0000000000 --- a/addons/core/functions/fn_addCustomEventHandler.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Add a custom event to a unit. The event scripts are called by FUNC(callCustomEventHandlers). - * - * Argument: - * 0: Object the event should be assigned to or namespace (Object OR Namespace) - * 1: Name of the event (String) - * 2: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_object", "_type", "_statement", "_name", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_object = _this select 0; -_type = _this select 1; -_statement = _this select 2; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_name = format ["AGM_CustomEventHandlers_%1", _type]; - -_actionsVar = _object getVariable [_name, [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -_object setVariable [_name, [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_addInfoDisplayEventHandler.sqf b/addons/core/functions/fn_addInfoDisplayEventHandler.sqf deleted file mode 100644 index 2cb4e6ea73..0000000000 --- a/addons/core/functions/fn_addInfoDisplayEventHandler.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Author: commy2 - * - * Add a unit info type handler. - * - * Argument: - * 0: Type. Can be "Soldier", "Vehicle", "Aircraft", "Ship", "Parachute" or "Any". "Any" will execute for any compatible display (String) - * 1: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_type", "_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_type = format ["AGM_onLoadInfo%1", _this select 0]; -_statement = _this select 1; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_actionsVar = missionNamespace getVariable [_type, [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -missionNamespace setVariable [_type, [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_addInventoryDisplayLoadedEventHandler.sqf b/addons/core/functions/fn_addInventoryDisplayLoadedEventHandler.sqf deleted file mode 100644 index b9b49551b0..0000000000 --- a/addons/core/functions/fn_addInventoryDisplayLoadedEventHandler.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: commy2 - * - * Add an inventory display opened handler. - * - * Argument: - * 0: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_statement = _this select 0; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_actionsVar = missionNamespace getVariable ["AGM_onLoadInventory", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -missionNamespace setVariable ["AGM_onLoadInventory", [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_addMapMarkerCreatedEventHandler.sqf b/addons/core/functions/fn_addMapMarkerCreatedEventHandler.sqf deleted file mode 100644 index fbcddbe5c3..0000000000 --- a/addons/core/functions/fn_addMapMarkerCreatedEventHandler.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: commy2 - * - * Add a map marker creation event handler. - * - * Argument: - * 0: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_statement = _this select 0; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_MapMarker", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -if (_id == 0) then { - uiNamespace setVariable ["AGM_EventHandler_MapMarker", count allMapMarkers]; - ("AGM_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["AGM_EventHandlerHelper2", "PLAIN"]; -}; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -missionNamespace setVariable ["AGM_EventHandler_MapMarker", [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_addScrollWheelEventHandler.sqf b/addons/core/functions/fn_addScrollWheelEventHandler.sqf deleted file mode 100644 index 33c4dd9acc..0000000000 --- a/addons/core/functions/fn_addScrollWheelEventHandler.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: commy2 - * - * Add an event handler that executes every time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. Argument will be [Interval] where 'Interval' is a number. - * - * Argument: - * 0: Code to execute (Code or String) - * - * Return value: - * ID of the event script (used to remove it later). - */ - -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_statement = _this select 0; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_ScrollWheel", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack _statement; - -missionNamespace setVariable ["AGM_EventHandler_ScrollWheel", [_id, _actionIDs, _actions]]; - -_id diff --git a/addons/core/functions/fn_adminKick.sqf b/addons/core/functions/fn_adminKick.sqf deleted file mode 100644 index c53d228da5..0000000000 --- a/addons/core/functions/fn_adminKick.sqf +++ /dev/null @@ -1,7 +0,0 @@ -// by commy2 - -private "_name"; - -_name = name (_this select 0); - -[_name, "{if (serverCommandAvailable '#kick') then {serverCommand format['#kick %1', _this]}}"] call FUNC(execRemoteFnc); diff --git a/addons/core/functions/fn_ambientBrightness.sqf b/addons/core/functions/fn_ambientBrightness.sqf deleted file mode 100644 index f3ec3d4bfe..0000000000 --- a/addons/core/functions/fn_ambientBrightness.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Author: commy2, idea by Falke - * - * Returns a brightness value depending on the sun and moon state. Ranges from 0 to 1 (dark ... bright). - * - * Argument: - * None. - * - * Return value: - * Ambient brightness (Number) - */ - -sunOrMoon * sunOrMoon + moonIntensity/5 min 1 diff --git a/addons/core/functions/fn_applyForceWalkStatus.sqf b/addons/core/functions/fn_applyForceWalkStatus.sqf deleted file mode 100644 index 54c78a2977..0000000000 --- a/addons/core/functions/fn_applyForceWalkStatus.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* -Name: FUNC(applyForceWalkStatus) - -Author: Pabst Mirror - -Description: - Applys the forceWalk status of an unit. Called from Extended_InitPost_EventHandlers. - -Parameters: - 0: OBJECT - Unit - -Returns: - None - -Example: - [AGM_Player] call FUNC(applyForceWalkStatus) -*/ - -private ["_unit", "_forceWalkNumber"]; - -_unit = _this select 0; -_forceWalkNumber = _unit getVariable ["AGM_forceWalkStatusNumber", 0]; - -_unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/core/functions/fn_binarizeNumber.sqf b/addons/core/functions/fn_binarizeNumber.sqf deleted file mode 100644 index d0ec7fe3b8..0000000000 --- a/addons/core/functions/fn_binarizeNumber.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: commy2 - * - * Get a binary equivalent of a decimal number. - * - * Argument: - * 0: Decimal Number (Number) - * 1: Minimum length of the returned Array, note: returned array can be larger (Number, optional default 8) - * - * Return value: - * Booleans (Array) - */ - -private ["_number", "_minLength", "_array", "_index", "_rest"]; - -_number = round (_this select 0); -_minLength = _this select 1; - -if (isNil "_minLength") then {_minLength = 8}; - -_array = []; -_array resize _minLength; - -for "_index" from 0 to (_minLength - 1) do { - _array set [_index, false]; -}; - -_index = 0; - -while {_number > 0} do { - _rest = _number mod 2; - _number = floor (_number / 2); - - _array set [_index, _rest == 1]; - _index = _index + 1; -}; -_array diff --git a/addons/core/functions/fn_callCustomEventHandlers.sqf b/addons/core/functions/fn_callCustomEventHandlers.sqf deleted file mode 100644 index b028102e7f..0000000000 --- a/addons/core/functions/fn_callCustomEventHandlers.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * - * Execute all custom event script assigned to this object. - * - * Argument: - * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace) - * 1: Name of the event (String) - * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to]) - * - * Return value: - * None. - */ - -private ["_object", "_type", "_argument", "_name", "_actions"]; - -_object = _this select 0; -_type = _this select 1; -_argument = _this select 2; - -if (isNil "_argument") then {_argument = [_object]}; - -_name = format ["AGM_CustomEventHandlers_%1", _type]; - -_actions = (_object getVariable [_name, [-1, [], []]]) select 2; - -{ - _argument call _x; nil; -} count _actions; -nil diff --git a/addons/core/functions/fn_callCustomEventHandlersGlobal.sqf b/addons/core/functions/fn_callCustomEventHandlersGlobal.sqf deleted file mode 100644 index 7195f70316..0000000000 --- a/addons/core/functions/fn_callCustomEventHandlersGlobal.sqf +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Author: commy2 - * - * Execute all custom event script assigned to this object on every machine. - * - * Argument: - * 0: Object the eventhandlers are assigned to or namespace (Object or Namespace) - * 1: Name of the event (String) - * 2: Arguments passed to the eventhandler script (Array, optional default: [Object the event handlers are assigned to]) - * - * Return value: - * None. - */ - -[_this, QUOTE(FUNC(callCustomEventHandlers)), 2] call FUNC(execRemoteFnc); diff --git a/addons/core/functions/fn_canGetInPosition.sqf b/addons/core/functions/fn_canGetInPosition.sqf deleted file mode 100644 index a4ca107cf9..0000000000 --- a/addons/core/functions/fn_canGetInPosition.sqf +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Author: commy2 - * - * Is the unit able to enter the vehicle in the given position? - * - * Arguments: - * 0: Unit to enter the vehicle (Object) - * 1: The vehicle to be entered (Object) - * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) - * 3: Check current distance to vehicles memory point? (Bool, optional default: false) - * 4: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. - * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) - * - * Return Value: - * Nothing - */ - -#define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} -#define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} - -private ["_unit", "_vehicle", "_position", "_checkDistance", "_index"]; - -_this resize 5; - -_unit = _this select 0; -_vehicle = _this select 1; -_position = toLower (_this select 2); -_checkDistance = _this select 3; -_index = _this select 4; // optional, please don't use - -if (isNil "_checkDistance") then {_checkDistance = false}; -if (isNil "_index") then {_index = -1}; - -// general -if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; - -private ["_config", "_turret", "_radius", "_selectionPosition", "_selectionPosition2", "_enemiesInVehicle", "_return"]; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = []; - -_radius = 0; - -_enemiesInVehicle = false; //Possible Side Restriction -{ - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; -} forEach crew _vehicle; - -_return = false; -switch (_position) do { - case "driver" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - if (_vehicle isKindOf "Tank") then { - _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; - }; - - _return = CANGETINDRIVER; - }; - - case "pilot" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - _return = CANGETINDRIVER; - }; - - case "gunner" : { - private "_turretConfig"; - _turret = [typeOf _vehicle] call FUNC(getTurretGunner); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "commander" : { - private "_turretConfig"; - _turret = [typeOf _vehicle] call FUNC(getTurretCommander); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "copilot" : { - private "_turretConfig"; - _turret = [typeOf _vehicle] call FUNC(getTurretCopilot); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "turret" : { - private ["_turrets", "_turretConfig"]; - _turrets = [typeOf _vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "ffv" : { - private ["_turrets", "_turretConfig"]; - _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - }; - }; - }; - - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - }; - }; - }; - - default {}; -}; - -private "_fnc_isInRange"; -_fnc_isInRange = { - if (_radius == 0) exitWith {true}; - - private ["_unitPosition", "_distance"]; - _unitPosition = getPos _unit; - - _distance = _unitPosition distance (_vehicle modelToWorld _selectionPosition); - - if (!isNil "_selectionPosition2") then { - _distance = _distance min (_unitPosition distance (_vehicle modelToWorld _selectionPosition2)); - }; - - _distance < _radius -}; - -// if you want into the cargo and you can't, then check ffv turrets aswell -if (_position == "cargo") exitWith { - if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { - [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); - } -}; - -_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange} - -//_enemiesInVehicle diff --git a/addons/core/functions/fn_canInteractWith.sqf b/addons/core/functions/fn_canInteractWith.sqf deleted file mode 100644 index 1550fcc031..0000000000 --- a/addons/core/functions/fn_canInteractWith.sqf +++ /dev/null @@ -1,10 +0,0 @@ -// by commy2 - -private ["_unit", "_target", "_owner"]; - -_unit = _this select 0; -_target = _this select 1; - -_owner = _target getVariable ["AGM_isUsedBy", objNull]; - -isNull _owner || {_unit == _owner} || {!isPlayer _owner} diff --git a/addons/core/functions/fn_canUseWeapon.sqf b/addons/core/functions/fn_canUseWeapon.sqf deleted file mode 100644 index 038e9b716a..0000000000 --- a/addons/core/functions/fn_canUseWeapon.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -// returns true if the unit is on foot or in a ffv position - -private ["_unit", "_config"]; - -_unit = _this select 0; - -if (_unit == vehicle _unit) exitWith {true}; - -_config = configFile >> "CfgMovesMaleSdr" >> "States" >> animationState _unit; - -isClass _config -&& {getNumber (_config >> "canPullTrigger") == 1} diff --git a/addons/core/functions/fn_changeProjectileDirection.sqf b/addons/core/functions/fn_changeProjectileDirection.sqf deleted file mode 100644 index a70d443d01..0000000000 --- a/addons/core/functions/fn_changeProjectileDirection.sqf +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Author: commy2 - * - * Adjust a projectiles velocity and dir + up vector. - * - * Argument: - * 0: Projectile (Object, CfgAmmo) - * 1: Adjust azimuth this much. (Number) - * 2: Adjust inclination this much. (Number) - * 3: Adjust projectile speed this much. In m/s. (Number, optional default: 0 m/s) - * - * Return value: - * None. - */ - -private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; - -_projectile = _this select 0; -_adjustDir = _this select 1; -_adjustUp = _this select 2; -_adjustSpeed = _this select 3; - -if (isNil "_adjustSpeed") then { - _adjustSpeed = 0; -}; - -["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call AGM_Debug_fnc_log; - -// get old direction vector -_vdir = vectorDir _projectile; - -// get azimuth and inclination and apply corrections -_dir = (_vdir select 0) atan2 (_vdir select 1) + _adjustDir; -_up = sqrt ((_vdir select 1) ^ 2 + (_vdir select 0) ^ 2) atan2 - (_vdir select 2) + _adjustUp; - -// get new direction vector (this is a unit vector) -_vdir = [ - sin _dir * sin _up, - cos _dir * sin _up, - - cos _up -]; - -// get best up vector -_l = sqrt ((_vdir select 0) ^ 2 + (_vdir select 1) ^ 2); if (_l == 0) then {diag_log text format ["[AGM] ERROR: %1, %2, %3, %4, %5, %6, %7", _projectile, _adjustDir, _adjustUp, vectorDir _projectile, _vdir, _dir, _up]}; -_r = -(_vdir select 2) / _l; - -_vup = [ - (_vdir select 0) * _r, - (_vdir select 1) * _r, - _l -]; - -// get new speed vector. Keep total speed, but change to new direction. Yay for vector commands. -_vel = _vdir vectorMultiply _adjustSpeed + vectorMagnitude velocity _projectile; - -// set projectile direction dir and up. Projectiles are long objects, especially with tracers, so it would look dumb otherwise. -_projectile setVectorDirAndUp [_vdir, _vup]; - -// set new speed vector -_projectile setVelocity _vel; diff --git a/addons/core/functions/fn_checkPBOs.sqf b/addons/core/functions/fn_checkPBOs.sqf deleted file mode 100644 index 5b3cf1ed13..0000000000 --- a/addons/core/functions/fn_checkPBOs.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: commy2 - * - * Used to execute the checkPBOs module without placing the module. Don't use this together with the module. - * - * Argument: - * 0: Mode (Number) - * 0: Warn once - * 1: Warn permanently - * 2: Kick - * 1: Check all PBOs? (Boolean, optional default: "[]") - * 2: Whitelist (String, optinal default: false) - * - * Return value: - * None. - */ - -private ["_mode", "_checkAll", "_whitelist", "_logic"]; - -_this resize 3; - -_mode = _this select 0; -_checkAll = _this select 1; -_whitelist = _this select 2; - -if (isNil "_checkAll") then { - _checkAll = false; -}; - -if (isNil "_whitelist") then { - _whitelist = "[]"; -}; - -_logic = "Logic" createVehicleLocal [0,0,0]; -_logic setVariable ["Action", _mode]; -_logic setVariable ["CheckAll", _checkAll]; -_logic setVariable ["Whitelist", _whitelist]; -[_logic, [], true] call FUNC(moduleCheckPBOs); -deleteVehicle _logic; diff --git a/addons/core/functions/fn_claim.sqf b/addons/core/functions/fn_claim.sqf deleted file mode 100644 index c92f9aa8d5..0000000000 --- a/addons/core/functions/fn_claim.sqf +++ /dev/null @@ -1,27 +0,0 @@ -// by commy2 - -private ["_unit", "_target", "_lockTarget", "_owner"]; - -_unit = _this select 0; -_target = _this select 1; -_lockTarget = _this select 2; - -if (isNil "_lockTarget") then {_lockTarget = false}; - -_owner = _target getVariable ["AGM_isUsedBy", objNull]; - -if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { - diag_log text "[AGM] ERROR: Claiming already owned object."; -}; - -_target setVariable ["AGM_isUsedBy", _unit, true]; - -if (_lockTarget) then { - if (!isNull _unit) then { - [_target, "{_locked = locked _this; _this setVariable ['AGM_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc); - } else { - [_target, "{_this lock (_this getVariable ['AGM_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc); - }; -}; - -//systemChat str locked _target; systemChat str (_target getVariable ['AGM_lockStatus', locked _target]); diff --git a/addons/core/functions/fn_closeDialogIfTargetMoves.sqf b/addons/core/functions/fn_closeDialogIfTargetMoves.sqf deleted file mode 100644 index 72d5efd337..0000000000 --- a/addons/core/functions/fn_closeDialogIfTargetMoves.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: commy2 - * - * Closes the current dialog if the target moves, changes vehicle etc. - * - * Arguments: - * 0: Target unit - * 1: Ignore the unit being dead? (Optional, default: No) - * - * Return Value: - * None - */ - -_this spawn { - _target = _this select 0; - _ignoreDead = _this select 1; - if (isNil "_ignoreDead") then {_ignoreDead = false}; - - _vehicleTarget = vehicle _target; - _vehiclePlayer = vehicle AGM_player; - _inVehicle = _target != _vehicleTarget; - - _position = getPosASL _target; - - _fnc_check = { - // either unit changed vehicles - if (_vehiclePlayer != vehicle AGM_player) exitWith {True}; - if (_vehicleTarget != vehicle _target) exitWith {True}; - - // target died - if (!alive _target && {!_ignoreDead}) exitWith {True}; - - // player fell unconscious - if (AGM_player getVariable ["AGM_isUnconscious", False]) exitWith {True}; - - // target moved (outside of vehicle) - (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) - }; - - waitUntil { - if (call _fnc_check) then { - closeDialog 0; - call AGM_Interaction_fnc_hideMenu; - }; - (isNil "AGM_Interaction_MainButton" && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open - }; -}; diff --git a/addons/core/functions/fn_codeToLetter.sqf b/addons/core/functions/fn_codeToLetter.sqf deleted file mode 100644 index 78f4e84eef..0000000000 --- a/addons/core/functions/fn_codeToLetter.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1 diff --git a/addons/core/functions/fn_codeToString.sqf b/addons/core/functions/fn_codeToString.sqf deleted file mode 100644 index 943696e32a..0000000000 --- a/addons/core/functions/fn_codeToString.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Author: commy2 - * - * Removes the brackets around a code and returns the code as a string. It does nothing if the code is already a string. - * - * Argument: - * 0: Code (Code or String) - * - * Return value: - * Code (String) - */ - -private "_function"; - -_function = _this select 0; - -if (typeName _function == "STRING") exitWith {_function}; - -_function = toArray str _function; -_function set [0, -1]; -_function set [count _function - 1, -1]; -_function = toString (_function - [-1]); -_function diff --git a/addons/core/functions/fn_convertKeyCode.sqf b/addons/core/functions/fn_convertKeyCode.sqf deleted file mode 100644 index 45ba78c02e..0000000000 --- a/addons/core/functions/fn_convertKeyCode.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: commy2 - * - * Get a key code used in AGM key input eh. - * - * Argument: - * 0: Arma DIK code (Number) - * 1: Key state for shift left and shift right key (Bool) - * 2: Key state for ctrl left and ctrl right key (Bool) - * 3: Key state for alt and alt gr key (Bool) - * - * Return value: - * Key code (Number) - */ - -#define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] - -private "_key"; - -_key = _this select 0; - -if (_key in KEY_MODIFIERS) exitWith {_key}; - -if (_this select 1) then {_key = _key + 0.1}; -if (_this select 2) then {_key = _key + 0.2}; -if (_this select 3) then {_key = _key + 0.4}; - -_key diff --git a/addons/core/functions/fn_currentChannel.sqf b/addons/core/functions/fn_currentChannel.sqf deleted file mode 100644 index 0be751367d..0000000000 --- a/addons/core/functions/fn_currentChannel.sqf +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Author: commy2 - * - * Returns the current radio / chat / marker channel. - * - * Argument: - * NONE. - * - * Return value: - * The current channel. Can be "group", "side", "global", "command", "vehicle" or "direct" (String) - */ - -#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"] -#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"] - -CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable ["AGM_currentChannel", ""])) max 0 diff --git a/addons/core/functions/fn_disableUserInput.sqf b/addons/core/functions/fn_disableUserInput.sqf deleted file mode 100644 index 12b3aae23c..0000000000 --- a/addons/core/functions/fn_disableUserInput.sqf +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Author: commy2 - * - * Disables key input. ESC can still be pressed to open the menu. - * - * Argument: - * 0: True to disable key inputs, false to re-enable them (Bool) - * - * Return value: - * Nothing - */ - -private ["_state", "_dlg"]; - -_state = _this select 0; - -if (_state) then { - disableSerialization; - - if (!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])) exitWith {}; - if ("AGM_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) exitWith {}; - - // end TFAR and ACRE2 radio transmissions - 0 spawn FUNC(endRadioTransmission); - - // Close map - if (visibleMap && {!(player getVariable ["AGM_canSwitchUnits", false])}) then {openMap false}; - - closeDialog 0; - createDialog QGVAR(DisableMouse_Dialog); - - _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); - - _dlg displayAddEventHandler ["KeyDown", { - _key = _this select 1; - - if (_key == 1 && {alive player}) then { - createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer); - - disableSerialization; - _dlg = finddisplay 49; - _dlg displayAddEventHandler ["KeyDown", { - _key = _this select 1; - !(_key == 1) - }]; - - for "_index" from 100 to 2000 do { - (_dlg displayCtrl _index) ctrlEnable false; - }; - - _ctrl = _dlg displayctrl 103; - _ctrl ctrlSetEventHandler ["buttonClick", "while {!isNull (uiNamespace getVariable ['GVAR(dlgDisableMouse)', displayNull])} do {closeDialog 0}; failMission 'LOSER'; [false] call FUNC(disableUserInput);"]; - _ctrl ctrlEnable true; - _ctrl ctrlSetText "ABORT"; - _ctrl ctrlSetTooltip "Abort."; - - _ctrl = _dlg displayctrl ([104, 1010] select isMultiplayer); - _ctrl ctrlSetEventHandler ["buttonClick", "closeDialog 0; player setDamage 1; [false] call FUNC(disableUserInput);"]; - _ctrl ctrlEnable (call {_config = missionConfigFile >> "respawnButton"; !isNumber _config || {getNumber _config == 1}}); - _ctrl ctrlSetText "RESPAWN"; - _ctrl ctrlSetTooltip "Respawn."; - }; - - if (_key in actionKeys "TeamSwitch" && {teamSwitchEnabled}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; teamSwitch};//_acc = accTime; teamSwitch; setAccTime _acc}; - if (_key in actionKeys "CuratorInterface" && {getAssignedCuratorLogic player in allCurators}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openCuratorInterface}; - if (_key in actionKeys "ShowMap" && {player getVariable ["AGM_canSwitchUnits", false]}) then {(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; openMap true}; - - if (serverCommandAvailable "#missions" || {player getVariable ["AGM_isUnconscious", false] && {(call FUNC(player)) getVariable ["AGM_Medical_AllowChatWhileUnconscious", missionNamespace getVariable ["AGM_Medical_AllowChatWhileUnconscious", false]]}}) then { - if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { - _key = 0; - }; - }; - - _key > 0 - }]; - _dlg displayAddEventHandler ["KeyUp", {true}]; - - ["AGM_DisableUserInput", "onEachFrame", { - if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then { - ["AGM_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - [true] call FUNC(disableUserInput); - }; - }] call BIS_fnc_addStackedEventHandler; -} else { - if ("AGM_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then { - ["AGM_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - }; - - (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0; -}; diff --git a/addons/core/functions/fn_displayText.sqf b/addons/core/functions/fn_displayText.sqf deleted file mode 100644 index 89f0a44948..0000000000 --- a/addons/core/functions/fn_displayText.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Author: commy2 - * - * Display a message. - * - * Argument: - * 0: Message (String) - * 1: Play a clicking sound (Bool, optional default: false) - * 2: How long before hiding the message in seconds (Number, optional default: 2 sec) - * 3: Priority, higher priority messages will override lesser important ones (Number, optional default: 0) - * - * Return value: - * Nothing - */ - -#define DEFAULT_PLAY_SOUND false -#define DEFAULT_DELAY 2 -#define DEFAULT_PRIORITY 0 - -if (isNil QGVAR(lastHint)) then { - GVAR(lastHint) = [0, 0]; -}; - -_this resize 4; - -_this spawn { - private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; - - _text = _this select 0; - _sound = _this select 1; - _delay = _this select 2; - _priority = _this select 3; - - _lastHintTime = GVAR(lastHint) select 0; - _lastHintPriority = GVAR(lastHint) select 1; - - if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text}; - if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; - if (isNil "_delay") then {_delay = DEFAULT_DELAY}; - if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; - - _time = time; - if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { - hintSilent _text; - if (_sound) then {playSound "AGM_Sound_Click"}; - GVAR(lastHint) set [0, _time]; - GVAR(lastHint) set [1, _priority]; - - sleep _delay; - if (_time == GVAR(lastHint) select 0) then {hintSilent ""}; - }; -}; diff --git a/addons/core/functions/fn_displayTextPicture.sqf b/addons/core/functions/fn_displayTextPicture.sqf deleted file mode 100644 index 7da5095c9e..0000000000 --- a/addons/core/functions/fn_displayTextPicture.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Display a structured text with image. - * - * Argument: - * 0: Text (Anything) - * 1: Image (String) - * - * Return value: - * Nothing - */ - -private ["_text", "_image"]; - -_text = _this select 0; -_image = _this select 1; - -if (typeName _text != "TEXT") then { - _text = parseText format ["%1", _text]; -}; - -_text = composeText [ - parseText format ["", _image], - lineBreak, - _text -]; - -[_text] call FUNC(displayTextStructured); diff --git a/addons/core/functions/fn_displayTextStructured.sqf b/addons/core/functions/fn_displayTextStructured.sqf deleted file mode 100644 index 4c7b2970a6..0000000000 --- a/addons/core/functions/fn_displayTextStructured.sqf +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Author: commy2 - * - * Display a structured text. - * - * Argument: - * 0: Text (Anything) - * 1: Size of the textbox (Number, optional default: 1) - * - * Return value: - * Nothing - */ - -private ["_text", "_size", "_isShown", "_ctrlHint"]; - -_text = _this select 0; -_size = _this select 1; - -if (isNil "_size") then {_size = 1}; - -if (typeName _text != "TEXT") then { - _text = composeText [lineBreak, parseText format ["%1", _text]]; -}; - -_isShown = ctrlShown (uiNamespace getVariable ["AGM_ctrlHint", controlNull]); - -("AGM_RscHint" call BIS_fnc_rscLayer) cutRsc ["AGM_RscHint", "PLAIN", 0, true]; - -disableSerialization; -_ctrlHint = uiNamespace getVariable "AGM_ctrlHint"; - -_ctrlHint ctrlSetPosition [ - safeZoneW + safeZoneX - 0 * safezoneW, - safeZoneY + 0.2 * safezoneH, - 0.2 * safeZoneW, - _size * 0.1 * SafeZoneH -]; -_ctrlHint ctrlCommit 0; - -_ctrlHint ctrlSetStructuredText _text; -_ctrlHint ctrlSetPosition [ - safeZoneW + safeZoneX - 0.2 * safezoneW, - safeZoneY + 0.2 * safezoneH, - 0.2 * safeZoneW, - _size * 0.1 * SafeZoneH -]; -_ctrlHint ctrlCommit ([0.2, 0] select _isShown); diff --git a/addons/core/functions/fn_doAnimation.sqf b/addons/core/functions/fn_doAnimation.sqf deleted file mode 100644 index ef0c74d94c..0000000000 --- a/addons/core/functions/fn_doAnimation.sqf +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Author: commy2 - * - * Execute an animation. This is used to not break things like the unconsciousness animation. - * - * Argument: - * 0: Unit (Object) - * 1: Animation (String) - * 2: Priority of the animation. (Number, optional default: 0) - * 0: PlayMove - * 1: PlayMoveNow - * 2: SwitchMove (no transitional animation, doesn't overwrite priority 1) - * - * Return value: - * Nothing - */ - -private ["_unit", "_animation", "_priority", "_force"]; - -_unit = _this select 0; -_animation = _this select 1; -_priority = _this select 2; -_force = False; - -// no animation given -if (isNil "_animation") exitWith { - diag_log format ["[AGM] ERROR: No animation specified in %1", _fnc_scriptNameParent]; -}; - -if (isNil "_priority") then { - _priority = 0; -}; -if (count _this > 3) then { - _force = _this select 3; -}; - -// don't overwrite more important animations -if (_unit getVariable ["AGM_isUnconscious", false] && {!_force}) exitWith { - if (_animation != "Unconscious") then { - [_unit, "Unconscious", 2] call FUNC(doAnimation); - }; -}; - -// don't go unconscious if the unit isn't unconscious -if (_animation == "Unconscious" && {!(_unit getVariable ["AGM_isUnconscious", false])}) exitWith {}; - -// switchMove "" no longer works in dev 1.37 -if (_animation == "") then { - _animation = [_unit] call FUNC(getDefaultAnim); -}; - -switch (_priority) do { - case 0 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); - }; - }; - case 1 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); - }; - }; - case 2 : { - // Execute on all machines. SwitchMove has local effects. - [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); - }; - default {}; -}; - -["Anim", [_priority, _animation]] call AGM_Debug_fnc_log; diff --git a/addons/core/functions/fn_endRadioTransmission.sqf b/addons/core/functions/fn_endRadioTransmission.sqf deleted file mode 100644 index 7cf764b6c5..0000000000 --- a/addons/core/functions/fn_endRadioTransmission.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * End radio transmissions of addons TFAR and ACRE2. TFAR v0.9.7, ACRE Public Beta 2.0.3.571 - * - * Arguments: - * None. - * - * Return Value: - * None. - * - */ - -// ACRE -if (isClass (configFile >> "CfgPatches" >> "acre_main")) then { - [-1] call acre_core_fnc_handleMultiPttKeyPressUp; - [0] call acre_core_fnc_handleMultiPttKeyPressUp; - [1] call acre_core_fnc_handleMultiPttKeyPressUp; - [2] call acre_core_fnc_handleMultiPttKeyPressUp; -}; - -// TFAR -if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then { - call TFAR_fnc_onSwTangentReleased; - call TFAR_fnc_onAdditionalSwTangentReleased; - call TFAR_fnc_onLRTangentReleased; - call TFAR_fnc_onAdditionalLRTangentReleased; - call TFAR_fnc_onDDTangentReleased; -}; diff --git a/addons/core/functions/fn_execPersistentFnc.sqf b/addons/core/functions/fn_execPersistentFnc.sqf deleted file mode 100644 index 5ca2f3ed43..0000000000 --- a/addons/core/functions/fn_execPersistentFnc.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Author: commy2 - * - * Execute a function on every machine. Function will also be called upon JIP (postInit). The arguments are stored in (_this select 0), while the assigned namespace is stored in (_this select 1). - * - * Argument: - * 0: Function arguments (Array) - * 1: Function to execute, has to be defined on the remote machine first (String) - * 2: Namespace to save that variable in (Object or Namespace) - * 3: Name. Will overwrite previously defined functions with that name (String) - * - * Return value: - * Nothing. - */ - -private ["_arguments", "_function", "_unit", "_name"]; - -GVAR(remoteFnc) = _this; - -_arguments = _this select 0; -_function = call compile (_this select 1); -_unit = _this select 2; -_name = _this select 3; - -["Remote", [_arguments, _this select 1, _name], {format ["%1 call %2 id: %3", _this select 0, _this select 1, _this select 2]}, false] call AGM_Debug_fnc_log; - -// execute function on every currently connected machine -[[_arguments, _unit], _this select 1, 2] call FUNC(execRemoteFnc); - -// save persistent function for JIP -private ["_persistentFunctions", "_index"]; - -_persistentFunctions = _unit getVariable ["AGM_PersistentFunctions", []]; - -// find index to overwrite function with the same name, add to end otherwise -_index = count _persistentFunctions; -{ - if (_x select 2 == _name) exitWith { - _index = _forEachIndex; - }; -} forEach _persistentFunctions; - -// set new value -_persistentFunctions set [_index, [_arguments, _function, _name]]; - -// broadcast variable -if (typeName _unit == "NAMESPACE") then { - AGM_PersistentFunctions = _persistentFunctions; - publicVariable "AGM_PersistentFunctions"; -} else { - _unit setVariable ["AGM_PersistentFunctions", _persistentFunctions, true]; -}; diff --git a/addons/core/functions/fn_execRemoteFnc.sqf b/addons/core/functions/fn_execRemoteFnc.sqf deleted file mode 100644 index 4f14d46890..0000000000 --- a/addons/core/functions/fn_execRemoteFnc.sqf +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Author: commy2 - * - * Execute a function on a remote machine in mp. - * - * Argument: - * 0: Function arguments (Array) - * 1: Function to execute, has to be defined on the remote machine first (String) - * 2: The function will be executed where this unit is local OR the mode were this function should be executed. (Object OR Number, optional default: 2) - * Mode 0: execute on this machine only - * Mode 1: execute on server - * Mode 2: execute on all clients + server - * Mode 3: execute on dedicated only - * - * Return value: - * Nothing - */ - -private ["_arguments", "_function", "_unit", "_id"]; - -GVAR(remoteFnc) = _this; - -_arguments = _this select 0; -_function = call compile (_this select 1); -_unit = _this select 2; - -if (isNil "_unit") then { - _unit = 2; -}; - -["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call AGM_Debug_fnc_log; - -if (typeName _unit == "SCALAR") exitWith { - switch (_unit) do { - case 0 : { - _arguments call _function; - }; - case 1 : { - if (isServer) then { - _arguments call _function; - } else { - publicVariableServer QGVAR(remoteFnc); - }; - }; - case 2 : { - _arguments call _function; - - GVAR(remoteFnc) set [2, 0]; - publicVariable QGVAR(remoteFnc); - }; - case 3 : { - if (isDedicated) then { - _arguments call _function; - } else { - if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; - }; - }; - }; -}; - -if (local _unit) then { - _arguments call _function; -} else { - if (isServer) then { - _id = owner _unit; - _id publicVariableClient QGVAR(remoteFnc); - } else { - publicVariableServer QGVAR(remoteFnc); - }; -}; diff --git a/addons/core/functions/fn_executePersistent.sqf b/addons/core/functions/fn_executePersistent.sqf deleted file mode 100644 index 9e2fab7b3d..0000000000 --- a/addons/core/functions/fn_executePersistent.sqf +++ /dev/null @@ -1,15 +0,0 @@ -// by commy2 - -private "_target"; - -_target = _this select 0; - -{ - if (isNil "_x") then { - diag_log text format ["[AGM] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; - } else { - if (typeName _x == "ARRAY") then { - [_x select 0, _target] call (_x select 1); - }; - }; -} forEach (_target getVariable ["AGM_PersistentFunctions", []]); diff --git a/addons/core/functions/fn_filter.sqf b/addons/core/functions/fn_filter.sqf deleted file mode 100644 index febbb7f38a..0000000000 --- a/addons/core/functions/fn_filter.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: KoffeinFlummi, commy2 - * - * Filters array and removes every element not fitting the condition - * - * Arguments: - * 0: Array to be filtered. - * 1: Code to be evaluated. - * - * Return Value: - * Final array - * - * Usage: - * [[0,1,2,3,4], {_this > 2}] call FUNC(filter) ==> [3,4] - */ - -private ["_array", "_code", "_newArray", "_index"]; - -_array = _this select 0; -_code = _this select 1; - -if (isNil "_array") exitWith { - diag_log text format ["[AGM] ERROR: No array for function filter in %1", _fnc_scriptNameParent]; - [] -}; - -_newArray = []; -for "_index" from 0 to (count _array - 1) do { - if ((_array select _index) call _code) then { - _newArray pushBack (_array select _index); - }; -}; -_newArray diff --git a/addons/core/functions/fn_fixLoweredRifleAnimation.sqf b/addons/core/functions/fn_fixLoweredRifleAnimation.sqf deleted file mode 100644 index 6a6e584305..0000000000 --- a/addons/core/functions/fn_fixLoweredRifleAnimation.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 - -private "_unit"; - -_unit = _this select 0; - -if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"}) then { - [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); -}; diff --git a/addons/core/functions/fn_getCaptivityStatus.sqf b/addons/core/functions/fn_getCaptivityStatus.sqf deleted file mode 100644 index d2352f2098..0000000000 --- a/addons/core/functions/fn_getCaptivityStatus.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: commy2 - * - * Return the captivity status of an unit. - * - * Argument: - * 0: Unit (Object) - * - * Return value: - * Reasons, why the unit is a captive. An empty array is returned if the unit is not a captive (Array of Strings) - */ - -private ["_unit", "_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; - -_unit = _this select 0; - -_captivityReasons = missionNamespace getVariable ["AGM_captivityReasons", []]; - -_unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(binarizeNumber); - -_unitCaptivityReasons = []; -{ - if (_unitCaptivityStatus select _forEachIndex) then { - _unitCaptivityReasons pushBack _x; - }; -} forEach _captivityReasons; - -_unitCaptivityReasons diff --git a/addons/core/functions/fn_getConfigCommander.sqf b/addons/core/functions/fn_getConfigCommander.sqf deleted file mode 100644 index fd1863ae6b..0000000000 --- a/addons/core/functions/fn_getConfigCommander.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Author: commy2 - * - * Get the commander config of a vehicles turret. - * - * Argument: - * 0: vehicle type (String) - * - * Return value: - * Commander config (Config) - */ - -private ["_vehicle", "_config", "_turret"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> _vehicle; -_turret = [_vehicle] call FUNC(getTurretCommander); - -[_config, _turret] call FUNC(getTurretConfigPath) diff --git a/addons/core/functions/fn_getConfigGunner.sqf b/addons/core/functions/fn_getConfigGunner.sqf deleted file mode 100644 index 1c13a2c99c..0000000000 --- a/addons/core/functions/fn_getConfigGunner.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Author: commy2 - * - * Get the gunner config of a vehicles turret. - * - * Argument: - * 0: vehicle type (String) - * - * Return value: - * Gunner config (Config) - */ - -private ["_vehicle", "_config", "_turret"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> _vehicle; -_turret = [_vehicle] call FUNC(getTurretGunner); - -[_config, _turret] call FUNC(getTurretConfigPath) diff --git a/addons/core/functions/fn_getDefaultAnim.sqf b/addons/core/functions/fn_getDefaultAnim.sqf deleted file mode 100644 index 1a2430af87..0000000000 --- a/addons/core/functions/fn_getDefaultAnim.sqf +++ /dev/null @@ -1,28 +0,0 @@ -// by commy2 - -private ["_unit", "_anim", "_stance"]; - -_unit = _this select 0; -_anim = toLower (animationState _unit); - -// stance is broken for some animations. -_stance = stance _unit; -if (_anim find "ppne" == 4) then { - _stance = "PRONE"; -}; -if (_anim find "pknl" == 4) then { - _stance = "CROUCH"; -}; -if (_anim find "perc" == 4) then { - _stance = "STAND"; -}; - -_anim = format ["AmovP%1M%2S%3W%4D%5", - ["erc", "knl", "pne"] select (["STAND", "CROUCH", "PRONE"] find _stance) max 0, - ["stp", "run"] select (vectorMagnitude velocity _unit > 1), - [["ras", "low"] select weaponLowered _unit, "non"] select (currentWeapon _unit == ""), - ["non", "rfl", "lnr", "pst", "bin"] select (["", primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] find currentWeapon _unit) max 0, - ["non", _anim select [count _anim - 1, 1]] select (_anim select [count _anim - 2, 2] in ["df", "db", "dl", "dr"]) -]; - -["", _anim] select isClass (configFile >> "CfgMovesMaleSdr" >> "States" >> _anim) diff --git a/addons/core/functions/fn_getDoorTurrets.sqf b/addons/core/functions/fn_getDoorTurrets.sqf deleted file mode 100644 index 8dd05861b3..0000000000 --- a/addons/core/functions/fn_getDoorTurrets.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: bux578 - * - * Gets the turret index of door gunners - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret indexes of the door gunner. Empty array means no gunner position. (Array) - */ - - /* - Name: FUNC(getDoorTurrets) - - Author(s): - bux578 - - Description: - Returns the turret indices of door gunners - - Parameters: - 0: STRING - vehicle type - - Returns: - ARRAY -*/ - -private ["_vehicleType", "_turrets", "_doorTurrets", "_config"]; - -_vehicleType = _this select 0; - -_turrets = [_vehicleType] call FUNC(getTurrets); - -_doorTurrets = []; - -{ - _config = configFile >> "CfgVehicles" >> _vehicleType; - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { - _doorTurrets pushBack _x; - }; -} forEach _turrets; - -_doorTurrets diff --git a/addons/core/functions/fn_getForceWalkStatus.sqf b/addons/core/functions/fn_getForceWalkStatus.sqf deleted file mode 100644 index be169761df..0000000000 --- a/addons/core/functions/fn_getForceWalkStatus.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* -Name: FUNC(getForceWalkStatus) - -Author: Pabst Mirror (from captivity by commy2) - -Description: - Returns reasons why the unit is forceWalk-ing, empty if not forced. - -Parameters: - 0: OBJECT - Unit - -Returns: - ARRAY(of strings) - Reason why the unit is force walking - -Example: - [AGM_Player] call FUNC(getForceWalkStatus) -*/ - -private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; - -_unit = _this select 0; - -_forceWalkReasons = missionNamespace getVariable ["AGM_forceWalkReasons", []]; - -_unitForceWalkNumber = _unit getVariable ["AGM_forceWalkStatusNumber", 0]; - -_unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC(binarizeNumber); - -_unitForceWalkReasons = []; -{ - if (_unitForceWalkStatus select _forEachIndex) then { - _unitForceWalkReasons pushBack _x; - }; -} forEach _forceWalkReasons; - -_unitForceWalkReasons diff --git a/addons/core/functions/fn_getHitPoints.sqf b/addons/core/functions/fn_getHitPoints.sqf deleted file mode 100644 index a6522348d1..0000000000 --- a/addons/core/functions/fn_getHitPoints.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: commy2 - * - * Returns all hitpoints of any vehicle. Non unique hitpoints in turrets are ignored. - * - * Arguments: - * 0: A vehicle, not the classname (Object) - * - * Return Value: - * The hitpoints (Array) - */ - -private ["_vehicle", "_config", "_hitpoints"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; - -_hitpoints = []; - -// get all classes that can contain hitpoints -private "_hitpointClasses"; -_hitpointClasses = [_config >> "HitPoints"]; -{ - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; - -} forEach allTurrets _vehicle; - -// iterate through all classes with hitpoints and their parents -{ - private "_class"; - _class = _x; - - while {isClass _class} do { - - for "_i" from 0 to (count _class - 1) do { - private "_entry"; - _entry = configName (_class select _i); - - if (!(_entry in _hitpoints) && {!isNil {_vehicle getHitPointDamage _entry}}) then { - _hitpoints pushBack _entry; - }; - }; - - _class = inheritsFrom _class; - }; - -} forEach _hitpointClasses; - -_hitpoints diff --git a/addons/core/functions/fn_getHitPointsWithSelections.sqf b/addons/core/functions/fn_getHitPointsWithSelections.sqf deleted file mode 100644 index 0b7133227c..0000000000 --- a/addons/core/functions/fn_getHitPointsWithSelections.sqf +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Author: commy2 - * - * Returns all hitpoints and their selections of any vehicle. Might contain duplicates if the turrets contain non unique hitpoints with different selection names. - * - * Arguments: - * 0: A vehicle, not the classname (Object) - * - * Return Value: - * The hitpoints with selections. Format: [hitpoints, selections]. They correspond by index. (Array) - */ - -private ["_vehicle", "_config", "_hitpoints", "_selections"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; - -_hitpoints = []; -_selections = []; - -// get all classes that can contain hitpoints -private "_hitpointClasses"; -_hitpointClasses = [_config >> "HitPoints"]; -{ - private "_class"; - _class = ([_config, _x] call FUNC(getTurretConfigPath)) >> "HitPoints"; - - if (isClass _class) then { - _hitpointClasses pushBack _class; - }; - -} forEach allTurrets _vehicle; - -// iterate through all classes with hitpoints and their parents -{ - private "_class"; - _class = _x; - - while {isClass _class} do { - - for "_i" from 0 to (count _class - 1) do { - private ["_entry", "_selection"]; - - _entry = configName (_class select _i); - _selection = getText (_class select _i >> "name"); - - if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { - _hitpoints pushBack _entry; - _selections pushBack _selection; - }; - }; - - _class = inheritsFrom _class; - }; - -} forEach _hitpointClasses; - -[_hitpoints, _selections] diff --git a/addons/core/functions/fn_getInPosition.sqf b/addons/core/functions/fn_getInPosition.sqf deleted file mode 100644 index 6d2a40968d..0000000000 --- a/addons/core/functions/fn_getInPosition.sqf +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Author: commy2 - * - * Move unit into given vehicle position. Or switch to that position if the unit is already inside the vehicle. - * - * Arguments: - * 0: Unit to enter the vehicle (Object) - * 1: The vehicle to be entered (Object) - * 2: Position. Can be "Driver", "Pilot", "Gunner", "Commander", "Copilot", "Turret", "FFV", "Codriver" or "Cargo" (String) - * 3: Index. "Turret", "FFV", "Codriver" and "Cargo" support this optional parameter. Which position should be taken. - * Note: This index is diffrent from Armas "cargoIndex". (Number, optional default: next free index) - * - * Return Value: - * Nothing - */ - -#define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} -#define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} - -private ["_unit", "_vehicle", "_position", "_index"]; - -_unit = _this select 0; -_vehicle = _this select 1; -_position = toLower (_this select 2); -_index = _this select 3; // optional, please don't use - -if (isNil "_index") then {_index = -1}; - -// general -if (!alive _vehicle || {locked _vehicle > 1}) exitWith {false}; - -private ["_config", "_turret", "_isInside", "_script", "_enemiesInVehicle"]; - -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_turret = []; - -_isInside = vehicle _unit == _vehicle; - -_script = {}; -_enemiesInVehicle = false; //Possible Side Restriction -{ - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; -} forEach crew _vehicle; - -switch (_position) do { - case "driver" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "pilot" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - _position = "driver"; - }; - }; - - case "gunner" : { - _turret = [typeOf _vehicle] call FUNC(getTurretGunner); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "commander" : { - _turret = [typeOf _vehicle] call FUNC(getTurretCommander); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "copilot" : { - _turret = [typeOf _vehicle] call FUNC(getTurretCopilot); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - }; - }; - - case "turret" : { - private "_turrets"; - _turrets = [typeOf _vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; - } else { - - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; - }; - }; - }; - }; - - case "ffv" : { - private "_turrets"; - _turrets = [typeOf _vehicle] call FUNC(getTurretsFFV); - - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - } else { - - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - }; - }; - }; - }; - - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; - }; - }; - - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; - }; - }; - - default {}; -}; - -// this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. -private "_fnc_getInEH"; -_fnc_getInEH = { - private "_config"; - // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? - _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; - - if (isClass _config) then { - //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats - if !(_isInside) then { - [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); - }; - }; -}; - -// if you want into the cargo and you can't, then check ffv turrets aswell -if (_position == "cargo") exitWith { - if (_script isEqualTo {}) then { - [_unit, _vehicle, "ffv"] call FUNC(getInPosition); - } else { - call _script; - }; -}; - -call _script; - -/* - sleep 0.1; - if ((vehicle _unit) != _vehicle) then { - ["fn_getInPosition.sqf - Side Restriction, failed to move _unit into vehicle"] call bis_fnc_error; - _unit moveInAny _vehicle; //attempt to fail gracefully - }; -*/ diff --git a/addons/core/functions/fn_getMarkerType.sqf b/addons/core/functions/fn_getMarkerType.sqf deleted file mode 100644 index 3d35cae56d..0000000000 --- a/addons/core/functions/fn_getMarkerType.sqf +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Get the apropriate marker for a group. - * - * Arguments: - * 0: Group - * - * Return Value: - * Marker Type (string) - */ - -_group = _this select 0; -_leader = leader _group; -_vehicle = vehicle _leader; -_side = side _leader; - -if (_vehicle == _leader) exitWith { - if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or - (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") - ) then { - ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - } else { - ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - }; -}; - -if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith { - ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportFuel") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportAmmo") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_canRepair") > 0) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_fuelCapacityCargo") > 0) - ) exitWith { - ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; - -if (_vehicle isKindOf "Plane") exitWith { - ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if (_vehicle isKindOf "Air") exitWith { - ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; - -if (_vehicle isKindOf "StaticMortar") exitWith { - ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith { - ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; - -if (_vehicle isKindOf "Car") exitWith { - ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith { - ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; -if (_vehicle isKindOf "Tank") exitWith { - ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; - -if (_vehicle isKindOf "Ship") exitWith { - ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) -}; - -// generic marker -["n_unknown", "b_unknown", "o_unknown"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) diff --git a/addons/core/functions/fn_getName.sqf b/addons/core/functions/fn_getName.sqf deleted file mode 100644 index 16ec94ab33..0000000000 --- a/addons/core/functions/fn_getName.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: commy2 - * - * Returns the name of the object. Used to prevent issues with the name command. - * - * Argument: - * 0: Object (Object) - * 1: Show effective commander name? (Bool, optinal default: false) - * - * Return value: - * The name. - */ - -private ["_unit", "_showEffective", "_name"]; - -_unit = _this select 0; -_showEffective = _this select 1; - -if (isNil "_showEffective") then { - _showEffective = false; -}; - -_name = ""; - -if (_unit isKindOf "CAManBase") then { - _name = _unit getVariable ["AGM_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; -} else { - if (_showEffective) then { - _name = [effectiveCommander _unit] call FUNC(getName); - } else { - _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); - }; -}; - -_name diff --git a/addons/core/functions/fn_getNumberFromMissionSQM.sqf b/addons/core/functions/fn_getNumberFromMissionSQM.sqf deleted file mode 100644 index 47524d7cb6..0000000000 --- a/addons/core/functions/fn_getNumberFromMissionSQM.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: commy2 - * - * Get a number from the mission.sqm file. Mission has to be saved in the Editor. - * - * Argument: - * 0: Path of the entry in the mission.sqm (Array) - * - * Return value: - * Value of the entry. Note: If the entry does not exist, it might return 0 or an entry with the same name of another class! (Number) - */ - -private "_number"; - -_number = _this call FUNC(getStringFromMissionSQM); - -parseNumber _number; diff --git a/addons/core/functions/fn_getPitchBankYaw.sqf b/addons/core/functions/fn_getPitchBankYaw.sqf deleted file mode 100644 index 95f9846e9a..0000000000 --- a/addons/core/functions/fn_getPitchBankYaw.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Returns [pitch, bank, yaw] for given vehicle in degrees. - * - * Arguments: - * 0: Unit/Vehicle - * - * Return Value: - * [pitch, bank, yaw] - */ - -((_this select 0) call BIS_fnc_getPitchBank) + [getDir (_this select 0)] diff --git a/addons/core/functions/fn_getStringFromMissionSQM.sqf b/addons/core/functions/fn_getStringFromMissionSQM.sqf deleted file mode 100644 index 34a2565a7e..0000000000 --- a/addons/core/functions/fn_getStringFromMissionSQM.sqf +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Author: commy2 - * - * Get a string from the mission.sqm file. Mission has to be saved in the Editor. The string cannot contain the ; character. - * - * Argument: - * 0: Path of the entry in the mission.sqm (Array) - * - * Return value: - * Value of the entry. Note: If the entry does not exist, it might return an empty string or an entry with the same name of another class! (String) - */ - -private ["_path", "_mission", "_a", "_class", "_index", "_array", "_b", "_entry"]; - -_path = _this; - -if (missionName == "") exitWith {""}; -_mission = toArray toLower loadFile "mission.sqm"; -_mission resize 65536; -{ - if (_x < 33) then { - _mission set [_forEachIndex, -1]; - } -} forEach _mission; -_mission = toString (_mission - [-1]); - -{_path set [_forEachIndex, toLower _x]} forEach _path; - -for "_a" from 0 to (count _path - 2) do { - _class = format ["class%1{", _path select _a]; - - _index = _mission find _class; - - _array = toArray _mission; - for "_b" from 0 to (_index + count toArray _class - 1) do { - _array set [_b, -1]; - }; - _array = _array - [-1]; - - _mission = toString _array; -}; - -_entry = format ["%1=", _path select (count _path - 1)]; -_index = _mission find _entry; -if (_index == -1) exitWith {""}; - -_array = toArray _mission; -for "_b" from 0 to (_index + count toArray _entry - 1) do { - _array set [_b, -1]; -}; -_mission = toString (_array - [-1]); - -_index = _mission find ";"; - -_mission = toArray _mission; -_mission resize _index; -format ["%1", toString _mission]; diff --git a/addons/core/functions/fn_getTargetAzimuthAndInclination.sqf b/addons/core/functions/fn_getTargetAzimuthAndInclination.sqf deleted file mode 100644 index 5f75268514..0000000000 --- a/addons/core/functions/fn_getTargetAzimuthAndInclination.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: commy2 - * - * Get players viewing direction and slope - * - * Argument: - * None. - * - * Return value: - * 0: Azimuth (Number) - * 1: Inclination or 'slope' (Number) - */ - -private ["_position", "_direction", "_azimuth", "_inclination"]; - -_position = ATLToASL positionCameraToWorld [0, 0, 0]; -_direction = ATLToASL positionCameraToWorld [0, 0, 1]; - -_azimuth = ((_direction select 0) - (_position select 0)) atan2 ((_direction select 1) - (_position select 1)); -_inclination = asin ((_direction select 2) - (_position select 2)); - -if (_azimuth < 0) then {_azimuth = _azimuth + 360}; - -[_azimuth, _inclination] diff --git a/addons/core/functions/fn_getTargetDistance.sqf b/addons/core/functions/fn_getTargetDistance.sqf deleted file mode 100644 index b0b50539f5..0000000000 --- a/addons/core/functions/fn_getTargetDistance.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: commy2 - * - * Get the distance to the next object the player is looking at. Used for laser distance measurements. - * - * Argument: - * 0: How accurate will the measurement be? In meters. (Number) - * 1: Maximal distance to measure. (Number) - * 2: Minimal distance to measure. (optional, Number) - * - * Return value: - * Measured distance in meters. Can return maximal or minimal distance (Number) - */ - -private ["_interval", "_maxDistance", "_minDistance", "_position", "_laser", "_line", "_distance", "_iteration"]; - -_interval = _this select 0; -_maxDistance = _this select 1; -_minDistance = _this select 2; - -_position = ATLToASL positionCameraToWorld [0, 0, 0]; -_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; - -_laser = + _position; -_line = [_position, _laser]; - -_distance = _maxDistance; -_iteration = _distance; - -while { - _iteration > _interval / 2 -} do { - _iteration = _iteration / 2; - - _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; - _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; - _line set [1, _laser]; - - _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle AGM_player]) || {terrainIntersectASL _line})) * _iteration); -}; - -_distance = _interval * round (_distance / _interval); - -_distance = _distance min _maxDistance; - -if !(isNil "_minDistance") then {_distance = _distance max _minDistance}; - -_distance diff --git a/addons/core/functions/fn_getTargetObject.sqf b/addons/core/functions/fn_getTargetObject.sqf deleted file mode 100644 index 9fb07c1cf0..0000000000 --- a/addons/core/functions/fn_getTargetObject.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: commy2 - * - * Get the nearest object the player is looking at. Used for laser designator instead of cursorTarget. - * - * Argument: - * 0: Maximal distance to search. (Number) - * - * Return value: - * Nearest object directly in line of sight, if none objNull (Object) - */ - -private ["_maxDistance", "_position", "_laser", "_intersects"]; - -_maxDistance = _this select 0; - -_position = ATLToASL positionCameraToWorld [0, 0, 0]; -_position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; - -_laser = ATLToASL positionCameraToWorld [0, 0, _maxDistance]; -_laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; - -_intersects = lineIntersectsObjs [_position, _laser, objNull, objNull, true, 2]; - -if (count _intersects == 0) then {objNull} else {_intersects select 0} diff --git a/addons/core/functions/fn_getTurretCommander.sqf b/addons/core/functions/fn_getTurretCommander.sqf deleted file mode 100644 index 9989928576..0000000000 --- a/addons/core/functions/fn_getTurretCommander.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret index of a vehicles commander. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret index of the vehicles commander. Empty array means no observer position. (Array) - */ - -private ["_vehicle", "_turrets", "_turret", "_config"]; - -_vehicle = _this select 0; - -_turrets = [_vehicle] call FUNC(getTurrets); - -_turret = []; -{ - _config = configFile >> "CfgVehicles" >> _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "primaryObserver") == 1) exitWith { - _turret = _x; - }; -} forEach _turrets; -_turret diff --git a/addons/core/functions/fn_getTurretConfigPath.sqf b/addons/core/functions/fn_getTurretConfigPath.sqf deleted file mode 100644 index 7b463fa397..0000000000 --- a/addons/core/functions/fn_getTurretConfigPath.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Get the config path of a vehicles turret. - * - * Argument: - * 0: vehicles config (Config) - * 1: Turret index (Array) - * - * Return value: - * Turret config (Config) - */ - -private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"]; - -_config = _this select 0; -_turretIndex = _this select 1; - -for "_index" from 0 to (count _turretIndex - 1) do { - _config = _config >> "Turrets"; - - _offset = 0; - _config2 = _config select 0; - - _foundClasses = 0; - for "_a" from 0 to (count _config - 1) do { - if (isClass _config2) then { - _foundClasses = _foundClasses + 1; - } else { - _offset = _offset + 1; - }; - _config2 = _config select (_turretIndex select _index) + _offset; - - if (_foundClasses == _turretIndex select _index) exitWith {}; - }; - _config = _config2; -}; -_config diff --git a/addons/core/functions/fn_getTurretCopilot.sqf b/addons/core/functions/fn_getTurretCopilot.sqf deleted file mode 100644 index c85c1ea114..0000000000 --- a/addons/core/functions/fn_getTurretCopilot.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret index of a vehicles copilot. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret index of the vehicles gunner. Empty array means no copilot position. (Array) - */ - -private ["_vehicle", "_turrets", "_turret", "_config"]; - -_vehicle = _this select 0; - -_turrets = [_vehicle] call FUNC(getTurrets); - -_turret = []; -{ - _config = configFile >> "CfgVehicles" >> _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { - _turret = _x; - }; -} forEach _turrets; -_turret diff --git a/addons/core/functions/fn_getTurretGunner.sqf b/addons/core/functions/fn_getTurretGunner.sqf deleted file mode 100644 index b4531e6611..0000000000 --- a/addons/core/functions/fn_getTurretGunner.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret index of a vehicles gunner. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret index of the vehicles gunner. Empty array means no gunner position. (Array) - */ - -private ["_vehicle", "_turrets", "_turret", "_config"]; - -_vehicle = _this select 0; - -_turrets = [_vehicle] call FUNC(getTurrets); - -_turret = []; -{ - _config = configFile >> "CfgVehicles" >> _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "primaryGunner") == 1) exitWith { - _turret = _x; - }; -} forEach _turrets; -_turret diff --git a/addons/core/functions/fn_getTurretIndex.sqf b/addons/core/functions/fn_getTurretIndex.sqf deleted file mode 100644 index 402a21d969..0000000000 --- a/addons/core/functions/fn_getTurretIndex.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret index of a units current turret. - * - * Argument: - * 0: Unit, not the vehicle (as in not a car but the player) (Object) - * - * Return value: - * Turret index array or config path. E.g: [0] for gunner or [0,0] for commander. Returns empty array if unit is not in a turret. (Array) - */ - -private ["_unit", "_vehicle", "_turrets", "_units", "_index"]; - -_unit = _this select 0; -_vehicle = vehicle _unit; - -//_turrets = [typeOf _vehicle] call FUNC(getTurrets); -_turrets = allTurrets [_vehicle, true]; - -_units = []; -{ - _units pushBack (_vehicle turretUnit _x); -} forEach _turrets; - -_index = _units find _unit; - -if (_index == -1) exitWith {[]}; - -_turrets select _index; diff --git a/addons/core/functions/fn_getTurrets.sqf b/addons/core/functions/fn_getTurrets.sqf deleted file mode 100644 index c5c781c59c..0000000000 --- a/addons/core/functions/fn_getTurrets.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Author: commy2 - * - * Get all turret indicies of a vehicle. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * All turret index arrays of the vehicle. E.g: [[0], [0,0]] (Array) - */ - -private ["_type", "_config", "_turrets", "_fnc_addTurret"]; - -_type = _this select 0; - -_varName = format ["AGM_CachedTurrets_%1", _type]; -_turrets = + (uiNamespace getVariable _varName); - -if (!isNil "_turrets") exitWith {_turrets}; - -_config = configFile >> "CfgVehicles" >> _type; - -_turrets = []; -_fnc_addTurret = { - private ["_config", "_path", "_count", "_offset", "_index", "_path2", "_config2"]; - - _config = _this select 0; - _path = _this select 1; - - _config = _config >> "Turrets"; - _count = count _config; - - _offset = 0; - for "_index" from 0 to (_count - 1) do { - _path2 = _path + [_index - _offset]; - _config2 = _config select _index; - - if (isClass _config2) then { - _turrets pushBack _path2; - [_config2, _path2] call _fnc_addTurret; - } else { - _offset = _offset + 1; - }; - }; -}; - -[_config, []] call _fnc_addTurret; - -uiNamespace setVariable [_varName, _turrets]; - -_turrets diff --git a/addons/core/functions/fn_getTurretsFFV.sqf b/addons/core/functions/fn_getTurretsFFV.sqf deleted file mode 100644 index 1c9947927f..0000000000 --- a/addons/core/functions/fn_getTurretsFFV.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret indices of ffv turrets. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret index of the vehicles gunner. Empty array means no ffv turrets. (Array) - */ - -private ["_vehicle", "_turrets", "_turret", "_config"]; - -_vehicle = _this select 0; - -_turrets = [_vehicle] call FUNC(getTurrets); - -_turret = []; -{ - _config = configFile >> "CfgVehicles" >> _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if (getNumber (_config >> "isPersonTurret") == 1) then { - _turret pushBack _x; - }; -} forEach _turrets; -_turret diff --git a/addons/core/functions/fn_getTurretsOther.sqf b/addons/core/functions/fn_getTurretsOther.sqf deleted file mode 100644 index 6c1c629a55..0000000000 --- a/addons/core/functions/fn_getTurretsOther.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: commy2 - * - * Get the turret indices of other turrets (not gunner, commander, copilot or ffv). - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Turret index of the vehicles gunner. Empty array means no other turrets. (Array) - */ - -private ["_vehicle", "_turrets", "_turret", "_config"]; - -_vehicle = _this select 0; - -_turrets = [_vehicle] call FUNC(getTurrets); - -_turret = []; -{ - _config = configFile >> "CfgVehicles" >> _vehicle; - - _config = [_config, _x] call FUNC(getTurretConfigPath); - - if ( getNumber (_config >> "isCopilot") != 1 - && {getNumber (_config >> "primaryGunner") != 1} - && {getNumber (_config >> "primaryObserver") != 1} - && {getNumber (_config >> "isPersonTurret") != 1} - ) then { - _turret pushBack _x; - }; -} forEach _turrets; -_turret diff --git a/addons/core/functions/fn_getUavControlPosition.sqf b/addons/core/functions/fn_getUavControlPosition.sqf deleted file mode 100644 index 9d3e414b9f..0000000000 --- a/addons/core/functions/fn_getUavControlPosition.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* -Name: FUNC(getUavControlPosition) - -Author: Pabst Mirror - -Description: - Gets the seat position of a UAV that the unit is activly controlling. - "" - not connected to anything or not activly controling - "DRIVER" - "GUNNER" - -Parameters: - 0: OBJECT - Unit - -Returns: - STRING - Position in the UAV that is currently being controled by the unit. - -Example: - [AGM_Player] call FUNC(getUavControlPosition) -*/ - -private ["_unit", "_uav", "_positionArray", "_playerIndex"]; - -_unit = _this select 0; -_uav = getConnectedUAV _unit; -if (isNull _uav) exitWith {""}; -_positionArray = UAVControl _uav; -_playerIndex = _positionArray find _unit; -if (_playerIndex == -1) exitWith {""}; - -_positionArray select (_playerIndex + 1) diff --git a/addons/core/functions/fn_getVehicleCargo.sqf b/addons/core/functions/fn_getVehicleCargo.sqf deleted file mode 100644 index 2a4a784117..0000000000 --- a/addons/core/functions/fn_getVehicleCargo.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: commy2 - * - * Get the vehicle cargo positions. Codrivers and ffv positions are not listed. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Vehicle cargo positions. (Array) - */ - -private ["_vehicle", "_config", "_cargo", "_codrivers"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> _vehicle; - -_cargo = []; -_codrivers = getArray (_config >> "cargoIsCoDriver"); - -for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; -}; -_cargo diff --git a/addons/core/functions/fn_getVehicleCodriver.sqf b/addons/core/functions/fn_getVehicleCodriver.sqf deleted file mode 100644 index 98f4a4bccd..0000000000 --- a/addons/core/functions/fn_getVehicleCodriver.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: commy2 - * - * Get the vehicle codriver positions. - * - * Argument: - * 0: Vehicle type (String) - * - * Return value: - * Vehicle codriver positions. (Array) - */ - -private ["_vehicle", "_config", "_cargo", "_codrivers"]; - -_vehicle = _this select 0; - -_config = configFile >> "CfgVehicles" >> _vehicle; - -_cargo = []; -_codrivers = getArray (_config >> "cargoIsCoDriver"); - -for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; -}; -_cargo diff --git a/addons/core/functions/fn_getVehicleCrew.sqf b/addons/core/functions/fn_getVehicleCrew.sqf deleted file mode 100644 index 927defdd1f..0000000000 --- a/addons/core/functions/fn_getVehicleCrew.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: commy2 - * - * Returns array of crew member objects. - * - * Argument: - * 0: Vehicle (Object) - * 1: Slot types. Can contain "driver", "commander", "gunner", "turret", "cargo" and "ffv". Case sensitive (Array) - * - * Return value: - * Crew (Array) - */ - -private ["_vehicle", "_types", "_crew"]; - -_vehicle = _this select 0; -_types = _this select 1; - -_crew = []; - -// iterate through all crew members -{ - // this unit is in a ffv position. check if we search for ffv. - if (_x select 4) then { - if ("ffv" in _types) then { - _crew pushBack (_x select 0); - }; - } else { - // otherwise check if we search for that type. toLower, because fullCrew returns "driver" vs. "Turret". - if (toLower (_x select 1) in _types) then { - _crew pushBack (_x select 0); - }; - }; -} forEach fullCrew _vehicle; - -_crew diff --git a/addons/core/functions/fn_getWeaponAzimuthAndInclination.sqf b/addons/core/functions/fn_getWeaponAzimuthAndInclination.sqf deleted file mode 100644 index 702bde7761..0000000000 --- a/addons/core/functions/fn_getWeaponAzimuthAndInclination.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: commy2 - * - * Get players weapon direction and slope - * - * Argument: - * 0: Weapon name (String) - * - * Return value: - * 0: Azimuth (Number) - * 1: Inclination or 'slope' (Number) - */ - -private ["_weapon", "_direction", "_azimuth", "_inclination"]; - -_weapon = _this select 0; - -_direction = AGM_player weaponDirection _weapon; - -_azimuth = (_direction select 0) atan2 (_direction select 1); -_inclination = asin (_direction select 2); - -if (_azimuth < 0) then {_azimuth = _azimuth + 360}; - -[_azimuth, _inclination] diff --git a/addons/core/functions/fn_getWeaponType.sqf b/addons/core/functions/fn_getWeaponType.sqf deleted file mode 100644 index 3f2829b4a9..0000000000 --- a/addons/core/functions/fn_getWeaponType.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: commy2 - * - * Check what kind of weapon the given class name is. (primary, secondary or handgun) - * - * Argument: - * 0: Class name of the weapon (String) - * - * Return value: - * Slot index of the given class name, 1: primary, 2: secondary, 3: handgun, else: -1 (Number) - */ - -private ["_weapon", "_type", "_index"]; - -_weapon = _this select 0; - -_type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); - -_index = 0; -while {!(_type select _index) && {_index < 16}} do { - _index = _index + 1; -}; - -switch (_index) do { - case 0 : {1}; - case 1 : {3}; - case 2 : {2}; - default {-1}; -} diff --git a/addons/core/functions/fn_getWindDirection.sqf b/addons/core/functions/fn_getWindDirection.sqf deleted file mode 100644 index fe1fad8341..0000000000 --- a/addons/core/functions/fn_getWindDirection.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * - * Get the compass direction the wind is blowing from. - * - * Argument: - * None. - * - * Return value: - * Wind direction. (String) - */ - -switch (round (windDir / 360 * 16)) do { - case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; - case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; - case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; - case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; - case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; - case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; - case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; - case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; - case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; - case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; - case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; - case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; - case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; - case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; - case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; - default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; -}; diff --git a/addons/core/functions/fn_goKneeling.sqf b/addons/core/functions/fn_goKneeling.sqf deleted file mode 100644 index 1dcbc78706..0000000000 --- a/addons/core/functions/fn_goKneeling.sqf +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Author: commy2 - * - * Abhocken! Unit goes kneeling if not prone already and lowers weapon. Try, throw, catch because I'm bored. - * - * Argument: - * 0: Unit (Object) - * - * Return value: - * None. - */ - -private "_unit"; - -_unit = _this select 0; - -try { - if (_unit == vehicle _unit) then { - switch (currentWeapon _unit) do { - case "" : {throw "AmovPknlMstpSnonWnonDnon"}; - case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; - case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; - case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; - case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; - }; - }; -} catch { - if (stance _unit != "PRONE") then { - [_unit, _exception] call FUNC(doAnimation); - }; -}; diff --git a/addons/core/functions/fn_hadamardProduct.sqf b/addons/core/functions/fn_hadamardProduct.sqf deleted file mode 100644 index 3b0d3fea9f..0000000000 --- a/addons/core/functions/fn_hadamardProduct.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Returns the Hadamard Product of two vectors. - * (x hadamard y) = [x1*y1, x2*y2, x3*y3] - * - * Arguments: - * 0: Vector 1 - * 1: Vector 2 - * - * Return Value: - * Hadamard Product - */ - -_vector1 = _this select 0; -_vector2 = _this select 1; - -_newVector = []; - -for "_i" from 0 to (((count _vector1) min (count _vector2)) - 1) do { - _newVector = _newVector + [(_vector1 select _i) * (_vector2 select _i)]; -}; - -_newVector diff --git a/addons/core/functions/fn_inTransitionAnim.sqf b/addons/core/functions/fn_inTransitionAnim.sqf deleted file mode 100644 index 14f470dd7c..0000000000 --- a/addons/core/functions/fn_inTransitionAnim.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "looped") == 0 diff --git a/addons/core/functions/fn_interpolateFromArray.sqf b/addons/core/functions/fn_interpolateFromArray.sqf deleted file mode 100644 index 4fc68ae427..0000000000 --- a/addons/core/functions/fn_interpolateFromArray.sqf +++ /dev/null @@ -1,11 +0,0 @@ -// by commy2 - -private ["_array", "_value", "_min", "_max"]; - -_array = _this select 0; -_value = _this select 1; - -_min = _array select floor _value; -_max = _array select ceil _value; - -_min + (_max - _min) * (_value % 1) diff --git a/addons/core/functions/fn_isAutoWind.sqf b/addons/core/functions/fn_isAutoWind.sqf deleted file mode 100644 index 756d0561f3..0000000000 --- a/addons/core/functions/fn_isAutoWind.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Author: commy2 - * - * Check if wind is set on auto. - * - * Argument: - * None. - * - * Return value: - * This mission has automatic wind? (Bool) - */ - -["Mission", "Intel", "windForced"] call FUNC(getNumberFromMissionSQM) != 1 diff --git a/addons/core/functions/fn_isEOD.sqf b/addons/core/functions/fn_isEOD.sqf deleted file mode 100644 index 257d6b0d5d..0000000000 --- a/addons/core/functions/fn_isEOD.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/* - Name: FUNC(isEOD) - - Author: Garth de Wet (LH) - - Description: - Checks whether the passed unit is an explosive specialist. - Either through config entry: "canDeactivateMines" - or - unit setVariable ["AGM_isEOD", true] - - Parameters: - 0: OBJECT - Unit to check if is a specialist - - Returns: - BOOLEAN - - Example: - _isSpecialist = [player] call FUNC(isEOD); -*/ - -private "_unit"; - -_unit = _this select 0; - -_unit getVariable ["AGM_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] diff --git a/addons/core/functions/fn_isEngineer.sqf b/addons/core/functions/fn_isEngineer.sqf deleted file mode 100644 index 7b147d827d..0000000000 --- a/addons/core/functions/fn_isEngineer.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: marc_book, edited by commy2 - * - * Checks if a unit is an engineer. - * - * Arguments: - * 0: unit to be checked (object) - * - * Return Value: - * Bool: is the unit an engineer? - */ - -private "_unit"; - -_unit = _this select 0; - -_unit getVariable ["AGM_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] diff --git a/addons/core/functions/fn_isInBuilding.sqf b/addons/core/functions/fn_isInBuilding.sqf deleted file mode 100644 index 124c128e56..0000000000 --- a/addons/core/functions/fn_isInBuilding.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Author: commy2 - * - * Check if the unit is in a building. Will return true if the unit is sitting in a bush. - * - * Argument: - * 0: Unit (Object) - * - * Return value: - * Is the unit in a building? (Bool) - */ - -#define DISTANCE 10 - -private ["_unit", "_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; - -_unit = _this select 0; - -_position = eyePos _unit; -_positionX = _position select 0; -_positionY = _position select 1; -_positionZ = _position select 2; -_intersections = 0; - -if (lineIntersects [_position, [_positionX, _positionY, _positionZ + DISTANCE]]) then { - _intersections = _intersections + 1; -}; - -if (lineIntersects [_position, [_positionX + DISTANCE, _positionY, _positionZ]]) then { - _intersections = _intersections + 1; -}; - -if (lineIntersects [_position, [_positionX - DISTANCE, _positionY, _positionZ]]) then { - _intersections = _intersections + 1; -}; - -if (lineIntersects [_position, [_positionX, _positionY + DISTANCE, _positionZ]]) then { - _intersections = _intersections + 1; -}; - -if (lineIntersects [_position, [_positionX, _positionY - DISTANCE, _positionZ]]) then { - _intersections = _intersections + 1; -}; - -_intersections > 3 diff --git a/addons/core/functions/fn_isMedic.sqf b/addons/core/functions/fn_isMedic.sqf deleted file mode 100644 index 59e3915948..0000000000 --- a/addons/core/functions/fn_isMedic.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Checks if a unit is a medic. - * - * Arguments: - * 0: unit to be checked (object) - * - * Return Value: - * Bool: is unit medic? - */ - -private ["_unit"]; - -_unit = _this select 0; - -_unit getVariable ["AGM_isMedic", (getNumber(configFile >> "CfgVehicles" >> typeOf _unit >> "attendant") == 1)] diff --git a/addons/core/functions/fn_isPlayer.sqf b/addons/core/functions/fn_isPlayer.sqf deleted file mode 100644 index 992e213776..0000000000 --- a/addons/core/functions/fn_isPlayer.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: bux578, commy2 - * - * Checks if a unit is a player / curator controlled unit. - * Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine) - * - * Arguments: - * 0: unit to be checked (object) - * - * Return Value: - * Bool: is unit a player? - */ - -isPlayer (_this select 0) || {_this select 0 == call FUNC(player)} diff --git a/addons/core/functions/fn_isTurnedOut.sqf b/addons/core/functions/fn_isTurnedOut.sqf deleted file mode 100644 index e4acc89240..0000000000 --- a/addons/core/functions/fn_isTurnedOut.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Check if the unit is in a vehicle and turned out. - * - * Argument: - * 0: Unit, not the vehicle (Object) - * - * Return value: - * Is the unit turned out or not? Will return false if there is no option to turn out in the first place. (Bool) - */ - -private ["_unit", "_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; - -_unit = _this select 0; -_vehicle = vehicle _unit; -_config = configFile >> "CfgVehicles" >> typeOf _vehicle; -_animation = animationState _unit; - -if (_unit == driver _vehicle) then { - _action = getText (_config >> "driverAction"); - _inAction = getText (_config >> "driverInAction"); -} else { - _turretIndex = [_unit] call FUNC(getTurretIndex); - - _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); - - _action = getText (_config >> "gunnerAction"); - _inAction = getText (_config >> "gunnerInAction"); -}; - -if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false}; - -_animation = toArray _animation; -_animation resize (count toArray _action); -_animation = toString _animation; - -_animation == _action diff --git a/addons/core/functions/fn_letterToCode.sqf b/addons/core/functions/fn_letterToCode.sqf deleted file mode 100644 index 4382e94362..0000000000 --- a/addons/core/functions/fn_letterToCode.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -[-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1 diff --git a/addons/core/functions/fn_map.sqf b/addons/core/functions/fn_map.sqf deleted file mode 100644 index c1f3ab4802..0000000000 --- a/addons/core/functions/fn_map.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: KoffeinFlummi, commy2 - * - * Applies given code to every element in an array, LIKE SOMETHING SQF SHOULD HAVE BY DEFAULT. - * - * Arguments: - * 0: Array to be thingied. - * 1: Code to be applied to every element. - * - * Return Value: - * Final array - * - * Usage: - * [["2", "gobblecock", "25"], {parseNumber _this}] call FUNC(map) ==> [2, 0, 25] - */ - -private ["_array", "_code"]; - -_array = + _this select 0; -_code = _this select 1; - -if (isNil "_array") exitWith { - diag_log text format ["[AGM] ERROR: No array for function map in %1", _fnc_scriptNameParent]; - [] -}; - -{ - _array set [_forEachIndex, _x call _code]; -} forEach _array; -_array diff --git a/addons/core/functions/fn_moduleCheckPBOs.sqf b/addons/core/functions/fn_moduleCheckPBOs.sqf deleted file mode 100644 index 9e502fc325..0000000000 --- a/addons/core/functions/fn_moduleCheckPBOs.sqf +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Initializes the check-PBOs module. - * - * Arguments: - * Whatever the module provides. (I dunno.) - * - * Return Value: - * None - */ - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -_mode = parseNumber (_logic getVariable "Action"); -_checkAll = _logic getVariable ["CheckAll", false]; -_whitelist = call compile (_logic getVariable ["Whitelist", "[]"]); - -if (isNil "_whitelist") then { - _whitelist = []; -}; - -_whitelist = [_whitelist, {toLower _this}] call FUNC(map); - -AGM_Version_CheckAll = _checkAll; -AGM_Version_Whitelist = _whitelist; - -if (!isServer) then { - [_mode, _checkAll, _whitelist] spawn { - _mode = _this select 0; - _checkAll = _this select 1; - _whitelist = _this select 2; - - waitUntil { - sleep 1; - !isNil "AGM_Version_ClientErrors" - }; - - _missingAddon = AGM_Version_ClientErrors select 0; - _missingAddonServer = AGM_Version_ClientErrors select 1; - _oldVersionClient = AGM_Version_ClientErrors select 2; - _oldVersionServer = AGM_Version_ClientErrors select 3; - - // Display error message. - if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { - _text = "[AGM] Version mismatch:

"; - _error = format ["AGM version mismatch: %1: ", profileName]; - - if (_missingAddon) then { - _text = _text + "Detected missing addon on client
"; - _error = _error + "Missing file(s); "; - }; - if (_missingAddonServer) then { - _text = _text + "Detected missing addon on server
"; - _error = _error + "Additional file(s); "; - }; - if (_oldVersionClient) then { - _text = _text + "Detected old client version
"; - _error = _error + "Older version; "; - }; - if (_oldVersionServer) then { - _text = _text + "Detected old server version
"; - _error = _error + "Newer version; "; - }; - - //[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - diag_log text _error; - - _text = composeText [lineBreak, parseText format ["%1", _text]]; - - _rscLayer = "AGM_RscErrorHint" call BIS_fnc_rscLayer; - _rscLayer cutRsc ["AGM_RscErrorHint", "PLAIN", 0, true]; - - disableSerialization; - _ctrlHint = uiNamespace getVariable "AGM_ctrlErrorHint"; - _ctrlHint ctrlSetStructuredText _text; - - if (_mode == 0) then { - sleep 10; - _rscLayer cutFadeOut 0.2; - }; - - if (_mode == 2) then { - sleep 10; - waitUntil {alive player}; - [player] call FUNC(adminKick); - }; - }; - }; -}; - -diag_log text format ["[AGM]: Check-PBOs Module Initialized. Mode: %1.", _mode]; diff --git a/addons/core/functions/fn_moduleLSDVehicles.sqf b/addons/core/functions/fn_moduleLSDVehicles.sqf deleted file mode 100644 index fbda2cc569..0000000000 --- a/addons/core/functions/fn_moduleLSDVehicles.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Nothing to see here, move along. - * - * Arguments: - * Whatever the module provides. (I dunno.) - * - * Return Value: - * None - */ - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -{ - _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); - if (_hiddenSelections > 0) then { - nul = [_x, _hiddenSelections] spawn { - _vehicle = _this select 0; - _hSCount = _this select 1; - _colors = [ - "#(argb,8,8,3)color(1,0,0,1,co)", - "#(argb,8,8,3)color(1,0.5,0,1,co)", - "#(argb,8,8,3)color(1,1,0,1,co)", - "#(argb,8,8,3)color(0,1,0,1,co)", - "#(argb,8,8,3)color(0,0,1,1,co)", - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", - "#(argb,8,8,3)color(0.5,0,1,1,co)" - ]; - _index = 0; - while {True} do { - for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, (_colors select _index)]; - }; - _index = (_index + 1) % 7; - sleep 0.02; - }; - }; - }; -} count _units; - -diag_log text "[AGM]: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."; diff --git a/addons/core/functions/fn_muteUnit.sqf b/addons/core/functions/fn_muteUnit.sqf deleted file mode 100644 index 0175118b50..0000000000 --- a/addons/core/functions/fn_muteUnit.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: commy2 - * - * Mutes the unit. It won't trigger auto generated chat messages either. - * - * Argument: - * 0: Unit (Object) - * - * Return value: - * Nothing - */ - -private ["_unit", "_speaker"]; - -_unit = _this select 0; - -if (isNull _unit) exitWith {}; - -_speaker = speaker _unit; -if (_speaker == "AGM_NoVoice") exitWith {}; - -[0, "{(_this select 1) setSpeaker 'AGM_NoVoice'}", _unit, "AGM_Speaker"] call FUNC(execPersistentFnc); - -_unit setVariable ["AGM_OriginalSpeaker", _speaker, true]; diff --git a/addons/core/functions/fn_numberToDigits.sqf b/addons/core/functions/fn_numberToDigits.sqf deleted file mode 100644 index 304a5dea2c..0000000000 --- a/addons/core/functions/fn_numberToDigits.sqf +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Author: commy2 - * - * Transforms a number to an array of the correspondending digits. - * - * Argument: - * 0: Number to 'digitize' (Number) - * 1: Set the minimal length of the returned array. Useful for getting left hand zeroes. (Number, optional) - * - * Return value: - * Digits. The maximum count is six digits. (Array) - */ - -private ["_number", "_minLength", "_length", "_digits", "_index", "_count"]; - -_number = _this select 0; -_minLength = _this select 1; - -_number = _number min 999999; -_length = floor (log _number + 1); - -if !(isNil "_minLength") then {_length = (_length max _minLength) min 6}; - -_digits = []; - -if (_number < 1) exitWith { - for "_index" from 0 to (_length - 1) do { - _digits set [_index, 0]; - }; - _digits -}; - -while { - _count = count _digits; - _count < _length -} do { - _digit = floor (_number / (10 ^ (_length - _count - 1))); - { - _digit = _digit - _x * (10 ^ (_count - _forEachIndex)); - } forEach _digits; - _digits set [_count, _digit]; -}; -_digits diff --git a/addons/core/functions/fn_numberToDigitsString.sqf b/addons/core/functions/fn_numberToDigitsString.sqf deleted file mode 100644 index 492137009f..0000000000 --- a/addons/core/functions/fn_numberToDigitsString.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Author: commy2 - * - * Transforms a number to an string of the correspondending digits. - * - * Argument: - * 0: Number to 'digitize' (Number) - * 1: Set the minimal length of the returned string. Useful for getting left hand zeroes. (Number, optional) - * - * Return value: - * Digits. The maximum length is six digits. (String) - */ - -private ["_digits", "_count", "_string", "_index"]; - -_digits = _this call FUNC(numberToDigits); - -_count = count _digits; - -_string = ""; -for "_index" from 0 to (_count - 1) do { - _string = _string + str (_digits select _index); -}; -_string diff --git a/addons/core/functions/fn_onLoadRscDisplayChannel.sqf b/addons/core/functions/fn_onLoadRscDisplayChannel.sqf deleted file mode 100644 index c1b7faa1ff..0000000000 --- a/addons/core/functions/fn_onLoadRscDisplayChannel.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - Name: FUNC(onLoadRscDisplayChannel) - - Author: Pabst Mirror, commy2 - - Description: - When the RscDisplayChannel is loaded, this will constantly uiNamespace variable "AGM_currentChannel" - with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open. - - Parameters: - 0: DISPLAY - RscDisplayChannel - - Returns: - Nothing -*/ - -/* -_this spawn { - private "_display"; - disableSerialization; - _display = _this select 0; - waitUntil { - if (isNull _display) exitWith {true}; - if (ctrlText (_display displayCtrl 101) != "") then { - uiNamespace setVariable ["AGM_currentChannel", ctrlText (_display displayCtrl 101)]; - }; - false - }; -}; -*/ - -uiNamespace setVariable ["AGM_ctrlChannel", (_this select 0) displayCtrl 101]; - -["AGM_currentChannel", "onEachFrame", { - if (ctrlText (uiNamespace getVariable ["AGM_ctrlChannel", controlNull]) != "") then { - uiNamespace setVariable ["AGM_currentChannel", ctrlText (uiNamespace getVariable ["AGM_ctrlChannel", controlNull])]; - }; -}] call BIS_fnc_addStackedEventhandler; diff --git a/addons/core/functions/fn_owned.sqf b/addons/core/functions/fn_owned.sqf deleted file mode 100644 index b3f7db8bf4..0000000000 --- a/addons/core/functions/fn_owned.sqf +++ /dev/null @@ -1,7 +0,0 @@ -// by commy2 - -private "_object"; - -_object = _this select 0; - -!isNull (_object getVariable ["AGM_isUsedBy", objNull]) diff --git a/addons/core/functions/fn_player.sqf b/addons/core/functions/fn_player.sqf deleted file mode 100644 index 25cefb9a86..0000000000 --- a/addons/core/functions/fn_player.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: bux578, commy2 - * - * Returns the player or curator controlled unit. - * Use this in INIT and RESPAWN eh scripts, because AGM_player isn't reset yet. - * - * Arguments: - * NONE. - * - * Return Value: - * Player controlled unit (object) - */ - -missionNamespace getVariable ["bis_fnc_moduleRemoteControl_unit", player] diff --git a/addons/core/functions/fn_playerSide.sqf b/addons/core/functions/fn_playerSide.sqf deleted file mode 100644 index d432a68fa7..0000000000 --- a/addons/core/functions/fn_playerSide.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -side group AGM_player diff --git a/addons/core/functions/fn_progressBar.sqf b/addons/core/functions/fn_progressBar.sqf deleted file mode 100644 index 37d353940e..0000000000 --- a/addons/core/functions/fn_progressBar.sqf +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Author: commy2 - * - * Draw progress bar and execute given function if succesful. - * - * Argument: - * 0: Duration of the action (Number) - * 1: Arguments of the callback function (Array) - * 2: Callback function name (String) - * 3: Title of the loading bar (String) - * 4: Name of the function that is called when the action is aborted via ESC (String, optional) - * - * Return value: - * Nothing - */ - -closeDialog 0; -createDialog QGVAR(ProgressBar_Dialog); - -_this spawn { - _time = _this select 0; - _arguments = _this select 1; - _function = call compile (_this select 2); - _title = _this select 3; - _function2 = call compile (_this select 4); - - disableSerialization; - _ctrlProgressBar = uiNamespace getVariable QGVAR(ctrlProgressBar); - _ctrlProgressBarTitle = uiNamespace getVariable QGVAR(ctrlProgressBarTitle); - - _ctrlProgressBar ctrlSetPosition [ - safezoneX + 0.1 * safezoneW, - safezoneY + 0.2 * safezoneH, - 0.8 * safezoneW, - 0.01 * safezoneH - ]; - _ctrlProgressBar ctrlCommit (_time / accTime); - - _ctrlProgressBarTitle ctrlSetText _title; - //_ctrlProgressBarTitle ctrlSetStructuredText _title; - - _time = time + _time; - waitUntil { - //make sure the progressBar is still open, not just any dialog - (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) || {!alive AGM_player} || {time > _time} - }; - - closeDialog 0; - - _progress = 1; - if (time > _time) then { - _arguments call _function; - } else { - [localize QOUTE(DOUBLES(STR,GVAR(ActionAborted)))] call FUNC(displayTextStructured); - if (!isNil "_function2") then { - _progress = 1 - ((_time - time) / (_this select 0)) max 0 min 1; - _arguments call _function2; - }; - }; -}; diff --git a/addons/core/functions/fn_queueAnimation.sqf b/addons/core/functions/fn_queueAnimation.sqf deleted file mode 100644 index eea4118dea..0000000000 --- a/addons/core/functions/fn_queueAnimation.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 - -terminate (missionNamespace getVariable ["AGM_waitForAnimationHandle", scriptNull]); - -AGM_waitForAnimationHandle = _this spawn { - waitUntil {!([_this select 0] call FUNC(inTransitionAnim))}; - - _this call FUNC(doAnimation); -}; diff --git a/addons/core/functions/fn_readBooleanParameterFromModule.sqf b/addons/core/functions/fn_readBooleanParameterFromModule.sqf deleted file mode 100644 index 6d9c51f184..0000000000 --- a/addons/core/functions/fn_readBooleanParameterFromModule.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: CAA-Picard - * - * Reads a boolean value from a module, sets de AGM_Parameter. Logs if parameters are missing in the module. - * - * Arguments: - * 0: Module (Object) - * 1: AGM_Parameter name (string) - * 2: Module parameter name (string) - * - * Return Value: - * None - */ - - private ["_logic", "_agmParameterName", "_moduleParameterName"]; - -_logic = _this select 0; -_agmParameterName = _this select 1; -_moduleParameterName = _this select 2; - -// Check if the parameter is defined in the module -if (isNil {_logic getVariable _moduleParameterName}) exitWith { - diag_log text format["[AGM]: Warning in %1 module: %2 parameter is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleParameterName]; -}; - -// Set the parameter -[_agmParameterName , if (_logic getVariable _moduleParameterName) then {1} else {0}] call FUNC(setParameter); diff --git a/addons/core/functions/fn_readNumericParameterFromModule.sqf b/addons/core/functions/fn_readNumericParameterFromModule.sqf deleted file mode 100644 index 723c0945a4..0000000000 --- a/addons/core/functions/fn_readNumericParameterFromModule.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: CAA-Picard - * - * Reads a numberic value from a module, sets de AGM_Parameter. Logs if parameters are missing in the module. - * - * Arguments: - * 0: Module (Object) - * 1: AGM_Parameter name (string) - * 2: Module parameter name (string) - * - * Return Value: - * None - */ - - private ["_logic", "_agmParameterName", "_moduleParameterName", "_value"]; - -_logic = _this select 0; -_agmParameterName = _this select 1; -_moduleParameterName = _this select 2; - -// Check if the parameter is defined in the module -if (isNil {_logic getVariable _moduleParameterName}) exitWith { - diag_log format["Warning in %1 module: %2 parameter is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleParameterName] -}; - -// Check if the value is defined as string for backward compatibility -_value = _logic getVariable _moduleParameterName; -if (typeName _value == "STRING") then { - _value = parseNumber _value; -}; - -// Set the parameter -[_agmParameterName, _value] call FUNC(setParameter); diff --git a/addons/core/functions/fn_removeActionEventHandler.sqf b/addons/core/functions/fn_removeActionEventHandler.sqf deleted file mode 100644 index 9e93e545d3..0000000000 --- a/addons/core/functions/fn_removeActionEventHandler.sqf +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Author: commy2 - * - * Remove an addAction event from a unit. - * - * Argument: - * 0: Unit the action is assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: ID of the action (Number) - * - * Return value: - * None. - */ - -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs", "_count"]; - -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; - -if (_id == -1) exitWith {}; - -_name = format ["AGM_Action_%1", _action]; - -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; - -_actionID = _actionsVar select 0; -_actions = _actionsVar select 1; - -_currentID = _actions select 0; -_actionIDs = _actions select 1; -_actions = _actions select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []]; -_actions = _actions - [[]]; - -if (count _actions == 0) then { - _unit removeAction _actionID; - _actionID = -1; -}; - -_unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions]], false]; diff --git a/addons/core/functions/fn_removeActionMenuEventHandler.sqf b/addons/core/functions/fn_removeActionMenuEventHandler.sqf deleted file mode 100644 index cd7a3da1cd..0000000000 --- a/addons/core/functions/fn_removeActionMenuEventHandler.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: commy2 - * - * Remove an addAction event from a unit. - * - * Argument: - * 0: Unit the action is assigned to (Object) - * 1: Name of the action, e.g. "DefaultAction" (String) - * 2: ID of the action (Number) - * - * Return value: - * None. - */ - -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; - -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; - -if (_id == -1) exitWith {}; - -_name = format ["AGM_ActionMenu_%1", _action]; - -_actionsVar = _unit getVariable [_name, [-1, [-1, [], []]]]; - -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_action = _actions select _id; -_actionID = _action select 0; -_nameVar = _action select 1; - -missionNamespace setVariable [_nameVar, nil]; - -_actionIDs deleteAt _id; -_actions deleteAt _id; - -_unit removeAction _actionID; - -_unit setVariable [_name, [_currentID, _actionIDs, _actions], false]; diff --git a/addons/core/functions/fn_removeCameraEventHandler.sqf b/addons/core/functions/fn_removeCameraEventHandler.sqf deleted file mode 100644 index 912902a56a..0000000000 --- a/addons/core/functions/fn_removeCameraEventHandler.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: commy2 - * - * Remove a camera view event handler. - * - * Argument: - * 0: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_id = _this select 0; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_CameraMode", [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []];//{} -_actions = _actions - [[]];//[{}] - -missionNamespace setVariable ["AGM_EventHandler_CameraMode", [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_removeCustomEventHandler.sqf b/addons/core/functions/fn_removeCustomEventHandler.sqf deleted file mode 100644 index 5337ace1f4..0000000000 --- a/addons/core/functions/fn_removeCustomEventHandler.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: commy2 - * - * Remove a custom event handler from an object. - * - * Argument: - * 0: Unit the event handler is assigned to or namespace (Object OR Namespace) - * 1: Name of the event (String) - * 2: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_object", "_type", "_id", "_name", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_object = _this select 0; -_type = _this select 1; -_id = _this select 2; - -_name = format ["AGM_CustomEventHandlers_%1", _type]; - -_actionsVar = _object getVariable [_name, [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []];//{} -_actions = _actions - [[]];//[{}] - -_object setVariable [_name, [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_removeInfoDisplayEventHandler.sqf b/addons/core/functions/fn_removeInfoDisplayEventHandler.sqf deleted file mode 100644 index ea0252df82..0000000000 --- a/addons/core/functions/fn_removeInfoDisplayEventHandler.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: commy2 - * - * Remove a unit info type event handler. - * - * Argument: - * 0: Type. Can be "Soldier", "Vehicle", "Aircraft" or "Parachute" (String) - * 1: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_type", "_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_type = format ["AGM_onLoadInfo%1", _this select 0]; -_id = _this select 1; - -_actionsVar = missionNamespace getVariable [_type, [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs deleteAt _id; -_actions deleteAt _id; - -missionNamespace setVariable [_type, [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_removeInventoryDisplayLoadedEventHandler.sqf b/addons/core/functions/fn_removeInventoryDisplayLoadedEventHandler.sqf deleted file mode 100644 index b2cc322e36..0000000000 --- a/addons/core/functions/fn_removeInventoryDisplayLoadedEventHandler.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Author: commy2 - * - * Remove an inventory display opened handler. - * - * Argument: - * 0: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_id = _this select 0; - -_actionsVar = missionNamespace getVariable ["AGM_onLoadInventory", [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs deleteAt _id; -_actions deleteAt _id; - -missionNamespace setVariable ["AGM_onLoadInventory", [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_removeMapMarkerCreatedEventHandler.sqf b/addons/core/functions/fn_removeMapMarkerCreatedEventHandler.sqf deleted file mode 100644 index a0edb36b78..0000000000 --- a/addons/core/functions/fn_removeMapMarkerCreatedEventHandler.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: commy2 - * - * Remove a map marker creation event handler. - * - * Argument: - * 0: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_id = _this select 0; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_MapMarker", [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []];//{} -_actions = _actions - [[]];//[{}] - -missionNamespace setVariable ["AGM_EventHandler_MapMarker", [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_removeScrollWheelEventHandler.sqf b/addons/core/functions/fn_removeScrollWheelEventHandler.sqf deleted file mode 100644 index b2dbd1317d..0000000000 --- a/addons/core/functions/fn_removeScrollWheelEventHandler.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: commy2 - * - * Remove a scroll wheel event handler. - * - * Argument: - * 0: ID of the event handler (Number) - * - * Return value: - * None. - */ - -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; - -_id = _this select 0; - -_actionsVar = missionNamespace getVariable ["AGM_EventHandler_ScrollWheel", [-1, [], []]]; - -_currentId = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []];//{} -_actions = _actions - [[]];//[{}] - -missionNamespace setVariable ["AGM_EventHandler_ScrollWheel", [_currentId, _actionIDs, _actions]]; diff --git a/addons/core/functions/fn_restoreVariablesJIP.sqf b/addons/core/functions/fn_restoreVariablesJIP.sqf deleted file mode 100644 index 04d08e83b9..0000000000 --- a/addons/core/functions/fn_restoreVariablesJIP.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: commy2 - * - * Called from respawn eventhandler. Resets all public object namespace variables that are added via FUNC(setVariableJIP). - * - * Argument: - * 0: Object (Object) - * - * Return value: - * Nothing. - */ - -private ["_unit", "_respawnVariables"]; - -_unit = _this select 0; - -_respawnVariables = _unit getVariable ["AGM_respawnVariables", []]; - -// yes those -_respawnVariables pushBack "AGM_PersistentFunctions"; - -{ - _unit setVariable [_x, _unit getVariable _x, true]; -} forEach _respawnVariables; - -// fix speaker after respawn -[_unit, format ["{_this setSpeaker '%1'}", speaker _unit], 2] call FUNC(execRemoteFnc); diff --git a/addons/core/functions/fn_revertKeyCodeLocalized.sqf b/addons/core/functions/fn_revertKeyCodeLocalized.sqf deleted file mode 100644 index d7bd7cff99..0000000000 --- a/addons/core/functions/fn_revertKeyCodeLocalized.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Revert a key code to a readible text. - * - * Argument: - * 0: Key code (Number) - * - * Return value: - * What input will result in the given key code? (String) - */ - -private ["_keyCode", "_key", "_alt", "_ctrl", "_shft"]; - -_keyCode = _this select 0; - -_key = toString ((toArray keyName floor _keyCode) - [34]); - -_keyCode = round ((_keyCode % 1) * 10); - -switch (_keyCode) do { - case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; - case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; - default { - _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); - - _alt = "1" == toString [_keyCode select 0]; - _ctrl = "1" == toString [_keyCode select 1]; - _shift = "1" == toString [_keyCode select 2]; - - format ["%1%2%3%4", - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, - _key - ] - }; -}; diff --git a/addons/core/functions/fn_sanitizeString.sqf b/addons/core/functions/fn_sanitizeString.sqf deleted file mode 100644 index 578991f332..0000000000 --- a/addons/core/functions/fn_sanitizeString.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Author: CAA-Picard, based on Killzone-Kid code - * - * Removes quotation marks to avoid exploits and optionally html tags from text to avoid conflicts with structured text. - * - * Arguments: - * 0: Source string (String) - * 1: Remove html tags (Bool, optional) - * - * Return Value: - * Sanitized string - */ - - private ["_string", "_removeTags", "_array", "_arrayNew"]; - -_string = _this select 0; -_removeTags = _this select 1; -if (isNil "_removeTags") then {_removeTags = false}; - -_array = toArray _string; - -_arrayNew = []; -{ - switch _x do { - case 60 : { - _arrayNew = if (_removeTags) then {_arrayNew + toArray "<";} else {_arrayNew + [_x];}; - }; - case 62 : { - _arrayNew = if (_removeTags) then {_arrayNew + toArray ">";} else {_arrayNew + [_x];}; - }; - case 34 : { - }; - case 39 : { - }; - default { - _arrayNew = _arrayNew + [_x]; - }; - }; -} forEach _array; - -toString _arrayNew diff --git a/addons/core/functions/fn_serverLog.sqf b/addons/core/functions/fn_serverLog.sqf deleted file mode 100644 index 8e4b99d50d..0000000000 --- a/addons/core/functions/fn_serverLog.sqf +++ /dev/null @@ -1,7 +0,0 @@ -// by CAA-Picard - -if (isServer) then { - diag_log _this; -} else { - [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); -}; diff --git a/addons/core/functions/fn_setCaptivityStatus.sqf b/addons/core/functions/fn_setCaptivityStatus.sqf deleted file mode 100644 index 792a893fa7..0000000000 --- a/addons/core/functions/fn_setCaptivityStatus.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Author: commy2 - * - * Set the captivity status of an unit. This allows the handling of more than one reason to set a unit captive. - * - * Argument: - * 0: Unit (Object) - * 1: The reason of the captivity (String) - * 2: Is the reason still valid? True for setting this reason, false for removing it (Bool) - * - * Return value: - * None. - */ - -private ["_unit", "_reason", "_status", "_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; - -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; - -_captivityReasons = missionNamespace getVariable ["AGM_captivityReasons", []]; - -// register new reason (these reasons are shared publicly, since units can change ownership, but keep their captivity status) -if !(_reason in _captivityReasons) then { - _captivityReasons pushBack _reason; - - AGM_captivityReasons = _captivityReasons; - publicVariable "AGM_captivityReasons"; -}; - -// get reasons why the unit is captive already and update to the new status -_unitCaptivityReasons = [_unit] call FUNC(getCaptivityStatus); - -_captivityReasonsBooleans = []; -{ - _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; -} forEach _captivityReasons; - -_captivityReasonsBooleans set [_captivityReasons find _reason, _status]; - -_bitmask = _captivityReasonsBooleans call FUNC(toBitmask); - -// actually apply the setCaptive command globaly -[[_unit, _bitmask], "{(_this select 0) setCaptive (_this select 1)}", _unit] call FUNC(execRemoteFnc); diff --git a/addons/core/functions/fn_setForceWalkStatus.sqf b/addons/core/functions/fn_setForceWalkStatus.sqf deleted file mode 100644 index 4aab1a9998..0000000000 --- a/addons/core/functions/fn_setForceWalkStatus.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* -Name: FUNC(setForceWalkStatus) - -Author: Pabst Mirror (from captivity by commy2) - -Description: - Sets the forceWalk status of an unit. This allows the handling of more than one reason to set forceWalk. - Unit will force walk until all reasons are removed. - -Parameters: - 0: OBJECT - Unit - 1: STRING - Reason for forcing walking - 2: BOOL - Is the reason still valid. True to force walk, false to remove restriction. - -Returns: - None - -Example: - [AGM_Player, "BrokenLeg", true] call FUNC(setForceWalkStatus) -*/ - -private ["_unit", "_reason", "_status", "_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; - -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; - -_forceWalkReasons = missionNamespace getVariable ["AGM_forceWalkReasons", []]; - -// register new reason (these reasons are shared publicly, since units can change ownership, but keep their forceWalk status) -if !(_reason in _forceWalkReasons) then { - _forceWalkReasons pushBack _reason; - AGM_forceWalkReasons = _forceWalkReasons; - publicVariable "AGM_forceWalkReasons"; -}; - -// get reasons why the unit is forceWalking already and update to the new status -_unitForceWalkReasons = [_unit] call FUNC(getForceWalkStatus); - -_forceWalkReasonsBooleans = []; -{ - _forceWalkReasonsBooleans set [_forEachIndex, (_forceWalkReasons select _forEachIndex) in _unitForceWalkReasons]; -} forEach _forceWalkReasons; - -_forceWalkReasonsBooleans set [_forceWalkReasons find _reason, _status]; - -_bitmaskNumber = _forceWalkReasonsBooleans call FUNC(toBitmask); - -_unit setVariable ["AGM_forceWalkStatusNumber", _bitmaskNumber, true]; - -// actually apply the forceWalk command globaly -[[_unit], QUOTE(FUNC(applyForceWalkStatus)), _unit] call FUNC(execRemoteFnc); diff --git a/addons/core/functions/fn_setKeyDefault.sqf b/addons/core/functions/fn_setKeyDefault.sqf deleted file mode 100644 index 5882603038..0000000000 --- a/addons/core/functions/fn_setKeyDefault.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Author: commy2 - * - * Set all keys from the 'GVAR(Default_Keys)' base class that are missing in the current user profile. - * - * Argument: - * 1: Overwrite existing key binds? (Bool) - * - * Return value: - * None. - */ - -private ["_overwrite", "_saveProfile", "_config", "_count", "_index", "_configFile", "_name", "_key", "_shft", "_ctrl", "_alt", "_keyCode", "_state"]; - -_overwrite = _this select 0; - -_saveProfile = false; - -_config = configFile >> QGVAR(Default_Keys); -_count = count _config; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - _name = format ["AGM_Key_%1", configName _configFile]; - _key = profileNamespace getVariable _name; - - if (isNil "_key" || {_overwrite}) then { - _key = getNumber (_configFile >> "Key"); - _shft = getNumber (_configFile >> "Shift") == 1; - _ctrl = getNumber (_configFile >> "Control") == 1; - _alt = getNumber (_configFile >> "Alt") == 1; - - _keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); - - profileNamespace setVariable [_name, _keyCode]; - _saveProfile = true; - }; -}; - -_config = configFile >> QGVAR(Options); -_count = count _config; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - _name = format ["AGM_%1", configName _configFile]; - _state = profileNamespace getVariable _name; - - if (isNil "_state" || {_overwrite}) then { - _state = getNumber (_configFile >> "default") == 1; - - profileNamespace setVariable [_name, _state]; - _saveProfile = true; - }; -}; - -if (_overwrite) then { - saveProfileNamespace; - diag_log text "[AGM]: Profile settings overwritten."; -} else { - if (_saveProfile) then { - saveProfileNamespace; - diag_log text "[AGM]: Encountered missing variable in profile namespace. Profile saved."; - } else { - diag_log text "[AGM]: No missing variables encountered in profile namespace."; - }; -}; diff --git a/addons/core/functions/fn_setName.sqf b/addons/core/functions/fn_setName.sqf deleted file mode 100644 index c5736e0a03..0000000000 --- a/addons/core/functions/fn_setName.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: commy2 - * - * Sets the name variable of the object. Used to prevent issues with the name command. - * - * Argument: - * 0: Object (Object) - * - * Return value: - * Nothing. - */ - -private ["_unit", "_name"]; - -_unit = _this select 0; - -if (isNull _unit || {!alive _unit}) exitWith {}; - -if (_unit isKindOf "CAManBase") then { - _name = [name _unit, true] call FUNC(sanitizeString); - - //if (_name != _unit getVariable ["AGM_Name", ""]) then { - _unit setVariable ["AGM_Name", _name, true]; - //}; -}; diff --git a/addons/core/functions/fn_setParameter.sqf b/addons/core/functions/fn_setParameter.sqf deleted file mode 100644 index ac605e34d3..0000000000 --- a/addons/core/functions/fn_setParameter.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: CAA-Picard - * - * Sets the value of an AGM_Parameter and makes it public. - * - * Arguments: - * 0: Parameter name (string) - * 1: Value - * - * Return Value: - * None - */ - - private ["_name", "_value"]; - -_name = _this select 0; -_value = _this select 1; - -// Hack to keep backward compatibility for the moment -if ((typeName (missionNamespace getVariable _name)) == "BOOL") then { - if ((typeName _value) == "SCALAR") then { - _value = _value > 0; - }; -}; - -missionNamespace setVariable [_name, _value]; -publicVariable _name; diff --git a/addons/core/functions/fn_setPitchBankYaw.sqf b/addons/core/functions/fn_setPitchBankYaw.sqf deleted file mode 100644 index 5624c6594f..0000000000 --- a/addons/core/functions/fn_setPitchBankYaw.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Taken From: - * https://community.bistudio.com/wiki/BIS_fnc_setPitchBank - * Edited By: - * KoffeinFlummi - * - * Arguments: - * 0: Unit/Vehicle - * 1: Pitch (degrees) - * 2: Yaw (degrees) - * 3: Bank (degrees) - * - * Return Value: - * None - */ - -private ["_object", "_aroundX", "_aroundY", "_aroundZ", "_dirX", "_dirY", "_dirZ", "_upX", "_upY", "_upZ", "_dir", "_up", "_dirXTemp", "_upXTemp"]; - -_object = _this select 0; -_aroundX = _this select 1; -_aroundY = _this select 2; -_aroundZ = (360 - (_this select 3)) - 360; - -_dirX = 0; -_dirY = 1; -_dirZ = 0; -_upX = 0; -_upY = 0; -_upZ = 1; -if (_aroundX != 0) then { - _dirY = cos _aroundX; - _dirZ = sin _aroundX; - _upY = -sin _aroundX; - _upZ = cos _aroundX; -}; -if (_aroundY != 0) then { - _dirX = _dirZ * sin _aroundY; - _dirZ = _dirZ * cos _aroundY; - _upX = _upZ * sin _aroundY; - _upZ = _upZ * cos _aroundY; -}; -if (_aroundZ != 0) then { - _dirXTemp = _dirX; - _dirX = (_dirXTemp* cos _aroundZ) - (_dirY * sin _aroundZ); - _dirY = (_dirY * cos _aroundZ) + (_dirXTemp * sin _aroundZ); - _upXTemp = _upX; - _upX = (_upXTemp * cos _aroundZ) - (_upY * sin _aroundZ); - _upY = (_upY * cos _aroundZ) + (_upXTemp * sin _aroundZ); -}; - -_dir = [_dirX,_dirY,_dirZ]; -_up = [_upX,_upY,_upZ]; - -_object setVectorDirAndUp [_dir,_up]; diff --git a/addons/core/functions/fn_setVariableJIP.sqf b/addons/core/functions/fn_setVariableJIP.sqf deleted file mode 100644 index 78694b7740..0000000000 --- a/addons/core/functions/fn_setVariableJIP.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: commy2 - * - * Sets a public object namespace variable that gets reset with the same value after respawn, so JIP clients keep the value. - * - * Argument: - * 0: Object (Object) - * 1: Variable name (String) - * 2: Any value (Anything) - * - * Return value: - * Nothing. - */ - -private ["_unit", "_varName", "_value", "_respawnVariables"]; - -_unit = _this select 0; -_varName = _this select 1; -_value = _this select 2; - -_respawnVariables = _unit getVariable ["AGM_respawnVariables", []]; - -if !(_varName in _respawnVariables) then { - _respawnVariables pushBack _varName; - _unit setVariable ["AGM_respawnVariables", _respawnVariables, true]; -}; - -_unit setVariable [_varName, _value, true]; diff --git a/addons/core/functions/fn_stringToColoredText.sqf b/addons/core/functions/fn_stringToColoredText.sqf deleted file mode 100644 index 4f90a92984..0000000000 --- a/addons/core/functions/fn_stringToColoredText.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: commy2 - * - * Create a centered, colored text. - * - * Argument: - * 0: Text (Anything) - * 2: Color (Array) - * - * Return value: - * Text - */ - -private ["_string", "_color"]; - -_string = format ["%1", _this select 0]; -_color = _this select 1; - -_color = ( - [255 * (_color select 0), 2] call FUNC(toHex) -) + ( - [255 * (_color select 1), 2] call FUNC(toHex) -) + ( - [255 * (_color select 2), 2] call FUNC(toHex) -); - -parseText format ["%1", _string, _color]; diff --git a/addons/core/functions/fn_subString.sqf b/addons/core/functions/fn_subString.sqf deleted file mode 100644 index c5eb1c8229..0000000000 --- a/addons/core/functions/fn_subString.sqf +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Returns a fraction of the given string, starting at a given index, with a given length. - * - * Arguments: - * 0: Source string - * 1: Starting index of new string - * 2: Length of the new string - * - * Return Value: - * String when successfull / False when not - */ - -_string = _this select 0; -_index = _this select 1; -_length = _this select 2; - -_array = toArray _string; -if (_index < 0 or _length < 0 or _index + _length > (count _array) + 1) exitWith {false}; - -_arrayNew = []; -for "_i" from _index to (_index + _length - 1) do { - _arrayNew = _arrayNew + [(_array select _i)]; -}; - -toString _arrayNew diff --git a/addons/core/functions/fn_toBin.sqf b/addons/core/functions/fn_toBin.sqf deleted file mode 100644 index a4f8a40f6f..0000000000 --- a/addons/core/functions/fn_toBin.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* -Author: commy2 - -Description: -Converts number to binary number - -Arguments: -A number - -Return Value: -A binary number, String -*/ - -private ["_number", "_minLength", "_sign", "_bin", "_rest"]; - -_number = _this select 0; -_minLength = _this select 1; - -if (isNil "_minLength") then {_minLength = 1}; - -_sign = ["", "-"] select (_number < 0); - -_number = round abs _number; -_bin = ["", "0"] select (_number == 0); - -while {_number > 0} do { - _rest = str (_number mod 2); - _number = floor (_number / 2); - - _bin = _rest + _bin; -}; - -while {count toArray _bin < _minLength} do { - _bin = "0" + _bin; -}; - -_sign + _bin diff --git a/addons/core/functions/fn_toBitmask.sqf b/addons/core/functions/fn_toBitmask.sqf deleted file mode 100644 index da997cc87a..0000000000 --- a/addons/core/functions/fn_toBitmask.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: commy2 - * - * Convert an array of booleans into a number. - * - * Argument: - * 0: Booleans (Array of Booleans) - * - * Return value: - * Bitmask (Number) - */ - -private ["_array", "_result"]; - -_array = _this; - -_result = 0; -{ - if (_x) then {_result = _result + 2 ^ _forEachIndex}; -} forEach _array; - -_result diff --git a/addons/core/functions/fn_toHex.sqf b/addons/core/functions/fn_toHex.sqf deleted file mode 100644 index d61ac07e5e..0000000000 --- a/addons/core/functions/fn_toHex.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* -Author: commy2 - -Description: -Converts number to hexadecimal number - -Arguments: -A number - -Return Value: -A hexadecimal number, String -*/ - -private ["_number", "_minLength", "_sign", "_hex", "_rest"]; - -_number = _this select 0; -_minLength = _this select 1; - -if (isNil "_minLength") then {_minLength = 1}; - -_sign = ["", "-"] select (_number < 0); - -_number = round abs _number; -_hex = ["", "0"] select (_number == 0); - -while {_number > 0} do { - _rest = _number mod 16; - _rest = switch _rest do { - case 10 : {"A"}; - case 11 : {"B"}; - case 12 : {"C"}; - case 13 : {"D"}; - case 14 : {"E"}; - case 15 : {"F"}; - default {str _rest}; - }; - _number = floor (_number / 16); - - _hex = _rest + _hex; -}; - -while {count toArray _hex < _minLength} do { - _hex = "0" + _hex; -}; - -_sign + _hex diff --git a/addons/core/functions/fn_toNumber.sqf b/addons/core/functions/fn_toNumber.sqf deleted file mode 100644 index 053714d3ca..0000000000 --- a/addons/core/functions/fn_toNumber.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - Name: FUNC(toNumber) - - Author(s): - Garth de Wet (LH) - - Description: - Takes a string/number and returns the number. - - Parameters: - 0: TYPE - Value to attempt to convert to number or if number simply return number. - - Returns: - NUMBER - - Example: - _number = ["102"] call FUNC(toNumber); -*/ -if (TYPENAME(_this select 0) == "SCALAR")exitWith { - (_this select 0) -}; - -(parseNumber (_this select 0)) \ No newline at end of file diff --git a/addons/core/functions/fn_unmuteUnit.sqf b/addons/core/functions/fn_unmuteUnit.sqf deleted file mode 100644 index 3e2dae2c22..0000000000 --- a/addons/core/functions/fn_unmuteUnit.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: commy2 - * - * Unmutes the unit. - * - * Argument: - * 0: Unit (Object) - * - * Return value: - * Nothing - */ - -private ["_unit", "_speaker"]; - -_unit = _this select 0; - -if (isNull _unit) exitWith {}; - -_speaker = _unit getVariable ["AGM_OriginalSpeaker", ""]; -if (_speaker == "") exitWith {}; - -[0, format ["{(_this select 1) setSpeaker '%1'}", _speaker], _unit, "AGM_Speaker"] call FUNC(execPersistentFnc); diff --git a/addons/core/script_component.hpp b/addons/core/script_component.hpp deleted file mode 100644 index d25bdff864..0000000000 --- a/addons/core/script_component.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#define COMPONENT core -#include "script_mod.hpp" - -// #define DEBUG_MODE_FULL - -#ifdef DEBUG_ENABLED_MAIN - #define DEBUG_MODE_FULL -#endif - -#ifdef DEBUG_SETTINGS_MAIN - #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN -#endif - -#include "script_macros.hpp" diff --git a/addons/core/scripts/KeyInput/initCanInteractFunction.sqf b/addons/core/scripts/KeyInput/initCanInteractFunction.sqf deleted file mode 100644 index ed0cc60042..0000000000 --- a/addons/core/scripts/KeyInput/initCanInteractFunction.sqf +++ /dev/null @@ -1,19 +0,0 @@ -// by commy2 - -private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"]; - -_function = "private '_exceptions'; _exceptions = _this; alive AGM_player"; - -_configFile = configFile >> QGVAR(canInteractConditions); -_count = count _configFile; - -for "_index" from 0 to (_count -1) do { - _config = _configFile select _index; - _configName = configName _config; - - _condition = getText (_config >> "condition"); - - _function = _function + format ["&& {%1 || {'%2' in _exceptions}}", _condition, _configName]; -}; - -GVAR(canInteract) = compileFinal _function; diff --git a/addons/core/scripts/KeyInput/initKeys.sqf b/addons/core/scripts/KeyInput/initKeys.sqf deleted file mode 100644 index cf24748840..0000000000 --- a/addons/core/scripts/KeyInput/initKeys.sqf +++ /dev/null @@ -1,71 +0,0 @@ -// by commy2 - -_config = configFile >> QGVAR(Default_Keys); -_count = count _config; - -_header = "_keyCode = [_this select 1, _this select 2, _this select 3, _this select 4] call FUNC(convertKeyCode); _keyIndex = floor _keyCode; if (_keyIndex == 0) exitWith {false}; if (!(profileNamespace getVariable ['AGM_enableNumberHotkeys', true]) && {_keyIndex < 12} && {_keyIndex > 1} && {_keyCode mod 1 == 0}) exitWith {false}; _time = time; _player = AGM_player; _vehicle = vehicle _player; _isInput = false;"; -_headerUp = "_keyCode = _this select 1; _keyIndex = _keyCode; if (_keyIndex == 0) exitWith {false}; _time = time; _player = AGM_player; _vehicle = vehicle _player;"; - -_handleDoubleTap = "if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8};"; -_handleHold = "_allowHold = false; _disallowHold = false; if (GVAR(keyStates) select _keyIndex > 1) exitWith {false}; if (GVAR(keyStates) select _keyIndex > 0) then {_keyCode = _keyIndex + 0.9};"; -_handleHoldUp = "if (GVAR(keyStates) select _keyIndex > 1) then {_keyCode = _keyIndex + 0.9};"; - -_debug = "if (!isNil 'AGM_Debug' && {'Keys' in AGM_Debug}) then {systemChat (str _keyCode + ' ' + str (GVAR(keyStates) select _keyIndex))};"; - -_onKeyDown = "" + _debug; -_onKeyUp = "" + _debug; - -for "_index" from 0 to (_count - 1) do { - _configFile = _config select _index; - - _keyName = configName _configFile; - _condition = getText (_configFile >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _statement = getText (_configFile >> "statement"); - - _exceptions = getArray (_configFile >> "exceptions"); - _canInteract = format ["%1 call GVAR(canInteract)", _exceptions]; - - _conditionName = format ["AGM_Key_%1_Condition", _keyName]; - _statementName = format ["AGM_Key_%1_Statement", _keyName]; - missionNamespace setVariable [_conditionName, compileFinal _condition]; - missionNamespace setVariable [_statementName, compileFinal _statement]; - - _handleHolding = ["_disallowHold = true;", "_allowHold = true;"] select (getNumber (_configFile >> "allowHolding") == 1); - - if (_statement != "") then { - _entry = format ["if (_keyCode == profileNamespace getVariable 'AGM_Key_%1' && {call %2}) then {if (%4) then {call %3};%5 _isInput = true;};", _keyName, _conditionName, _statementName, _canInteract, _handleHolding]; - _onKeyDown = _onKeyDown + _entry; - }; - - _condition = getText (_configFile >> "conditionUp"); - if (_condition == "") then {_condition = "true"}; - - _statement = getText (_configFile >> "statementUp"); - - _conditionName = format ["AGM_Key_%1_ConditionUp", _keyName]; - _statementName = format ["AGM_Key_%1_StatementUp", _keyName]; - missionNamespace setVariable [_conditionName, compileFinal _condition]; - missionNamespace setVariable [_statementName, compileFinal _statement]; - - if (_statement != "") then { - _entry = format ["if (_keyCode == floor (profileNamespace getVariable 'AGM_Key_%1') && {call %2}) then {call %3; _isInput = true;};", _keyName, _conditionName, _statementName]; - _onKeyUp = _onKeyUp + _entry; - }; -}; - -_halt = "if (!(_allowHold) || {_disallowHold}) then {GVAR(keyStates) set [_keyIndex, (GVAR(keyStates) select _keyIndex) + 1]; GVAR(keyTimes) set [_keyIndex, _time];};"; -_haltUp = QGVAR(keyStates) set [_keyIndex, 0];; - -//_return = "_isInput"; -_return = "if (profileNamespace getVariable ['AGM_enableNumberHotkeys', true] && {_keyIndex < 12} && {_keyIndex > 1}) then {true} else {_isInput}"; - -_repeat = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyDown + _return + "};"; -_repeatUp = "if (!_isInput && {_keyCode mod 1 > 0.75} && {_keyCode mod 1 < 0.85}) exitWith {_keyCode = _keyIndex; " + _onKeyUp + "};"; - -_onKeyDown = _header + _handleDoubleTap + _handleHold + _onKeyDown + _halt + _repeat + _return; -_onKeyUp = _headerUp + _onKeyUp + _haltUp + _repeatUp; //_headerUp + _handleHoldUp + _onKeyUp + _haltUp + _repeatUp; - -GVAR(onKeyDown) = compileFinal _onKeyDown; -GVAR(onKeyUp) = compileFinal _onKeyUp; diff --git a/addons/core/scripts/KeyInput/initScrollWheel.sqf b/addons/core/scripts/KeyInput/initScrollWheel.sqf deleted file mode 100644 index 61f18b26f4..0000000000 --- a/addons/core/scripts/KeyInput/initScrollWheel.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -GVAR(ScrollWheelFrame) = diag_frameno; - -GVAR(onScrollWheel) = { - _scroll = _this select 1; - - if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; - GVAR(ScrollWheelFrame) = diag_frameno; - - { - [_scroll] call _x; - } count ((missionNamespace getVariable ["AGM_EventHandler_ScrollWheel", [-1, [], []]]) select 2); -}; diff --git a/addons/core/scripts/Version/checkVersionNumber.sqf b/addons/core/scripts/Version/checkVersionNumber.sqf deleted file mode 100644 index 4e7049eeb2..0000000000 --- a/addons/core/scripts/Version/checkVersionNumber.sqf +++ /dev/null @@ -1,189 +0,0 @@ -// by commy2 - -sleep 1; //wait for module - -_files = []; - -if (missionNamespace getVariable ["AGM_Version_CheckAll", false]) then { - { - if (toLower _x find "a3_" != 0 && {!(toLower _x in (missionNamespace getVariable ["AGM_Version_Whitelist", []]))}) then { - _files pushBack _x; - }; - } forEach activatedAddons; -} else { - { - if (toLower _x find "agm_" == 0) then { - _files pushBack _x; - }; - } forEach activatedAddons; -}; - -_versionMain = parseNumber getText (configFile >> "CfgPatches" >> "AGM_Core" >> "version"); - -_versions = []; -{ - _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); - _versions set [_forEachIndex, _version]; -} forEach _files; - -if (isServer) then { - diag_log text format ["[AGM] Server: agm_core is Version %1.", _versionMain]; - - { - if (toLower _x find "agm_" == 0) then {// - _version = _versions select _forEachIndex; - if (_version != _versionMain) then { - diag_log text format ["[AGM] Server: %1 is Version %2.", _x, _version]; - }; - }; - } forEach _files; - - AGM_Version_ServerVersions = [_files, _versions]; - publicVariable "AGM_Version_ServerVersions"; -} else { - diag_log text format ["[AGM] Client: agm_core is Version %1.", _versionMain]; - - { - if (toLower _x find "agm_" == 0) then {// - _version = _versions select _forEachIndex; - if (_version != _versionMain) then { - diag_log text format ["[AGM] Client: %1 is Version %2.", _x, _version]; - }; - }; - } forEach _files; - - AGM_Version_ClientVersions = [_files, _versions]; -}; - -// Begin client version check -if (!isServer) then { - // Wait for server to send the servers files and version numbers - waitUntil { - sleep 1; - !isNil "AGM_Version_ClientVersions" && {!isNil "AGM_Version_ServerVersions"} - }; - - _client = profileName; - - _files = AGM_Version_ClientVersions select 0; - _versions = AGM_Version_ClientVersions select 1; - - _serverFiles = AGM_Version_ServerVersions select 0; - _serverVersions = AGM_Version_ServerVersions select 1; - - // Compare client and server files and versions - _missingAddons = []; - _oldVersionsClient = []; - _oldVersionsServer = []; - { - _serverVersion = _serverVersions select _forEachIndex; - - _index = _files find _x; - if (_index == -1) then { - _missingAddons pushBack _x; - } else { - - _clientVersion = _versions select _index; - - if (_clientVersion < _serverVersion) then { - _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; - }; - - if (_clientVersion > _serverVersion) then { - _oldVersionsServer pushBack [_x, _clientVersion, _serverVersion]; - }; - }; - } forEach _serverFiles; - - // find client files which the server doesn't have - _missingAddonsServer = []; - { - _index = _serverFiles find _x; - if (_index == -1) then { - _missingAddonsServer pushBack _x; - } - } forEach _files; - - // display and log error messages - _fnc_cutComma = { - _string = _this; - _string = toArray _string; - - _count = count _string; - _string set [_count - 2, toArray "." select 0]; - _string set [_count - 1, -1]; - _string = _string - [-1]; - - toString _string; - }; - - _missingAddon = false; - if (count _missingAddons > 0) then { - _missingAddon = true; - - _error = format ["[AGM] %1: ERROR missing addon(s): ", _client]; - { - _error = _error + format ["%1, ", _x]; - - if (_forEachIndex > 9) exitWith {};// - } forEach _missingAddons; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; - - _missingAddonServer = false; - if (count _missingAddonsServer > 0) then { - _missingAddonServer = true; - - _error = format ["[AGM] %1: ERROR missing server addon(s): ", _client]; - { - _error = _error + format ["%1, ", _x]; - - if (_forEachIndex > 9) exitWith {};// - } forEach _missingAddonsServer; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; - - _oldVersionClient = false; - if (count _oldVersionsClient > 0) then { - _oldVersionClient = true; - - _error = format ["[AGM] %1: ERROR outdated addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; - - if (_forEachIndex > 9) exitWith {};// - } forEach _oldVersionsClient; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; - - _oldVersionServer = false; - if (count _oldVersionsServer > 0) then { - _oldVersionServer = true; - - _error = format ["[AGM] %1: ERROR outdated server addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; - - if (_forEachIndex > 9) exitWith {};// - } forEach _oldVersionsServer; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; - - AGM_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; -}; diff --git a/addons/core/scripts/assignedItemFix.sqf b/addons/core/scripts/assignedItemFix.sqf deleted file mode 100644 index e5b9948e6b..0000000000 --- a/addons/core/scripts/assignedItemFix.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 - -if (isNil "AGM_itemFix") then { - AGM_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; - AGM_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; - AGM_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; - AGM_isRadioEnabled = call {_config = missionConfigFile >> "showRadio"; !isNumber _config || {getNumber _config == 1}}; - AGM_isGPSEnabled = call {_config = missionConfigFile >> "showGPS"; !isNumber _config || {getNumber _config == 1}}; - - AGM_itemFix = ["AGM_itemFix", "onEachFrame", { - _items = assignedItems AGM_player; - showMap (AGM_isMapEnabled && {"ItemMap" in _items}); - showCompass (AGM_isCompassEnabled && {"ItemCompass" in _items}); - showWatch (AGM_isWatchEnabled && {"ItemWatch" in _items}); - //showRadio (AGM_isRadioEnabled && {"ItemRadio" in _items}); - showGPS (AGM_isGPSEnabled && {"ItemGPS" in _items || {cameraOn == getConnectedUAV AGM_player}}); //If player is activly controling a UAV, showGPS controls showing the map (m key) - }] call BIS_fnc_addStackedEventHandler; -}; diff --git a/addons/core/scripts/closeMenu.sqf b/addons/core/scripts/closeMenu.sqf deleted file mode 100644 index f641bc499c..0000000000 --- a/addons/core/scripts/closeMenu.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 - -closeDialog 0; -[localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); diff --git a/addons/core/scripts/editKey.sqf b/addons/core/scripts/editKey.sqf deleted file mode 100644 index 4d55a9808b..0000000000 --- a/addons/core/scripts/editKey.sqf +++ /dev/null @@ -1,112 +0,0 @@ -// by commy2 - -#define GRAY [0.25, 0.25, 0.25, 1] -#define WHITE [1, 1, 1, 1] -#define OFFSET_1 100 -#define OFFSET_2 200 - -waitUntil {isNil QGVAR(keyNewTemp)}; -GVAR(keyNewTemp) = []; - -GVAR(keySet) = 0; -_index = count GVAR(keyNew); - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); -_ctrlMenuDialog = _dlgMenuDialog displayCtrl (OFFSET_2 + (_this select 0)); -_action = GVAR(keyNames) select (_this select 0); -_displayName = getText (configFile >> QGVAR(Default_Keys)" >> _action >> "displayName); - -_keyCode = profileNamespace getVariable [format ["AGM_Key_%1", _action], 0];// -for "_index1" from 0 to (count GVAR(keyNew) - 1) do { - if (_action == (GVAR(keyNew) select _index1) select 0) then { - _keyCode = (GVAR(keyNew) select _index1) select 1; - } -}; -(_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized));//""; -/*(_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; -(_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; -(_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY;*/ - -for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow true}; -for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable false}; - -(_dlgMenuDialog displayCtrl 30) ctrlSetText _displayName; - -GVAR(keysetDefault) = compile format [ - "_configFile = configFile >> 'GVAR(Default_Keys)' >> '%1'; - _key = getNumber (_configFile >> 'Key'); - _shft = getNumber (_configFile >> 'Shift') == 1; - _ctrl = getNumber (_configFile >> 'Control') == 1; - _alt = getNumber (_configFile >> 'Alt') == 1; - - _keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); - - GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode];", - _action -]; - -_description = ctrlText _ctrlMenuDialog; -//_ctrlMenuDialog ctrlSetText ".."; - -_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this call GVAR(keyInput)"]; -_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this call GVAR(keyRelease)"]; - -waitUntil { - if (count GVAR(keyNewTemp) > 0) then { - _key = GVAR(keyNewTemp) select 0; - _keyModifier = GVAR(keyNewTemp) select 1; - //_keyCode = round (10 * ((GVAR(keyNewTemp) select 2) % 1)); - _keyCode = GVAR(keyNewTemp) select 2; - - (_dlgMenuDialog displayCtrl 24) ctrlSetText ([_keyCode] call FUNC(revertKeyCodeLocalized)); - - /*_key = toString (toArray (keyName _key) - [34]); - - switch (_keyCode) do { - case 8 : { - (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; - }; - case 9 : { - (_dlgMenuDialog displayCtrl 24) ctrlSetText format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor GRAY; - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor GRAY; - }; - default { - (_dlgMenuDialog displayCtrl 24) ctrlSetText _key; - - (_dlgMenuDialog displayCtrl 21) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 0)); - (_dlgMenuDialog displayCtrl 22) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 1)); - (_dlgMenuDialog displayCtrl 23) ctrlSetTextColor ([GRAY, WHITE] select (_keyModifier select 2)); - }; - };*/ - }; - GVAR(keySet) != 0 || - {!dialog} -}; - -for "_index1" from 10 to 13 do {(_dlgMenuDialog displayCtrl _index1) ctrlEnable true}; -for "_index1" from 20 to 32 do {(_dlgMenuDialog displayCtrl _index1) ctrlShow false}; - -_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; -_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; - -if (GVAR(keySet) == 1 && {count GVAR(keyNewTemp) > 0}) then { - _keyCode = GVAR(keyNewTemp) select 2; - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - _ctrlMenuDialog ctrlSetText _description; - - GVAR(keyNew) set [_index, [_action, _keyCode]]; -} else { - _ctrlMenuDialog ctrlSetText _description; -}; - -GVAR(keySet) = -1; -GVAR(keyNewTemp) = nil; -GVAR(keysetDefault) = nil; diff --git a/addons/core/scripts/keyInput.sqf b/addons/core/scripts/keyInput.sqf deleted file mode 100644 index 3c3c15fb35..0000000000 --- a/addons/core/scripts/keyInput.sqf +++ /dev/null @@ -1,25 +0,0 @@ -// by commy2 - -#define FORBIDDEN_KEYS [42, 54, 29, 157, 56, 184, 0, 183, 197, 1] - -_key = _this select 1; -_shft = _this select 2; -_ctrl = _this select 3; -_alt =_this select 4; - -if (_key in FORBIDDEN_KEYS) exitWith {true}; - -_keyCode = [_key, _shft, _ctrl, _alt] call FUNC(convertKeyCode); - -_keyIndex = floor _keyCode; -_time = time; - -if (_time < (GVAR(keyTimes) select _keyIndex) + 0.5 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.8}; -if (GVAR(keyStates) select _keyIndex > 1) exitWith {true}; -if (GVAR(keyStates) select _keyIndex > 0 && {_keyIndex == _keyCode}) then {_keyCode = _keyIndex + 0.9}; - -GVAR(keyStates) set [_keyIndex, (GVAR(keyStates) select _keyIndex) + 1]; -GVAR(keyTimes) set [_keyIndex, _time]; - -GVAR(keyNewTemp) = [_key, [_shft, _ctrl, _alt], _keyCode]; -true diff --git a/addons/core/scripts/keyRelease.sqf b/addons/core/scripts/keyRelease.sqf deleted file mode 100644 index d9277a20f4..0000000000 --- a/addons/core/scripts/keyRelease.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by commy2 - -_keyIndex = _this select 1; - -GVAR(keyStates) set [_keyIndex, 0]; diff --git a/addons/core/scripts/nextKeys.sqf b/addons/core/scripts/nextKeys.sqf deleted file mode 100644 index ff544f312c..0000000000 --- a/addons/core/scripts/nextKeys.sqf +++ /dev/null @@ -1,122 +0,0 @@ -// by commy2 - -#define OFFSET_1 100 -#define OFFSET_2 200 -#define OFFSET_3 300 -#define OFFSET_4 400 -#define OFFSET_5 500 - -_config = configFile >> QGVAR(Default_Keys); -_count = count _config; - -_countPages = ceil (_count / 20) + 1; - -GVAR(MenuPage) = GVAR(MenuPage) + ([-1, 1] select _this); - -if (GVAR(MenuPage) == - 1) then {GVAR(MenuPage) = _countPages - 1}; -if (GVAR(MenuPage) > _countPages - 1) then {GVAR(MenuPage) = 0}; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; - -if (GVAR(MenuPage) == _countPages - 1) then { - for "_index" from OFFSET_1 to (OFFSET_1 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_2 to (OFFSET_2 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - - _config = configFile >> QGVAR(Options); - _count = count _config; - - _offset = 0; - - for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index + _offset; - _configName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _state = profileNamespace getVariable format ["AGM_%1", _configName]; - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); - _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); - - _control1 ctrlSetText format [PATHTOF(UI\box_%1checked_ca.paa", ["un", ")] select _state]; - _control2 ctrlSetText _displayName; - - _control1 ctrlShow true; - _control2 ctrlShow true; - _control3 ctrlShow true; - - GVAR(OptionNames) set [_index, _configName]; - }; - - for "_index" from _count to (_count + 19) do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_3 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_4 + _index); - _control3 = _dlgMenuDialog displayCtrl (OFFSET_5 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; - _control3 ctrlShow false; - }; - -} else { - for "_index" from OFFSET_3 to (OFFSET_3 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_4 to (OFFSET_4 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - for "_index" from OFFSET_5 to (OFFSET_5 + 19) do {(_dlgMenuDialog displayCtrl _index) ctrlShow false}; - - _offset = 20 * GVAR(MenuPage); - if (GVAR(MenuPage) == _countPages - 2) then { - _count = (_count - 1) % 20 + 1; - }; - - _updateNames = []; - _updateKeys = []; - { - _keyName = _x select 0; - _keyInput = _x select 1; - - _index = _updateNames find _keyName; - if (_index == -1) then {_index = count _updateKeys}; - - _updateNames set [_index, _keyName]; - _updateKeys set [_index, _keyInput]; - } forEach GVAR(keyNew); - - for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index + _offset; - _keyName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _isDisabled = getNumber (_configFile >> "disabled") == 1; - - _indexUpdate = _updateNames find _keyName; - _keyCode = if (_indexUpdate == -1) then { - profileNamespace getVariable format ["AGM_Key_%1", _keyName]; - } else { - _updateKeys select _indexUpdate; - }; - - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlSetText _displayName; - _control2 ctrlSetText _description; - - _control1 ctrlShow true; - _control2 ctrlShow true; - - GVAR(keyNames) set [_index, _keyName]; - }; - - for "_index" from _count to (_count + 19) do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; - }; - - GVAR(keySet) = -1; -}; diff --git a/addons/core/scripts/openMenu.sqf b/addons/core/scripts/openMenu.sqf deleted file mode 100644 index 12383b2f88..0000000000 --- a/addons/core/scripts/openMenu.sqf +++ /dev/null @@ -1,99 +0,0 @@ -// by commy2 - -#define OFFSET_1 100 -#define OFFSET_2 200 - -closeDialog 0; -createDialog QGVAR(OptionsMenu_Dialog); - -GVAR(keyNew) = []; -GVAR(keySet) = -1; -GVAR(keySave) = 0; -GVAR(keyNames) = []; -GVAR(MenuPage) = 0; -GVAR(OptionNames) = []; -GVAR(OptionNamesNew) = []; -GVAR(OptionStatesNew) = []; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", "_this select 1 > 1"]; -_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", "_this select 1 > 1"]; - -_config = configFile >> QGVAR(Default_Keys); -_count = count _config; - -_countPages = ceil (_count / 20) + 1; -(_dlgMenuDialog displayCtrl 14) ctrlSetText format ["%1/%2", GVAR(MenuPage) + 1, _countPages]; - -for "_index" from 0 to (_count - 1 min 19) do { - _configFile = _config select _index; - _keyName = configName _configFile; - _displayName = getText (_configFile >> "displayName"); - _isDisabled = getNumber (_configFile >> "disabled") == 1; - - _keyCode = profileNamespace getVariable format ["AGM_Key_%1", _keyName]; - _description = [_keyCode] call FUNC(revertKeyCodeLocalized); - - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlSetText _displayName; - _control2 ctrlSetText _description; - - _control1 ctrlShow true; - _control2 ctrlShow true; - - GVAR(keyNames) set [_index, _keyName]; -}; - -for "_index" from _count to 19 do { - _control1 = _dlgMenuDialog displayCtrl (OFFSET_1 + _index); - _control2 = _dlgMenuDialog displayCtrl (OFFSET_2 + _index); - - _control1 ctrlShow false; - _control2 ctrlShow false; -}; - -waitUntil {!dialog}; - -_dlgMenuDialog displayRemoveEventHandler ["KeyDown", _ehid_keydown]; -_dlgMenuDialog displayRemoveEventHandler ["KeyUp", _ehid_keyup]; - -if (GVAR(keySave) == 1) then { - _count0 = count GVAR(keyNew); - - for "_index" from 0 to (_count0 - 1) do { - _key = GVAR(keyNew) select _index; - _keyName = _key select 0; - _keyCode = _key select 1; - - profileNamespace setVariable [format ["AGM_Key_%1", _keyName], _keyCode]; - }; - - _count1 = count GVAR(OptionNamesNew); - - for "_index" from 0 to (_count1 - 1) do { - _name = GVAR(OptionNamesNew) select _index; - _state = GVAR(OptionStatesNew) select _index; - - profileNamespace setVariable [_name, _state]; - }; - - if (_count0 > 0 || {_count1 > 0}) then { - saveProfileNamespace; - [localize QUOTE(DOUBLES(STR,GVAR(ProfileSaved)))] call FUNC(displayTextStructured); - } else { - [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); - }; -} else { - [localize QUOTE(DOUBLES(STR,GVAR(ProfileNotSaved)))] call FUNC(displayTextStructured); -}; - -GVAR(keyNewTemp) = nil; -GVAR(keyNames) = nil; -GVAR(MenuPage) = nil; -GVAR(OptionNames) = nil; -GVAR(OptionNamesNew) = nil; -GVAR(OptionStatesNew) = nil; diff --git a/addons/core/scripts/readParameters.sqf b/addons/core/scripts/readParameters.sqf deleted file mode 100644 index 363b4915d5..0000000000 --- a/addons/core/scripts/readParameters.sqf +++ /dev/null @@ -1,64 +0,0 @@ -// by CAA-Picard - -// Read AGM_Parameters from config and set them on the mission namespace -_config = configFile >> "AGM_Parameters"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value] call FUNC(setParameter); -}; - -_config = configFile >> "AGM_Parameters_Numeric"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value] call FUNC(setParameter); -}; - -_config = configFile >> "AGM_Parameters_Boolean"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value > 0] call FUNC(setParameter); -}; - - -// Read AGM_Parameters from mission and set them on the mission namespace, replacing defaults if necesary -_config = missionConfigFile >> "AGM_Parameters"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value] call FUNC(setParameter); -}; - -_config = missionConfigFile >> "AGM_Parameters_Numeric"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value] call FUNC(setParameter); -}; - -_config = missionConfigFile >> "AGM_Parameters_Boolean"; -_count = count _config; -for "_index" from 0 to (_count - 1) do { - _x = _config select _index; - - _name = configName _x; - _value = _x call bis_fnc_getcfgdata; - [_name, _value > 0] call FUNC(setParameter); -}; diff --git a/addons/core/scripts/toggleState.sqf b/addons/core/scripts/toggleState.sqf deleted file mode 100644 index 1bd9b09912..0000000000 --- a/addons/core/scripts/toggleState.sqf +++ /dev/null @@ -1,17 +0,0 @@ -// by commy2 - -_index = _this select 0; - -_name = format ["AGM_%1", GVAR(OptionNames) select _index]; - -_index1 = GVAR(OptionNamesNew) find _name; -_state = if (_index1 == -1) then {_index1 = count GVAR(OptionNamesNew); !(profileNamespace getVariable _name)} else {!(GVAR(OptionStatesNew) select _index1)}; - -disableSerialization; -_dlgMenuDialog = uiNamespace getVariable QGVAR(MenuDialog); - -_control = _dlgMenuDialog displayCtrl (300 + _index); -_control ctrlSetText format [PATHTOF(UI\box_%1checked_ca.paa", ["un", ")] select _state]; - -GVAR(OptionNamesNew) set [_index1, _name]; -GVAR(OptionStatesNew) set [_index1, _state]; diff --git a/addons/core/stringtable.xml b/addons/core/stringtable.xml deleted file mode 100644 index e60529bde0..0000000000 --- a/addons/core/stringtable.xml +++ /dev/null @@ -1,467 +0,0 @@ - - - - - - AGM-Team - AGM-Team - AGM-Team - AGM-Team - AGM-Team - AGM-Team - ĐĐ¾Đ¼Đ°Đ½Đ´Đ° AGM - AGM-Team - AGM-Team - AGM-Team - - - Save - Speichern - Guardar - Zapisz - Uložit - Sauvegarder - Đ¡Đ¾Ñ…Ñ€Đ°Đ½Đ¸Ñ‚ÑŒ - Salvar - MentĂ©s - Salva - - - Cancel - Abbrechen - Cancelar - Anuluj - ZruÅ¡it - Annuler - ĐÑ‚Đ¼ĐµĐ½Đ° - Cancelar - MĂ©gse - Annulla - - - AGM Options - AGM Optionen - Opciones AGM - Opcje AGM - AGM NastavenĂ­ - AGM Options - AGM ĐĐ°ÑÑ‚Ñ€Đ¾Đ¹ĐºĐ¸ - Opções do AGM - AGM OpciĂ³k - Opzioni AGM - - - Shift - Umschalt - Shift - Shift - Shift - Shift - Shift - Shift - Shift - Shift - - - Ctrl - Strg - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - Ctrl - - - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - Alt - - - Shift right - Umschalt rechts - Shift derecho - Prawy Shift - PravĂ½ Shift - Shift Droite - ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Shift - Shift da Direita - Jobb Shift - Shift destro - - - Ctrl right - Strg rechts - Ctrl derecho - Prawy Ctrl - PravĂ½ Ctrl - Ctrl Droite - ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Ctrl - Ctrl da Direita - Jobb Ctrl - Ctrl destro - - - Alt right - Alt Gr - Alt derecho - Prawy Alt - PravĂ½ Alt - Alt Droite - ĐŸÑ€Đ°Đ²Ñ‹Đ¹ Alt - Alt da Direita - Alt Gr - Alt Gr - - - Default - Standard - Por defecto - DomyÅ›lne - VĂ½chozĂ­ - DĂ©faut - ĐŸĐ¾ ÑƒĐ¼Đ¾Đ»Ñ‡Đ°Đ½Đ¸Ñ - PadrĂ£o - AlapĂ©rtelmezett - Standard - - - None - Keiner - Ninguna - Brak - Å½Ă¡dnĂ½ - Aucun - Đе Đ½Đ°Đ·Đ½Đ°Ñ‡ĐµĐ½Đ¾ - Nenhuma - Semmi - Non assegnato - - - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - 2x %1 - - - Hold %1 - %1 halten - Mantener %1 - Przytrzymać %1 - Držet %1 - Tenir %1 - Đ£Đ´ĐµÑ€Đ¶Đ¸Đ²Đ°Ñ %1 - Segurar %1 - %1 NyomvatartĂ¡sa - Tieni premuto %1 - - - Profile saved - Profil gespeichert - Perfil guardado - Profil zapisany - Profil uložen - Profil sauvegardĂ© - ĐŸÑ€Đ¾Ñ„Đ¸Đ»ÑŒ ÑĐ¾Ñ…Ñ€Đ°Đ½ĐµĐ½ - Perfil salvo - Profil elmentve - Profilo salvato - - - Profile not saved - Profil nicht gespeichert - Perfil no guardado - Profil niezapisany - Profil neuložen - Profil non sauvegardĂ© - ĐŸÑ€Đ¾Ñ„Đ¸Đ»ÑŒ Đ½Đµ ÑĐ¾Ñ…Ñ€Đ°Đ½ĐµĐ½ - Perfil nĂ£o salvo - A profil nincs elmentve - Profilo non salvato - - - - N - N - N - N - S - N - Đ¡ - N - É - N - - - NNE - NNO - NNE - NNE - SSV - NNE - Đ¡Đ¡Đ’ - NNE - ÉÉK - NNE - - - NE - NO - NE - NE - SV - NE - Đ¡Đ’ - NE - ÉK - NE - - - ENE - ONO - ENE - ENE - VSV - ENE - Đ’Đ¡Đ’ - LNE - KÉK - ENE - - - E - O - E - E - V - E - Đ’ - L - K - E - - - ESE - OSO - ESE - ESE - VJV - ESE - ВЮВ - LSE - KDK - ESE - - - SE - SO - SE - SE - JV - SE - ЮВ - SE - DK - SE - - - SSE - SSO - SSE - SSE - JJV - SSE - ЮЮВ - SSE - DDK - SSE - - - S - S - S - S - J - S - Đ® - S - D - S - - - SSW - SSW - SSO - SSW - JJZ - SSO - ЮЮЗ - SSO - DDNy - SSO - - - SW - SW - SO - SW - JZ - SO - ЮЗ - SO - DNy - SO - - - WSW - WSW - OSO - WSW - ZJZ - OSO - ЗЮЗ - OSO - NyDNy - OSO - - - W - W - O - W - Z - O - Đ— - O - Ny - O - - - WNW - WNW - ONO - WNW - ZSZ - ONO - Đ—Đ¡Đ— - ONO - NyÉNy - ONO - - - NW - NW - NO - NW - SZ - NO - Đ¡Đ— - NO - ÉNy - NO - - - NNW - NNW - NNO - NNW - SSZ - NNO - Đ¡Đ¡Đ— - NNO - ÉÉNy - NNO - - - Action cancelled. - Aktion abgebrochen. - AcciĂ³n cancelada. - Przerwano czynność - Akce pÅ™eruÅ¡ena - Action annulĂ©e. - Đ”ĐµĐ¹ÑÑ‚Đ²Đ¸Đµ Đ¾Ñ‚Đ¼ĐµĐ½ĐµĐ½Đ¾. - AĂ§Ă£o cancelada. - Művelet megszakĂ­tva. - Azione cancellata. - - - < Prev - < ZurĂ¼ck - < Anterior. - < Poprzedni - < PÅ™edchozĂ­ - < PrĂ©c - < ĐŸÑ€ĐµĐ´. - < Anterior - < ElÅ‘zÅ‘ - < Prec - - - Next > - Weiter > - Siguiente > - NastÄ™pny > - DalÅ¡Ă­ > - Suivant > - Đ¡Đ»ĐµĐ´. > - PrĂ³ximo > - KövetkezÅ‘ > - Prossimo > - - - [AGM] Miscellaneous Items - [AGM] Verschiedenes - [AGM] Objetos varios - [AGM] RĂ³Å¼ne przedmioty - [AGM] OstatnĂ­ pÅ™edmÄ›ty - [AGM] Objets divers - [AGM] Đ Đ°Đ·Đ»Đ¸Ñ‡Đ½Ñ‹Đµ Đ¿Ñ€ĐµĐ´Đ¼ĐµÑ‚Ñ‹ - [AGM] Itens diversos - [AGM] EgyĂ©b tĂ¡rgyak - [AGM] Oggetti vari - - - Disable Command Menu - BefehlsmenĂ¼ ausschalten - Desactivar menĂº de mando - WyÅ‚Ä…cz menu dowodzenia - Vypnout velĂ­cĂ­ menu - DĂ©sactiver Menu Commande - Đ’Ñ‹ĐºĐ»ÑÑ‡Đ¸Ñ‚ÑŒ ĐºĐ¾Đ¼Đ°Đ½Đ´Đ½Đ¾Đµ Đ¼ĐµĐ½Ñ - Parancsnoki menĂ¼ kikapcsolĂ¡sa - - - Unknown - Unbekannt - Desconocido - Nieznany - NeznĂ¡mĂ½ - ĐĐµĐ¸Đ·Đ²ĐµÑÑ‚Đ½Đ¾ - Ismeretlen - - - No Voice - Keine Stimme - Sin voz - Brak gÅ‚osu - Å½Ă¡dnĂ½ hlas - Без Đ³Đ¾Đ»Đ¾ÑĐ° - Nincs hang - - - \ No newline at end of file diff --git a/addons/frag/fnc_BIS_ARTY_WRAPPER.sqf b/addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf similarity index 100% rename from addons/frag/fnc_BIS_ARTY_WRAPPER.sqf rename to addons/frag/functions/fnc_BIS_ARTY_WRAPPER.sqf diff --git a/addons/frag/fnc_addBlackList.sqf b/addons/frag/functions/fnc_addBlackList.sqf similarity index 100% rename from addons/frag/fnc_addBlackList.sqf rename to addons/frag/functions/fnc_addBlackList.sqf diff --git a/addons/frag/fnc_addManualTrack.sqf b/addons/frag/functions/fnc_addManualTrack.sqf similarity index 100% rename from addons/frag/fnc_addManualTrack.sqf rename to addons/frag/functions/fnc_addManualTrack.sqf diff --git a/addons/frag/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf similarity index 100% rename from addons/frag/fnc_addTrack.sqf rename to addons/frag/functions/fnc_addTrack.sqf diff --git a/addons/frag/fnc_clearTraces.sqf b/addons/frag/functions/fnc_clearTraces.sqf similarity index 100% rename from addons/frag/fnc_clearTraces.sqf rename to addons/frag/functions/fnc_clearTraces.sqf diff --git a/addons/frag/fnc_denyFrag.sqf b/addons/frag/functions/fnc_denyFrag.sqf similarity index 100% rename from addons/frag/fnc_denyFrag.sqf rename to addons/frag/functions/fnc_denyFrag.sqf diff --git a/addons/frag/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf similarity index 100% rename from addons/frag/fnc_doSpall.sqf rename to addons/frag/functions/fnc_doSpall.sqf diff --git a/addons/frag/fnc_drawTraces.sqf b/addons/frag/functions/fnc_drawTraces.sqf similarity index 100% rename from addons/frag/fnc_drawTraces.sqf rename to addons/frag/functions/fnc_drawTraces.sqf diff --git a/addons/frag/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf similarity index 100% rename from addons/frag/fnc_fired.sqf rename to addons/frag/functions/fnc_fired.sqf diff --git a/addons/frag/fnc_frag_trace.sqf b/addons/frag/functions/fnc_frag_trace.sqf similarity index 100% rename from addons/frag/fnc_frag_trace.sqf rename to addons/frag/functions/fnc_frag_trace.sqf diff --git a/addons/frag/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf similarity index 100% rename from addons/frag/fnc_frago.sqf rename to addons/frag/functions/fnc_frago.sqf diff --git a/addons/frag/fnc_removeTrack.sqf b/addons/frag/functions/fnc_removeTrack.sqf similarity index 100% rename from addons/frag/fnc_removeTrack.sqf rename to addons/frag/functions/fnc_removeTrack.sqf diff --git a/addons/frag/fnc_spallHP.sqf b/addons/frag/functions/fnc_spallHP.sqf similarity index 100% rename from addons/frag/fnc_spallHP.sqf rename to addons/frag/functions/fnc_spallHP.sqf diff --git a/addons/frag/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf similarity index 100% rename from addons/frag/fnc_spallTrack.sqf rename to addons/frag/functions/fnc_spallTrack.sqf diff --git a/addons/frag/fnc_startTracing.sqf b/addons/frag/functions/fnc_startTracing.sqf similarity index 100% rename from addons/frag/fnc_startTracing.sqf rename to addons/frag/functions/fnc_startTracing.sqf diff --git a/addons/frag/fnc_stopTracing.sqf b/addons/frag/functions/fnc_stopTracing.sqf similarity index 100% rename from addons/frag/fnc_stopTracing.sqf rename to addons/frag/functions/fnc_stopTracing.sqf diff --git a/addons/frag/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf similarity index 100% rename from addons/frag/fnc_trackFragRound.sqf rename to addons/frag/functions/fnc_trackFragRound.sqf diff --git a/addons/frag/fnc_trackTrace.sqf b/addons/frag/functions/fnc_trackTrace.sqf similarity index 100% rename from addons/frag/fnc_trackTrace.sqf rename to addons/frag/functions/fnc_trackTrace.sqf diff --git a/addons/frag/fnc_vectorDiffFast.sqf b/addons/frag/functions/fnc_vectorDiffFast.sqf similarity index 100% rename from addons/frag/fnc_vectorDiffFast.sqf rename to addons/frag/functions/fnc_vectorDiffFast.sqf diff --git a/addons/frag/functions/script_component.hpp b/addons/frag/functions/script_component.hpp new file mode 100644 index 0000000000..8312313751 --- /dev/null +++ b/addons/frag/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\frag\script_component.hpp" \ No newline at end of file diff --git a/addons/interaction/CfgEventHandlers.hpp b/addons/interaction/CfgEventHandlers.hpp new file mode 100644 index 0000000000..17200056b8 --- /dev/null +++ b/addons/interaction/CfgEventHandlers.hpp @@ -0,0 +1,27 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; + +class Extended_GetIn_EventHandlers { + class All { + class ADDONnu { + clientGetIn = QUOTE( if (_this select 2 == ACE_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}); + }; + }; +}; + +class Extended_GetOut_EventHandlers { + class All { + class ADDONnu { + clientGetOut = QUOTE( if (_this select 2 == ACE_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}); + }; + }; +}; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index cc66efa2e9..0a5ded72e6 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -3,9 +3,9 @@ #define VSPACE 0.5-0.3/9/2 class RscStructuredText; -class AGM_Interaction_Button_Base { +class ACE_Interaction_Button_Base { tooltip = ""; - //action = "AGM_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = AGM_Interaction_Buttons select AGM_Interaction_SelectedButton;AGM_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; + //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; action = ""; idc = -1; @@ -46,14 +46,14 @@ class AGM_Interaction_Button_Base { #define ICON_BORDER 0.05 // Old command rose -class AGM_Interaction_Dialog { +class ACE_Interaction_Dialog { idd = 1713999; enableSimulation = 1; movingEnable = 0; - onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['AGM_Interaction_Dialog', _dlgInteractionDialog];"; + onLoad = "_dlgInteractionDialog = _this select 0; for '_a' from 10 to 19 do {(_dlgInteractionDialog displayCtrl _a) ctrlShow false}; uiNamespace setVariable ['ACE_Interaction_Dialog', _dlgInteractionDialog];"; objects[] = {}; class controls { - class Interaction_BackgroundMain: AGM_Interaction_Button_Base { + class Interaction_BackgroundMain: ACE_Interaction_Button_Base { type = 0; style = 2; idc = 2; @@ -65,8 +65,8 @@ class AGM_Interaction_Dialog { h = "0.55 / 9 * safezoneH"; }; - class Interaction_ButtonMain: AGM_Interaction_Button_Base { - action = "-1 call AGM_Interaction_fnc_onClick;"; + class Interaction_ButtonMain: ACE_Interaction_Button_Base { + action = "-1 call ACE_Interaction_fnc_onClick;"; style = 2; tooltip = ""; text = "Interaction Menu"; @@ -82,7 +82,7 @@ class AGM_Interaction_Dialog { h = "0.55 / 9 * safezoneH"; }; - class Interaction_Background0: AGM_Interaction_Button_Base { + class Interaction_Background0: ACE_Interaction_Button_Base { type = 0; style = 2; idc = 40; @@ -157,7 +157,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; - class Interaction_Icon0: AGM_Interaction_Button_Base { + class Interaction_Icon0: ACE_Interaction_Button_Base { tooltip = ""; text = ""; idc = 20; @@ -233,7 +233,7 @@ class AGM_Interaction_Dialog { h = (0.3-ICON_BORDER) / 9 * safezoneH; }; - class Interaction_Shortcut0: AGM_Interaction_Button_Base { + class Interaction_Shortcut0: ACE_Interaction_Button_Base { tooltip = ""; text = ""; idc = 30; @@ -317,8 +317,8 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; - class Interaction_Button0: AGM_Interaction_Button_Base { - action = "0 call AGM_Interaction_fnc_onClick;"; + class Interaction_Button0: ACE_Interaction_Button_Base { + action = "0 call ACE_Interaction_fnc_onClick;"; style = 2; tooltip = ""; text = ""; @@ -333,7 +333,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button1: Interaction_Button0 { - action = "1 call AGM_Interaction_fnc_onClick;"; + action = "1 call ACE_Interaction_fnc_onClick;"; idc = 11; x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; @@ -341,7 +341,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button2: Interaction_Button0 { - action = "2 call AGM_Interaction_fnc_onClick;"; + action = "2 call ACE_Interaction_fnc_onClick;"; idc = 12; x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; @@ -349,7 +349,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button3: Interaction_Button0 { - action = "3 call AGM_Interaction_fnc_onClick;"; + action = "3 call ACE_Interaction_fnc_onClick;"; idc = 13; x = "(0.5-2.0/16/2 + 1.25 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; @@ -357,7 +357,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button4: Interaction_Button0 { - action = "4 call AGM_Interaction_fnc_onClick;"; + action = "4 call ACE_Interaction_fnc_onClick;"; idc = 14; x = "(0.5-2.0/16/2 + 1.0 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; @@ -365,7 +365,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button5: Interaction_Button0 { - action = "5 call AGM_Interaction_fnc_onClick;"; + action = "5 call ACE_Interaction_fnc_onClick;"; idc = 15; x = "(0.5-2.0/16/2 + 0 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 + 2.5 * 0.04) * safezoneH + safezoneY"; @@ -373,7 +373,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button6: Interaction_Button0 { - action = "6 call AGM_Interaction_fnc_onClick;"; + action = "6 call ACE_Interaction_fnc_onClick;"; idc = 16; x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 + 1.5 * 0.04) * safezoneH + safezoneY"; @@ -381,7 +381,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button7: Interaction_Button0 { - action = "7 call AGM_Interaction_fnc_onClick;"; + action = "7 call ACE_Interaction_fnc_onClick;"; idc = 17; x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 + 0.5 * 0.04) * safezoneH + safezoneY"; @@ -389,7 +389,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button8: Interaction_Button0 { - action = "8 call AGM_Interaction_fnc_onClick;"; + action = "8 call ACE_Interaction_fnc_onClick;"; idc = 18; x = "(0.5-2.0/16/2 - 1.25 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 - 0.5 * 0.04) * safezoneH + safezoneY"; @@ -397,7 +397,7 @@ class AGM_Interaction_Dialog { h = "0.3 / 9 * safezoneH"; }; class Interaction_Button9: Interaction_Button0 { - action = "9 call AGM_Interaction_fnc_onClick;"; + action = "9 call ACE_Interaction_fnc_onClick;"; idc = 19; x = "(0.5-2.0/16/2 - 1.0 * 0.1) * safezoneW + safezoneX"; y = "(0.5-0.3/9/2 - 1.5 * 0.04) * safezoneH + safezoneY"; @@ -412,7 +412,7 @@ class IGUIBack; class RscText; #define X_OFFSET 0.2 -class RscAGM_SelectAnItem { +class RscACE_SelectAnItem { idd = 8854; movingEnable = 0; class controls { @@ -433,7 +433,7 @@ class RscAGM_SelectAnItem { text = ""; }; class itemList:RscListBox { - onMouseButtonDblClick = "_this call AGM_Interaction_fnc_onSelectMenuDblClick"; + onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; idc = 8866; x = X_OFFSET + 0.005; w = 0.59; @@ -441,7 +441,7 @@ class RscAGM_SelectAnItem { y = 0.06; }; - class cancelBtnBackground: AGM_Interaction_Button_Base { + class cancelBtnBackground: ACE_Interaction_Button_Base { type = 0; style = 2; idc = -1; @@ -452,7 +452,7 @@ class RscAGM_SelectAnItem { h = 0.1; y = 0.605; }; - class approveBtnBackground: AGM_Interaction_Button_Base { + class approveBtnBackground: ACE_Interaction_Button_Base { type = 0; style = 2; idc = -1; @@ -464,29 +464,29 @@ class RscAGM_SelectAnItem { w = 0.15; }; - class cancelBtn: AGM_Interaction_Button_Base { + class cancelBtn: ACE_Interaction_Button_Base { idc = 8855; x = X_OFFSET + 0.005; w = 0.15; h = 0.1; y = 0.605; style = 2; - text = $STR_AGM_Interaction_Back; //$STR_AGM_Interaction_CancelSelection; - action = "call AGM_Interaction_fnc_hideMenu;"; //'Default' call AGM_Interaction_fnc_openMenu; 'Default' call AGM_Interaction_fnc_openMenuSelf; + text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; colorBackground[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundActive[] = {1,1,1,0.2}; colorFocused[] = {0,0,0,0}; }; - class approveBtn: AGM_Interaction_Button_Base { + class approveBtn: ACE_Interaction_Button_Base { idc = 8860; x = X_OFFSET + 0.445; y = 0.605; h = 0.1; w = 0.15; style = 2; - text = $STR_AGM_Interaction_MakeSelection; - action = "call AGM_Interaction_fnc_hideMenu;"; + text = $STR_ACE_Interaction_MakeSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; colorBackground[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundActive[] = {1,1,1,0.2}; @@ -518,19 +518,19 @@ class RscInteractionText: RscText{ h = 1.5 * GUI_GRID_H; }; class RscTitles { - class AGM_FlowMenu { + class ACE_FlowMenu { idd = 9920; enableSimulation = 1; movingEnable = 0; fadeIn=0.5; fadeOut=0.5; duration = 10e10; - onLoad = "uiNamespace setVariable ['AGM_Flow_Display', _this select 0];"; + onLoad = "uiNamespace setVariable ['ACE_Flow_Display', _this select 0];"; class controls { class RearIcon: RscInteractionIcon{ idc = 999; - text = "AGM_interaction\UI\CenterIcon_ca.paa"; + text = "ACE_interaction\UI\CenterIcon_ca.paa"; x = 17.9 * GUI_GRID_W; y = 10 * GUI_GRID_H; w = 3.7 * GUI_GRID_H; @@ -570,7 +570,7 @@ class RscTitles { }; class BackIcon: RscInteractionIcon{ idc = 1210; - text = "AGM_interaction\UI\backArrow_ca.paa"; + text = "ACE_interaction\UI\backArrow_ca.paa"; x = 18.25 * GUI_GRID_W; y = 12.69 * GUI_GRID_H; w = 0.5 * GUI_GRID_W; @@ -587,45 +587,45 @@ class RscTitles { }; }; }; - class AGM_InteractionHelper { + class ACE_InteractionHelper { idd = 9930; enableSimulation = 1; movingEnable = 0; fadeIn=0.5; fadeOut=0.5; duration = 10e10; - onLoad = "uiNamespace setVariable ['AGM_Helper_Display', _this select 0];"; + onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; class controls { class SelectIcon: RscInteractionHelperIcon{ idc = 1200; - text = "AGM_interaction\UI\mouse_left_ca.paa"; + text = "ACE_interaction\UI\mouse_left_ca.paa"; y = 17.5 * GUI_GRID_H; }; class SelectText: RscInteractionText{ idc = 1000; y = 17 * GUI_GRID_H; - text = $STR_AGM_Interaction_MakeSelection; + text = $STR_ACE_Interaction_MakeSelection; }; class GoBackIcon: RscInteractionHelperIcon{ idc = 1201; - text = "AGM_interaction\UI\mouse_right_ca.paa"; + text = "ACE_interaction\UI\mouse_right_ca.paa"; y = 19.5 * GUI_GRID_H; }; class GoBackText: RscInteractionText{ idc = 1001; y = 19 * GUI_GRID_H; - text = $STR_AGM_Interaction_Back; + text = $STR_ACE_Interaction_Back; }; class ScrollIcon: RscInteractionHelperIcon{ idc = 1202; - text = "AGM_interaction\UI\mouse_scroll_ca.paa"; + text = "ACE_interaction\UI\mouse_scroll_ca.paa"; y = 18.5 * GUI_GRID_H; }; class ScrollText: RscInteractionText{ idc = 1002; y = 18 * GUI_GRID_H; - text = $STR_AGM_Interaction_ScrollHint; + text = $STR_ACE_Interaction_ScrollHint; }; }; }; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf new file mode 100644 index 0000000000..7b64310037 --- /dev/null +++ b/addons/interaction/XEH_clientInit.sqf @@ -0,0 +1,13 @@ +// by commy2 and CAA-Picard + +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(isOpeningDoor) = false; + +// restore global fire teams for JIP +{ + _team = _x getVariable [QGVAR(assignedFireTeam), ""]; + if (_team != "") then {_x assignTeam _team}; +} forEach allUnits; diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf new file mode 100644 index 0000000000..e5093f77f2 --- /dev/null +++ b/addons/interaction/XEH_preInit.sqf @@ -0,0 +1,46 @@ +#include "script_component.hpp" + +PREP(addInteraction); +PREP(addInteractionSelf); +PREP(AddSelectableItem); +PREP(addToTooltip); +PREP(applyButtons); +PREP(canInteractWith); +PREP(canTapShoulder); +PREP(getActions2); +PREP(GetActions); +PREP(getDoor); +PREP(getDoorAnimations); +PREP(getDown); +PREP(getSelectedButton); +PREP(hideMenu); +PREP(hideMouseHint); +PREP(initialiseInteraction); +PREP(isInRange); +PREP(joinTeam); +PREP(menuKeyInput); +PREP(moduleInteraction); +PREP(moveDown); +PREP(onButtonDown); +PREP(onButtonDownSelf); +PREP(onButtonUp); +PREP(onClick); +PREP(onSelectMenuDblClick); +PREP(openDoor); +PREP(openMenu); +PREP(openMenuSelectUI); +PREP(openMenuSelf); +PREP(openSelectMenu); +PREP(openSubMenu); +PREP(openSubMenuSelf); +PREP(prepareSelectMenu); +PREP(push); +PREP(removeInteraction); +PREP(removeInteractionSelf); +PREP(removeTag); +PREP(sendAway); +PREP(showMenu); +PREP(showMouseHint); +PREP(sortOptionsByPriority); +PREP(tapShoulder); +PREP(updateTooltipPosition); \ No newline at end of file diff --git a/addons/interaction/clientInit.sqf b/addons/interaction/clientInit.sqf deleted file mode 100644 index 02762d42b6..0000000000 --- a/addons/interaction/clientInit.sqf +++ /dev/null @@ -1,12 +0,0 @@ -// by commy2 and CAA-Picard - -if (!hasInterface) exitWith {}; - -AGM_Interaction_isOpeningDoor = false; -AGM_Dancing = false; - -// restore global fire teams for JIP -{ - _team = _x getVariable ["AGM_assignedFireTeam", ""]; - if (_team != "") then {_x assignTeam _team}; -} forEach allUnits; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 961d644a0b..e59f861f79 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -1,9 +1,11 @@ +#include "script_component.hpp" + class CfgPatches { - class AGM_Interaction { + class ADDON { units[] = {}; weapons[] = {}; requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; + requiredAddons[] = {"ace_common"}; version = "0.95"; versionStr = "0.95"; versionAr[] = {0,95,0}; @@ -12,157 +14,60 @@ class CfgPatches { }; }; -class CfgFunctions { - class AGM_Interaction { - class AGM_Interaction { - file = "\AGM_interaction\functions"; - class addInteraction; - class addInteractionSelf; - class AddSelectableItem; - class addToTooltip; - class applyButtons; - class canInteractWith; - class canLockDoor; - class canTapShoulder; - class getActions2; - class GetActions; - class getDoor; - class getDoorAnimations; - class getDown; - class getSelectedButton; - class hideMenu; - class hideMouseHint; - class initialiseInteraction; - class isInRange; - class joinTeam; - class lockDoor; - class menuKeyInput; - class moduleInteraction; - class moveDown; - class onButtonDown; - class onButtonDownSelf; - class onButtonUp; - class onClick; - class onSelectMenuDblClick; - class openDoor; - class openMenu; - class openMenuSelectUI; - class openMenuSelf; - class openSelectMenu; - class openSubMenu; - class openSubMenuSelf; - class prepareSelectMenu; - class push; - class removeInteraction; - class removeInteractionSelf; - class removeTag; - class sendAway; - class showMenu; - class showMouseHint; - class sortOptionsByPriority; - class tapShoulder; - class updateTooltipPosition; +#include "CfgEventHandlers.hpp" - // backwards compatibility, remove in some patches - class getCaptivityStatus; - class setCaptivityStatus; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Interaction { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Interaction\clientInit.sqf'"; - }; -}; - -class Extended_GetIn_EventHandlers { - class All { - class AGM_AutoCloseMenu { - clientGetIn = "if (_this select 2 == AGM_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}"; - }; - }; -}; - -class Extended_GetOut_EventHandlers { - class All { - class AGM_AutoCloseMenu { - clientGetOut = "if (_this select 2 == AGM_player && {!isNull (findDisplay 1713999)}) then {(findDisplay 1713999) closeDisplay 1}"; - }; - }; -}; - -class AGM_Core_Default_Keys { +class ACE_Core_Default_Keys { class openInteractionMenuNew { - displayName = "$STR_AGM_Interaction_InteractionMenu"; + displayName = "$STR_ACE_Interaction_InteractionMenu"; condition = "true"; - statement = "call AGM_Interaction_fnc_onButtonDown"; - conditionUp = "!isNull (findDisplay 1713999) && {profileNamespace getVariable ['AGM_Interaction_AutoCloseMenu', false]}"; - statementUp = "if (AGM_Interaction_MenuType mod 2 == 0) then {call AGM_Interaction_fnc_onButtonUp};"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting", "AGM_Interaction_isNotSwimming"}; + statement = QUOTE( call FUNC(onButtonDown) ); + conditionUp = QUOTE( !isNull (findDisplay 1713999) && {profileNamespace getVariable [QUOTE(QGVAR(AutoCloseMenu)), false]} ); + statementUp = QUOTE( if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)}; ); + exceptions[] = {"ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"}; key = 219; shift = 0; control = 0; alt = 0; }; class openInteractionMenuSelfNew { - displayName = "$STR_AGM_Interaction_InteractionMenuSelf"; + displayName = "$STR_ACE_Interaction_InteractionMenuSelf"; condition = "true"; - statement = "call AGM_Interaction_fnc_onButtonDownSelf"; - conditionUp = "!isNull (findDisplay 1713999) && {profileNamespace getVariable ['AGM_Interaction_AutoCloseMenu', false]}"; - statementUp = "if (AGM_Interaction_MenuType mod 2 == 1) then {call AGM_Interaction_fnc_onButtonUp};"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Medical_canTreat", "AGM_Interaction_isNotEscorting", "AGM_Interaction_isNotSwimming", "AGM_Core_notOnMap"}; + statement = QUOTE( call FUNC(onButtonDownSelf) ); + conditionUp = QUOTE( !isNull (findDisplay 1713999) && {profileNamespace getVariable [QUOTE(QGVAR(AutoCloseMenu)), false]} ); + statementUp = QUOTE( if (EGVAR(interaction,MenuType) mod 2 == 1) then {call FUNC(onButtonUp)}; ); + exceptions[] = {"ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming", "ACE_Core_notOnMap"}; key = 219; shift = 0; control = 1; alt = 0; }; class openDoor { - displayName = "$STR_AGM_Interaction_OpenDoor"; - condition = "!AGM_Interaction_isOpeningDoor && {[2] call AGM_Interaction_fnc_getDoor select 1 != ''}"; - statement = "call AGM_Interaction_fnc_openDoor"; - conditionUp = "AGM_Interaction_isOpeningDoor"; - statementUp = "AGM_Interaction_isOpeningDoor = false"; + displayName = "$STR_ACE_Interaction_OpenDoor"; + condition = QUOTE( !GVAR(isOpeningDoor) && {[2] call FUNC(getDoor) select 1 != ''} ); + statement = QUOTE( call ACE_Interaction_fnc_openDoor ); + conditionUp = QUOTE( GVAR(isOpeningDoor) ); + statementUp = QUOTE( GVAR(isOpeningDoor) = false;); key = 57; shift = 0; control = 1; alt = 0; }; - // disabled for now - /*class lockDoor { - displayName = "$STR_AGM_Interaction_LockDoor"; - condition = "[true] call AGM_Interaction_fnc_canLockDoor && {!AGM_Interaction_isOpeningDoor}"; - statement = "[true] call AGM_Interaction_fnc_lockDoor"; - key = 57; - shift = 0; - control = 0; - alt = 1; - }; - class unlockDoor { - displayName = "$STR_AGM_Interaction_UnlockDoor"; - condition = "[false] call AGM_Interaction_fnc_canLockDoor"; - statement = "[false] call AGM_Interaction_fnc_lockDoor"; - key = 57; - shift = 0; - control = 1; - alt = 1; - };*/ class tapShoulder { - displayName = "$STR_AGM_Interaction_TapShoulder"; - condition = "[_player, cursorTarget] call AGM_Interaction_fnc_canTapShoulder"; - statement = "[_player, cursorTarget] call AGM_Interaction_fnc_tapShoulder"; + displayName = "$STR_ACE_Interaction_TapShoulder"; + condition = QUOTE( [_player, cursorTarget] call FUNC(canTapShoulder) ); + statement = QUOTE( [_player, cursorTarget] call FUNC(tapShoulder); ); key = 20; shift = 1; control = 0; alt = 0; }; class modifierKey { - displayName = "$STR_AGM_Interaction_ModifierKey"; + displayName = "$STR_ACE_Interaction_ModifierKey"; condition = ""; - statement = "AGM_Modifier = 1;"; + statement = QUOTE( GVAR(Modifier) = 1; ); conditionUp = ""; - statementUp = "AGM_Modifier = 0;"; - exceptions[] = {"AGM_Drag_isNotDragging"}; + statementUp = QUOTE( GVAR(Modifier) = 0; ); + exceptions[] = {"ACE_Drag_isNotDragging"}; key = 29; shift = 0; control = 0; @@ -170,40 +75,40 @@ class AGM_Core_Default_Keys { }; }; -class AGM_Core_Options { +class ACE_Core_Options { class Interaction_FlowMenu { - displayName = "$STR_AGM_Interaction_FlowMenu"; + displayName = "$STR_ACE_Interaction_FlowMenu"; default = 0; }; class Interaction_AutoCloseMenu { - displayName = "$STR_AGM_Interaction_AutoCloseMenu"; + displayName = "$STR_ACE_Interaction_AutoCloseMenu"; default = 0; }; class Interaction_AutoCenterCursor { - displayName = "$STR_AGM_Interaction_AutoCenterCursor"; + displayName = "$STR_ACE_Interaction_AutoCenterCursor"; default = 1; }; }; -class AGM_Parameters { - AGM_Modifier = 0; +class ACE_Parameters { + ACE_Modifier = 0; }; -class AGM_Parameters_Boolean { - AGM_Interaction_EnableTeamManagement = 1; +class ACE_Parameters_Boolean { + ACE_Interaction_EnableTeamManagement = 1; }; -class AGM_Core_canInteractConditions { - class AGM_Interaction_isNotEscorting { - condition = "!(_player getVariable ['AGM_isEscorting', false])"; +class ACE_Core_canInteractConditions { + class ACE_Interaction_isNotEscorting { + condition = QUOTE( !(_player getVariable ['ACE_isEscorting', false]) ); }; - class AGM_Interaction_isNotCaptive { - condition = "!(_player getVariable ['AGM_isCaptive', false])"; + class ACE_Interaction_isNotCaptive { + condition = QUOTE( !(_player getVariable ['ACE_isCaptive', false]) ); }; - class AGM_Interaction_isNotSurrendering { - condition = "!(_player getVariable ['AGM_isSurrender', false])"; + class ACE_Interaction_isNotSurrendering { + condition = QUOTE( !(_player getVariable ['ACE_isSurrender', false]) ); }; - class AGM_Interaction_isNotSwimming { - condition = "!underwater _player"; + class ACE_Interaction_isNotSwimming { + condition = QUOTE( !underwater _player ); }; }; @@ -215,14 +120,14 @@ class AGM_Core_canInteractConditions { class CfgVehicles { class Module_F; - class AGM_ModuleInteraction: Module_F { - author = "$STR_AGM_Core_AGMTeam"; - category = "AGM"; + class ACE_ModuleInteraction: Module_F { + author = "$STR_ACE_Core_ACETeam"; + category = "ACE"; displayName = "Interaction System"; - function = "AGM_Interaction_fnc_moduleInteraction"; + function = "ACE_Interaction_fnc_moduleInteraction"; scope = 2; isGlobal = 1; - icon = "\AGM_Interaction\UI\IconInteraction_ca.paa"; + icon = PATHTOF(UI\IconInteraction_ca.paa); class Arguments { class EnableTeamManagement { displayName = "Enable Team Management"; @@ -238,327 +143,327 @@ class CfgVehicles { class Man; class CAManBase: Man { - class AGM_Actions { - class AGM_TeamManagement { - displayName = "$STR_AGM_Interaction_TeamManagement"; + class ACE_Actions { + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player} && {AGM_Interaction_EnableTeamManagement}"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)} ); statement = ""; showDisabled = 0; priority = 3.2; - icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; - subMenu[] = {"AGM_TeamManagement", 0}; + icon = PATHOF(UI\team\team_management_ca.paa); + subMenu[] = {"ACE_TeamManagement", 0}; hotkey = "M"; enableInside = 1; - class AGM_JoinTeamRed { - displayName = "$STR_AGM_Interaction_JoinTeamRed"; + class ACE_JoinTeamRed { + displayName = "$STR_ACE_Interaction_JoinTeamRed"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; - statement = "[_target, 'RED'] call AGM_Interaction_fnc_joinTeam"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} ); + statement = QUOTE( [_target, 'RED'] call FUNC(joinTeam) ); showDisabled = 1; - icon = "\AGM_Interaction\UI\team\team_red_ca.paa"; + icon = PATHOF(UI\team\team_red_ca.paa); priority = 2.4; hotkey = "R"; enableInside = 1; }; - class AGM_JoinTeamGreen { - displayName = "$STR_AGM_Interaction_JoinTeamGreen"; + class ACE_JoinTeamGreen { + displayName = "$STR_ACE_Interaction_JoinTeamGreen"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; - statement = "[_target, 'GREEN'] call AGM_Interaction_fnc_joinTeam"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} ); + statement = QUOTE( [_target, 'GREEN'] call FUNC(joinTeam) ); showDisabled = 1; - icon = "\AGM_Interaction\UI\team\team_green_ca.paa"; + icon = PATHOF(UI\team\team_green_ca.paa); priority = 2.3; hotkey = "G"; enableInside = 1; }; - class AGM_JoinTeamBlue { - displayName = "$STR_AGM_Interaction_JoinTeamBlue"; + class ACE_JoinTeamBlue { + displayName = "$STR_ACE_Interaction_JoinTeamBlue"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; - statement = "[_target, 'BLUE'] call AGM_Interaction_fnc_joinTeam"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} ); + statement = QUOTE( [_target, 'BLUE'] call FUNC(joinTeam) ); showDisabled = 1; - icon = "\AGM_Interaction\UI\team\team_blue_ca.paa"; + icon = PATHOF(UI\team\team_blue_ca.paa); priority = 2.2; hotkey = "B"; enableInside = 1; }; - class AGM_JoinTeamYellow { - displayName = "$STR_AGM_Interaction_JoinTeamYellow"; + class ACE_JoinTeamYellow { + displayName = "$STR_ACE_Interaction_JoinTeamYellow"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player}"; - statement = "[_target, 'YELLOW'] call AGM_Interaction_fnc_joinTeam"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} ); + statement = QUOTE( [_target, 'YELLOW'] call FUNC(joinTeam) ); showDisabled = 1; - icon = "\AGM_Interaction\UI\team\team_yellow_ca.paa"; + icon = PATHOF(UI\team\team_yellow_ca.paa); priority = 2.1; hotkey = "Y"; enableInside = 1; }; - class AGM_LeaveTeam { - displayName = "$STR_AGM_Interaction_LeaveTeam"; + class ACE_LeaveTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; distance = 4; - condition = "alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'}"; - statement = "[_target, 'MAIN'] call AGM_Interaction_fnc_joinTeam"; + condition = QUOTE( alive _target && {!isPlayer _target} && {_target in units group _player} && {assignedTeam _player != 'MAIN'} ); + statement = QUOTE( [_target, 'MAIN'] call FUNC(joinTeam) ); showDisabled = 1; - icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + icon = PATHOF(UI\team\team_white_ca.paa); priority = 2.5; hotkey = "N"; enableInside = 1; }; }; - class AGM_TapShoulder { - displayName = "$STR_AGM_Interaction_TapShoulder"; + class ACE_TapShoulder { + displayName = "$STR_ACE_Interaction_TapShoulder"; distance = 4; - condition = "[_player, _target] call AGM_Interaction_fnc_canTapShoulder"; - statement = "[_player, _target] call AGM_Interaction_fnc_tapShoulder"; + condition = QUOTE( [_player, _target] call FUNC(canTapShoulder) ); + statement = QUOTE( [_player, _target] call FUNC(tapShoulder) ); showDisabled = 1; priority = 2.8; hotkey = "Q"; enableInside = 1; }; - class AGM_JoinGroup { - displayName = "$STR_AGM_Interaction_JoinGroup"; + class ACE_JoinGroup { + displayName = "$STR_ACE_Interaction_JoinGroup"; distance = 4; - condition = "side group _player == side group _target && {group _player != group _target}"; - statement = "[_player] joinSilent group _target;"; + condition = QUOTE( side group _player == side group _target && {group _player != group _target} ); + statement = QUOTE( [_player] joinSilent group _target; ); showDisabled = 0; priority = 2.6; - icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + icon = PATHOF(UI\team\team_management_ca.paa); hotkey = "J"; enableInside = 1; }; - class AGM_GetDown { - displayName = "$STR_AGM_Interaction_GetDown"; + class ACE_GetDown { + displayName = "$STR_ACE_Interaction_GetDown"; distance = 4; - condition = "[_target] call AGM_Interaction_fnc_canInteractWith"; - statement = "[_target] call AGM_Interaction_fnc_getDown"; + condition = QUOTE( [_target] call FUNC(canInteractWith) ); + statement = QUOTE( [_target] call FUNC(getDown) ); showDisabled = 0; priority = 2.2; }; - class AGM_SendAway { - displayName = "$STR_AGM_Interaction_SendAway"; + class ACE_SendAway { + displayName = "$STR_ACE_Interaction_SendAway"; distance = 4; - condition = "[_target] call AGM_Interaction_fnc_canInteractWith"; - statement = "[_target] call AGM_Interaction_fnc_sendAway"; + condition = QUOTE( [_target] call FUNC(canInteractWith) ); + statement = QUOTE( [_target] call FUNC(sendAway) ); showDisabled = 0; priority = 2.0; }; - class AGM_Pardon { - displayName = "$STR_AGM_Interaction_Pardon"; + class ACE_Pardon { + displayName = "$STR_ACE_Interaction_Pardon"; distance = 4; - condition = "rating _target < -2000 && {alive _target} && {side group _player == side group _target}"; - statement = "[_target, '{_this addRating -rating _this}', _target] call AGM_Core_fnc_execRemoteFnc"; + condition = QUOTE( rating _target < -2000 && {alive _target} && {side group _player == side group _target} ); + statement = QUOTE( [_target, '{_this addRating -rating _this}', _target] call EFUNC(core,execRemoteFnc) ); showDisabled = 0; priority = 2.5; enableInside = 1; }; }; - class AGM_SelfActions { - class AGM_TeamManagement { - displayName = "$STR_AGM_Interaction_TeamManagement"; - condition = "AGM_Interaction_EnableTeamManagement"; + class ACE_SelfActions { + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; + condition = QUOTE( GVAR(EnableTeamManagement) ); statement = ""; showDisabled = 1; priority = 3.2; - icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; - subMenu[] = {"AGM_TeamManagement", 1}; + icon = PATHOF(UI\team\team_management_ca.paa); + subMenu[] = {"ACE_TeamManagement", 1}; enableInside = 1; hotkey = "M"; - class AGM_JoinTeamRed { - displayName = "$STR_AGM_Interaction_JoinTeamRed"; - condition = "true"; - statement = "[_player, 'RED'] call AGM_Interaction_fnc_joinTeam"; + class ACE_JoinTeamRed { + displayName = "$STR_ACE_Interaction_JoinTeamRed"; + condition = QUOTE( true ); + statement = QUOTE( [_player, 'RED'] call FUNC(joinTeam) ); showDisabled = 1; priority = 2.4; - icon = "\AGM_Interaction\UI\team\team_red_ca.paa"; + icon = PATHOF(UI\team\team_red_ca.paa); enableInside = 1; hotkey = "R"; }; - class AGM_JoinTeamGreen { - displayName = "$STR_AGM_Interaction_JoinTeamGreen"; - condition = "true"; - statement = "[_player, 'GREEN'] call AGM_Interaction_fnc_joinTeam"; + class ACE_JoinTeamGreen { + displayName = "$STR_ACE_Interaction_JoinTeamGreen"; + condition = QUOTE( true ); + statement = QUOTE( [_player, 'GREEN'] call FUNC(joinTeam) ); showDisabled = 1; priority = 2.3; - icon = "\AGM_Interaction\UI\team\team_green_ca.paa"; + icon = PATHOF(UI\team\team_green_ca.paa); enableInside = 1; hotkey = "G"; }; - class AGM_JoinTeamBlue { - displayName = "$STR_AGM_Interaction_JoinTeamBlue"; - condition = "true"; - statement = "[_player, 'BLUE'] call AGM_Interaction_fnc_joinTeam"; + class ACE_JoinTeamBlue { + displayName = "$STR_ACE_Interaction_JoinTeamBlue"; + condition = QUOTE( true ); + statement = QUOTE( [_player, 'BLUE'] call FUNC(joinTeam) ); showDisabled = 1; priority = 2.2; - icon = "\AGM_Interaction\UI\team\team_blue_ca.paa"; + icon = PATHOF(UI\team\team_blue_ca.paa); enableInside = 1; hotkey = "B"; }; - class AGM_JoinTeamYellow { - displayName = "$STR_AGM_Interaction_JoinTeamYellow"; - condition = "true"; - statement = "[_player, 'YELLOW'] call AGM_Interaction_fnc_joinTeam"; + class ACE_JoinTeamYellow { + displayName = "$STR_ACE_Interaction_JoinTeamYellow"; + condition = QUOTE( true ); + statement = QUOTE( [_player, 'YELLOW'] call FUNC(joinTeam) ); showDisabled = 1; priority = 2.1; - icon = "\AGM_Interaction\UI\team\team_yellow_ca.paa"; + icon = PATHOF(UI\team\team_yellow_ca.paa); enableInside = 1; hotkey = "Y"; }; - class AGM_LeaveTeam { - displayName = "$STR_AGM_Interaction_LeaveTeam"; - condition = "assignedTeam _player != 'MAIN'"; - statement = "[_player, 'MAIN'] call AGM_Interaction_fnc_joinTeam"; + class ACE_LeaveTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + condition = QUOTE( assignedTeam _player != 'MAIN' ); + statement = QUOTE( [_player, 'MAIN'] call FUNC(joinTeam) ); showDisabled = 1; priority = 2.5; - icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + icon = PATHOF(UI\team\team_white_ca.paa); enableInside = 1; hotkey = "N"; }; - class AGM_BecomeLeader { - displayName = "$STR_AGM_Interaction_BecomeLeader"; - condition = "count (units group _player) > 1 && {leader group _player != _player}"; - statement = "_newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player;"; + class ACE_BecomeLeader { + displayName = "$STR_ACE_Interaction_BecomeLeader"; + condition = QUOTE( count (units group _player) > 1 && {leader group _player != _player} ); + statement = QUOTE( _newGroup = createGroup side group _player; (units group _player) joinSilent _newGroup; _newGroup selectLeader _player; ); showDisabled = 1; priority = 1.0; - icon = "\AGM_Interaction\UI\team\team_white_ca.paa"; + icon = PATHOF(UI\team\team_white_ca.paa); enableInside = 1; hotkey = "L"; }; - class AGM_LeaveGroup { - displayName = "$STR_AGM_Interaction_LeaveGroup"; - condition = "count (units group _player) > 1"; - statement = "_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;"; + class ACE_LeaveGroup { + displayName = "$STR_ACE_Interaction_LeaveGroup"; + condition = QUOTE( count (units group _player) > 1 ); + statement = QUOTE( _oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup; ); showDisabled = 1; priority = 1.2; - icon = "\AGM_Interaction\UI\team\team_management_ca.paa"; + icon = PATHOF(UI\team\team_management_ca.paa); enableInside = 1; hotkey = "M"; }; }; /* DANCE ANIMATION DOESN'T WORK :( - class AGM_Dance { - displayName = "$STR_AGM_Interaction_Dance"; - condition = "isClass (configFile >> 'CfgPatches' >> 'AGM_Movement') and !AGM_Dancing"; - statement = "AGM_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;"; + class ACE_Dance { + displayName = "$STR_ACE_Interaction_Dance"; + condition = "isClass (configFile >> 'CfgPatches' >> 'ACE_Movement') and !ACE_Dancing"; + statement = "ACE_Dancing = true; [-2, {_this switchMove 'TestDance';}, player] call CBA_fnc_globalExecute;"; showDisabled = 0; priority = -1.2; }; - class AGM_StopDancing { - displayName = "$STR_AGM_Interaction_StopDancing"; - condition = "AGM_Dancing"; - statement = "AGM_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;"; + class ACE_StopDancing { + displayName = "$STR_ACE_Interaction_StopDancing"; + condition = "ACE_Dancing"; + statement = "ACE_Dancing = false; [-2, {_this switchMove '';}, player] call CBA_fnc_globalExecute;"; showDisabled = 0; priority = -1.2; }; */ - class AGM_Gestures { - displayName = "$STR_AGM_Interaction_Gestures"; + class ACE_Gestures { + displayName = "$STR_ACE_Interaction_Gestures"; condition = "canStand _target"; statement = ""; showDisabled = 1; priority = 3.5; - subMenu[] = {"AGM_Gestures", 1}; - icon = "AGM_Interaction\UI\gestures_ca.paa"; + subMenu[] = {"ACE_Gestures", 1}; + icon = "ACE_Interaction\UI\gestures_ca.paa"; hotkey = "G"; - /*class AGM_Gesture_Advance { - displayName = "$STR_AGM_Interaction_Gestures_Attack"; + /*class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Attack"; condition = "canStand _target"; statement = "_target playActionNow 'gestureAttack';"; showDisabled = 1; priority = 2.0; };*/ - class AGM_Gesture_Advance { - displayName = "$STR_AGM_Interaction_Gestures_Advance"; + class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Advance"; condition = "canStand _target"; statement = "_target playActionNow 'gestureAdvance';"; showDisabled = 1; priority = 1.9; hotkey = "1"; }; - class AGM_Gesture_Go { - displayName = "$STR_AGM_Interaction_Gestures_Go"; + class ACE_Gesture_Go { + displayName = "$STR_ACE_Interaction_Gestures_Go"; condition = "canStand _target"; statement = "_target playActionNow (['gestureGo', 'gestureGoB'] select (floor random 2));"; showDisabled = 1; priority = 1.8; hotkey = "2"; }; - class AGM_Gesture_Follow { - displayName = "$STR_AGM_Interaction_Gestures_Follow"; + class ACE_Gesture_Follow { + displayName = "$STR_ACE_Interaction_Gestures_Follow"; condition = "canStand _target"; statement = "_target playActionNow 'gestureFollow';"; showDisabled = 1; priority = 1.7; hotkey = "3"; }; - /*class AGM_Gesture_Point { - displayName = "$STR_AGM_Interaction_Gestures_Point"; + /*class ACE_Gesture_Point { + displayName = "$STR_ACE_Interaction_Gestures_Point"; condition = "canStand _target"; statement = "_target playActionNow 'gesturePoint';"; showDisabled = 1; priority = 1.6; };*/ - class AGM_Gesture_Up { - displayName = "$STR_AGM_Interaction_Gestures_Up"; + class ACE_Gesture_Up { + displayName = "$STR_ACE_Interaction_Gestures_Up"; condition = "canStand _target"; statement = "_target playActionNow 'gestureUp';"; showDisabled = 1; priority = 1.5; hotkey = "4"; }; - class AGM_Gesture_Cover { - displayName = "$STR_AGM_Interaction_Gestures_Cover"; + class ACE_Gesture_Cover { + displayName = "$STR_ACE_Interaction_Gestures_Cover"; condition = "canStand _target"; statement = "_target playActionNow 'gestureCover';"; showDisabled = 1; priority = 1.4; hotkey = "5"; }; - class AGM_Gesture_CeaseFire { - displayName = "$STR_AGM_Interaction_Gestures_Cease_Fire"; + class ACE_Gesture_CeaseFire { + displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; condition = "canStand _target"; statement = "_target playActionNow 'gestureCeaseFire';"; showDisabled = 1; priority = 1.3; hotkey = "6"; }; - class AGM_Gesture_Freeze { - displayName = "$STR_AGM_Interaction_Gestures_Freeze"; + class ACE_Gesture_Freeze { + displayName = "$STR_ACE_Interaction_Gestures_Freeze"; condition = "canStand _target"; statement = "_target playActionNow 'gestureFreeze';"; showDisabled = 1; priority = 1.2; hotkey = "7"; }; - class AGM_Gesture_Yes { - displayName = "$STR_AGM_Interaction_Gestures_Yes"; + class ACE_Gesture_Yes { + displayName = "$STR_ACE_Interaction_Gestures_Yes"; condition = "canStand _target"; statement = "_target playActionNow (['gestureYes', 'gestureNod'] select (floor random 2));"; showDisabled = 1; priority = 1.1; hotkey = "8"; }; - class AGM_Gesture_No { - displayName = "$STR_AGM_Interaction_Gestures_No"; + class ACE_Gesture_No { + displayName = "$STR_ACE_Interaction_Gestures_No"; condition = "canStand _target"; statement = "_target playActionNow 'gestureNo';"; showDisabled = 1; priority = 1.0; hotkey = "9"; }; - class AGM_Gesture_Hi { - displayName = "$STR_AGM_Interaction_Gestures_Hi"; + class ACE_Gesture_Hi { + displayName = "$STR_ACE_Interaction_Gestures_Hi"; condition = "canStand _target"; statement = "_target playActionNow (['gestureHi', 'gestureHiB', 'gestureHiC'] select (floor random 3));"; showDisabled = 1; @@ -567,24 +472,24 @@ class CfgVehicles { }; }; - class AGM_Equipment { - displayName = "$STR_AGM_Interaction_Equipment"; + class ACE_Equipment { + displayName = "$STR_ACE_Interaction_Equipment"; condition = "true"; statement = ""; showDisabled = 1; priority = 4.5; icon = ""; // @todo - subMenu[] = {"AGM_Equipment", 1}; + subMenu[] = {"ACE_Equipment", 1}; enableInside = 1; hotkey = "E"; - class AGM_Dummy { + class ACE_Dummy { displayName = ""; condition = "false"; statement = ""; showDisabled = 1; priority = -99; - icon = "AGM_Core\UI\blank_CO.paa"; + icon = PATHOF(UI\blank_CO.paa); enableInside = 1; }; }; @@ -593,67 +498,67 @@ class CfgVehicles { class LandVehicle; class Car: LandVehicle { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class Tank: LandVehicle { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class Air; class Helicopter: Air { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class Plane: Air { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class Ship; class Ship_F: Ship { - class AGM_Actions { - class AGM_Push { - displayName = "$STR_AGM_Interaction_Push"; + class ACE_Actions { + class ACE_Push { + displayName = "$STR_ACE_Interaction_Push"; distance = 4; - condition = "getMass _target < 1000 and alive _target"; - statement = "[_target, [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]] call AGM_Interaction_fnc_push;"; + condition = QUOTE( getMass _target < 1000 and alive _target ); + //statement = QUOTE( [_target, [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]] call FUNC(push); ); showDisabled = 0; priority = -1; }; }; - class AGM_SelfActions {}; + class ACE_SelfActions {}; }; class StaticWeapon: LandVehicle { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class StaticMortar; class Mortar_01_base_F: StaticMortar { - class AGM_Actions {}; - class AGM_SelfActions {}; + class ACE_Actions {}; + class ACE_SelfActions {}; }; class Box_NATO_Support_F; - class AGM_Box_Misc: Box_NATO_Support_F { + class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(AGM_CableTie,24) + MACRO_ADDITEM(ACE_CableTie,24) }; }; }; class CfgWeapons { - class AGM_ItemCore; + class ACE_ItemCore; class InventoryItem_Base_F; - class AGM_CableTie: AGM_ItemCore { - displayName = "$STR_AGM_Interaction_CableTie_Name"; - descriptionShort = "$STR_AGM_Interaction_CableTie_Description"; - model = "\AGM_Interaction\agm_cabletie.p3d"; - picture = "\AGM_Interaction\UI\agm_cabletie_x_ca.paa"; + class ACE_CableTie: ACE_ItemCore { + displayName = "$STR_ACE_Interaction_CableTie_Name"; + descriptionShort = "$STR_ACE_Interaction_CableTie_Description"; + model = PATHOF(ACE_cabletie.p3d); + picture = PATHOF(UI\ACE_cabletie_x_ca.paa); scope = 2; class ItemInfo: InventoryItem_Base_F { mass = 1; diff --git a/addons/interaction/functions/fn_AddSelectableItem.sqf b/addons/interaction/functions/fn_AddSelectableItem.sqf deleted file mode 100644 index f6fccae709..0000000000 --- a/addons/interaction/functions/fn_AddSelectableItem.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - Name: AGM_Interaction_fnc_AddSelectableItem - - Author: Garth de Wet (LH) - - Description: - Adds an item to the select menu - - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data - - Returns: - ARRAY/Number - - Example: -*/ -private ["_container", "_displayName", "_picture", "_data", "_index"]; - -_container = _this select 0; -_displayName = _this select 1; -_picture = _this select 2; -_data = _this select 3; - -if (_picture == "" || _picture == "PictureThing") then { - _picture = "AGM_Interaction\UI\dot_ca.paa"; -}; - -if ((profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) then { - //[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey] - _container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data]; -}else{ - _index = lbAdd [_container, _displayName]; - lbSetData [_container, _index, str _data]; - lbSetPicture [_container, _index, _picture]; -}; - -_container diff --git a/addons/interaction/functions/fn_GetActions.sqf b/addons/interaction/functions/fn_GetActions.sqf deleted file mode 100644 index 6e7b067150..0000000000 --- a/addons/interaction/functions/fn_GetActions.sqf +++ /dev/null @@ -1,154 +0,0 @@ -/* - Name: AGM_Interaction_fnc_GetActions - - Author: - commy2 - Garth de Wet (LH) - - Description: - - Parameters: - 0: OBJECT - target - 1: ARRAY - Parents of the target object - 2: ARRAY - Actions - 3: ARRAY - Patches - 4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles") - 5: BOOL - Is mission config file? - 6: STRING - Classname ("AGM_Actions"/"AGM_SelfActions") - 7: STRING - Sub-class - - Returns: - Nothing - - Example: - [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "AGM_Actions"] call AGM_Interaction_fnc_GetActions; - - [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "AGM_SelfActions"] call AGM_Interaction_fnc_GetActions; -*/ -#define DEFAULT_ICON "\AGM_Interaction\UI\dot_ca.paa" -private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"]; -_target = _this select 0; -_parents = _this select 1; -_actions = _this select 2; -_patches = _this select 3; -_baseConfig = _this select 4; -_missionConfig = _this select 5; -_actionType = _this select 6; -_subClass = _this select 7; - -_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType); -if (_subClass != "") then { - _stdConfig = _stdConfig >> _subClass; -}; - -_count = count _parents; -for "_i" from 0 to (_count - 1) do { - _config = _baseConfig >> _parents select _i >> _actionType; - if (_subClass != "") then { - _config = _config >> _subClass; - }; - - _count = count _config; - if (_count > 0) then { - for "_index" from 0 to (_count - 1) do { - private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey", - "_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"]; - _action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)}; - _cache = missionNamespace getVariable ["AGM_Interaction_MenuCache", [[], [], []]]; - - if (count _action > 0) then { - _configName = configName _action; - - _cacheConfigs = _cache select 0; - _cacheActions = _cache select 1; - _cacheIndices = _cache select 2; - - _indexCache = _cacheConfigs find _action; - if (_indexCache == -1) then { - _displayName = getText (_action >> "displayName"); - _distance = getNumber (_action >> "distance"); - _priority = getNumber (_action >> "priority"); - _subMenu = getArray (_action >> "subMenu"); - _tooltip = getText (_action >> "tooltip"); - _hotkey = getText (_action >> "hotkey"); - _enableInside = getNumber (_action >> "enableInside"); - - // Condition - _condition = getText (_action >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _condition = _condition + format [" && {%1 call AGM_Core_canInteract} && {[AGM_player, AGM_Interaction_Target] call AGM_Core_fnc_canInteractWith}", getArray (_action >> "exceptions")]; - if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; - - _condition = compile _condition; - - // Condition to show the action - _conditionShow = getText (_action >> "conditionShow"); - _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call _conditionShow; - }; - - // Exceptions to the general conditions that have to be true - _exceptions = getArray (_action >> "exceptions"); - - // statement - _statement = getText (_action >> "statement"); - _statement = compile _statement; - - if (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]) then { - _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { - compile format ["call AGM_Interaction_fnc_hideMenu;if(%2 == 1)then{['%1'] call AGM_Interaction_fnc_openSubMenuSelf;}else{['%1'] call AGM_Interaction_fnc_openSubMenu;};", _subMenu select 0, _subMenu select 1]; - } else { - compile ("call AGM_Interaction_fnc_hideMenu;" + getText (_action >> "statement")); - }; - }; - - // icon - _icon = getText (_action >> "Icon"); - if (_icon == "") then { - _icon = DEFAULT_ICON; - }; - - _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; - - if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call AGM_Interaction_fnc_isInRange}}) then { - _actions pushBack _actionToCache; - _patches pushBack _configName; - }; - - _indexCache = _cacheActions find _actionToCache; - if (_indexCache == -1) then { - _indexCache = count _cacheActions; - _cacheActions pushBack _actionToCache; - }; - - _cacheConfigs pushBack _action; - _cacheIndices pushBack _indexCache; - - _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; - ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call AGM_Debug_fnc_log; - } else { - ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call AGM_Debug_fnc_log; - - _cachedAction = _cacheActions select (_cacheIndices select _indexCache); - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call (_cachedAction select 7); - }; - - if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call AGM_Interaction_fnc_isInRange || {(_cachedAction select 9) == 0}}) then { - _actions pushBack _cachedAction; - _patches pushBack _configName; - }; - }; - }; - - AGM_Interaction_MenuCache = _cache; - }; - }; -}; -[_actions, _patches] diff --git a/addons/interaction/functions/fn_MoveDown.sqf b/addons/interaction/functions/fn_MoveDown.sqf deleted file mode 100644 index 7a5662ed9b..0000000000 --- a/addons/interaction/functions/fn_MoveDown.sqf +++ /dev/null @@ -1,66 +0,0 @@ -/* - Name: AGM_Interaction_fnc_MoveDown - - Author: Garth de Wet (LH) - - Description: - Depending on the passed value, either scrolls down through the list or up. - - Parameters: - NUMBER - Amount to increase current interaction target - - Returns: - Nothing - - Example: - 1 call AGM_Interaction_fnc_MoveDown; - -1 call AGM_Interaction_fnc_MoveDown; -*/ -#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) -if (isNil "AGM_Interaction_MainButton") exitWith{}; -if (isNil "AGM_Interaction_Buttons") exitWith{}; -_count = (count AGM_Interaction_Buttons)- 1; -AGM_Interaction_SelectedButton = CLAMP(AGM_Interaction_SelectedButton + _this, 0, _count); - -_target = AGM_Interaction_Target; -_player = AGM_player; -_vehicle = vehicle _player; - -disableSerialization; -_dlgInteractionDialog = uiNamespace getVariable "AGM_Flow_Display"; -_top = AGM_Interaction_SelectedButton - 2; -_i = 0; -while {_i <= 4} do { - _index =_i + _top; - _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); - if (_index >= 0 && {_index <= _count}) then { - _action = AGM_Interaction_Buttons select _index; - _ctrl ctrlShow true; - _ctrl ctrlSetText (_action select 5); - _color = [1,1,1,1]; - if !([_target, _player] call (_action select 2)) then { - _color = [0.3,0.3,0.3,0.8]; - }; - if (_i == 0 || _i == 4) then { - _color set [3, 0.5]; - }; - if (_i == 1 || _i == 3) then { - _color set [3, 0.75]; - }; - _ctrl ctrlSetTextColor _color; - }else{ - _ctrl ctrlShow false; - }; - _i = _i + 1; -}; - -_ctrl = _dlgInteractionDialog displayCtrl 1000; -_ctrl ctrlSetText ((AGM_Interaction_Buttons select AGM_Interaction_SelectedButton) select 0); -_ctrl = _dlgInteractionDialog displayCtrl 1100; -_current = (AGM_Interaction_Buttons select AGM_Interaction_SelectedButton); -_infoText = ""; -if !([_target, _player] call (_current select 2)) then { - _infoText = "Unavailable"; -}; -_ctrl ctrlSetText _infoText; -_ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fn_addInteraction.sqf b/addons/interaction/functions/fn_addInteraction.sqf deleted file mode 100644 index 72c3ccb182..0000000000 --- a/addons/interaction/functions/fn_addInteraction.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: commy2 - * - * Add an AGM action to an object. Note: This function is global. - * - * Argument: - * 0: Object the action should be assigned to (Object) - * 1: Name of the action shown in the menu (String) - * 2: Distance the player can be away from the object (Number) - * 3: Condition (Code or String) - * 4: Statement (Code or String) - * 5: Show the action even if the conditon is not met (Bool or Number) - * 6: Priority (Number, optional default: 0) - * - * Return value: - * ID of the action (used to remove it later). - */ - -private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; - -_object = _this select 0; -_displayName = _this select 1; -_distance = _this select 2; -_condition = _this select 3; -_statement = _this select 4; -_showDisabled = _this select 5; -_priority = _this select 6; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -if (typeName _showDisabled == "SCALAR") then { - _showDisabled = _showDisabled > 0; -}; - -if (isNil "_priority") then { - _priority = 0; -}; - -_actionsVar = _object getVariable ["AGM_Interactions", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority]; - -_object setVariable ["AGM_Interactions", [_id, _actionIDs, _actions], true]; -_id diff --git a/addons/interaction/functions/fn_addInteractionSelf.sqf b/addons/interaction/functions/fn_addInteractionSelf.sqf deleted file mode 100644 index bccaf40528..0000000000 --- a/addons/interaction/functions/fn_addInteractionSelf.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Author: commy2 - * - * Add an AGM self action to the player. Execute this on the local machine of the player. - * - * Argument: - * 0: Name of the action shown in the menu (String) - * 1: Condition (Code or String) - * 2: Statement (Code or String) - * 3: Show the action even if the conditon is not met (Bool or Number) - * 4: Priority (Number, optional default: 0) - * - * Return value: - * ID of the action (used to remove it later). - */ - - - -private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; - - -_displayName = _this select 0; - -_condition = _this select 1; -_statement = _this select 2; -_showDisabled = _this select 3; -_priority = _this select 4; - -if (typeName _condition == "STRING") then { - _condition = compile _condition; -}; - -if (typeName _statement == "STRING") then { - _statement = compile _statement; -}; - -if (typeName _showDisabled == "SCALAR") then { - _showDisabled = _showDisabled > 0; -}; - -if (isNil "_priority") then { - _priority = 0; -}; - -_actionsVar = AGM_player getVariable ["AGM_InteractionsSelf", [-1, [], []]]; - -_id = (_actionsVar select 0) + 1; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_actionIDs pushBack _id; -_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority]; - -AGM_player setVariable ["AGM_InteractionsSelf", [_id, _actionIDs, _actions], false]; -_id diff --git a/addons/interaction/functions/fn_addToTooltip.sqf b/addons/interaction/functions/fn_addToTooltip.sqf deleted file mode 100644 index b54b7c5716..0000000000 --- a/addons/interaction/functions/fn_addToTooltip.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -AGM_Interaction_CurrentTooltip pushBack (_this select 0); diff --git a/addons/interaction/functions/fn_applyButtons.sqf b/addons/interaction/functions/fn_applyButtons.sqf deleted file mode 100644 index 8bc732f946..0000000000 --- a/addons/interaction/functions/fn_applyButtons.sqf +++ /dev/null @@ -1,51 +0,0 @@ -// by commy2 - -private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; - -_object = AGM_Interaction_Target; -_actions = AGM_Interaction_Buttons; - - -disableSerialization; -_dlgInteractionDialog = uiNamespace getVariable "AGM_Interaction_Dialog"; - -/* -for "_a" from 0 to (_count - 1) do { - _action = AGM_Interaction_Buttons select _a; - - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); - _ctrlInteractionDialog ctrlShow true; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); -}; -*/ - -_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; - -AGM_Interaction_MainButton = "(findDisplay 1713999) closeDisplay 1;"; - -if (_object isKindOf "Man") then { - _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["AGM_Name", "Unknown"]}); -} else { - _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); -}; - -for "_index" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); - _ctrlInteractionDialog ctrlShow true; - - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); - - if (_index < _count) then { - _action = AGM_Interaction_Buttons select _index; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable (call (_action select 2)); - - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; - - _ctrlInteractionDialogIcon ctrlSetText ""; - }; -}; diff --git a/addons/interaction/functions/fn_canInteractWith.sqf b/addons/interaction/functions/fn_canInteractWith.sqf deleted file mode 100644 index 8766ff096e..0000000000 --- a/addons/interaction/functions/fn_canInteractWith.sqf +++ /dev/null @@ -1,12 +0,0 @@ -// by commy2 - -private ["_unit", "_isCivilian"]; - -_unit = _this select 0; -_isCivilian = _this select 1; - -if (isNil "_isCivilian") then {_isCivilian = true}; - -alive _unit -&& [side _unit != side AGM_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fn_canLockDoor.sqf b/addons/interaction/functions/fn_canLockDoor.sqf deleted file mode 100644 index 8591bc3c78..0000000000 --- a/addons/interaction/functions/fn_canLockDoor.sqf +++ /dev/null @@ -1,16 +0,0 @@ -// by commy2 - -private ["_mode", "_info", "_house", "_door", "_id"]; - -_mode = _this select 0; //lock: true, unlock: false - -_info = [2] call AGM_Interaction_fnc_getDoor; - -_house = _info select 0; -_door = _info select 1; -_id = _info select 2; - -!isNull _house -&& {_door == "door"} -&& {!_mode || {_house animationPhase format ["door_%1_rot", _id] <= 0}} -&& {(_house getVariable [format ["BIS_Disabled_Door_%1", _id], 0] != 1) isEqualTo _mode} diff --git a/addons/interaction/functions/fn_canTapShoulder.sqf b/addons/interaction/functions/fn_canTapShoulder.sqf deleted file mode 100644 index 0966b53c37..0000000000 --- a/addons/interaction/functions/fn_canTapShoulder.sqf +++ /dev/null @@ -1,11 +0,0 @@ -// by commy2 - -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; - -_target isKindOf "CAManBase" && -{alive _target} && -{_unit distance _target < 4} && -{!(_target getVariable ["AGM_isUnconscious", false])} diff --git a/addons/interaction/functions/fn_getActions2.sqf b/addons/interaction/functions/fn_getActions2.sqf deleted file mode 100644 index 2ede8ea968..0000000000 --- a/addons/interaction/functions/fn_getActions2.sqf +++ /dev/null @@ -1,120 +0,0 @@ -// commy2 - -private ["_object", "_config", "_type", "_actions", "_configs"]; - -_object = _this select 0; -_config = _this select 1; // configFile, missionConfigFile -_type = _this select 2; // "AGM_CfgInteractions", "AGM_CfgInteractionsSelf" -_actions = _this select 3; // []; - -_configs = "_object isKindOf configName _x" configClasses (_config >> _type); - -// cache -private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"]; - -_cache = uiNamespace getVariable ["AGM_Interaction_MenuCache", [[], [], []]]; -_cacheConfigs = _cache select 0; -_cacheActions = _cache select 1; -_cacheIndices = _cache select 2; - -// get interactions -{ - private "_configActions"; - - _configActions = "true" configClasses (_config >> _type >> configName _x); - { - private ["_action", "_configName", "_indexCache"]; - - _action = _x; - _configName = configName _action; - - _indexCache = _cacheConfigs find _action; - if (_indexCache == -1) then { - private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"]; - - _displayName = getText (_action >> "displayName"); - _distance = getNumber (_action >> "distance"); - _priority = getNumber (_action >> "priority"); - _subMenu = getArray (_action >> "subMenu"); - _tooltip = getText (_action >> "tooltip"); - _hotkey = getText (_action >> "hotkey"); - _enableInside = getNumber (_action >> "enableInside"); - - // Condition - _condition = getText (_action >> "condition"); - if (_condition == "") then {_condition = "true"}; - - _condition = _condition + format [" && {%1 call AGM_Core_canInteract} && {[AGM_player, AGM_Interaction_Target] call AGM_Core_fnc_canInteractWith}", getArray (_action >> "exceptions")]; - if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; - - _condition = compile _condition; - - // Condition to show the action - _conditionShow = getText (_action >> "conditionShow"); - _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call _conditionShow; - }; - - // Exceptions to the general conditions that have to be true - _exceptions = getArray (_action >> "exceptions"); - - // statement - _statement = getText (_action >> "statement"); - _statement = compile _statement; - - if (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]) then { - _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { - compile format ["call AGM_Interaction_fnc_hideMenu;if(%2 == 1)then{['%1'] call AGM_Interaction_fnc_openSubMenuSelf;}else{['%1'] call AGM_Interaction_fnc_openSubMenu;};", _subMenu select 0, _subMenu select 1]; - } else { - compile ("call AGM_Interaction_fnc_hideMenu;" + getText (_action >> "statement")); - }; - }; - - // icon - _icon = getText (_action >> "Icon"); - if (_icon == "") then { - _icon = DEFAULT_ICON; - }; - - private "_actionToCache"; - _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; - - if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call AGM_Interaction_fnc_isInRange}}) then { - _actions pushBack _actionToCache; - }; - - _indexCache = _cacheActions find _actionToCache; - if (_indexCache == -1) then { - _indexCache = count _cacheActions; - _cacheActions pushBack _actionToCache; - }; - - _cacheConfigs pushBack _action; - _cacheIndices pushBack _indexCache; - - _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; - ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call AGM_Debug_fnc_log; - } else { - ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call AGM_Debug_fnc_log; - - private ["_cachedAction", "_showDisabled"]; - _cachedAction = _cacheActions select (_cacheIndices select _indexCache); - - _showDisabled = getNumber (_action >> "showDisabled") == 1; - if (isText (_action >> "conditionShow")) then { - _showDisabled = [_object, _player] call (_cachedAction select 7); - }; - - if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call AGM_Interaction_fnc_isInRange || {(_cachedAction select 9) == 0}}) then { - _actions pushBack _cachedAction; - }; - }; - } forEach _configActions; //Actions of this CfgVehicles class -} forEach _configs; //CfgVehicles class - -uiNamespace setVariable ["AGM_Interaction_MenuCache", _cache]; - -_actions diff --git a/addons/interaction/functions/fn_getCaptivityStatus.sqf b/addons/interaction/functions/fn_getCaptivityStatus.sqf deleted file mode 100644 index 43538e882b..0000000000 --- a/addons/interaction/functions/fn_getCaptivityStatus.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -_this call AGM_Core_fnc_getCaptivityStatus; diff --git a/addons/interaction/functions/fn_getDoor.sqf b/addons/interaction/functions/fn_getDoor.sqf deleted file mode 100644 index 19e5277873..0000000000 --- a/addons/interaction/functions/fn_getDoor.sqf +++ /dev/null @@ -1,31 +0,0 @@ -// by commy2 - -private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; - -_distance = _this select 0; - -_position0 = positionCameraToWorld [0, 0, 0]; -_position1 = positionCameraToWorld [0, 0, _distance]; - -_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true]; - -_count = count _intersections; -if (_count == 0) exitWith {[objNull, ""]}; - -_house = _intersections select (_count - 1); - -// shithouse is bugged -if (typeOf _house == "") exitWith {[objNull, ""]}; - -_intersections = [_house, "GEOM"] intersect [_position0, _position1]; - -_door = _intersections select 0 select 0; -if (isNil "_door") exitWith {[_house, ""]}; -[_house, _door] - -/* -_house = cursorTarget; -_actions = "true" configClasses (configFile >> "CfgVehicles" >> typeOf _house >> "UserActions"); -_actions = [_actions, {getText (_x >> "statement")}] call AGM_Core_fnc_map; -_actions -*/ diff --git a/addons/interaction/functions/fn_getDoorAnimations.sqf b/addons/interaction/functions/fn_getDoorAnimations.sqf deleted file mode 100644 index 67e6788754..0000000000 --- a/addons/interaction/functions/fn_getDoorAnimations.sqf +++ /dev/null @@ -1,106 +0,0 @@ -// by commy2 - -private ["_house", "_door", "_animations", "_lockedVariable"]; - -_house = _this select 0; -_door = _this select 1; - -_index = [ - "door_1", - "door_2", - "door_3", - "door_4", - "door_5", - "door_6", - "door_7", - "door_8", - "door_9", - "door_10", - "door_11", - "door_12", - "door_13", - "Door_14", - "door_15", - "door_16", - "door_17", - "door_18", - "door_19", - "door_20", - "door_21", - "door_22", - - "hatch_1", - "hatch_2", - "hatch_3", - "hatch_4", - "hatch_5", - "hatch_6" -] find toLower _door; - -if (_index == -1) exitWith {[[],""]}; - -_animations = [ - ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], - ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], - ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], - ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], - ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], - ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], - ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], - ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], - ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], - ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], - ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], - ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], - ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], - ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], - ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], - ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], - ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], - ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], - ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], - ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], - ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], - ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], - - ["Hatch_1_rot"], - ["Hatch_2_rot"], - ["Hatch_3_rot"], - ["Hatch_4_rot"], - ["Hatch_5_rot"], - ["Hatch_6_rot"] -] select _index; - -_lockedVariable = [ - ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], - ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], - ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], - ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], - ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], - ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], - ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], - ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], - ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], - ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], - ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], - ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], - ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], - ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], - ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], - ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], - ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], - ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], - ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], - ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], - ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], - ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], - - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""] -] select _index; - -[_animations, _lockedVariable] diff --git a/addons/interaction/functions/fn_getDown.sqf b/addons/interaction/functions/fn_getDown.sqf deleted file mode 100644 index 73bae1c883..0000000000 --- a/addons/interaction/functions/fn_getDown.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Forces a civilian to the ground. (chance of failure). - * - * Arguments: - * 0: Unit to be sent away (Object) - * - * Return value: - * none - */ - -#define RADIUS 10 - -private ["_unit", "_chance", "_x"]; - -_unit = _this select 0; - -AGM_player playActionNow "GestureGo"; // put something else here. - -if (count (weapons AGM_player) > 0) then { - _chance = 0.8; -} else { - _chance = 0.5; -}; - -{ - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - _this setUnitPos "DOWN"; - }, _x] call CBA_fnc_globalExecute; - }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fn_getSelectedButton.sqf b/addons/interaction/functions/fn_getSelectedButton.sqf deleted file mode 100644 index 3813811703..0000000000 --- a/addons/interaction/functions/fn_getSelectedButton.sqf +++ /dev/null @@ -1,23 +0,0 @@ -// by commy2 - -#define MIN_DISTANCE 0.0065 - -private ["_position", "_distance", "_angle"]; - -_position = uiNamespace getVariable ['AGM_Interaction_CursorPosition', [0.5, 0.5, 0]]; - -_position = [((_position select 1) - 0.5) / safezoneH, ((_position select 2) - 0.5) / safezoneW, 0]; - -_distance = [0, 0, 0] vectorDistanceSqr _position; - -// is in center -if (_distance < MIN_DISTANCE) exitWith {-1}; - -_angle = (_position select 0) atan2 (_position select 1); - -// rotate circle -_angle = 180 - _angle + 360 / 10 / 2; -if (_angle < 0) then {_angle = _angle + 360}; - -_angle = floor (_angle / 360 * 10); -if (_angle == 10) then {0} else {_angle} diff --git a/addons/interaction/functions/fn_hideMenu.sqf b/addons/interaction/functions/fn_hideMenu.sqf deleted file mode 100644 index 24e867b5b5..0000000000 --- a/addons/interaction/functions/fn_hideMenu.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - Name: AGM_Interaction_fnc_hideMenu - - Author: Garth de Wet (LH) - - Description: - Closes the Interaction menu - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Interaction_fnc_hideMenu; -*/ -closeDialog 0; -(findDisplay 1713999) closeDisplay 1; -(uiNameSpace getVariable "AGM_Flow_Display") closeDisplay 0; -AGM_Interaction_MainButton = nil; -call AGM_Interaction_fnc_hideMouseHint; \ No newline at end of file diff --git a/addons/interaction/functions/fn_hideMouseHint.sqf b/addons/interaction/functions/fn_hideMouseHint.sqf deleted file mode 100644 index f8f9b75b35..0000000000 --- a/addons/interaction/functions/fn_hideMouseHint.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - Name: AGM_Interaction_fnc_hideMouseHint - - Author(s): - Garth de Wet (LH) - - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Interaction_fnc_hideMouseHint; -*/ -if (isNull (uiNamespace getVariable ["AGM_Helper_Display", objNull])) exitWith{}; - -("AGM_InteractionHelper" call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -showHUD true; \ No newline at end of file diff --git a/addons/interaction/functions/fn_initialiseInteraction.sqf b/addons/interaction/functions/fn_initialiseInteraction.sqf deleted file mode 100644 index 556e3d0bd6..0000000000 --- a/addons/interaction/functions/fn_initialiseInteraction.sqf +++ /dev/null @@ -1,167 +0,0 @@ -/* - Name: AGM_Interaction_fnc_initialiseInteraction - - Author: - commy2 - Garth de Wet (LH) - - Description: - Initialises the interaction click handlers. - - Parameters: - 0 : CODE - code to call when right clicking/center button - 1 : BOOLEAN - Submenu - 2 : BOOLEAN - Flow Menu - 3 : BOOLEAN - Self interaction - 4 : OBJECT - Target - - Returns: - Nothing - - Example: - [{"Default" call AGM_Interaction_fnc_openMenu;}, true, (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]), AGM_Interaction_Target] call AGM_Interaction_fnc_initialiseInteraction; -*/ -private ["_subMenu", "_selfMenu", "_target"]; -AGM_Interaction_MainButton = _this select 0; -_subMenu = _this select 1; -_selfMenu = _this select 3; -_target = _this select 4; - -_player = AGM_player; -_vehicle = vehicle _player; -//_object = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); - -if !([_target, 5] call AGM_Interaction_fnc_isInRange) exitWith {}; - -AGM_Interaction_Shortcuts = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; - -// Flow menu -if (_this select 2) then { - ("AGM_FlowMenu" call BIS_fnc_rscLayer) cutRsc ["AGM_FlowMenu", "PLAIN",0.5, false]; - AGM_Interaction_SelectedButton = 0; - (findDisplay 1713999) closeDisplay 1; - if (_player getVariable ["AGM_AcceptAction", -1] == -1) then { - [{if(isNil {AGM_Interaction_MainButton} || {!(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])})exitWith{false};(-(_this select 0) / 1.2) call AGM_Interaction_fnc_MoveDown;true}] call AGM_Core_fnc_addScrollWheelEventHandler; - - _player setVariable ["AGM_AcceptAction", [_player, "DefaultAction", {(!isNil {AGM_Interaction_MainButton}) && {(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])}}, {_action = AGM_Interaction_Buttons select AGM_Interaction_SelectedButton;_target = AGM_Interaction_Target;_player = AGM_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call AGM_Interaction_fnc_hideMenu;if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call AGM_core_fnc_addActionEventHandler]; - _player setVariable ["AGM_AcceptAction", [_player, "menuBack", {(!isNil {AGM_Interaction_MainButton}) && {(profileNamespace getVariable ['AGM_Interaction_FlowMenu', false])}}, {call AGM_Interaction_MainButton;}] call AGM_core_fnc_addActionEventHandler]; - }; - 0 call AGM_Interaction_fnc_moveDown; - [localize "STR_AGM_Interaction_MakeSelection", if (_subMenu)then{localize "STR_AGM_Interaction_Back"}else{""}, localize "STR_AGM_Interaction_ScrollHint"] call AGM_Interaction_fnc_showMouseHint; - ((uiNamespace getVariable "AGM_Flow_Display") displayCtrl (1210)) ctrlShow _subMenu; -}else{ // Rose - if (!isNull(uiNamespace getVariable "AGM_Flow_Display")) then { - (uiNameSpace getVariable "AGM_Flow_Display") closeDisplay 0; - call AGM_Interaction_fnc_hideMouseHint; - }; - if (!_subMenu || {isNull (findDisplay 1713999)}) then { - (findDisplay 1713999) closeDisplay 1; - - (findDisplay 46) createDisplay "AGM_Interaction_Dialog"; - // Add eventhandlers - (findDisplay 1713999) displayAddEventHandler ["KeyDown", "_this call AGM_Core_onKeyDown"]; - (findDisplay 1713999) displayAddEventHandler ["KeyUp", "_this call AGM_Core_onKeyUp"]; - - (findDisplay 1713999) displayAddEventHandler ["KeyDown", "_this call AGM_Interaction_fnc_menuKeyInput"]; - }; - disableSerialization; - _dlgInteractionDialog = uiNamespace getVariable "AGM_Interaction_Dialog"; - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; - if (profileNamespace getVariable ["AGM_Interaction_AutoCenterCursor", true]) then {setMousePosition [0.5, 0.5]}; - if !(_subMenu) then { - _ctrlInteractionDialog ctrlSetText ([_target] call AGM_Core_fnc_getName); - } else { - _ctrlInteractionDialog ctrlSetText localize "STR_AGM_Interaction_Back"; - }; - - _buttons = AGM_Interaction_Buttons; - _count = count _buttons; - - for "_i" from 0 to 9 do { - _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i); - _ctrlInteractionDialog ctrlShow true; - - _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i); - _ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i); - //_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i); - if (_i < _count) then { - _action = _buttons select _i; - _ctrlInteractionDialog ctrlSetText (_action select 0); - _ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2)); - _ctrlInteractionDialog ctrlSetTooltip (_action select 6); - - _ctrlInteractionDialogIcon ctrlSetText (_action select 5); - _ctrlInteractionDialogShortcut ctrlSetText (_action select 10); - //_ctrlInteractionDialogBackground ctrlShow true; - - AGM_Interaction_Shortcuts set [_i, [_action select 10] call AGM_Core_fnc_letterToCode]; - } else { - _ctrlInteractionDialog ctrlSetText ""; - _ctrlInteractionDialog ctrlEnable false; - _ctrlInteractionDialog ctrlSetTooltip ""; - - _ctrlInteractionDialogIcon ctrlSetText ""; - _ctrlInteractionDialogShortcut ctrlSetText ""; - //_ctrlInteractionDialogBackground ctrlShow false; - }; - }; - - // Update Buttons - terminate (missionNamespace getVariable ["AGM_Interaction_updateMenuHandle", scriptNull]); - - AGM_Interaction_updateMenuHandle = 0 spawn { - disableSerialization; - _dlgMenu = uiNamespace getVariable ["AGM_Interaction_Dialog", displayNull]; - _ctrlTooltip = _dlgMenu displayCtrl 40; - - _player = AGM_player; - _vehicle = vehicle _player; - _target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); - - waitUntil { - if !([_target, 5] call AGM_Interaction_fnc_isInRange) exitWith { - (findDisplay 1713999) closeDisplay 1 - }; - - AGM_Interaction_Tooltips = [[], [], [], [], [], [], [], [], [], []]; - { - _ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex); - _ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex); - - _condition = _x select 2; - _conditionShow = _x select 7; - _distance = _x select 9; - - AGM_Interaction_CurrentTooltip = []; - - _enable = (_distance == 0 || {[_target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}; - if (isNil "_enable") then {_enable = false}; - - AGM_Interaction_Tooltips set [_forEachIndex, AGM_Interaction_CurrentTooltip]; - - // apply conditional tooltips - /*if (_forEachIndex == call AGM_Interaction_fnc_getSelectedButton) then { - _tooltip = _x select 6; - - _showTooltip = _tooltip != ""; - - _tooltip = text _tooltip; - - { - _showTooltip = true; - _tooltip = composeText [_tooltip, lineBreak, _x]; - } forEach (AGM_Interaction_Tooltips select _forEachIndex); - - _ctrlTooltip ctrlSetStructuredText _tooltip; - _ctrlTooltip ctrlShow _showTooltip; - };*/ - - _ctrlText ctrlEnable _enable; - _ctrlIcon ctrlEnable _enable; - } forEach AGM_Interaction_Buttons; - - sleep 0.5; - isNull (findDisplay 1713999) - }; - }; -}; diff --git a/addons/interaction/functions/fn_isInRange.sqf b/addons/interaction/functions/fn_isInRange.sqf deleted file mode 100644 index bb82f7af95..0000000000 --- a/addons/interaction/functions/fn_isInRange.sqf +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Author: commy2 - * - * Check if the vehicle is in range of the player. - * - * Argument: - * 0: Vehicke (Object) - * 1: Distance in meters (Number) - * - * Return value: - * (Bool) - */ - -private ["_vehicle", "_distance", "_player"]; - -_vehicle = _this select 0; -_distance = _this select 1; - -_player = AGM_player; - -if (_vehicle isKindOf "Man") exitWith {_player distance _vehicle < _distance}; - -private ["_position0", "_position1"];//, "_direction"]; - -_position0 = getPosASL _player; -_position1 = getPosASL _vehicle; - -/* -_direction = _position1 vectorDiff _position0; -_direction = _direction vectorMultiply (_distance / (vectorMagnitude _direction)); - -_position0 = eyePos _player; -_position1 = _position0 vectorAdd _direction; - -_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance} -*/ - -_position0 = ATLToASL positionCameraToWorld [0, 0, 0]; -_position0 set [2, (_position0 select 2) - (getTerrainHeightASL _position0 min 0)]; - -_position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; -_position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; - -if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { - true -} else { - ["Not in Range"] call AGM_Interaction_fnc_addToTooltip; - false -} diff --git a/addons/interaction/functions/fn_joinTeam.sqf b/addons/interaction/functions/fn_joinTeam.sqf deleted file mode 100644 index c6db297c49..0000000000 --- a/addons/interaction/functions/fn_joinTeam.sqf +++ /dev/null @@ -1,20 +0,0 @@ -// by commy2 - -private ["_unit", "_team", "_message"]; - -_unit = _this select 0; -_team = _this select 1; - -_unit setVariable ["AGM_assignedFireTeam", _team, true]; -[_unit, format ["{_this assignTeam '%1'}", _team]] call AGM_Core_fnc_execRemoteFnc; - -if (_unit == AGM_player) then { - _message = if (_team == "MAIN") then { - localize "STR_AGM_Interaction_LeftTeam"; - } else { - _team = localize format ["STR_AGM_Interaction_Team%1", _team]; - format [localize "STR_AGM_Interaction_JoinedTeam", _team]; - }; - - [_message] call AGM_Core_fnc_displayTextStructured; -}; diff --git a/addons/interaction/functions/fn_lockDoor.sqf b/addons/interaction/functions/fn_lockDoor.sqf deleted file mode 100644 index edc317bfac..0000000000 --- a/addons/interaction/functions/fn_lockDoor.sqf +++ /dev/null @@ -1,27 +0,0 @@ -// by commy2 - -private ["_mode", "_info", "_house", "_door", "_id", "_phase"]; - -_mode = _this select 0; //lock: true, unlock: false - -_info = [2] call AGM_Interaction_fnc_getDoor; - -_house = _info select 0; -_door = _info select 1; -_id = _info select 2; - -if (isNull _house) exitWith {}; - -/* -_phase = [1, 0] select _mode; - -_house animate [format ["%1_%2_rot", _door, _id], _phase]; -_house animate [format ["%1_Handle_%2_rot_1", _door, _id], _phase]; -_house animate [format ["%1_Handle_%2_rot_2", _door, _id], _phase]; -*/ - -_house setVariable [format ["BIS_Disabled_%1_%2", _door, _id], [0, 1] select _mode]; - -playSound "AGM_Sound_Click"; - -[localize (["STR_AGM_Interaction_UnlockedDoor", "STR_AGM_Interaction_LockedDoor"] select _mode)] call AGM_Core_fnc_displayTextStructured; diff --git a/addons/interaction/functions/fn_menuKeyInput.sqf b/addons/interaction/functions/fn_menuKeyInput.sqf deleted file mode 100644 index 786add7670..0000000000 --- a/addons/interaction/functions/fn_menuKeyInput.sqf +++ /dev/null @@ -1,16 +0,0 @@ -// by commy2 - -private "_key"; - -_key = _this select 1; - -if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true}; - -_index = AGM_Interaction_Shortcuts find _key; - -if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith { - _index call AGM_Interaction_fnc_onClick; - true -}; - -false diff --git a/addons/interaction/functions/fn_moduleInteraction.sqf b/addons/interaction/functions/fn_moduleInteraction.sqf deleted file mode 100644 index 60f15e1215..0000000000 --- a/addons/interaction/functions/fn_moduleInteraction.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Author: bux578 - * - * Initializes the Interaction module. - * - * Arguments: - * Whatever the module provides. (I dunno.) - * - * Return Value: - * None - */ - -_logic = _this select 0; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -[_logic, "AGM_Interaction_EnableTeamManagement", "EnableTeamManagement"] call AGM_Core_fnc_readBooleanParameterFromModule; - -diag_log text "[AGM]: Interaction Module Initialized."; diff --git a/addons/interaction/functions/fn_onButtonDown.sqf b/addons/interaction/functions/fn_onButtonDown.sqf deleted file mode 100644 index 91a20d9fc7..0000000000 --- a/addons/interaction/functions/fn_onButtonDown.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -if (dialog) exitWith { - closeDialog 0; -}; - -if (isNull (findDisplay 1713999)) then { - if (AGM_player == vehicle AGM_player) then {"" call AGM_Interaction_fnc_openMenu} else {[AGM_player, vehicle AGM_player] call AGM_Interaction_fnc_openMenuSelectUI}; - setMousePosition [0.5, 0.5]; -} else { - (findDisplay 1713999) closeDisplay 1; -}; - -[_player, "interactionMenuOpened", [_player, AGM_Interaction_Target, 0]] call AGM_Core_fnc_callCustomEventHandlers; diff --git a/addons/interaction/functions/fn_onButtonDownSelf.sqf b/addons/interaction/functions/fn_onButtonDownSelf.sqf deleted file mode 100644 index 90aa4b4aca..0000000000 --- a/addons/interaction/functions/fn_onButtonDownSelf.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -if (dialog) exitWith { - closeDialog 0; -}; - -if (isNull (findDisplay 1713999)) then { - "" call AGM_Interaction_fnc_openMenuSelf; - setMousePosition [0.5, 0.5]; -} else { - (findDisplay 1713999) closeDisplay 1; -}; - -[_player, "interactionMenuOpened", [_player, AGM_Interaction_Target, 1]] call AGM_Core_fnc_callCustomEventHandlers; diff --git a/addons/interaction/functions/fn_onButtonUp.sqf b/addons/interaction/functions/fn_onButtonUp.sqf deleted file mode 100644 index 0466eee0dc..0000000000 --- a/addons/interaction/functions/fn_onButtonUp.sqf +++ /dev/null @@ -1,44 +0,0 @@ -// by commy2 - -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; - -_player = AGM_player; -_vehicle = vehicle _player; -_target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); - -_count = count AGM_Interaction_Buttons; -_index = call AGM_Interaction_fnc_getSelectedButton; - -_action = if (_index != -1 && {_index < _count}) then { - AGM_Interaction_Buttons select _index -} else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] -}; - -(findDisplay 1713999) closeDisplay 1; -closeDialog 0; - - - - - - - - - - - - - - - - -_statement = _action select 1; -_condition = _action select 2; -_conditionShow = _action select 7; -_exceptions = _action select 8;// -_distance = _action select 9; - -if ((_distance == 0 || {[AGM_Interaction_Target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; -}; diff --git a/addons/interaction/functions/fn_onClick.sqf b/addons/interaction/functions/fn_onClick.sqf deleted file mode 100644 index 6fb9a353fc..0000000000 --- a/addons/interaction/functions/fn_onClick.sqf +++ /dev/null @@ -1,44 +0,0 @@ -// by commy2 - -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; - -_player = AGM_player; -_vehicle = vehicle _player; -_target = [AGM_Interaction_Target, _player] select (AGM_Interaction_MenuType % 2 == 1); - -_count = count AGM_Interaction_Buttons; -_index = _this; //call AGM_Interaction_fnc_getSelectedButton; - -_action = if (_index != -1 && {_index < _count}) then { - AGM_Interaction_Buttons select _index -} else { - ["", {}, {false}, 0, [], "", "", {false}, [], 0] -}; - -_subMenu = _action select 4; - -// back -if (_index == -1) exitWith { - call AGM_Interaction_MainButton; -}; - -if (count _subMenu < 2) then { - (findDisplay 1713999) closeDisplay 1; - closeDialog 0; - - _statement = _action select 1; - _condition = _action select 2; - _conditionShow = _action select 7; - _exceptions = _action select 8;// - _distance = _action select 9; - - if ((_distance == 0 || {[AGM_Interaction_Target, _distance] call AGM_Interaction_fnc_isInRange}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { - [_target, _player] call _statement; - }; -} else { - if (_subMenu select 1 < 1) then { - [_subMenu select 0] call AGM_Interaction_fnc_openSubMenu; - } else { - [_subMenu select 0] call AGM_Interaction_fnc_openSubMenuSelf; - }; -}; diff --git a/addons/interaction/functions/fn_onSelectMenuDblClick.sqf b/addons/interaction/functions/fn_onSelectMenuDblClick.sqf deleted file mode 100644 index db7f326bd2..0000000000 --- a/addons/interaction/functions/fn_onSelectMenuDblClick.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by CorruptedHeart, commy2 - -call compile (lbData [8866, lbCurSel 8866]) call AGM_Interaction_SelectAccept; diff --git a/addons/interaction/functions/fn_openDoor.sqf b/addons/interaction/functions/fn_openDoor.sqf deleted file mode 100644 index 98f21fe690..0000000000 --- a/addons/interaction/functions/fn_openDoor.sqf +++ /dev/null @@ -1,56 +0,0 @@ -// by commy2 - -private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; - -_info = [2] call AGM_Interaction_fnc_getDoor; - -_house = _info select 0; -_door = _info select 1; - -if (isNull _house) exitWith {}; - -_animations = [_house, _door] call AGM_Interaction_fnc_getDoorAnimations; - -_lockedVariable = _animations select 1; -_animations = _animations select 0; - -if (count _animations == 0) exitWith {}; - -if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { - _lockedVariable set [0, _house]; - _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; -}; - -AGM_Interaction_isOpeningDoor = true; -playSound "AGM_Sound_Click"; - -[_house, _animations] spawn { - _house = _this select 0; - _animations = _this select 1; - - _phase = _house animationPhase (_animations select 0); - _position = getPosASL AGM_player; - - _time = time + 0.2; - _usedMouseWheel = false; - waitUntil { - if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { - _usedMouseWheel = true; - }; - - _phase = _phase + (inputAction "PrevAction" / 12) min 1; - _phase = _phase - (inputAction "NextAction" / 12) max 0; - - {_house animate [_x, _phase]} forEach _animations; - - !AGM_Interaction_isOpeningDoor || {getPosASL AGM_player distance _position > 1} - }; - - if (!_usedMouseWheel && {time < _time}) then { - _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); - - {_house animate [_x, _phase]} forEach _animations; - }; - - AGM_Interaction_isOpeningDoor = false; -}; diff --git a/addons/interaction/functions/fn_openMenu.sqf b/addons/interaction/functions/fn_openMenu.sqf deleted file mode 100644 index 02fe1ba1ab..0000000000 --- a/addons/interaction/functions/fn_openMenu.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by commy2 - -private "_target"; -_target = [cursorTarget, AGM_Interaction_Target] select (_this == "Default"); - -[0, _target, ""] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openMenuSelectUI.sqf b/addons/interaction/functions/fn_openMenuSelectUI.sqf deleted file mode 100644 index dbac9e2f75..0000000000 --- a/addons/interaction/functions/fn_openMenuSelectUI.sqf +++ /dev/null @@ -1,43 +0,0 @@ -// by commy2 - -private ["_unit", "_vehicle", "_cargo"]; - -_unit = _this select 0; -_vehicle = _this select 1; - -// allow interaction with all cargo slots and all ffv slots -_cargo = [_vehicle, ["cargo", "ffv"], true] call AGM_Core_fnc_getVehicleCrew; - -// you can only interact if you are in cargo or ffv yourself. exit otherwise -if !(_unit in _cargo) exitWith {}; - -AGM_InteractionMenu_Crew = _cargo; - -// prepare: add header and "OK" button to select menu -private "_actions"; -_actions = [localize "STR_AGM_Interaction_InteractionMenu", localize "STR_AGM_Interaction_Interact"] call AGM_Interaction_fnc_prepareSelectMenu; - -// prepare: add all cargo units as options to select menu -{ - if (_x != _unit) then { - _actions = [ - _actions, - [_x] call AGM_Core_fnc_getName, - "\AGM_Interaction\UI\dot_ca.paa", - _forEachIndex - ] call AGM_Interaction_fnc_AddSelectableItem; - }; -} forEach _cargo; - -// open select menu -[ - _actions, - { - call AGM_Interaction_fnc_hideMenu; - [0, AGM_InteractionMenu_Crew select _this, ""] spawn AGM_Interaction_fnc_showMenu; - AGM_InteractionMenu_Crew = nil; - }, - { - call AGM_Interaction_fnc_hideMenu; - } -] call AGM_Interaction_fnc_openSelectMenu; diff --git a/addons/interaction/functions/fn_openMenuSelf.sqf b/addons/interaction/functions/fn_openMenuSelf.sqf deleted file mode 100644 index e6056eb1ef..0000000000 --- a/addons/interaction/functions/fn_openMenuSelf.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -[1, AGM_player, ""] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openSelectMenu.sqf b/addons/interaction/functions/fn_openSelectMenu.sqf deleted file mode 100644 index 069d1dbc8a..0000000000 --- a/addons/interaction/functions/fn_openSelectMenu.sqf +++ /dev/null @@ -1,43 +0,0 @@ -/* - Name: AGM_Interaction_fnc_openSelectMenu - - Author: Garth de Wet (LH) - - Description: - Opens the select menu UI and sets up the UI - - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing - - Example: -*/ -if (!(profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) then { - AGM_Interaction_SelectAccept = _this select 1; - AGM_Interaction_SelectCancel = _this select 2; - buttonSetAction [8855, "call AGM_Interaction_SelectCancel;"]; // cancel - buttonSetAction [8860, "(call compile (lbData [8866, lbCurSel 8866])) call AGM_Interaction_SelectAccept;"]; // accept - lbSetCurSel [8866, 0]; -}else{ - _customActions = _this select 0; - _count = count _customActions; - if (_count == 0) exitWith {}; - _customActions call AGM_Interaction_fnc_sortOptionsByPriority; - for "_i" from 0 to _count -1 do { - _action = _customActions select _i; - _action set [1, (_this select 1)]; - }; - AGM_Interaction_Buttons = _customActions; - [(_this select 2), true, true, false, AGM_player] call AGM_Interaction_fnc_initialiseInteraction; -}; diff --git a/addons/interaction/functions/fn_openSubMenu.sqf b/addons/interaction/functions/fn_openSubMenu.sqf deleted file mode 100644 index 7898d9e181..0000000000 --- a/addons/interaction/functions/fn_openSubMenu.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -[2, AGM_Interaction_Target, _this select 0] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_openSubMenuSelf.sqf b/addons/interaction/functions/fn_openSubMenuSelf.sqf deleted file mode 100644 index 966684c84f..0000000000 --- a/addons/interaction/functions/fn_openSubMenuSelf.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -[3, AGM_player, _this select 0] call AGM_Interaction_fnc_showMenu; diff --git a/addons/interaction/functions/fn_prepareSelectMenu.sqf b/addons/interaction/functions/fn_prepareSelectMenu.sqf deleted file mode 100644 index bb84eaca12..0000000000 --- a/addons/interaction/functions/fn_prepareSelectMenu.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - Name: AGM_Interaction_fnc_prepareSelectMenu - - Author: Garth de Wet (LH) - - Description: - Prepares the select menu for use. - - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text - - Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. - - Example: - ["Select Explosive", "Place"] call AGM_Interaction_fnc_prepareSelectMenu; -*/ -private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; -closeDialog 0; -if (!(profileNamespace getVariable ["AGM_Interaction_FlowMenu", false])) exitWith { - _header = _this select 0; - _buttonText = _this select 1; - if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize "STR_AGM_Interaction_MakeSelection"; - }; - createDialog "RscAGM_SelectAnItem"; - ctrlSetText [8860, _buttonText]; - ctrlSetText [8870, _header]; - - lbClear 8866; - - 8866 -}; -[] diff --git a/addons/interaction/functions/fn_push.sqf b/addons/interaction/functions/fn_push.sqf deleted file mode 100644 index d4ce290d1e..0000000000 --- a/addons/interaction/functions/fn_push.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Pushes a boat away from the player. - * - * Arguments: - * 0: Boat (object) - * 1: Velocity (vectorlike array) - * - * Return Value: - * None - */ - -_boat = _this select 0; -_velocity = _this select 1; - -if !(local _boat) exitWith { - [_this, "AGM_Interaction_fnc_push", _boat] call AGM_Core_fnc_execRemoteFnc; -}; - -_boat setVelocity _velocity; diff --git a/addons/interaction/functions/fn_removeInteraction.sqf b/addons/interaction/functions/fn_removeInteraction.sqf deleted file mode 100644 index b633ce0bc8..0000000000 --- a/addons/interaction/functions/fn_removeInteraction.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: commy2 - * - * Remove an AGM action from an object. Note: This function is global. - * - * Argument: - * 0: Object (Object) - * 1: ID of the action (Number) - * - * Return value: - * None. - */ - -private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; - -_object = _this select 0; -_id = _this select 1; - -_actionsVar = _object getVariable ["AGM_Interactions", [-1, [], []]]; - -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []]; -_actions = _actions - [[]]; - -_object setVariable ["AGM_Interactions", [_currentID, _actionIDs, _actions], true]; diff --git a/addons/interaction/functions/fn_removeInteractionSelf.sqf b/addons/interaction/functions/fn_removeInteractionSelf.sqf deleted file mode 100644 index 140c6f0502..0000000000 --- a/addons/interaction/functions/fn_removeInteractionSelf.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: commy2 - * - * Remove an AGM self action from the player. - * - * Argument: - * 0: ID of the action (Number) - * - * Return value: - * None. - */ - - -private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; - - -_id = _this select 0; - -_actionsVar = AGM_player getVariable ["AGM_InteractionsSelf", [-1, [], []]]; - -_currentID = _actionsVar select 0; -_actionIDs = _actionsVar select 1; -_actions = _actionsVar select 2; - -_id = _actionIDs find _id; - -if (_id == -1) exitWith {}; - -_actionIDs set [_id, -1]; -_actionIDs = _actionIDs - [-1]; - -_actions set [_id, []]; -_actions = _actions - [[]]; - -AGM_player setVariable ["AGM_InteractionsSelf", [_currentID, _actionIDs, _actions], false]; diff --git a/addons/interaction/functions/fn_removeTag.sqf b/addons/interaction/functions/fn_removeTag.sqf deleted file mode 100644 index 9d37367f1c..0000000000 --- a/addons/interaction/functions/fn_removeTag.sqf +++ /dev/null @@ -1,19 +0,0 @@ -// by commy2 - -0 spawn { - waitUntil {player getVariable ["AGM_Name", ""] != ""}; - - _name = player getVariable ["AGM_Name", ""]; - _name = toArray _name; - - _index = _name find (toArray "]" select 0); - - if (_index != -1) then { - for "_index" from 0 to _index do { - _name set [_index, -1]; - }; - _name = _name - [-1]; - _name = toString _name; - player setVariable ["AGM_Name", _name, true]; - }; -}; diff --git a/addons/interaction/functions/fn_sendAway.sqf b/addons/interaction/functions/fn_sendAway.sqf deleted file mode 100644 index a4434bbd12..0000000000 --- a/addons/interaction/functions/fn_sendAway.sqf +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Sends a civilian crowd away (chance of failure). - * - * Arguments: - * 0: Unit to be sent away (Object) - * - * Return value: - * none -*/ - -#define DISTANCE 50 -#define RADIUS 10 - -private ["_unit", "_chance", "_x"]; - -_unit = _this select 0; - -AGM_player playActionNow "GestureGo"; - -if (count weapons AGM_player > 0) then { - _chance = 0.8; -} else { - _chance = 0.5; -}; - -{ - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - (_this select 0) setUnitPos "AUTO"; - (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; - }, [_x, AGM_player]] call CBA_fnc_globalExecute; - }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fn_setCaptivityStatus.sqf b/addons/interaction/functions/fn_setCaptivityStatus.sqf deleted file mode 100644 index 1055780cac..0000000000 --- a/addons/interaction/functions/fn_setCaptivityStatus.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -_this call AGM_Core_fnc_setCaptivityStatus; diff --git a/addons/interaction/functions/fn_showMenu.sqf b/addons/interaction/functions/fn_showMenu.sqf deleted file mode 100644 index 291ab27331..0000000000 --- a/addons/interaction/functions/fn_showMenu.sqf +++ /dev/null @@ -1,118 +0,0 @@ -/* - Name: AGM_Interaction_fnc_showMenu - - Author: - commy2 - Garth de Wet (LH) - aeroson - - Description: - - Parameters: - 0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction) - 1: OBJECT - Target object - 2: STRING - Sub-Menu ClassName - - Returns: - Nothing - - Example: - [0, AGM_Interaction_Target] call AGM_Interaction_fnc_showMenu; - [1, player] call AGM_Interaction_fnc_showMenu; - [2, AGM_Interaction_Target, "AGM_Explosives"] call AGM_Interaction_fnc_showMenu; - [3, player, "AGM_Explosives"] call AGM_Interaction_fnc_showMenu; -*/ -private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"]; -#define DEFAULT_ICON "\AGM_Interaction\UI\dot_ca.paa" -#define DEFAULT_DISTANCE 4 // seems to be 4 -_player = AGM_player; -_vehicle = vehicle _player; - -AGM_Interaction_MenuType = _this select 0; // 0 Interaction, 1 Self Interaction - -_mainButtonAction = [ - {call AGM_Interaction_fnc_hideMenu}, - {call AGM_Interaction_fnc_hideMenu}, - {"Default" call AGM_Interaction_fnc_openMenu}, - {"Default" call AGM_Interaction_fnc_openMenuSelf} -] select AGM_Interaction_MenuType; - -_menuType = AGM_Interaction_MenuType % 2; -uiNamespace setVariable ["AGM_Interaction_CursorPosition", [controlNull, 0.5, 0.5, -1]]; - -AGM_Interaction_Target = _this select 1; -_object = AGM_Interaction_Target; - -if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call AGM_Interaction_fnc_isInRange)})}) exitWith {};//call ([AGM_Interaction_fnc_onButtonDown, AGM_Interaction_fnc_onButtonDownSelf] select _menuType)}; -if !([_player, _object] call AGM_Core_fnc_canInteractWith) exitWith {}; - -// add actions or self actions of AGM_Interaction_Target -_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents; -_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions; -_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions) select 0; - -// add self actions of vehicle _player -if (_menuType == 1 && {_player != _vehicle}) then { - _parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents; - _result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions; - _actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["AGM_Actions", "AGM_SelfActions"] select _menuType, _this select 2] call AGM_Interaction_fnc_GetActions) select 0); -}; - -// custom defined actions, stored in variable instead of cfg like above -if (AGM_Interaction_MenuType < 2) then { - - private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"]; - - // add interactions or self interactions of AGM_Interaction_Target - _customActions = (_object getVariable [["AGM_Interactions", "AGM_InteractionsSelf"] select _menuType, [-1, [], []]]) select 2; - - // add self interactions of vehicle _player - if (_menuType == 1 && {_player != _vehicle}) then { - _customActions = _customActions + ((_vehicle getVariable [["AGM_Interactions", "AGM_InteractionsSelf"] select _menuType, [-1, [], []]]) select 2); - }; - - if(_menuType==0) then { - - private ["_distance"]; - - for "_index" from 0 to (count _customActions - 1) do { - - _customAction = _customActions select _index; - _displayName = _customAction select 0; - _distance = _customAction select 1; - _condition = _customAction select 2; - _statement = _customAction select 3; - _showDisabled = _customAction select 4; - _priority = _customAction select 5; - - if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call AGM_Interaction_fnc_isInRange || {_distance == 0}}) then { - _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""]; - }; - }; - - } else { // self interactions do not have distance - - for "_index" from 0 to (count _customActions - 1) do { - - _customAction = _customActions select _index; - _displayName = _customAction select 0; - _condition = _customAction select 1; - _statement = _customAction select 2; - _showDisabled = _customAction select 3; - _priority = _customAction select 4; - - if (_showDisabled || {[_object, _player] call _condition}) then { - _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""]; - }; - }; - - }; - - -}; - -if (count _actions == 0) exitWith {};//call ([AGM_Interaction_fnc_onButtonDown, AGM_Interaction_fnc_onButtonDownSelf] select _menuType)}; - -_actions call AGM_Interaction_fnc_sortOptionsByPriority; -AGM_Interaction_Buttons = _actions; -[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable ["AGM_Interaction_FlowMenu", false]), _menuType == 1, _object] call AGM_Interaction_fnc_initialiseInteraction; diff --git a/addons/interaction/functions/fn_showMouseHint.sqf b/addons/interaction/functions/fn_showMouseHint.sqf deleted file mode 100644 index a856e9d9c6..0000000000 --- a/addons/interaction/functions/fn_showMouseHint.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/* - Name: AGM_Interaction_fnc_showMouseHint - - Author(s): - Garth de Wet (LH) - - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text - - Returns: - Nothing - - Example: - ["Place Explosive", "Cancel"] call AGM_Interaction_fnc_showMouseHint; -*/ -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) -private ["_leftClick", "_rightClick", "_scroll"]; -_leftClick = _this select 0; -_rightClick = _this select 1; -_scroll = ""; -if (count _this > 2) then { - _scroll = _this select 2; -}; - -("AGM_InteractionHelper" call BIS_fnc_rscLayer) cutRsc ["AGM_InteractionHelper", "PLAIN",0.5, false]; -disableSerialization; -_display = uiNamespace getVariable ["AGM_Helper_Display", objNull]; -if (isNull _display) exitWith{}; - -(_display displayCtrl 1000) ctrlSetText _leftClick; -(_display displayCtrl 1001) ctrlSetText _rightClick; - -(_display displayCtrl 1000) ctrlShow (_leftClick != ""); -(_display displayCtrl 1200) ctrlShow (_leftClick != ""); -(_display displayCtrl 1001) ctrlShow (_rightClick != ""); -(_display displayCtrl 1201) ctrlShow (_rightClick != ""); - -if (_scroll == "") exitWith { - (_display displayCtrl 1002) ctrlShow false; - (_display displayCtrl 1202) ctrlShow false; - - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; - (_display displayCtrl 1001) ctrlCommit 0; - (_display displayCtrl 1201) ctrlCommit 0; -}; -(_display displayCtrl 1002) ctrlSetText _scroll; -showHUD false; \ No newline at end of file diff --git a/addons/interaction/functions/fn_sortOptionsByPriority.sqf b/addons/interaction/functions/fn_sortOptionsByPriority.sqf deleted file mode 100644 index dd94cadfe4..0000000000 --- a/addons/interaction/functions/fn_sortOptionsByPriority.sqf +++ /dev/null @@ -1,20 +0,0 @@ -// by commy2 - -private ["_actions", "_count", "_index", "_actionN", "_actionM"]; - -_actions = _this; -_count = count _actions; -_index = 0; - -while {_index < _count - 1} do { - _actionN = + _actions select _index; - _actionM = + _actions select (_index + 1); - - if (_actionN select 3 < _actionM select 3) then { - _actions set [_index, _actionM]; - _actions set [_index + 1, _actionN]; - _index = 0; - } else { - _index = _index + 1; - }; -}; diff --git a/addons/interaction/functions/fn_tapShoulder.sqf b/addons/interaction/functions/fn_tapShoulder.sqf deleted file mode 100644 index 8d6340143f..0000000000 --- a/addons/interaction/functions/fn_tapShoulder.sqf +++ /dev/null @@ -1,20 +0,0 @@ -// by commy2 - -private ["_unit", "_message"]; - -_tapper = _this select 0; -_target = _this select 1; - -if (_target != AGM_player) exitWith { - addCamShake [4, 0.5, 5]; - if !(local _target) then { - [[_tapper, _target], "AGM_Interaction_fnc_tapShoulder", _target] call AGM_Core_fnc_execRemoteFnc; - }; -}; - -addCamShake [4, 0.5, 5]; - -//_message = format ["%1 tapped you on your shoulder.", [_unit] call AGM_Core_fnc_getName]; -_message = localize "STR_AGM_Interaction_YouWereTapped"; - -[_message] call AGM_Core_fnc_displayTextStructured; diff --git a/addons/interaction/functions/fn_updateTooltipPosition.sqf b/addons/interaction/functions/fn_updateTooltipPosition.sqf deleted file mode 100644 index 3df14635e0..0000000000 --- a/addons/interaction/functions/fn_updateTooltipPosition.sqf +++ /dev/null @@ -1,12 +0,0 @@ -// by commy2 - -disableSerialization; -_ctrl = ctrlParent (_this select 0) displayCtrl 40; - -_ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, - 2.0 / 16 * safezoneW, - 0.3 / 9 * safezoneH -]; -_ctrl ctrlCommit 0; diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf new file mode 100644 index 0000000000..1e3065d234 --- /dev/null +++ b/addons/interaction/functions/fnc_AddSelectableItem.sqf @@ -0,0 +1,41 @@ +/* + Author: Garth de Wet (LH) + + Description: + Adds an item to the select menu + + Parameters: + 0: ARRAY/NUMBER - List container + 1: String - Display Name + 2: String - Picture + 3: String/code - data + + Returns: + ARRAY/Number + + Example: +*/ + +#include "script_component.hpp" + +private ["_container", "_displayName", "_picture", "_data", "_index"]; + +_container = _this select 0; +_displayName = _this select 1; +_picture = _this select 2; +_data = _this select 3; + +if (_picture == "" || _picture == "PictureThing") then { + _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); +}; + +if ((profileNamespace getVariable [QGVAR(FlowMenu), false])) then { + //[_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey] + _container pushBack [_displayName, nil, {true},0,[], _picture, "", {true}, [], 4, "", _data]; +}else{ + _index = lbAdd [_container, _displayName]; + lbSetData [_container, _index, str _data]; + lbSetPicture [_container, _index, _picture]; +}; + +_container diff --git a/addons/interaction/functions/fnc_GetActions.sqf b/addons/interaction/functions/fnc_GetActions.sqf new file mode 100644 index 0000000000..096050a6b3 --- /dev/null +++ b/addons/interaction/functions/fnc_GetActions.sqf @@ -0,0 +1,154 @@ +/* + Author: + commy2 + Garth de Wet (LH) + + Description: + + Parameters: + 0: OBJECT - target + 1: ARRAY - Parents of the target object + 2: ARRAY - Actions + 3: ARRAY - Patches + 4: CONFIG - Parent config (ConfigFile >> "CfgVehicles"/MissionConfigFile >> "CfgVehicles") + 5: BOOL - Is mission config file? + 6: STRING - Classname ("ACE_Actions"/"ACE_SelfActions") + 7: STRING - Sub-class + + Returns: + Nothing + + Example: + [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_Actions"] call ACE_Interaction_fnc_GetActions; + + [player, [configfile >> "CfgVehicles" >> typeOf player, true] call BIS_fnc_returnParents, [], [],configfile >> "CfgVehicles", false, "ACE_SelfActions"] call ACE_Interaction_fnc_GetActions; +*/ +#include "script_component.hpp" + +#define DEFAULT_ICON QUOTE(PATHTOF(UI\dot_ca.paa)) +private ["_target", "_parents", "_actions", "_patches", "_baseConfig", "_actionType", "_i","_index", "_missionConfig", "_stdConfig"]; +_target = _this select 0; +_parents = _this select 1; +_actions = _this select 2; +_patches = _this select 3; +_baseConfig = _this select 4; +_missionConfig = _this select 5; +_actionType = _this select 6; +_subClass = _this select 7; + +_stdConfig = (configFile >> "CfgVehicles" >> typeOf _target >> _actionType); +if (_subClass != "") then { + _stdConfig = _stdConfig >> _subClass; +}; + +_count = count _parents; +for "_i" from 0 to (_count - 1) do { + _config = _baseConfig >> _parents select _i >> _actionType; + if (_subClass != "") then { + _config = _config >> _subClass; + }; + + _count = count _config; + if (_count > 0) then { + for "_index" from 0 to (_count - 1) do { + private ["_action", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority", "_tooltip", "_hotkey", + "_subMenu", "_conditionShow", "_exceptions", "_icon", "_actionToCache", "_cacheActions", "_cache", "_indexCache", "_configName"]; + _action = if (_missionConfig) then {_config select _index} else {_stdConfig >> configName (_config select _index)}; + _cache = missionNamespace getVariable [QGVAR(MenuCache), [[], [], []]]; + + if (count _action > 0) then { + _configName = configName _action; + + _cacheConfigs = _cache select 0; + _cacheActions = _cache select 1; + _cacheIndices = _cache select 2; + + _indexCache = _cacheConfigs find _action; + if (_indexCache == -1) then { + _displayName = getText (_action >> "displayName"); + _distance = getNumber (_action >> "distance"); + _priority = getNumber (_action >> "priority"); + _subMenu = getArray (_action >> "subMenu"); + _tooltip = getText (_action >> "tooltip"); + _hotkey = getText (_action >> "hotkey"); + _enableInside = getNumber (_action >> "enableInside"); + + // Condition + _condition = getText (_action >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _condition = _condition + format [QUOTE( && {%1 call EGVAR(core,canInteract)} && {[ACE_player, GVAR(Target)] call EFUNC(common,canInteractWith)} ), getArray (_action >> "exceptions")]; + if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; + + _condition = compile _condition; + + // Condition to show the action + _conditionShow = getText (_action >> "conditionShow"); + _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call _conditionShow; + }; + + // Exceptions to the general conditions that have to be true + _exceptions = getArray (_action >> "exceptions"); + + // statement + _statement = getText (_action >> "statement"); + _statement = compile _statement; + + if (profileNamespace getVariable [QGVAR(FlowMenu), false]) then { + _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { + compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1]; + } else { + compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement")); + }; + }; + + // icon + _icon = getText (_action >> "Icon"); + if (_icon == "") then { + _icon = DEFAULT_ICON; + }; + + _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; + + if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call _condition}} && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then { + _actions pushBack _actionToCache; + _patches pushBack _configName; + }; + + _indexCache = _cacheActions find _actionToCache; + if (_indexCache == -1) then { + _indexCache = count _cacheActions; + _cacheActions pushBack _actionToCache; + }; + + _cacheConfigs pushBack _action; + _cacheIndices pushBack _indexCache; + + _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; + ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(debug,log); + } else { + ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(debug,log); + + _cachedAction = _cacheActions select (_cacheIndices select _indexCache); + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call (_cachedAction select 7); + }; + + if (!(_configName in _patches) && {_showDisabled || {[_object, _player] call (_cachedAction select 2)}} && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then { + _actions pushBack _cachedAction; + _patches pushBack _configName; + }; + }; + }; + + GVAR(MenuCache) = _cache; + }; + }; +}; +[_actions, _patches] diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_MoveDown.sqf new file mode 100644 index 0000000000..2221deab62 --- /dev/null +++ b/addons/interaction/functions/fnc_MoveDown.sqf @@ -0,0 +1,66 @@ +/* + Author: Garth de Wet (LH) + + Description: + Depending on the passed value, either scrolls down through the list or up. + + Parameters: + NUMBER - Amount to increase current interaction target + + Returns: + Nothing + + Example: + 1 call FUNC(MoveDown); + -1 call FUNC(MoveDown); +*/ +#include "script_component.hpp" + +#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) +if (isNil QGVAR(MainButton)) exitWith{}; +if (isNil QGVAR(Buttons)) exitWith{}; +_count = (count GVAR(Buttons))- 1; +GVAR(SelectedButton) = CLAMP(GVAR(SelectedButton) + _this, 0, _count); + +_target = GVAR(Target); +_player = ACE_player; +_vehicle = vehicle _player; + +disableSerialization; +_dlgInteractionDialog = uiNamespace getVariable QGVAR(Flow_Display); +_top = GVAR(SelectedButton) - 2; +_i = 0; +while {_i <= 4} do { + _index =_i + _top; + _ctrl = _dlgInteractionDialog displayCtrl (1200 + _i); + if (_index >= 0 && {_index <= _count}) then { + _action = GVAR(Buttons) select _index; + _ctrl ctrlShow true; + _ctrl ctrlSetText (_action select 5); + _color = [1,1,1,1]; + if !([_target, _player] call (_action select 2)) then { + _color = [0.3,0.3,0.3,0.8]; + }; + if (_i == 0 || _i == 4) then { + _color set [3, 0.5]; + }; + if (_i == 1 || _i == 3) then { + _color set [3, 0.75]; + }; + _ctrl ctrlSetTextColor _color; + }else{ + _ctrl ctrlShow false; + }; + _i = _i + 1; +}; + +_ctrl = _dlgInteractionDialog displayCtrl 1000; +_ctrl ctrlSetText ((GVAR(Buttons) select GVAR(SelectedButton)) select 0); +_ctrl = _dlgInteractionDialog displayCtrl 1100; +_current = (GVAR(Buttons) select GVAR(SelectedButton)); +_infoText = ""; +if !([_target, _player] call (_current select 2)) then { + _infoText = "Unavailable"; +}; +_ctrl ctrlSetText _infoText; +_ctrl ctrlShow (_infoText != ""); diff --git a/addons/interaction/functions/fnc_addInteraction.sqf b/addons/interaction/functions/fnc_addInteraction.sqf new file mode 100644 index 0000000000..5e8889891d --- /dev/null +++ b/addons/interaction/functions/fnc_addInteraction.sqf @@ -0,0 +1,57 @@ +/* + * Author: commy2 + * + * Add an ACE action to an object. Note: This function is global. + * + * Argument: + * 0: Object the action should be assigned to (Object) + * 1: Name of the action shown in the menu (String) + * 2: Distance the player can be away from the object (Number) + * 3: Condition (Code or String) + * 4: Statement (Code or String) + * 5: Show the action even if the conditon is not met (Bool or Number) + * 6: Priority (Number, optional default: 0) + * + * Return value: + * ID of the action (used to remove it later). + */ + +#include "script_component.hpp" + +private ["_object", "_displayName", "_distance", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; + +_object = _this select 0; +_displayName = _this select 1; +_distance = _this select 2; +_condition = _this select 3; +_statement = _this select 4; +_showDisabled = _this select 5; +_priority = _this select 6; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +if (typeName _showDisabled == "SCALAR") then { + _showDisabled = _showDisabled > 0; +}; + +if (isNil "_priority") then { + _priority = 0; +}; + +_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack [_displayName, _distance, _condition, _statement, _showDisabled, _priority]; + +_object setVariable [QGVAR(Interactions), [_id, _actionIDs, _actions], true]; +_id diff --git a/addons/interaction/functions/fnc_addInteractionSelf.sqf b/addons/interaction/functions/fnc_addInteractionSelf.sqf new file mode 100644 index 0000000000..48773fcb99 --- /dev/null +++ b/addons/interaction/functions/fnc_addInteractionSelf.sqf @@ -0,0 +1,55 @@ +/* + * Author: commy2 + * + * Add an ACE self action to the player. Execute this on the local machine of the player. + * + * Argument: + * 0: Name of the action shown in the menu (String) + * 1: Condition (Code or String) + * 2: Statement (Code or String) + * 3: Show the action even if the conditon is not met (Bool or Number) + * 4: Priority (Number, optional default: 0) + * + * Return value: + * ID of the action (used to remove it later). + */ + +#include "script_component.hpp" + +private ["_displayName", "_condition", "_statement", "_showDisabled", "_priority", "_actionsVar", "_id", "_actionIDs", "_actions"]; + + +_displayName = _this select 0; + +_condition = _this select 1; +_statement = _this select 2; +_showDisabled = _this select 3; +_priority = _this select 4; + +if (typeName _condition == "STRING") then { + _condition = compile _condition; +}; + +if (typeName _statement == "STRING") then { + _statement = compile _statement; +}; + +if (typeName _showDisabled == "SCALAR") then { + _showDisabled = _showDisabled > 0; +}; + +if (isNil "_priority") then { + _priority = 0; +}; + +_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]]; + +_id = (_actionsVar select 0) + 1; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_actionIDs pushBack _id; +_actions pushBack [_displayName, _condition, _statement, _showDisabled, _priority]; + +ACE_player setVariable [QGVAR(InteractionsSelf), [_id, _actionIDs, _actions], false]; +_id diff --git a/addons/interaction/functions/fnc_addToTooltip.sqf b/addons/interaction/functions/fnc_addToTooltip.sqf new file mode 100644 index 0000000000..894223b68e --- /dev/null +++ b/addons/interaction/functions/fnc_addToTooltip.sqf @@ -0,0 +1,5 @@ +// by commy2 + +#include "script_component.hpp" + +QGVAR(CurrentTooltip) pushBack (_this select 0); diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf new file mode 100644 index 0000000000..7459b1a7bf --- /dev/null +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -0,0 +1,53 @@ +// by commy2 + +#include "script_component.hpp" + +private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; + +_object = GVAR(Target); +_actions = GVAR(Buttons); + + +disableSerialization; +_dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); + +/* +for "_a" from 0 to (_count - 1) do { + _action = GVAR(Buttons) select _a; + + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a); + _ctrlInteractionDialog ctrlShow true; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); +}; +*/ + +_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; + +GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;"; + +if (_object isKindOf "Man") then { + _ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]}); +} else { + _ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName")); +}; + +for "_index" from 0 to 9 do { + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index); + _ctrlInteractionDialog ctrlShow true; + + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index); + + if (_index < _count) then { + _action = GVAR(Buttons) select _index; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable (call (_action select 2)); + + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; + + _ctrlInteractionDialogIcon ctrlSetText ""; + }; +}; diff --git a/addons/interaction/functions/fnc_canInteractWith.sqf b/addons/interaction/functions/fnc_canInteractWith.sqf new file mode 100644 index 0000000000..5a47782546 --- /dev/null +++ b/addons/interaction/functions/fnc_canInteractWith.sqf @@ -0,0 +1,14 @@ +// by commy2 + +#include "script_component.hpp" + +private ["_unit", "_isCivilian"]; + +_unit = _this select 0; +_isCivilian = _this select 1; + +if (isNil "_isCivilian") then {_isCivilian = true}; + +alive _unit +&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian +//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf new file mode 100644 index 0000000000..4ea9836117 --- /dev/null +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -0,0 +1,13 @@ +// by commy2 + +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +_target isKindOf "CAManBase" && +{alive _target} && +{_unit distance _target < 4} && +{!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_getActions2.sqf b/addons/interaction/functions/fnc_getActions2.sqf new file mode 100644 index 0000000000..01c86d6db0 --- /dev/null +++ b/addons/interaction/functions/fnc_getActions2.sqf @@ -0,0 +1,121 @@ +// commy2 +#include "script_component.hpp" + +private ["_object", "_config", "_type", "_actions", "_configs"]; + +_object = _this select 0; +_config = _this select 1; // configFile, missionConfigFile +_type = _this select 2; // "ACE_CfgInteractions", "ACE_CfgInteractionsSelf" +_actions = _this select 3; // []; + +_configs = "_object isKindOf configName _x" configClasses (_config >> _type); + +// cache +private ["_cache", "_cacheConfigs", "_cacheActions", "_cacheIndices"]; + +_cache = uiNamespace getVariable [QGVAR(MenuCache), [[], [], []]]; +_cacheConfigs = _cache select 0; +_cacheActions = _cache select 1; +_cacheIndices = _cache select 2; + +// get interactions +{ + private "_configActions"; + + _configActions = "true" configClasses (_config >> _type >> configName _x); + { + private ["_action", "_configName", "_indexCache"]; + + _action = _x; + _configName = configName _action; + + _indexCache = _cacheConfigs find _action; + if (_indexCache == -1) then { + private ["_displayName", "_distance", "_priority", "_subMenu", "_tooltip", "_hotkey", "_enableInside", "_condition", "_conditionShow", "_showDisabled", "_exceptions", "_statement", "_icon"]; + + _displayName = getText (_action >> "displayName"); + _distance = getNumber (_action >> "distance"); + _priority = getNumber (_action >> "priority"); + _subMenu = getArray (_action >> "subMenu"); + _tooltip = getText (_action >> "tooltip"); + _hotkey = getText (_action >> "hotkey"); + _enableInside = getNumber (_action >> "enableInside"); + + // Condition + _condition = getText (_action >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _condition = _condition + format [QUOTE(&& {%1 call EFUNC(common,canInteract)} && {[ACE_player, GVAR(Target)] call FUNC(canInteractWith)}), getArray (_action >> "exceptions")]; + if (_enableInside != 1) then {_condition = _condition + " && {_player == _vehicle}"}; + + _condition = compile _condition; + + // Condition to show the action + _conditionShow = getText (_action >> "conditionShow"); + _conditionShow = if (_conditionShow == "") then {{true}} else {compile _conditionShow}; + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call _conditionShow; + }; + + // Exceptions to the general conditions that have to be true + _exceptions = getArray (_action >> "exceptions"); + + // statement + _statement = getText (_action >> "statement"); + _statement = compile _statement; + + if (profileNamespace getVariable ["ACE_Interaction_FlowMenu", false]) then { + _statement = if (getText (_action >> "statement") == "" && {count _subMenu > 1}) then { + compile format [QUOTE( call FUNC(hideMenu);if(%2 == 1)then{['%1'] call FUNC(openSubMenuSelf);}else{['%1'] call FUNC(openSubMenu);}; ), _subMenu select 0, _subMenu select 1]; + } else { + compile (QUOTE( call FUNC(hideMenu); ) + getText (_action >> "statement")); + }; + }; + + // icon + _icon = getText (_action >> "Icon"); + if (_icon == "") then { + _icon = DEFAULT_ICON; + }; + + private "_actionToCache"; + _actionToCache = [_displayName, _statement, _condition, _priority, _subMenu, _icon, _tooltip, _conditionShow, _exceptions, _distance, _hotkey]; + + if ((_showDisabled || {[_object, _player] call _condition}) && {_distance == 0 || {[_object, _distance] call FUNC(isInRange)}}) then { + _actions pushBack _actionToCache; + }; + + _indexCache = _cacheActions find _actionToCache; + if (_indexCache == -1) then { + _indexCache = count _cacheActions; + _cacheActions pushBack _actionToCache; + }; + + _cacheConfigs pushBack _action; + _cacheIndices pushBack _indexCache; + + _cache = [_cacheConfigs, _cacheActions, _cacheIndices]; + ["InteractionMenu", _action, {format ["%1 loaded into cache", _this]}] call EFUNC(debug,log); + } else { + ["InteractionMenu", _action, {format ["%1 loaded from cache", _this]}] call EFUNC(debug,log); + + private ["_cachedAction", "_showDisabled"]; + _cachedAction = _cacheActions select (_cacheIndices select _indexCache); + + _showDisabled = getNumber (_action >> "showDisabled") == 1; + if (isText (_action >> "conditionShow")) then { + _showDisabled = [_object, _player] call (_cachedAction select 7); + }; + + if ((_showDisabled || {[_object, _player] call (_cachedAction select 2)}) && {[_object, (_cachedAction select 9)] call FUNC(isInRange) || {(_cachedAction select 9) == 0}}) then { + _actions pushBack _cachedAction; + }; + }; + } forEach _configActions; //Actions of this CfgVehicles class +} forEach _configs; //CfgVehicles class + +uiNamespace setVariable [QGVAR(MenuCache), _cache]; + +_actions diff --git a/addons/interaction/functions/fnc_getCaptivityStatus.sqf b/addons/interaction/functions/fnc_getCaptivityStatus.sqf new file mode 100644 index 0000000000..e97b580ce5 --- /dev/null +++ b/addons/interaction/functions/fnc_getCaptivityStatus.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +_this call EFUNC(common,getCaptivityStatus); diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf new file mode 100644 index 0000000000..91c2161d9f --- /dev/null +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -0,0 +1,25 @@ +// by commy2 +#include "script_component.hpp" + +private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; + +_distance = _this select 0; + +_position0 = positionCameraToWorld [0, 0, 0]; +_position1 = positionCameraToWorld [0, 0, _distance]; + +_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true]; + +_count = count _intersections; +if (_count == 0) exitWith {[objNull, ""]}; + +_house = _intersections select (_count - 1); + +// shithouse is bugged +if (typeOf _house == "") exitWith {[objNull, ""]}; + +_intersections = [_house, "GEOM"] intersect [_position0, _position1]; + +_door = _intersections select 0 select 0; +if (isNil "_door") exitWith {[_house, ""]}; +[_house, _door] diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf new file mode 100644 index 0000000000..ebb820584a --- /dev/null +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -0,0 +1,107 @@ +// by commy2 +#include "script_component.hpp" + +private ["_house", "_door", "_animations", "_lockedVariable"]; + +_house = _this select 0; +_door = _this select 1; + +_index = [ + "door_1", + "door_2", + "door_3", + "door_4", + "door_5", + "door_6", + "door_7", + "door_8", + "door_9", + "door_10", + "door_11", + "door_12", + "door_13", + "Door_14", + "door_15", + "door_16", + "door_17", + "door_18", + "door_19", + "door_20", + "door_21", + "door_22", + + "hatch_1", + "hatch_2", + "hatch_3", + "hatch_4", + "hatch_5", + "hatch_6" +] find toLower _door; + +if (_index == -1) exitWith {[[],""]}; + +_animations = [ + ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], + ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], + ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], + ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], + ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], + ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], + ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], + ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], + ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], + ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], + ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], + ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], + ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], + ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], + ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], + ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], + ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], + ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], + ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], + ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], + ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], + ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], + + ["Hatch_1_rot"], + ["Hatch_2_rot"], + ["Hatch_3_rot"], + ["Hatch_4_rot"], + ["Hatch_5_rot"], + ["Hatch_6_rot"] +] select _index; + +_lockedVariable = [ + ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], + ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], + ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], + ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], + ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], + ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], + ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], + ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], + ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], + ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], + ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], + ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], + ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], + ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], + ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], + ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], + ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], + ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], + ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], + ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], + ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], + ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], + + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""], + ["", ""] +] select _index; + +[_animations, _lockedVariable] diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf new file mode 100644 index 0000000000..ead5dcd290 --- /dev/null +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -0,0 +1,34 @@ +/* + * Author: KoffeinFlummi + * + * Forces a civilian to the ground. (chance of failure). + * + * Arguments: + * 0: Unit to be sent away (Object) + * + * Return value: + * none + */ +#include "script_component.hpp" + +#define RADIUS 10 + +private ["_unit", "_chance", "_x"]; + +_unit = _this select 0; + +ACE_player playActionNow "GestureGo"; // put something else here. + +if (count (weapons ACE_player) > 0) then { + _chance = 0.8; +} else { + _chance = 0.5; +}; + +{ + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + _this setUnitPos "DOWN"; + }, _x] call CBA_fnc_globalExecute; + }; +} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_getSelectedButton.sqf b/addons/interaction/functions/fnc_getSelectedButton.sqf new file mode 100644 index 0000000000..d1c801e1dc --- /dev/null +++ b/addons/interaction/functions/fnc_getSelectedButton.sqf @@ -0,0 +1,24 @@ +// by commy2 +#include "script_component.hpp" + +#define MIN_DISTANCE 0.0065 + +private ["_position", "_distance", "_angle"]; + +_position = uiNamespace getVariable [QGVAR(CursorPosition), [0.5, 0.5, 0]]; + +_position = [((_position select 1) - 0.5) / safezoneH, ((_position select 2) - 0.5) / safezoneW, 0]; + +_distance = [0, 0, 0] vectorDistanceSqr _position; + +// is in center +if (_distance < MIN_DISTANCE) exitWith {-1}; + +_angle = (_position select 0) atan2 (_position select 1); + +// rotate circle +_angle = 180 - _angle + 360 / 10 / 2; +if (_angle < 0) then {_angle = _angle + 360}; + +_angle = floor (_angle / 360 * 10); +if (_angle == 10) then {0} else {_angle} diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf new file mode 100644 index 0000000000..43444b7d99 --- /dev/null +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -0,0 +1,22 @@ +/* + Author: Garth de Wet (LH) + + Description: + Closes the Interaction menu + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(hideMenu); +*/ +#include "script_component.hpp" + +closeDialog 0; +(findDisplay 1713999) closeDisplay 1; +(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; +GVAR(MainButton) = nil; +call FUNC(hideMouseHint); \ No newline at end of file diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf new file mode 100644 index 0000000000..7553df59ee --- /dev/null +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -0,0 +1,22 @@ +/* + Author(s): + Garth de Wet (LH) + + Description: + Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(hideMouseHint); +*/ +#include "script_component.hpp" + +if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; + +("ACE_InteractionHelper" call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; +showHUD true; \ No newline at end of file diff --git a/addons/interaction/functions/fnc_initialiseInteraction.sqf b/addons/interaction/functions/fnc_initialiseInteraction.sqf new file mode 100644 index 0000000000..180a7024bb --- /dev/null +++ b/addons/interaction/functions/fnc_initialiseInteraction.sqf @@ -0,0 +1,167 @@ +/* + Author: + commy2 + Garth de Wet (LH) + + Description: + Initialises the interaction click handlers. + + Parameters: + 0 : CODE - code to call when right clicking/center button + 1 : BOOLEAN - Submenu + 2 : BOOLEAN - Flow Menu + 3 : BOOLEAN - Self interaction + 4 : OBJECT - Target + + Returns: + Nothing + + Example: + [{"Default" call FUNC(openMenu);}, true, (profileNamespace getVariable [QGVAR(FlowMenu), false]), GVAR(Target)] call FUNC(initialiseInteraction); +*/ +#include "script_component.hpp" + +private ["_subMenu", "_selfMenu", "_target"]; +GVAR(MainButton) = _this select 0; +_subMenu = _this select 1; +_selfMenu = _this select 3; +_target = _this select 4; + +_player = ACE_player; +_vehicle = vehicle _player; +//_object = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); + +if !([_target, 5] call GVAR(isInRange)) exitWith {}; + +GVAR(Shortcuts) = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; + +// Flow menu +if (_this select 2) then { + (QGVAR(FlowMenu) call BIS_fnc_rscLayer) cutRsc [QGVAR(FlowMenu), "PLAIN",0.5, false]; + ACE_Interaction_SelectedButton = 0; + (findDisplay 1713999) closeDisplay 1; + if (_player getVariable ["ACE_AcceptAction", -1] == -1) then { + [{if(isNil {GVAR(MainButton)} || {!(profileNamespace getVariable [QGVAR(FlowMenu), false])})exitWith{false};(-(_this select 0) / 1.2) call FUNC(MoveDown);true}] call EFUNC(common,addScrollWheelEventHandler); + + _player setVariable ["ACE_AcceptAction", [_player, "DefaultAction", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {_action = GVAR(Buttons) select ACE_Interaction_SelectedButton;_target = GVAR(Target);_player = ACE_player;_vehicle = vehicle _player;if ([_target, _player] call (_action select 2)) then {call FUNC(hideMenu);if(count _action == 12) then{(_action select 11) call (_action select 1);}else{[_target, _player] call (_action select 1);};};}] call EFUNC(common,addActionEventHandler)]; + _player setVariable ["ACE_AcceptAction", [_player, "menuBack", {(!isNil {GVAR(MainButton)}) && {(profileNamespace getVariable [QGVAR(FlowMenu), false])}}, {call GVAR(MainButton);}] call EFUNC(common,addActionEventHandler)]; + }; + 0 call FUNC(moveDown); + [localize "STR_ACE_Interaction_MakeSelection", if (_subMenu)then{localize "STR_ACE_Interaction_Back"}else{""}, localize "STR_ACE_Interaction_ScrollHint"] call FUNC(showMouseHint); + ((uiNamespace getVariable QGVAR(Flow_Display)) displayCtrl (1210)) ctrlShow _subMenu; +}else{ // Rose + if (!isNull(uiNamespace getVariable QGVAR(Flow_Display))) then { + (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; + call FUNC(hideMouseHint); + }; + if (!_subMenu || {isNull (findDisplay 1713999)}) then { + (findDisplay 1713999) closeDisplay 1; + + (findDisplay 46) createDisplay QGVAR(Dialog); + // Add eventhandlers + (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE( _this call EFUNC(common,onKeyDown) )]; + (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE( _this call EFUNC(common,onKeyUp) )]; + + (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE( _this call FUNC(menuKeyInput) )]; + }; + disableSerialization; + _dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog); + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3; + if (profileNamespace getVariable [QGVAR(AutoCenterCursor), true]) then {setMousePosition [0.5, 0.5]}; + if !(_subMenu) then { + _ctrlInteractionDialog ctrlSetText ([_target] call EFUNC(common,getName)); + } else { + _ctrlInteractionDialog ctrlSetText localize "STR_ACE_Interaction_Back"; + }; + + _buttons = GVAR(Buttons); + _count = count _buttons; + + for "_i" from 0 to 9 do { + _ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _i); + _ctrlInteractionDialog ctrlShow true; + + _ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _i); + _ctrlInteractionDialogShortcut = _dlgInteractionDialog displayCtrl (30 + _i); + //_ctrlInteractionDialogBackground = _dlgInteractionDialog displayCtrl (40 + _i); + if (_i < _count) then { + _action = _buttons select _i; + _ctrlInteractionDialog ctrlSetText (_action select 0); + _ctrlInteractionDialog ctrlEnable ([_target, _player] call (_action select 2)); + _ctrlInteractionDialog ctrlSetTooltip (_action select 6); + + _ctrlInteractionDialogIcon ctrlSetText (_action select 5); + _ctrlInteractionDialogShortcut ctrlSetText (_action select 10); + //_ctrlInteractionDialogBackground ctrlShow true; + + GVAR(Shortcuts) set [_i, [_action select 10] call EFUNC(common,letterToCode)]; + } else { + _ctrlInteractionDialog ctrlSetText ""; + _ctrlInteractionDialog ctrlEnable false; + _ctrlInteractionDialog ctrlSetTooltip ""; + + _ctrlInteractionDialogIcon ctrlSetText ""; + _ctrlInteractionDialogShortcut ctrlSetText ""; + //_ctrlInteractionDialogBackground ctrlShow false; + }; + }; + + // Update Buttons + terminate (missionNamespace getVariable [QGVAR(updateMenuHandle), scriptNull]); + + GVAR(updateMenuHandle) = 0 spawn { + disableSerialization; + _dlgMenu = uiNamespace getVariable [QGVAR(Dialog), displayNull]; + _ctrlTooltip = _dlgMenu displayCtrl 40; + + _player = ACE_player; + _vehicle = vehicle _player; + _target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); + + waitUntil { + if !([_target, 5] call GVAR(isInRange)) exitWith { + (findDisplay 1713999) closeDisplay 1 + }; + + GVAR(Tooltips) = [[], [], [], [], [], [], [], [], [], []]; + { + _ctrlText = _dlgMenu displayCtrl (10 + _forEachIndex); + _ctrlIcon = _dlgMenu displayCtrl (20 + _forEachIndex); + + _condition = _x select 2; + _conditionShow = _x select 7; + _distance = _x select 9; + + GVAR(CurrentTooltip) = []; + + _enable = (_distance == 0 || {[_target, _distance] call GVAR(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}; + if (isNil "_enable") then {_enable = false}; + + GVAR(Tooltips) set [_forEachIndex, GVAR(CurrentTooltip)]; + + // apply conditional tooltips + /*if (_forEachIndex == call ACE_Interaction_fnc_getSelectedButton) then { + _tooltip = _x select 6; + + _showTooltip = _tooltip != ""; + + _tooltip = text _tooltip; + + { + _showTooltip = true; + _tooltip = composeText [_tooltip, lineBreak, _x]; + } forEach (GVAR(Tooltips) select _forEachIndex); + + _ctrlTooltip ctrlSetStructuredText _tooltip; + _ctrlTooltip ctrlShow _showTooltip; + };*/ + + _ctrlText ctrlEnable _enable; + _ctrlIcon ctrlEnable _enable; + } forEach GVAR(Buttons); + + sleep 0.5; + isNull (findDisplay 1713999) + }; + }; +}; diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf new file mode 100644 index 0000000000..24b5793d6f --- /dev/null +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -0,0 +1,50 @@ +/* + * Author: commy2 + * + * Check if the vehicle is in range of the player. + * + * Argument: + * 0: Vehicke (Object) + * 1: Distance in meters (Number) + * + * Return value: + * (Bool) + */ +#include "script_component.hpp" + +private ["_vehicle", "_distance", "_player"]; + +_vehicle = _this select 0; +_distance = _this select 1; + +_player = ACE_player; + +if (_vehicle isKindOf "Man") exitWith {_player distance _vehicle < _distance}; + +private ["_position0", "_position1"];//, "_direction"]; + +_position0 = getPosASL _player; +_position1 = getPosASL _vehicle; + +/* +_direction = _position1 vectorDiff _position0; +_direction = _direction vectorMultiply (_distance / (vectorMagnitude _direction)); + +_position0 = eyePos _player; +_position1 = _position0 vectorAdd _direction; + +_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance} +*/ + +_position0 = ATLToASL positionCameraToWorld [0, 0, 0]; +_position0 set [2, (_position0 select 2) - (getTerrainHeightASL _position0 min 0)]; + +_position1 = ATLToASL positionCameraToWorld [0, 0, _distance]; +_position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)]; + +if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then { + true +} else { + ["Not in Range"] call FUNC(addToTooltip); + false +} diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf new file mode 100644 index 0000000000..d0aeccc3ad --- /dev/null +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -0,0 +1,21 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_team", "_message"]; + +_unit = _this select 0; +_team = _this select 1; + +_unit setVariable [QGVAR(assignedFireTeam), _team, true]; +[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); + +if (_unit == ACE_player) then { + _message = if (_team == "MAIN") then { + localize "STR_ACE_Interaction_LeftTeam"; + } else { + _team = localize format ["STR_ACE_Interaction_Team%1", _team]; + format [localize "STR_ACE_Interaction_JoinedTeam", _team]; + }; + + [_message] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/interaction/functions/fnc_menuKeyInput.sqf b/addons/interaction/functions/fnc_menuKeyInput.sqf new file mode 100644 index 0000000000..2390d6be14 --- /dev/null +++ b/addons/interaction/functions/fnc_menuKeyInput.sqf @@ -0,0 +1,17 @@ +// by commy2 +#include "script_component.hpp" + +private "_key"; + +_key = _this select 1; + +if (_key in [28, 57, 156, 200, 208, 203, 205, 201, 209]) exitWith {true}; + +_index = GVAR(Shortcuts) find _key; + +if (_index != -1 && {ctrlEnabled (findDisplay 1713999 displayCtrl (_index + 10))}) exitWith { + _index call FUNC(onClick); + true +}; + +false diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf new file mode 100644 index 0000000000..78fd6e2acc --- /dev/null +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -0,0 +1,21 @@ +/* + * Author: bux578 + * + * Initializes the Interaction module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(EnableTeamManagement), "EnableTeamManagement"] call EFUNC(common,readBooleanParameterFromModule); + +diag_log text "[ACE]: Interaction Module Initialized."; diff --git a/addons/interaction/functions/fnc_onButtonDown.sqf b/addons/interaction/functions/fnc_onButtonDown.sqf new file mode 100644 index 0000000000..27b46380e0 --- /dev/null +++ b/addons/interaction/functions/fnc_onButtonDown.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "script_component.hpp" + +if (dialog) exitWith { + closeDialog 0; +}; + +if (isNull (findDisplay 1713999)) then { + if (ACE_player == vehicle ACE_player) then {"" call FUNC(openMenu)} else {[ACE_player, vehicle ACE_player] call FUNC(openMenuSelectUI)}; + setMousePosition [0.5, 0.5]; +} else { + (findDisplay 1713999) closeDisplay 1; +}; + +[_player, "interactionMenuOpened", [_player, GVAR(Target), 0]] call EFUNC(common,callCustomEventHandlers); diff --git a/addons/interaction/functions/fnc_onButtonDownSelf.sqf b/addons/interaction/functions/fnc_onButtonDownSelf.sqf new file mode 100644 index 0000000000..53f57827e9 --- /dev/null +++ b/addons/interaction/functions/fnc_onButtonDownSelf.sqf @@ -0,0 +1,15 @@ +// by commy2 +#include "script_component.hpp" + +if (dialog) exitWith { + closeDialog 0; +}; + +if (isNull (findDisplay 1713999)) then { + "" call FUNC(openMenuSelf); + setMousePosition [0.5, 0.5]; +} else { + (findDisplay 1713999) closeDisplay 1; +}; + +[_player, "interactionMenuOpened", [_player, GVAR(Target), 1]] call EFUNC(common,callCustomEventHandlers); diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf new file mode 100644 index 0000000000..44c4e340f0 --- /dev/null +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -0,0 +1,32 @@ +// by commy2 +#include "script_component.hpp" + +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; + +_player = ACE_player; +_vehicle = vehicle _player; +_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); + +_count = count GVAR(Buttons); +_index = call FUNC(getSelectedButton); + +_action = if (_index != -1 && {_index < _count}) then { + GVAR(Buttons) select _index +} else { + ["", {}, {false}, 0, [], "", "", {false}, [], 0] +}; + +(findDisplay 1713999) closeDisplay 1; +closeDialog 0; + + + +_statement = _action select 1; +_condition = _action select 2; +_conditionShow = _action select 7; +_exceptions = _action select 8;// +_distance = _action select 9; + +if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; +}; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf new file mode 100644 index 0000000000..68047a5fba --- /dev/null +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -0,0 +1,44 @@ +// by commy2 +#include "script_component.hpp" +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; + +_player = ACE_player; +_vehicle = vehicle _player; +_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1); + +_count = count GVAR(Buttons); +_index = _this; + +_action = if (_index != -1 && {_index < _count}) then { + GVAR(Buttons) select _index +} else { + ["", {}, {false}, 0, [], "", "", {false}, [], 0] +}; + +_subMenu = _action select 4; + +// back +if (_index == -1) exitWith { + call FUNC(MainButton); +}; + +if (count _subMenu < 2) then { + (findDisplay 1713999) closeDisplay 1; + closeDialog 0; + + _statement = _action select 1; + _condition = _action select 2; + _conditionShow = _action select 7; + _exceptions = _action select 8;// + _distance = _action select 9; + + if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { + [_target, _player] call _statement; + }; +} else { + if (_subMenu select 1 < 1) then { + [_subMenu select 0] call FUNC(openSubMenu); + } else { + [_subMenu select 0] call FUNC(openSubMenuSelf); + }; +}; diff --git a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf new file mode 100644 index 0000000000..25d307a2eb --- /dev/null +++ b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf @@ -0,0 +1,4 @@ +// by CorruptedHeart, commy2 +#include "script_component.hpp" + +call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf new file mode 100644 index 0000000000..d8cd8b0693 --- /dev/null +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -0,0 +1,57 @@ +// by commy2 +#include "script_component.hpp" + +private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; + +_info = [2] call FUNC(getDoor); + +_house = _info select 0; +_door = _info select 1; + +if (isNull _house) exitWith {}; + +_animations = [_house, _door] call FUNC(getDoorAnimations); + +_lockedVariable = _animations select 1; +_animations = _animations select 0; + +if (count _animations == 0) exitWith {}; + +if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { + _lockedVariable set [0, _house]; + _lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf"; +}; + +GVAR(isOpeningDoor) = true; +playSound "ACE_Sound_Click"; + +[_house, _animations] spawn { + _house = _this select 0; + _animations = _this select 1; + + _phase = _house animationPhase (_animations select 0); + _position = getPosASL ACE_player; + + _time = time + 0.2; + _usedMouseWheel = false; + waitUntil { + if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { + _usedMouseWheel = true; + }; + + _phase = _phase + (inputAction "PrevAction" / 12) min 1; + _phase = _phase - (inputAction "NextAction" / 12) max 0; + + {_house animate [_x, _phase]} forEach _animations; + + !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} + }; + + if (!_usedMouseWheel && {time < _time}) then { + _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); + + {_house animate [_x, _phase]} forEach _animations; + }; + + GVAR(isOpeningDoor) = false; +}; diff --git a/addons/interaction/functions/fnc_openMenu.sqf b/addons/interaction/functions/fnc_openMenu.sqf new file mode 100644 index 0000000000..7785f2e4a4 --- /dev/null +++ b/addons/interaction/functions/fnc_openMenu.sqf @@ -0,0 +1,7 @@ +// by commy2 +#include "script_component.hpp" + +private "_target"; +_target = [cursorTarget, GVAR(Target)] select (_this == "Default"); + +[0, _target, ""] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf new file mode 100644 index 0000000000..a13fa6a9f0 --- /dev/null +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -0,0 +1,44 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_vehicle", "_cargo"]; + +_unit = _this select 0; +_vehicle = _this select 1; + +// allow interaction with all cargo slots and all ffv slots +_cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew); + +// you can only interact if you are in cargo or ffv yourself. exit otherwise +if !(_unit in _cargo) exitWith {}; + +GVAR(InteractionMenu_Crew) = _cargo; + +// prepare: add header and "OK" button to select menu +private "_actions"; +_actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu); + +// prepare: add all cargo units as options to select menu +{ + if (_x != _unit) then { + _actions = [ + _actions, + [_x] call EFUNC(common,getName), + QUOTE(PATHTOF(UI\dot_ca.paa)), + _forEachIndex + ] call FUNC(AddSelectableItem); + }; +} forEach _cargo; + +// open select menu +[ + _actions, + { + call FUNC(hideMenu); + [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); + GVAR(InteractionMenu_Crew) = nil; + }, + { + call FUNC(hideMenu); + } +] call FUNC(openSelectMenu); diff --git a/addons/interaction/functions/fnc_openMenuSelf.sqf b/addons/interaction/functions/fnc_openMenuSelf.sqf new file mode 100644 index 0000000000..9ce84f7287 --- /dev/null +++ b/addons/interaction/functions/fnc_openMenuSelf.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +[1, ACE_player, ""] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf new file mode 100644 index 0000000000..ae7d5ce21b --- /dev/null +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -0,0 +1,43 @@ +/* + Author: Garth de Wet (LH) + + Description: + Opens the select menu UI and sets up the UI + + Parameters: + 0: ARRAY - items + ARRAY + 0 = Text + 1 = statement to execute + 2 = condition before execute + 3 = showDisabled + 4 = priority + 5 = icon + 6 = extra variables. Passed to the code. + 1: Code - select action + 2: Code - Cancel Action + Returns: + Nothing + + Example: +*/ +#include "script_component.hpp" + +if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { + GVAR(SelectAccept) = _this select 1; + GVAR(SelectCancel) = _this select 2; + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [8866, lbCurSel 8866])) call GVAR(SelectAccept); )]; // accept + lbSetCurSel [8866, 0]; +}else{ + _customActions = _this select 0; + _count = count _customActions; + if (_count == 0) exitWith {}; + _customActions call FUNC(sortOptionsByPriority); + for "_i" from 0 to _count -1 do { + _action = _customActions select _i; + _action set [1, (_this select 1)]; + }; + GVAR(Buttons) = _customActions; + [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); +}; diff --git a/addons/interaction/functions/fnc_openSubMenu.sqf b/addons/interaction/functions/fnc_openSubMenu.sqf new file mode 100644 index 0000000000..cda4e76537 --- /dev/null +++ b/addons/interaction/functions/fnc_openSubMenu.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +[2, GVAR(Target), _this select 0] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_openSubMenuSelf.sqf b/addons/interaction/functions/fnc_openSubMenuSelf.sqf new file mode 100644 index 0000000000..e207603ebb --- /dev/null +++ b/addons/interaction/functions/fnc_openSubMenuSelf.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +[3, ACE_player, _this select 0] call FUNC(showMenu); diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf new file mode 100644 index 0000000000..43c9eccdf1 --- /dev/null +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -0,0 +1,35 @@ +/* + Author: Garth de Wet (LH) + + Description: + Prepares the select menu for use. + + Parameters: + 0: TEXT - Header text + 1: TEXT - Approve button text + + Returns: + ARRAY/NUMBER - container object for use with AddSelectableItem. + + Example: + ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); +*/ +#include "script_component.hpp" + +private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; +closeDialog 0; +if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) exitWith { + _header = _this select 0; + _buttonText = _this select 1; + if (isNil "_buttonText" or {_buttonText == ""}) then { + _buttonText = localize "STR_ACE_Interaction_MakeSelection"; + }; + createDialog "RscACE_SelectAnItem"; + ctrlSetText [8860, _buttonText]; + ctrlSetText [8870, _header]; + + lbClear 8866; + + 8866 +}; +[] diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf new file mode 100644 index 0000000000..f52a9d40de --- /dev/null +++ b/addons/interaction/functions/fnc_push.sqf @@ -0,0 +1,22 @@ +/* + * Author: KoffeinFlummi + * + * Pushes a boat away from the player. + * + * Arguments: + * 0: Boat (object) + * 1: Velocity (vectorlike array) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_boat = _this select 0; +_velocity = _this select 1; + +if !(local _boat) exitWith { + [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); +}; + +_boat setVelocity _velocity; diff --git a/addons/interaction/functions/fnc_removeInteraction.sqf b/addons/interaction/functions/fnc_removeInteraction.sqf new file mode 100644 index 0000000000..141773da73 --- /dev/null +++ b/addons/interaction/functions/fnc_removeInteraction.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2 + * + * Remove an ACE action from an object. Note: This function is global. + * + * Argument: + * 0: Object (Object) + * 1: ID of the action (Number) + * + * Return value: + * None. + */ +#include "script_component.hpp" + +private ["_object", "_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; + +_object = _this select 0; +_id = _this select 1; + +_actionsVar = _object getVariable [QGVAR(Interactions), [-1, [], []]]; + +_currentID = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []]; +_actions = _actions - [[]]; + +_object setVariable [QGVAR(Interactions), [_currentID, _actionIDs, _actions], true]; diff --git a/addons/interaction/functions/fnc_removeInteractionSelf.sqf b/addons/interaction/functions/fnc_removeInteractionSelf.sqf new file mode 100644 index 0000000000..fce0f6a5a0 --- /dev/null +++ b/addons/interaction/functions/fnc_removeInteractionSelf.sqf @@ -0,0 +1,35 @@ +/* + * Author: commy2 + * + * Remove an ACE self action from the player. + * + * Argument: + * 0: ID of the action (Number) + * + * Return value: + * None. + */ +#include "script_component.hpp" + +private ["_id", "_actionsVar", "_currentID", "_actionIDs", "_actions"]; + + +_id = _this select 0; + +_actionsVar = ACE_player getVariable [QGVAR(InteractionsSelf), [-1, [], []]]; + +_currentID = _actionsVar select 0; +_actionIDs = _actionsVar select 1; +_actions = _actionsVar select 2; + +_id = _actionIDs find _id; + +if (_id == -1) exitWith {}; + +_actionIDs set [_id, -1]; +_actionIDs = _actionIDs - [-1]; + +_actions set [_id, []]; +_actions = _actions - [[]]; + +ACE_player setVariable [QGVAR(InteractionsSelf), [_currentID, _actionIDs, _actions], false]; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf new file mode 100644 index 0000000000..7a9b9b4bc0 --- /dev/null +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "script_component.hpp" + +0 spawn { + waitUntil {player getVariable ["ACE_Name", ""] != ""}; + + _name = player getVariable ["ACE_Name", ""]; + _name = toArray _name; + + _index = _name find (toArray "]" select 0); + + if (_index != -1) then { + for "_index" from 0 to _index do { + _name set [_index, -1]; + }; + _name = _name - [-1]; + _name = toString _name; + player setVariable ["ACE_Name", _name, true]; + }; +}; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf new file mode 100644 index 0000000000..5cd6a9d43a --- /dev/null +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -0,0 +1,36 @@ +/* + * Author: KoffeinFlummi + * + * Sends a civilian crowd away (chance of failure). + * + * Arguments: + * 0: Unit to be sent away (Object) + * + * Return value: + * none +*/ +#include "script_component.hpp" + +#define DISTANCE 50 +#define RADIUS 10 + +private ["_unit", "_chance", "_x"]; + +_unit = _this select 0; + +ACE_player playActionNow "GestureGo"; + +if (count weapons ACE_player > 0) then { + _chance = 0.8; +} else { + _chance = 0.5; +}; + +{ + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + (_this select 0) setUnitPos "AUTO"; + (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; + }, [_x, ACE_player]] call CBA_fnc_globalExecute; + }; +} foreach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_setCaptivityStatus.sqf b/addons/interaction/functions/fnc_setCaptivityStatus.sqf new file mode 100644 index 0000000000..fc6c618590 --- /dev/null +++ b/addons/interaction/functions/fnc_setCaptivityStatus.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +_this call EFUNC(common,setCaptivityStatus); diff --git a/addons/interaction/functions/fnc_showMenu.sqf b/addons/interaction/functions/fnc_showMenu.sqf new file mode 100644 index 0000000000..b567a22ea4 --- /dev/null +++ b/addons/interaction/functions/fnc_showMenu.sqf @@ -0,0 +1,118 @@ +/* + Author: + commy2 + Garth de Wet (LH) + aeroson + + Description: + + Parameters: + 0: NUMBER - Menu type (0 - interaction, 1 - self-interaction, 2 - sub-interaction, 3 - sub-self-interaction) + 1: OBJECT - Target object + 2: STRING - Sub-Menu ClassName + + Returns: + Nothing + + Example: + [0, GVAR(Target)] call FUNC(showMenu); + [1, player] call FUNC(showMenu); + [2, GVAR(Target), "ACE_Explosives"] call FUNC(showMenu); + [3, player, "ACE_Explosives"] call FUNC(showMenu); +*/ +#include "script_component.hpp" + +private ["_player", "_vehicle", "_mainButtonAction", "_object", "_index", "_actions", "_result", "_menuType"]; +#define DEFAULT_ICON QUOTE(PATHOF(UI\dot_ca.paa)) +#define DEFAULT_DISTANCE 4 // seems to be 4 +_player = ACE_player; +_vehicle = vehicle _player; + +GVAR(MenuType) = _this select 0; // 0 Interaction, 1 Self Interaction + +_mainButtonAction = [ + {call FUNC(hideMenu)}, + {call FUNC(hideMenu)}, + {"Default" call FUNC(openMenu)}, + {"Default" call FUNC(openMenuSelf)} +] select GVAR(MenuType); + +_menuType = GVAR(MenuType) % 2; +uiNamespace setVariable [QGVAR(CursorPosition), [controlNull, 0.5, 0.5, -1]]; + +GVAR(Target) = _this select 1; +_object = GVAR(Target); + +if (_menuType == 0 && {(isNull (_object) || {!([_object, 4] call FUNC(isInRange))})}) exitWith {}; +if !([_player, _object] call EFUNC(common,canInteractWith)) exitWith {}; + +// add actions or self actions of GVAR(Target) +_parents = [configFile >> "CfgVehicles" >> typeOf _object, true] call BIS_fnc_returnParents; +_result = [_object, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions); +_actions = ([_object, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0); + +// add self actions of vehicle _player +if (_menuType == 1 && {_player != _vehicle}) then { + _parents = [configFile >> "CfgVehicles" >> typeOf _vehicle, true] call BIS_fnc_returnParents; + _result = [_vehicle, _parents, [], [], missionConfigFile >> "CfgVehicles", true, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions); + _actions = _actions + (([_vehicle, _parents, _result select 0, _result select 1,configFile >> "CfgVehicles", false, ["ACE_Actions", "ACE_SelfActions"] select _menuType, _this select 2] call FUNC(GetActions) select 0)); +}; + +// custom defined actions, stored in variable instead of cfg like above +if (GVAR(MenuType) < 2) then { + + private ["_customActions", "_customAction", "_displayName", "_distance","_condition","_statement","_showDisabled", "_priority"]; + + // add interactions or self interactions of GVAR(Target) + _customActions = (_object getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2; + + // add self interactions of vehicle _player + if (_menuType == 1 && {_player != _vehicle}) then { + _customActions = _customActions + ((_vehicle getVariable [[QGVAR(Interactions), QGVAR(ACE_InteractionsSelf)] select _menuType, [-1, [], []]]) select 2); + }; + + if(_menuType==0) then { + + private ["_distance"]; + + for "_index" from 0 to (count _customActions - 1) do { + + _customAction = _customActions select _index; + _displayName = _customAction select 0; + _distance = _customAction select 1; + _condition = _customAction select 2; + _statement = _customAction select 3; + _showDisabled = _customAction select 4; + _priority = _customAction select 5; + + if ((_showDisabled || {[_object, _player] call _condition}) && {[_object, _distance] call FUNC(isInRange) || {_distance == 0}}) then { + _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], _distance, ""]; + }; + }; + + } else { // self interactions do not have distance + + for "_index" from 0 to (count _customActions - 1) do { + + _customAction = _customActions select _index; + _displayName = _customAction select 0; + _condition = _customAction select 1; + _statement = _customAction select 2; + _showDisabled = _customAction select 3; + _priority = _customAction select 4; + + if (_showDisabled || {[_object, _player] call _condition}) then { + _actions pushBack [_displayName, _statement, _condition, _priority, [], DEFAULT_ICON, "", {true}, [], DEFAULT_DISTANCE, ""]; + }; + }; + + }; + + +}; + +if (count _actions == 0) exitWith {}; + +_actions call FUNC(sortOptionsByPriority); +GVAR(Buttons) = _actions; +[_mainButtonAction, (_this select 2) != "", (profileNamespace getVariable [QGVAR(FlowMenu), false]), _menuType == 1, _object] call FUNC(initialiseInteraction); diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf new file mode 100644 index 0000000000..b162754b13 --- /dev/null +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -0,0 +1,54 @@ +/* + Author(s): + Garth de Wet (LH) + + Description: + Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + + Parameters: + 0: STRING - Left click text + 1: STRING - Right click text + 3: STRING - (Optional) Scroll text + + Returns: + Nothing + + Example: + ["Place Explosive", "Cancel"] call FUNC(showMouseHint); +*/ +#include "script_component.hpp" + +#define GUI_GRID_W (0.025) +#define GUI_GRID_H (0.04) +private ["_leftClick", "_rightClick", "_scroll"]; +_leftClick = _this select 0; +_rightClick = _this select 1; +_scroll = ""; +if (count _this > 2) then { + _scroll = _this select 2; +}; + +(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutRsc [QGVAR(InteractionHelper), "PLAIN",0.5, false]; +disableSerialization; +_display = uiNamespace getVariable ["ACE_Helper_Display", objNull]; +if (isNull _display) exitWith{}; + +(_display displayCtrl 1000) ctrlSetText _leftClick; +(_display displayCtrl 1001) ctrlSetText _rightClick; + +(_display displayCtrl 1000) ctrlShow (_leftClick != ""); +(_display displayCtrl 1200) ctrlShow (_leftClick != ""); +(_display displayCtrl 1001) ctrlShow (_rightClick != ""); +(_display displayCtrl 1201) ctrlShow (_rightClick != ""); + +if (_scroll == "") exitWith { + (_display displayCtrl 1002) ctrlShow false; + (_display displayCtrl 1202) ctrlShow false; + + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlCommit 0; + (_display displayCtrl 1201) ctrlCommit 0; +}; +(_display displayCtrl 1002) ctrlSetText _scroll; +showHUD false; \ No newline at end of file diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf new file mode 100644 index 0000000000..d29ebd3e5f --- /dev/null +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -0,0 +1,21 @@ +// by commy2 +#include "script_component.hpp" + +private ["_actions", "_count", "_index", "_actionN", "_actionM"]; + +_actions = _this; +_count = count _actions; +_index = 0; + +while {_index < _count - 1} do { + _actionN = + _actions select _index; + _actionM = + _actions select (_index + 1); + + if (_actionN select 3 < _actionM select 3) then { + _actions set [_index, _actionM]; + _actions set [_index + 1, _actionN]; + _index = 0; + } else { + _index = _index + 1; + }; +}; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf new file mode 100644 index 0000000000..aedf6ce37f --- /dev/null +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -0,0 +1,21 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_message"]; + +_tapper = _this select 0; +_target = _this select 1; + +if (_target != ACE_player) exitWith { + addCamShake [4, 0.5, 5]; + if !(local _target) then { + [[_tapper, _target], QUOTE(FUNC(tapShoulder)), _target] call EFUNC(execRemoteFnc); + }; +}; + +addCamShake [4, 0.5, 5]; + +//_message = format ["%1 tapped you on your shoulder.", [_unit] call EFUNC(common,getName)]; +_message = localize "STR_ACE_Interaction_YouWereTapped"; + +[_message] call EFUNC(common,displayTextStructured); diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf new file mode 100644 index 0000000000..c4b2a6e102 --- /dev/null +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "script_component.hpp" + +disableSerialization; +_ctrl = ctrlParent (_this select 0) displayCtrl 40; + +_ctrl ctrlSetPosition [ + (_this select 1) + 0.01 * safezoneW, + (_this select 2) + 0.01 * safezoneH, + 2.0 / 16 * safezoneW, + 0.3 / 9 * safezoneH +]; +_ctrl ctrlCommit 0; diff --git a/addons/interaction/functions/script_component.hpp b/addons/interaction/functions/script_component.hpp new file mode 100644 index 0000000000..ef1c22f146 --- /dev/null +++ b/addons/interaction/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\interaction\script_component.hpp" \ No newline at end of file diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp new file mode 100644 index 0000000000..07fcac5740 --- /dev/null +++ b/addons/interaction/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT interaction +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_INTERACTION + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_INTERACTION + #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 47670ccf75..e58e808687 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,8 +1,8 @@  - + - + Interaction Menu InteraktionsmenĂ¼ MenĂº de interacciĂ³n @@ -14,7 +14,7 @@ Menu de InteraĂ§Ă£o MenĂ¹ Interattivo - + Interaction Menu (Self) InteraktionsmenĂ¼ (Selbst) MenĂº de interacciĂ³n (Propia) @@ -26,7 +26,7 @@ Menu de InteraĂ§Ă£o (Individual) MenĂ¹ Interattivo (Individuale) - + Open / Close Door TĂ¼r öffnen / schlieĂŸen Abrir / Cerrar puerta @@ -38,7 +38,7 @@ Abrir / Fechar Porta Apri / Chiudi la porta - + Lock Door TĂ¼r sperren Bloquear puerta @@ -50,7 +50,7 @@ Zablokuj drzwi Zamknout dveÅ™e - + Unlock Door TĂ¼r entsperren Desbloquear puerta @@ -62,7 +62,7 @@ Odblokuj drzwi Odemknout dveÅ™e - + Locked Door TĂ¼r gesperrt Puerta bloqueada @@ -74,7 +74,7 @@ Zablokowano drzwi ZamÄenĂ© dveÅ™e - + Unlocked Door TĂ¼r entsperrt Puerta desbloqueada @@ -86,7 +86,7 @@ Odblokowano drzwi OdemÄenĂ© dveÅ™e - + Join group Gruppe beitreten Unirse al grupo @@ -98,7 +98,7 @@ Unir-se ao grupo Unisciti alla squadra - + Leave Group Gruppe verlassen Dejar grupo @@ -110,7 +110,7 @@ Deixar grupo Lascia la squadra - + Become Leader Grp.-fĂ¼hrung Ă¼bern. Asumir el liderazgo @@ -122,7 +122,7 @@ Tornar-se LĂ­der Prendi il comando - + DANCE! TANZEN! BAILAR! @@ -134,7 +134,7 @@ DANCE! Balla! - + Stop Dancing Tanzen abbrechen Dejar de bailar @@ -146,7 +146,7 @@ Parar de dançar Smetti di ballare - + << Back << ZurĂ¼ck << AtrĂ¡s @@ -158,7 +158,7 @@ << Voltar << Indietro - + Gestures >> Gesten >> Gestos >> @@ -170,7 +170,7 @@ Gestos >> Segnali gestuali >> - + Attack Angreifen Atacar @@ -182,7 +182,7 @@ Atacar Attaccare - + Advance Vordringen Avanzar @@ -194,7 +194,7 @@ Avançar Avanzare - + Go Los Adelante @@ -206,7 +206,7 @@ Mover-se Muoversi - + Follow Folgen Seguirme @@ -218,7 +218,7 @@ Seguir Seguire - + Point Zeigen Señalar @@ -230,7 +230,7 @@ Apontar Puntare a - + Up Aufstehen Arriba @@ -242,7 +242,7 @@ Acima Alzarsi - + Cover Deckung Cubrirse @@ -254,7 +254,7 @@ Proteger-se Copertura - + Cease Fire Feuer einstellen Alto el fuego @@ -266,7 +266,7 @@ Cessar Fogo Cessare il Fuoco - + Freeze Keine Bewegung Alto @@ -278,7 +278,7 @@ Alto Fermi - + Hi Hallo Hola @@ -290,7 +290,7 @@ OlĂ¡ Ciao - + Yes Ja Si @@ -302,7 +302,7 @@ Sim Si - + No Nein No @@ -314,7 +314,7 @@ NĂ£o No - + Put weapon on back Waffe wegstecken Arma a la espalda @@ -326,7 +326,7 @@ Colocar arma nas costas Metti l'arma in spalla - + Tap Shoulder Auf Schulter klopfen Tocar el hombro @@ -338,7 +338,7 @@ Tocar ombro Dai un colpetto - + You were tapped on the shoulder. Dir wurde auf die Schulter geklopft Te tocaron el hombro. @@ -350,7 +350,7 @@ VocĂª foi tocado no ombro. Ti è stato dato un colpetto sulla spalla - + Cancel Abbrechen Cancelar @@ -362,7 +362,7 @@ Cancelar MĂ©gse - + Select Wählen Seleccionar @@ -374,7 +374,7 @@ Selecionar KivĂ¡laszt - + Go Away! Geh Weg! AlĂ©jate! @@ -386,7 +386,7 @@ VĂ¡ Embora! Via di qui! - + Get Down! Auf Den Boden! Al suelo! @@ -398,7 +398,7 @@ Abaixe-se! A Terra! - + Team Management >> Team Management >> GestiĂ³n de equipo >> @@ -410,7 +410,7 @@ Organizzazione Squadra >> Csapat kezelĂ©s >> - + Red Rot Rojo @@ -422,7 +422,7 @@ Rosso Piros - + Green GrĂ¼n Verde @@ -434,7 +434,7 @@ Verde Zöld - + Blue Blau Azul @@ -446,7 +446,7 @@ Blu KĂ©k - + Yellow Gelb Amarillo @@ -458,7 +458,7 @@ Giallo SĂ¡rga - + Join Team Red Team Rot beitreten Unirse al equipo rojo @@ -470,7 +470,7 @@ Entra nella Squadra Rossa CsatlakozĂ¡s a piros csapathoz - + Join Team Green Team GrĂ¼n beitreten Unirse al equipo verde @@ -482,7 +482,7 @@ Entra nella Squadra Verde CsatlakozĂ¡s a zöld csapathoz - + Join Team Blue Team Blau beitreten Unirse al equipo azul @@ -494,7 +494,7 @@ Entra nella Squadra Blu CsatlakozĂ¡s a kĂ©k csapathoz - + Join Team Yellow Team Gelb beitreten Unirse al equipo amarillo @@ -506,7 +506,7 @@ Entra nella Squadra Gialla CsatlakozĂ¡s a sĂ¡rga csapathoz - + You joined Team %1 Du bist Team %1 beigetreten Te has unido al equipo %1 @@ -518,7 +518,7 @@ Sei entrato nella Squadra %1 CsatlakoztĂ¡l a %1 csapathoz - + Leave Team Team verlassen Dejar equipo @@ -530,7 +530,7 @@ Lascia la Squadra Csapat elhagyĂ¡sa - + You left the Team Du hast das Team verlassen Has dejado el equipo @@ -542,7 +542,7 @@ Hai lasciato la squadra Elhagytad a csapatot - + Pardon Begnadigen Perdonar @@ -554,7 +554,7 @@ Perdona MegbocsĂ¡tĂ¡s - + Flow Menu MausradmenĂ¼ Flow Menu @@ -566,7 +566,7 @@ MenĂ¹ a Scorrimento LegördĂ¼lÅ‘ menĂ¼ - + Scroll Scrollen PrzewiÅ„ @@ -578,7 +578,7 @@ GörgetĂ©s OtĂ¡ÄenĂ­ - + Modifier Key Modifikator Modyfikator @@ -590,7 +590,7 @@ MĂ³dosĂ­tĂ³ billentyű ModifikĂ¡tor - + Not in Range AuĂŸer Reichweite Hors de portĂ©e. @@ -601,7 +601,7 @@ Poza zasiÄ™giem Mimo dosah - + Close Menu on Key Release MenĂ¼ nach Loslassen schlieĂŸen Zamknij menu automatycznie @@ -611,7 +611,7 @@ Đ—Đ°ĐºÑ€Ñ‹Đ²Đ°Ñ‚ÑŒ Đ¼ĐµĐ½Ñ Đ¿Ñ€Đ¸ Đ¾Ñ‚Đ¶Đ°Ñ‚Đ¸Đ¸ ĐºĐ»Đ°Đ²Đ¸ÑˆĐ¸ Menu interakce (Na drženĂ­) - + Auto Center Cursor Mauszeiger automatisch zentrieren Auto-centrar cursor @@ -620,7 +620,7 @@ EgĂ©r auto-centrĂ­rozĂ¡sa ĐĐ²Ñ‚Đ¾Ñ†ĐµĐ½Ñ‚Ñ€Đ¸Ñ€Đ¾Đ²Đ°Đ½Đ¸Đµ ĐºÑƒÑ€ÑĐ¾Ñ€Đ° - + Equipment >> AusrĂ¼stung >> Equipamiento >> @@ -630,7 +630,7 @@ FelszerelĂ©s >> Đ¡Đ½Đ°Ñ€ÑĐ¶ĐµĐ½Đ¸Đµ >> - + Push Schieben Empujar @@ -640,7 +640,7 @@ TolĂ¡s Đ¢Đ¾Đ»ĐºĐ°Ñ‚ÑŒ - + Interact Interagiere Interakce diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index ee1b9f1996..6fec248637 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "uo_main", "a3_ui_f" }; + requiredAddons[] = { "ace_common" }; version = VERSION; }; }; diff --git a/addons/laser/fnc_checkLos.sqf b/addons/laser/functions/fnc_checkLos.sqf similarity index 100% rename from addons/laser/fnc_checkLos.sqf rename to addons/laser/functions/fnc_checkLos.sqf diff --git a/addons/laser/fnc_findLaserDesignator.sqf b/addons/laser/functions/fnc_findLaserDesignator.sqf similarity index 100% rename from addons/laser/fnc_findLaserDesignator.sqf rename to addons/laser/functions/fnc_findLaserDesignator.sqf diff --git a/addons/laser/fnc_findStrongestRay.sqf b/addons/laser/functions/fnc_findStrongestRay.sqf similarity index 100% rename from addons/laser/fnc_findStrongestRay.sqf rename to addons/laser/functions/fnc_findStrongestRay.sqf diff --git a/addons/laser/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf similarity index 100% rename from addons/laser/fnc_laserTargetPFH.sqf rename to addons/laser/functions/fnc_laserTargetPFH.sqf diff --git a/addons/laser/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf similarity index 100% rename from addons/laser/fnc_laser_init.sqf rename to addons/laser/functions/fnc_laser_init.sqf diff --git a/addons/laser/fnc_rotateVectLine.sqf b/addons/laser/functions/fnc_rotateVectLine.sqf similarity index 100% rename from addons/laser/fnc_rotateVectLine.sqf rename to addons/laser/functions/fnc_rotateVectLine.sqf diff --git a/addons/laser/fnc_rotateVectLineGetMap.sqf b/addons/laser/functions/fnc_rotateVectLineGetMap.sqf similarity index 100% rename from addons/laser/fnc_rotateVectLineGetMap.sqf rename to addons/laser/functions/fnc_rotateVectLineGetMap.sqf diff --git a/addons/laser/fnc_shootCone.sqf b/addons/laser/functions/fnc_shootCone.sqf similarity index 100% rename from addons/laser/fnc_shootCone.sqf rename to addons/laser/functions/fnc_shootCone.sqf diff --git a/addons/laser/fnc_shootRay.sqf b/addons/laser/functions/fnc_shootRay.sqf similarity index 100% rename from addons/laser/fnc_shootRay.sqf rename to addons/laser/functions/fnc_shootRay.sqf diff --git a/addons/laser/fnc_translateToModelSpace.sqf b/addons/laser/functions/fnc_translateToModelSpace.sqf similarity index 100% rename from addons/laser/fnc_translateToModelSpace.sqf rename to addons/laser/functions/fnc_translateToModelSpace.sqf diff --git a/addons/laser/fnc_translateToWeaponSpace.sqf b/addons/laser/functions/fnc_translateToWeaponSpace.sqf similarity index 100% rename from addons/laser/fnc_translateToWeaponSpace.sqf rename to addons/laser/functions/fnc_translateToWeaponSpace.sqf diff --git a/addons/laser/functions/script_component.hpp b/addons/laser/functions/script_component.hpp new file mode 100644 index 0000000000..98d00342c0 --- /dev/null +++ b/addons/laser/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\laser\script_component.hpp" \ No newline at end of file diff --git a/addons/main/config.cpp b/addons/main/config.cpp index 0bad03d89c..3b8c600e22 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -1,11 +1,12 @@ #include "script_component.hpp" + class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { - "a3_air_f", + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "a3_air_f", "a3_air_f_beta", "a3_air_f_beta_heli_attack_01", "a3_air_f_beta_heli_attack_02", @@ -491,48 +492,48 @@ class CfgPatches { "a3_weapons_f_vests", "a3data", "extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3" - }; - author[] = {"ACE Team"}; - authorUrl = ""; - versionDesc = "A.C.E."; - versionAct = "['MAIN',_this] execVM '\z\ace\addons\main\about.sqf';"; - VERSION_CONFIG; - }; + }; + author[] = {"ACE Team"}; + authorUrl = ""; + versionDesc = "A.C.E."; + versionAct = "['MAIN',_this] execVM '\z\ace\addons\main\about.sqf';"; + VERSION_CONFIG; + }; }; class CfgMods { - class PREFIX { - dir = "@ACE"; - name = "Core - Advanced Combat Environment"; - picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; - hidePicture = "true"; - hideName = "true"; - actionName = "Website"; - action = "http://ace.dev-heaven.net"; - description = "Bugtracker: "; - }; + class PREFIX { + dir = "@ACE"; + name = "Core - Advanced Combat Environment"; + picture = "A3\Ui_f\data\Logos\arma3_expansion_alpha_ca"; + hidePicture = "true"; + hideName = "true"; + actionName = "Website"; + action = "http://ace.dev-heaven.net"; + description = "Bugtracker: "; + }; }; class CfgSettings { - class CBA { - class Versioning { - class PREFIX { - level = DEFAULT_VERSIONING_LEVEL; - handler = "ace_common_fnc_mismatch"; - class Dependencies { - CBA[]={"cba_main", {1,0,0}, "true"}; - XEH[]={"cba_xeh", {1,0,0}, "true"}; - }; - }; - }; + class CBA { + class Versioning { + class PREFIX { + level = DEFAULT_VERSIONING_LEVEL; + handler = "ace_common_fnc_mismatch"; + class Dependencies { + CBA[]={"cba_main", {1,0,0}, "true"}; + XEH[]={"cba_xeh", {1,0,0}, "true"}; + }; + }; + }; /* - class Registry { - class PREFIX { - removed[] = {}; - }; - }; + class Registry { + class PREFIX { + removed[] = {}; + }; + }; */ - }; + }; }; #include "CfgModuleCategories.hpp" diff --git a/addons/main/license.sqf b/addons/main/license.sqf new file mode 100644 index 0000000000..e97d9c51a3 --- /dev/null +++ b/addons/main/license.sqf @@ -0,0 +1,92 @@ +License (short) +=============== + +You are free: +- to Share — to copy, distribute and transmit the work + +Under the following conditions: +- Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). +- Noncommercial — You may not use this work for commercial purposes. +- No Derivative Works — You may not alter, transform, or build upon this work. + +With the understanding that: + +Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. + +Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. + +Other Rights — In no way are any of the following rights affected by the license: + - Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; + - The author's moral rights; + - Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. + +Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. + + +Full license text +================= + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + +"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. +"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. +"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership. +"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. +"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. +"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. +"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. +"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. +"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. + +2. Fair Dealing Rights. + +Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. + +3. License Grant. + +Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + +to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and, to Distribute and Publicly Perform the Work including as incorporated in Collections. +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d). + +4. Restrictions. + +The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + +You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. +You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. +If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. + +For the avoidance of doubt: + +Non-waivable Compulsory License Schemes. + +In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; +Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and, +Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b). +Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. + +5. Representations, Warranties and Disclaimer. + +UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination. + +This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. +Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). + +Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous. + +Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. +If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. +No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. +This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. +The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 3dd2b1ba92..be16f947ac 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -47,7 +47,7 @@ #define ACE_NOGRIP handAnim[] = {} #define ACE_DISTANCE_DEFAULT distanceZoomMin = 300; distanceZoomMax = 300 -#include "script_macros_optics.hpp" +// #include "script_macros_optics.hpp" //ToDo #define ACE_NOZEROING discreteDistance[] = {}; \ discreteDistanceInitIndex = 0; \ @@ -177,6 +177,10 @@ #define DGVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(GVAR(varName)) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(GVAR(varName))); }; GVAR(varName) #define DVAR(varName) if(isNil "ACE_DEBUG_NAMESPACE") then { ACE_DEBUG_NAMESPACE = []; }; if(!(QUOTE(varName) in ACE_DEBUG_NAMESPACE)) then { PUSH(ACE_DEBUG_NAMESPACE, QUOTE(varName)); }; varName #define DFUNC(var1) TRIPLES(ADDON,fnc,var1) +#define DEFUNC(var1,var2) TRIPLES(DOUBLES(PREFIX,var1),fnc,var2) + +#define QFUNC(var1) QUOTE(DFUNC(var1)) +#define QEFUNC(var1,var2) QUOTE(DEFUNC(var1,var2)) #ifdef DISABLE_COMPILE_CACHE #define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf)) diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index 33c2bfe8de..d2961604b6 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -1,7 +1,7 @@ +class Mode_SemiAuto; class CfgWeapons { class CannonCore; class LauncherCore; - class Mode_SemiAuto; class RocketPods: LauncherCore { canLock = 1; diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index 42d23c98c0..be4ccc5a22 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "uo_main", "ace__laser", "a3_ui_f" }; + requiredAddons[] = { "ace_common", "ace_laser" }; version = VERSION; }; }; diff --git a/addons/missileguidance/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf similarity index 100% rename from addons/missileguidance/fnc_fired.sqf rename to addons/missileguidance/functions/fnc_fired.sqf diff --git a/addons/missileguidance/fnc_guidance_DAGR.sqf b/addons/missileguidance/functions/fnc_guidance_DAGR.sqf similarity index 100% rename from addons/missileguidance/fnc_guidance_DAGR.sqf rename to addons/missileguidance/functions/fnc_guidance_DAGR.sqf diff --git a/addons/missileguidance/fnc_guidance_HellfireII.sqf b/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf similarity index 100% rename from addons/missileguidance/fnc_guidance_HellfireII.sqf rename to addons/missileguidance/functions/fnc_guidance_HellfireII.sqf diff --git a/addons/missileguidance/fnc_guidance_LGB.sqf b/addons/missileguidance/functions/fnc_guidance_LGB.sqf similarity index 100% rename from addons/missileguidance/fnc_guidance_LGB.sqf rename to addons/missileguidance/functions/fnc_guidance_LGB.sqf diff --git a/addons/missileguidance/fnc_rotateVectLine.sqf b/addons/missileguidance/functions/fnc_rotateVectLine.sqf similarity index 100% rename from addons/missileguidance/fnc_rotateVectLine.sqf rename to addons/missileguidance/functions/fnc_rotateVectLine.sqf diff --git a/addons/missileguidance/fnc_rotateVectLineGetMap.sqf b/addons/missileguidance/functions/fnc_rotateVectLineGetMap.sqf similarity index 100% rename from addons/missileguidance/fnc_rotateVectLineGetMap.sqf rename to addons/missileguidance/functions/fnc_rotateVectLineGetMap.sqf diff --git a/addons/missileguidance/fnc_translateToModelSpace.sqf b/addons/missileguidance/functions/fnc_translateToModelSpace.sqf similarity index 100% rename from addons/missileguidance/fnc_translateToModelSpace.sqf rename to addons/missileguidance/functions/fnc_translateToModelSpace.sqf diff --git a/addons/missileguidance/fnc_translateToWeaponSpace.sqf b/addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf similarity index 100% rename from addons/missileguidance/fnc_translateToWeaponSpace.sqf rename to addons/missileguidance/functions/fnc_translateToWeaponSpace.sqf diff --git a/addons/missileguidance/functions/script_component.hpp b/addons/missileguidance/functions/script_component.hpp new file mode 100644 index 0000000000..7046e9271d --- /dev/null +++ b/addons/missileguidance/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\missileguidance\script_component.hpp" \ No newline at end of file diff --git a/addons/ragdolls/config.cpp b/addons/ragdolls/config.cpp index dba3b10a7c..3d9198a41d 100644 --- a/addons/ragdolls/config.cpp +++ b/addons/ragdolls/config.cpp @@ -1,17 +1,15 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {ace_core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi", "Opticalsnare"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"KoffeinFlummi", "Opticalsnare"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; }; /* @@ -21,783 +19,783 @@ class CfgPatches { */ class PhysXParams { - epeImpulseDamageCoef = 1320.0; - impulseForceRagdollCoef = 200; - impulseTorqueRagdollCoef = 100; - maxRagdollImpulseForceMagnitude = 500; - maxRagdollImpulseTorqueMagnitude = 150; - ragdollHitDmgLimit = "0.01f"; - ragdollHitForceCoef = "20f"; - ragdollHitTime = "0.05f"; - ragdollOnCollideForceCoef = "20.0f"; - ragdollOnCollideMassLimit = "0.0f"; - ragdollOnCollideMaxForce = "25.0f"; - ragdollOnCollideMaxOffset = "2.0f"; - ragdollOnCollideMaxOffsetSpeed = "50.0f"; - ragdollOnCollideSpeedLimit = "2500.0f"; - ragdollOnCollideVehicleImpulseCoef = "0.5f"; - ragdollUnconsciousSleepCoef = "0f"; - ragdollUnderwaterBuoyancyCoef = 9.7; - ragdollUnderwaterResistanceCoef = 0.005; - ragdollVehicleCollision = 1; + epeImpulseDamageCoef = 1320.0; + impulseForceRagdollCoef = 200; + impulseTorqueRagdollCoef = 100; + maxRagdollImpulseForceMagnitude = 500; + maxRagdollImpulseTorqueMagnitude = 150; + ragdollHitDmgLimit = "0.01f"; + ragdollHitForceCoef = "20f"; + ragdollHitTime = "0.05f"; + ragdollOnCollideForceCoef = "20.0f"; + ragdollOnCollideMassLimit = "0.0f"; + ragdollOnCollideMaxForce = "25.0f"; + ragdollOnCollideMaxOffset = "2.0f"; + ragdollOnCollideMaxOffsetSpeed = "50.0f"; + ragdollOnCollideSpeedLimit = "2500.0f"; + ragdollOnCollideVehicleImpulseCoef = "0.5f"; + ragdollUnconsciousSleepCoef = "0f"; + ragdollUnderwaterBuoyancyCoef = 9.7; + ragdollUnderwaterResistanceCoef = 0.005; + ragdollVehicleCollision = 1; }; class RagDollDefaultLimit { - value = 0; - restitution = 0.9; - hardness = 0.5; + value = 0; + restitution = 0.9; + hardness = 0.5; }; class RagDollDefaultSpring { - enabled = 0; - value = 0.5; - damper = 1; - targetValue = 0; + enabled = 0; + value = 0.5; + damper = 1; + targetValue = 0; }; class RagDollSphericalJoint { - class TwistLimitLow : RagDollDefaultLimit {}; + class TwistLimitLow : RagDollDefaultLimit {}; - class TwistLimitHigh : RagDollDefaultLimit {}; + class TwistLimitHigh : RagDollDefaultLimit {}; - class SwingLimit : RagDollDefaultLimit {}; + class SwingLimit : RagDollDefaultLimit {}; - class TwistSpring : RagDollDefaultSpring { - enabled = 1; - }; + class TwistSpring : RagDollDefaultSpring { + enabled = 1; + }; - class SwingSpring : RagDollDefaultSpring { - enabled = 1; - damper = 2; - }; + class SwingSpring : RagDollDefaultSpring { + enabled = 1; + damper = 2; + }; - class JointSpring : RagDollDefaultSpring { - enabled = 0; - }; - type = "spherical"; - enableCollision = 0; - projectionDistance = 0.05; - projectionMode = "point"; + class JointSpring : RagDollDefaultSpring { + enabled = 0; + }; + type = "spherical"; + enableCollision = 0; + projectionDistance = 0.05; + projectionMode = "point"; }; class RagDollRevoluteJoint { - class LimitLow : RagDollDefaultLimit {}; + class LimitLow : RagDollDefaultLimit {}; - class LimitHigh : RagDollDefaultLimit {}; + class LimitHigh : RagDollDefaultLimit {}; - class Spring : RagDollDefaultSpring { - enabled = 0; - }; - type = "revolute"; - enableCollision = 0; - projectionDistance = 0.05; - projectionMode = "point"; + class Spring : RagDollDefaultSpring { + enabled = 0; + }; + type = "revolute"; + enableCollision = 0; + projectionDistance = 0.05; + projectionMode = "point"; }; class RagDollD6Joint_PX3 { - type = "D6"; - enableCollision = 0; - projectionDistance = 0.05; - projectionMode = "point"; - swingLimitY = "0.0f"; - swingLimitZ = "0.0f"; - swingSpring = "0.0f"; - swingDamping = "0.0f"; - swingRestitution = "0.6f"; - swingContactDistance = "0.05f"; - twistLimitLower = "0.0f"; - twistLimitUpper = "0.0f"; - twistSpring = "0.0f"; - twistDamping = "0.0f"; - twistRestitution = "0.6f"; - twistContactDistance = "0.05f"; - driveSpring = "20.0f"; - driveDamping = "20.0f"; - driveMaxForce = "1000000.0f"; - driveUseAcceleration = 1; - driveLinearVelocity[] = {0, 0, 0}; - driveAngularVelocity[] = {0, 0, 0}; + type = "D6"; + enableCollision = 0; + projectionDistance = 0.05; + projectionMode = "point"; + swingLimitY = "0.0f"; + swingLimitZ = "0.0f"; + swingSpring = "0.0f"; + swingDamping = "0.0f"; + swingRestitution = "0.6f"; + swingContactDistance = "0.05f"; + twistLimitLower = "0.0f"; + twistLimitUpper = "0.0f"; + twistSpring = "0.0f"; + twistDamping = "0.0f"; + twistRestitution = "0.6f"; + twistContactDistance = "0.05f"; + driveSpring = "20.0f"; + driveDamping = "20.0f"; + driveMaxForce = "1000000.0f"; + driveUseAcceleration = 1; + driveLinearVelocity[] = {0, 0, 0}; + driveAngularVelocity[] = {0, 0, 0}; }; class CfgRagDollSkeletons { - class BaseRagdoll { - primaryWeaponBone = ""; - secondaryWeaponBone = ""; - networkBonePrimary = ""; - networkBoneSecondary = ""; - weaponSleepLinearVelocity = 20; - weaponSleepAngularVelocity = 20; - weaponDropMinTime = 1.0; - weaponDropMaxTime = 100.0; - weaponDistanceLimit = "10f"; - weaponDistanceLimitTime = "5.0f"; - sleepLinearVelocity = 0.05; - sleepAngularVelocity = 0.05; - simulateMinTime = 30; - simulateMaxTime = 100.0; - simulateDistanceLimit = "0.05f"; - simulateDistanceLimitTime = "5.0f"; - recoveryBlendTime = "0.5f"; - recoveryCosLimit = "0.3f"; - recoveryDistLimit = "0.7f"; - animBlendTime = "0.0f"; - }; - - class Soldier : BaseRagdoll { - primaryWeaponBone = "weapon"; - secondaryWeaponBone = "launcher"; - networkBonePrimary = "chest"; - networkBoneSecondary = "pelvis"; - draggingMask = "dragging"; - hitMask = "hit"; - hitMaskUnderwater = "hitUnderwater"; - - class WeaponLinkBones { - class LinkBone1 { - bone = "leftHand"; - canBeDropped = 1; - prefference = "1.0f"; - }; - - class LinkBone2 { - bone = "rightHand"; - canBeDropped = 1; - prefference = "2.0f"; - }; - - class LinkBone3 { - bone = "chest"; - canBeDropped = 1; - prefference = "1.0f"; - }; + class BaseRagdoll { + primaryWeaponBone = ""; + secondaryWeaponBone = ""; + networkBonePrimary = ""; + networkBoneSecondary = ""; + weaponSleepLinearVelocity = 20; + weaponSleepAngularVelocity = 20; + weaponDropMinTime = 1.0; + weaponDropMaxTime = 100.0; + weaponDistanceLimit = "10f"; + weaponDistanceLimitTime = "5.0f"; + sleepLinearVelocity = 0.05; + sleepAngularVelocity = 0.05; + simulateMinTime = 30; + simulateMaxTime = 100.0; + simulateDistanceLimit = "0.05f"; + simulateDistanceLimitTime = "5.0f"; + recoveryBlendTime = "0.5f"; + recoveryCosLimit = "0.3f"; + recoveryDistLimit = "0.7f"; + animBlendTime = "0.0f"; }; - class Masks { - class DraggingMask { - name = "dragging"; - mask[] = {{"pelvis", 0, 1}, {"chest", 0, 1}, {"head", "0.6f", 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 0}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 0}, {"weapon", 0, 1}, {"launcher", 0, 1}}; - }; + class Soldier : BaseRagdoll { + primaryWeaponBone = "weapon"; + secondaryWeaponBone = "launcher"; + networkBonePrimary = "chest"; + networkBoneSecondary = "pelvis"; + draggingMask = "dragging"; + hitMask = "hit"; + hitMaskUnderwater = "hitUnderwater"; - class HitMask { - name = "hit"; - mask[] = {{"pelvis", 1, 0}, {"chest", 1, 0}, {"head", 1, 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 1}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 1}, {"weapon", 1, 0}, {"launcher", 1, 0}}; - }; + class WeaponLinkBones { + class LinkBone1 { + bone = "leftHand"; + canBeDropped = 1; + prefference = "1.0f"; + }; - class HitMaskUnderwater { - name = "hitUnderwater"; - mask[] = {{"pelvis", 1, 1}, {"chest", 1, 1}, {"head", 1, 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 0}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 0}, {"weapon", 1, 0}, {"launcher", 1, 0}}; - }; + class LinkBone2 { + bone = "rightHand"; + canBeDropped = 1; + prefference = "2.0f"; + }; + + class LinkBone3 { + bone = "chest"; + canBeDropped = 1; + prefference = "1.0f"; + }; + }; + + class Masks { + class DraggingMask { + name = "dragging"; + mask[] = {{"pelvis", 0, 1}, {"chest", 0, 1}, {"head", "0.6f", 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 0}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 0}, {"weapon", 0, 1}, {"launcher", 0, 1}}; + }; + + class HitMask { + name = "hit"; + mask[] = {{"pelvis", 1, 0}, {"chest", 1, 0}, {"head", 1, 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 1}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 1}, {"weapon", 1, 0}, {"launcher", 1, 0}}; + }; + + class HitMaskUnderwater { + name = "hitUnderwater"; + mask[] = {{"pelvis", 1, 1}, {"chest", 1, 1}, {"head", 1, 0}, {"leftArm", 1, 0}, {"leftForeArm", 1, 0}, {"leftHand", 1, 0}, {"rightArm", 1, 0}, {"rightForeArm", 1, 0}, {"rightHand", 1, 0}, {"leftUpLeg", 1, 0}, {"leftLeg", 1, 0}, {"leftFoot", 1, 0}, {"rightUpLeg", 1, 0}, {"rightLeg", 1, 0}, {"rightFoot", 1, 0}, {"weapon", 1, 0}, {"launcher", 1, 0}}; + }; + }; + + class BaseRagdollBone { + material = "Ragdoll"; + childrenUseStartTrans = 1; + }; + + class Bones { + class Pelvis : BaseRagdollBone { + name = "pelvis"; + type = "capsule"; + startBone = "pelvis"; + endBone = "spine2"; + mass = 15; + radius = 0.12; + networkType = "root"; + }; + + class Chest : BaseRagdollBone { + name = "chest"; + type = "capsule"; + startBone = "spine1"; + endBone = "neck"; + radius = 0.16; + mass = 15; + }; + + class Head : BaseRagdollBone { + name = "head"; + type = "sphere"; + startBone = "head"; + mass = 8; + radius = 0.16; + }; + + class LeftArm : BaseRagdollBone { + name = "leftArm"; + type = "capsule"; + startBone = "leftArm"; + endBone = "leftForeArm"; + mass = 8; + }; + + class LeftForeArm : BaseRagdollBone { + name = "leftForeArm"; + type = "capsule"; + startBone = "leftForeArm"; + endBone = "leftHand"; + mass = 6; + }; + + class LeftHand : BaseRagdollBone { + name = "leftHand"; + type = "sphere"; + startBone = "leftHand"; + mass = 6; + radius = 0.08; + childrenUseStartTrans = 0; + networkType = "leftHand"; + }; + + class RightArm : BaseRagdollBone { + name = "rightArm"; + type = "capsule"; + startBone = "rightArm"; + endBone = "rightForeArm"; + mass = 8; + }; + + class RightForeArm : BaseRagdollBone { + name = "rightForeArm"; + type = "capsule"; + startBone = "rightForeArm"; + endBone = "rightHand"; + mass = 6; + }; + + class RightHand : BaseRagdollBone { + name = "rightHand"; + type = "sphere"; + startBone = "rightHand"; + mass = 6; + radius = 0.08; + childrenUseStartTrans = 0; + networkType = "rightHand"; + }; + + class LeftUpLeg : BaseRagdollBone { + name = "leftUpLeg"; + type = "capsule"; + startBone = "leftUpLeg"; + endBone = "leftLeg"; + mass = 15; + }; + + class LeftLeg : BaseRagdollBone { + name = "leftLeg"; + type = "capsule"; + startBone = "leftLeg"; + endBone = "leftFoot"; + mass = 10; + }; + + class LeftFoot : BaseRagdollBone { + name = "leftFoot"; + type = "box"; + startBone = "leftFoot"; + size[] = {0.15, 0.035, 0.07}; + mass = 8; + networkType = "leftFoot"; + }; + + class RightUpLeg : BaseRagdollBone { + name = "rightUpLeg"; + type = "capsule"; + startBone = "rightUpLeg"; + endBone = "rightLeg"; + mass = 15; + }; + + class RightLeg : BaseRagdollBone { + name = "rightLeg"; + type = "capsule"; + startBone = "rightLeg"; + endBone = "rightFoot"; + mass = 10; + }; + + class RightFoot : BaseRagdollBone { + name = "rightFoot"; + type = "box"; + startBone = "rightFoot"; + size[] = {0.15, 0.035, 0.07}; + mass = 8; + networkType = "rightFoot"; + }; + + class Weapon : BaseRagdollBone { + name = "weapon"; + type = "weapon"; + startBone = "weapon"; + endPosRelToStart[] = {0.0, 1.0, 0.0}; + mass = 3; + }; + + class Launcher : BaseRagdollBone { + name = "launcher"; + type = "weapon"; + startBone = "launcher"; + endPosRelToStart[] = {1.0, 0.0, 0.0}; + mass = 3; + }; + }; + + class JointsPX2 { + class Pelvis_Chest_PX2 : RagDollSphericalJoint { + name = "pelvis_chest"; + bone1 = "pelvis"; + bone2 = "chest"; + axis[] = {0, 1, 0.3}; + + class SwingLimit : SwingLimit { + value = 25; + }; + + class TwistLimitLow : TwistLimitLow { + value = -15; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 25; + }; + }; + + class Chest_Head_PX2 : RagDollSphericalJoint { + name = "chest_head"; + bone1 = "chest"; + bone2 = "head"; + + class SwingLimit : SwingLimit { + value = 20; + }; + + class TwistLimitLow : TwistLimitLow { + value = -15; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 15; + }; + }; + + class Chest_LeftArm_PX2 : RagDollSphericalJoint { + name = "chest_leftArm"; + bone1 = "chest"; + bone2 = "leftArm"; + axis[] = {-1, 0.0, 0.5}; + enableCollision = 1; + + class SwingLimit : SwingLimit { + value = 60; + }; + + class TwistLimitLow : TwistLimitLow { + value = -20; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 20; + }; + }; + + class LeftArm_LeftForeArm_PX2 : RagDollRevoluteJoint { + name = "leftArm_leftForeArm"; + bone1 = "leftArm"; + bone2 = "leftForeArm"; + axis[] = {1, -1, 0.2}; + + class LimitLow : LimitLow { + value = -2; + }; + + class LimitHigh : LimitHigh { + value = 60; + }; + }; + + class LeftForeArm_LeftHand_PX2 : RagDollSphericalJoint { + name = "leftForeArm_leftHand"; + bone1 = "leftForeArm"; + bone2 = "leftHand"; + + class SwingLimit : SwingLimit { + value = 20; + }; + + class TwistLimitLow : TwistLimitLow { + value = -5; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 5; + }; + }; + + class Chest_RightArm_PX2 : RagDollSphericalJoint { + name = "chest_rightArm"; + bone1 = "chest"; + bone2 = "rightArm"; + axis[] = {1, 0.0, 0.5}; + enableCollision = 1; + + class SwingLimit : SwingLimit { + value = 60; + }; + + class TwistLimitLow : TwistLimitLow { + value = -20; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 20; + }; + }; + + class RightArm_RightForeArm_PX2 : RagDollRevoluteJoint { + name = "rightArm_rightForeArm"; + bone1 = "rightArm"; + bone2 = "rightForeArm"; + axis[] = {1, 1, -0.2}; + + class LimitLow : LimitLow { + value = -2; + }; + + class LimitHigh : LimitHigh { + value = 60; + }; + }; + + class RightForeArm_RightHand_PX2 : RagDollSphericalJoint { + name = "rightForeArm_rightHand"; + bone1 = "rightForeArm"; + bone2 = "rightHand"; + + class SwingLimit : SwingLimit { + value = 20; + }; + + class TwistLimitLow : TwistLimitLow { + value = -5; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 5; + }; + }; + + class Pelvis_LeftUpLeg_PX2 : RagDollSphericalJoint { + name = "pelvis_leftUpLeg"; + bone1 = "pelvis"; + bone2 = "leftUpLeg"; + axis[] = {-1.5, -1.1, 2}; + enableCollision = 1; + + class SwingLimit : SwingLimit { + value = 45; + }; + + class TwistLimitLow : TwistLimitLow { + value = -10; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 20; + }; + }; + + class LeftUpLeg_LeftLeg_PX2 : RagDollRevoluteJoint { + name = "leftUpLeg_leftLeg"; + bone1 = "leftUpLeg"; + bone2 = "leftLeg"; + axis[] = {-1, 0, 0}; + + class LimitLow : LimitLow { + value = -5; + }; + + class LimitHigh : LimitHigh { + value = 110; + }; + }; + + class LeftLeg_LeftFoot_PX2 : RagDollRevoluteJoint { + name = "leftLeg_leftFoot"; + bone1 = "leftLeg"; + bone2 = "leftFoot"; + axis[] = {-1, 0, 0}; + + class LimitLow : LimitLow { + value = -15; + }; + + class LimitHigh : LimitHigh { + value = 45; + }; + }; + + class Pelvis_RightUpLeg_PX2 : RagDollSphericalJoint { + name = "pelvis_rightUpLeg"; + bone1 = "pelvis"; + bone2 = "rightUpLeg"; + axis[] = {1.5, -1.1, 2}; + enableCollision = 1; + + class SwingLimit : SwingLimit { + value = 45; + }; + + class TwistLimitLow : TwistLimitLow { + value = -10; + }; + + class TwistLimitHigh : TwistLimitHigh { + value = 20; + }; + }; + + class RightUpLeg_RightLeg_PX2 : RagDollRevoluteJoint { + name = "rightUpLeg_rightLeg"; + bone1 = "rightUpLeg"; + bone2 = "rightLeg"; + axis[] = {-1, 0, 0}; + + class LimitLow : LimitLow { + value = -5; + }; + + class LimitHigh : LimitHigh { + value = 110; + }; + }; + + class RightLeg_RightFoot_PX2 : RagDollRevoluteJoint { + name = "rightLeg_rightFoot"; + bone1 = "rightLeg"; + bone2 = "rightFoot"; + axis[] = {-1, 0, 0}; + + class LimitLow : LimitLow { + value = -15; + }; + + class LimitHigh : LimitHigh { + value = 45; + }; + }; + }; + + class JointsPX3 { + class Pelvis_Chest_PX3 : RagDollD6Joint_PX3 { + name = "pelvis_chest"; + bone1 = "pelvis"; + bone2 = "chest"; + axis[] = {0, 1, 0.3}; + enableCollision = 0; + swingLimitY = 30; + swingLimitZ = 30; + twistLimitLower = -25; + twistLimitUpper = 25; + driveSpring = 30; + driveDamping = 30; + driveSpringWater = 5; + driveDampingWater = 5; + }; + + class Chest_Head_PX3 : RagDollD6Joint_PX3 { + name = "chest_head"; + bone1 = "chest"; + bone2 = "head"; + swingLimitY = 45; + swingLimitZ = 45; + twistLimitLower = -40; + twistLimitUpper = 40; + driveSpring = 15.0; + driveDamping = 30; + driveSpringWater = 1.5; + driveDampingWater = 3.0; + twistSpring = 15.0; + twistDamping = 30.0; + }; + + class Chest_LeftArm_PX3 : RagDollD6Joint_PX3 { + name = "chest_leftArm"; + bone1 = "chest"; + bone2 = "leftArm"; + enableCollision = 1; + swingLimitY = 85; + swingLimitZ = 85; + twistLimitLower = -60; + twistLimitUpper = 60; + driveSpring = 30; + driveDamping = 30; + driveSpringWater = 3; + driveDampingWater = 3; + }; + + class LeftArm_LeftForeArm_PX3 : RagDollD6Joint_PX3 { + name = "leftArm_leftForeArm"; + bone1 = "leftArm"; + bone2 = "leftForeArm"; + axis[] = {-1, 1, -0.2}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -5; + twistLimitUpper = 150; + driveSpring = 10; + driveDamping = 10; + driveSpringWater = 1; + driveDampingWater = 1; + }; + + class LeftForeArm_LeftHand_PX3 : RagDollD6Joint_PX3 { + name = "leftForeArm_leftHand"; + bone1 = "leftForeArm"; + bone2 = "leftHand"; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -20; + twistLimitUpper = 20; + driveSpring = 10; + driveDamping = 10; + driveSpringWater = 1; + driveDampingWater = 1; + }; + + class Chest_RightArm_PX3 : RagDollD6Joint_PX3 { + name = "chest_rightArm"; + bone1 = "chest"; + bone2 = "rightArm"; + enableCollision = 1; + swingLimitY = 85; + swingLimitZ = 85; + twistLimitLower = -60; + twistLimitUpper = 60; + driveSpring = 30; + driveDamping = 30; + driveSpringWater = 3; + driveDampingWater = 3; + }; + + class RightArm_RightForeArm_PX3 : RagDollD6Joint_PX3 { + name = "rightArm_rightForeArm"; + bone1 = "rightArm"; + bone2 = "rightForeArm"; + axis[] = {-1, -1, 0.2}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -5; + twistLimitUpper = 150; + driveSpring = 10; + driveDamping = 10; + driveSpringWater = 1; + driveDampingWater = 1; + }; + + class RightForeArm_RightHand_PX3 : RagDollD6Joint_PX3 { + name = "rightForeArm_rightHand"; + bone1 = "rightForeArm"; + bone2 = "rightHand"; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -20; + twistLimitUpper = 20; + driveSpring = 10; + driveDamping = 10; + driveSpringWater = 1; + driveDampingWater = 1; + }; + + class Pelvis_LeftUpLeg_PX3 : RagDollD6Joint_PX3 { + name = "pelvis_leftUpLeg"; + bone1 = "pelvis"; + bone2 = "leftUpLeg"; + enableCollision = 1; + swingLimitY = 35; + swingLimitZ = 35; + twistLimitLower = -10; + twistLimitUpper = 60; + driveSpring = 30; + driveDamping = 30; + driveSpringWater = 3; + driveDampingWater = 3; + twistDamping = 30.0; + }; + + class LeftUpLeg_LeftLeg_PX3 : RagDollD6Joint_PX3 { + name = "leftUpLeg_leftLeg"; + bone1 = "leftUpLeg"; + bone2 = "leftLeg"; + axis[] = {1, 0, 0}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -5; + twistLimitUpper = 120; + driveSpring = 20; + driveDamping = 20; + driveSpringWater = 2; + driveDampingWater = 2; + }; + + class LeftLeg_LeftFoot_PX3 : RagDollD6Joint_PX3 { + name = "leftLeg_leftFoot"; + bone1 = "leftLeg"; + bone2 = "leftFoot"; + axis[] = {1, 0, 0}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -15; + twistLimitUpper = 45; + driveSpring = 20; + driveDamping = 20; + driveSpringWater = 2; + driveDampingWater = 2; + }; + + class Pelvis_RightUpLeg_PX3 : RagDollD6Joint_PX3 { + name = "pelvis_rightUpLeg"; + bone1 = "pelvis"; + bone2 = "rightUpLeg"; + enableCollision = 1; + swingLimitY = 35; + swingLimitZ = 35; + twistLimitLower = -10; + twistLimitUpper = 60; + driveSpring = 30; + driveDamping = 30; + driveSpringWater = 3; + driveDampingWater = 3; + twistDamping = 30.0; + }; + + class RightUpLeg_RightLeg_PX3 : RagDollD6Joint_PX3 { + name = "rightUpLeg_rightLeg"; + bone1 = "rightUpLeg"; + bone2 = "rightLeg"; + axis[] = {1, 0, 0}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -5; + twistLimitUpper = 120; + driveSpring = 20; + driveDamping = 20; + driveSpringWater = 2; + driveDampingWater = 2; + }; + + class RightLeg_RightFoot_PX3 : RagDollD6Joint_PX3 { + name = "rightLeg_rightFoot"; + bone1 = "rightLeg"; + bone2 = "rightFoot"; + axis[] = {1, 0, 0}; + swingLimitY = 10; + swingLimitZ = 10; + twistLimitLower = -15; + twistLimitUpper = 45; + driveSpring = 20; + driveDamping = 20; + driveSpringWater = 2; + driveDampingWater = 2; + }; + }; }; - - class BaseRagdollBone { - material = "Ragdoll"; - childrenUseStartTrans = 1; - }; - - class Bones { - class Pelvis : BaseRagdollBone { - name = "pelvis"; - type = "capsule"; - startBone = "pelvis"; - endBone = "spine2"; - mass = 15; - radius = 0.12; - networkType = "root"; - }; - - class Chest : BaseRagdollBone { - name = "chest"; - type = "capsule"; - startBone = "spine1"; - endBone = "neck"; - radius = 0.16; - mass = 15; - }; - - class Head : BaseRagdollBone { - name = "head"; - type = "sphere"; - startBone = "head"; - mass = 8; - radius = 0.16; - }; - - class LeftArm : BaseRagdollBone { - name = "leftArm"; - type = "capsule"; - startBone = "leftArm"; - endBone = "leftForeArm"; - mass = 8; - }; - - class LeftForeArm : BaseRagdollBone { - name = "leftForeArm"; - type = "capsule"; - startBone = "leftForeArm"; - endBone = "leftHand"; - mass = 6; - }; - - class LeftHand : BaseRagdollBone { - name = "leftHand"; - type = "sphere"; - startBone = "leftHand"; - mass = 6; - radius = 0.08; - childrenUseStartTrans = 0; - networkType = "leftHand"; - }; - - class RightArm : BaseRagdollBone { - name = "rightArm"; - type = "capsule"; - startBone = "rightArm"; - endBone = "rightForeArm"; - mass = 8; - }; - - class RightForeArm : BaseRagdollBone { - name = "rightForeArm"; - type = "capsule"; - startBone = "rightForeArm"; - endBone = "rightHand"; - mass = 6; - }; - - class RightHand : BaseRagdollBone { - name = "rightHand"; - type = "sphere"; - startBone = "rightHand"; - mass = 6; - radius = 0.08; - childrenUseStartTrans = 0; - networkType = "rightHand"; - }; - - class LeftUpLeg : BaseRagdollBone { - name = "leftUpLeg"; - type = "capsule"; - startBone = "leftUpLeg"; - endBone = "leftLeg"; - mass = 15; - }; - - class LeftLeg : BaseRagdollBone { - name = "leftLeg"; - type = "capsule"; - startBone = "leftLeg"; - endBone = "leftFoot"; - mass = 10; - }; - - class LeftFoot : BaseRagdollBone { - name = "leftFoot"; - type = "box"; - startBone = "leftFoot"; - size[] = {0.15, 0.035, 0.07}; - mass = 8; - networkType = "leftFoot"; - }; - - class RightUpLeg : BaseRagdollBone { - name = "rightUpLeg"; - type = "capsule"; - startBone = "rightUpLeg"; - endBone = "rightLeg"; - mass = 15; - }; - - class RightLeg : BaseRagdollBone { - name = "rightLeg"; - type = "capsule"; - startBone = "rightLeg"; - endBone = "rightFoot"; - mass = 10; - }; - - class RightFoot : BaseRagdollBone { - name = "rightFoot"; - type = "box"; - startBone = "rightFoot"; - size[] = {0.15, 0.035, 0.07}; - mass = 8; - networkType = "rightFoot"; - }; - - class Weapon : BaseRagdollBone { - name = "weapon"; - type = "weapon"; - startBone = "weapon"; - endPosRelToStart[] = {0.0, 1.0, 0.0}; - mass = 3; - }; - - class Launcher : BaseRagdollBone { - name = "launcher"; - type = "weapon"; - startBone = "launcher"; - endPosRelToStart[] = {1.0, 0.0, 0.0}; - mass = 3; - }; - }; - - class JointsPX2 { - class Pelvis_Chest_PX2 : RagDollSphericalJoint { - name = "pelvis_chest"; - bone1 = "pelvis"; - bone2 = "chest"; - axis[] = {0, 1, 0.3}; - - class SwingLimit : SwingLimit { - value = 25; - }; - - class TwistLimitLow : TwistLimitLow { - value = -15; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 25; - }; - }; - - class Chest_Head_PX2 : RagDollSphericalJoint { - name = "chest_head"; - bone1 = "chest"; - bone2 = "head"; - - class SwingLimit : SwingLimit { - value = 20; - }; - - class TwistLimitLow : TwistLimitLow { - value = -15; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 15; - }; - }; - - class Chest_LeftArm_PX2 : RagDollSphericalJoint { - name = "chest_leftArm"; - bone1 = "chest"; - bone2 = "leftArm"; - axis[] = {-1, 0.0, 0.5}; - enableCollision = 1; - - class SwingLimit : SwingLimit { - value = 60; - }; - - class TwistLimitLow : TwistLimitLow { - value = -20; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 20; - }; - }; - - class LeftArm_LeftForeArm_PX2 : RagDollRevoluteJoint { - name = "leftArm_leftForeArm"; - bone1 = "leftArm"; - bone2 = "leftForeArm"; - axis[] = {1, -1, 0.2}; - - class LimitLow : LimitLow { - value = -2; - }; - - class LimitHigh : LimitHigh { - value = 60; - }; - }; - - class LeftForeArm_LeftHand_PX2 : RagDollSphericalJoint { - name = "leftForeArm_leftHand"; - bone1 = "leftForeArm"; - bone2 = "leftHand"; - - class SwingLimit : SwingLimit { - value = 20; - }; - - class TwistLimitLow : TwistLimitLow { - value = -5; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 5; - }; - }; - - class Chest_RightArm_PX2 : RagDollSphericalJoint { - name = "chest_rightArm"; - bone1 = "chest"; - bone2 = "rightArm"; - axis[] = {1, 0.0, 0.5}; - enableCollision = 1; - - class SwingLimit : SwingLimit { - value = 60; - }; - - class TwistLimitLow : TwistLimitLow { - value = -20; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 20; - }; - }; - - class RightArm_RightForeArm_PX2 : RagDollRevoluteJoint { - name = "rightArm_rightForeArm"; - bone1 = "rightArm"; - bone2 = "rightForeArm"; - axis[] = {1, 1, -0.2}; - - class LimitLow : LimitLow { - value = -2; - }; - - class LimitHigh : LimitHigh { - value = 60; - }; - }; - - class RightForeArm_RightHand_PX2 : RagDollSphericalJoint { - name = "rightForeArm_rightHand"; - bone1 = "rightForeArm"; - bone2 = "rightHand"; - - class SwingLimit : SwingLimit { - value = 20; - }; - - class TwistLimitLow : TwistLimitLow { - value = -5; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 5; - }; - }; - - class Pelvis_LeftUpLeg_PX2 : RagDollSphericalJoint { - name = "pelvis_leftUpLeg"; - bone1 = "pelvis"; - bone2 = "leftUpLeg"; - axis[] = {-1.5, -1.1, 2}; - enableCollision = 1; - - class SwingLimit : SwingLimit { - value = 45; - }; - - class TwistLimitLow : TwistLimitLow { - value = -10; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 20; - }; - }; - - class LeftUpLeg_LeftLeg_PX2 : RagDollRevoluteJoint { - name = "leftUpLeg_leftLeg"; - bone1 = "leftUpLeg"; - bone2 = "leftLeg"; - axis[] = {-1, 0, 0}; - - class LimitLow : LimitLow { - value = -5; - }; - - class LimitHigh : LimitHigh { - value = 110; - }; - }; - - class LeftLeg_LeftFoot_PX2 : RagDollRevoluteJoint { - name = "leftLeg_leftFoot"; - bone1 = "leftLeg"; - bone2 = "leftFoot"; - axis[] = {-1, 0, 0}; - - class LimitLow : LimitLow { - value = -15; - }; - - class LimitHigh : LimitHigh { - value = 45; - }; - }; - - class Pelvis_RightUpLeg_PX2 : RagDollSphericalJoint { - name = "pelvis_rightUpLeg"; - bone1 = "pelvis"; - bone2 = "rightUpLeg"; - axis[] = {1.5, -1.1, 2}; - enableCollision = 1; - - class SwingLimit : SwingLimit { - value = 45; - }; - - class TwistLimitLow : TwistLimitLow { - value = -10; - }; - - class TwistLimitHigh : TwistLimitHigh { - value = 20; - }; - }; - - class RightUpLeg_RightLeg_PX2 : RagDollRevoluteJoint { - name = "rightUpLeg_rightLeg"; - bone1 = "rightUpLeg"; - bone2 = "rightLeg"; - axis[] = {-1, 0, 0}; - - class LimitLow : LimitLow { - value = -5; - }; - - class LimitHigh : LimitHigh { - value = 110; - }; - }; - - class RightLeg_RightFoot_PX2 : RagDollRevoluteJoint { - name = "rightLeg_rightFoot"; - bone1 = "rightLeg"; - bone2 = "rightFoot"; - axis[] = {-1, 0, 0}; - - class LimitLow : LimitLow { - value = -15; - }; - - class LimitHigh : LimitHigh { - value = 45; - }; - }; - }; - - class JointsPX3 { - class Pelvis_Chest_PX3 : RagDollD6Joint_PX3 { - name = "pelvis_chest"; - bone1 = "pelvis"; - bone2 = "chest"; - axis[] = {0, 1, 0.3}; - enableCollision = 0; - swingLimitY = 30; - swingLimitZ = 30; - twistLimitLower = -25; - twistLimitUpper = 25; - driveSpring = 30; - driveDamping = 30; - driveSpringWater = 5; - driveDampingWater = 5; - }; - - class Chest_Head_PX3 : RagDollD6Joint_PX3 { - name = "chest_head"; - bone1 = "chest"; - bone2 = "head"; - swingLimitY = 45; - swingLimitZ = 45; - twistLimitLower = -40; - twistLimitUpper = 40; - driveSpring = 15.0; - driveDamping = 30; - driveSpringWater = 1.5; - driveDampingWater = 3.0; - twistSpring = 15.0; - twistDamping = 30.0; - }; - - class Chest_LeftArm_PX3 : RagDollD6Joint_PX3 { - name = "chest_leftArm"; - bone1 = "chest"; - bone2 = "leftArm"; - enableCollision = 1; - swingLimitY = 85; - swingLimitZ = 85; - twistLimitLower = -60; - twistLimitUpper = 60; - driveSpring = 30; - driveDamping = 30; - driveSpringWater = 3; - driveDampingWater = 3; - }; - - class LeftArm_LeftForeArm_PX3 : RagDollD6Joint_PX3 { - name = "leftArm_leftForeArm"; - bone1 = "leftArm"; - bone2 = "leftForeArm"; - axis[] = {-1, 1, -0.2}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -5; - twistLimitUpper = 150; - driveSpring = 10; - driveDamping = 10; - driveSpringWater = 1; - driveDampingWater = 1; - }; - - class LeftForeArm_LeftHand_PX3 : RagDollD6Joint_PX3 { - name = "leftForeArm_leftHand"; - bone1 = "leftForeArm"; - bone2 = "leftHand"; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -20; - twistLimitUpper = 20; - driveSpring = 10; - driveDamping = 10; - driveSpringWater = 1; - driveDampingWater = 1; - }; - - class Chest_RightArm_PX3 : RagDollD6Joint_PX3 { - name = "chest_rightArm"; - bone1 = "chest"; - bone2 = "rightArm"; - enableCollision = 1; - swingLimitY = 85; - swingLimitZ = 85; - twistLimitLower = -60; - twistLimitUpper = 60; - driveSpring = 30; - driveDamping = 30; - driveSpringWater = 3; - driveDampingWater = 3; - }; - - class RightArm_RightForeArm_PX3 : RagDollD6Joint_PX3 { - name = "rightArm_rightForeArm"; - bone1 = "rightArm"; - bone2 = "rightForeArm"; - axis[] = {-1, -1, 0.2}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -5; - twistLimitUpper = 150; - driveSpring = 10; - driveDamping = 10; - driveSpringWater = 1; - driveDampingWater = 1; - }; - - class RightForeArm_RightHand_PX3 : RagDollD6Joint_PX3 { - name = "rightForeArm_rightHand"; - bone1 = "rightForeArm"; - bone2 = "rightHand"; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -20; - twistLimitUpper = 20; - driveSpring = 10; - driveDamping = 10; - driveSpringWater = 1; - driveDampingWater = 1; - }; - - class Pelvis_LeftUpLeg_PX3 : RagDollD6Joint_PX3 { - name = "pelvis_leftUpLeg"; - bone1 = "pelvis"; - bone2 = "leftUpLeg"; - enableCollision = 1; - swingLimitY = 35; - swingLimitZ = 35; - twistLimitLower = -10; - twistLimitUpper = 60; - driveSpring = 30; - driveDamping = 30; - driveSpringWater = 3; - driveDampingWater = 3; - twistDamping = 30.0; - }; - - class LeftUpLeg_LeftLeg_PX3 : RagDollD6Joint_PX3 { - name = "leftUpLeg_leftLeg"; - bone1 = "leftUpLeg"; - bone2 = "leftLeg"; - axis[] = {1, 0, 0}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -5; - twistLimitUpper = 120; - driveSpring = 20; - driveDamping = 20; - driveSpringWater = 2; - driveDampingWater = 2; - }; - - class LeftLeg_LeftFoot_PX3 : RagDollD6Joint_PX3 { - name = "leftLeg_leftFoot"; - bone1 = "leftLeg"; - bone2 = "leftFoot"; - axis[] = {1, 0, 0}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -15; - twistLimitUpper = 45; - driveSpring = 20; - driveDamping = 20; - driveSpringWater = 2; - driveDampingWater = 2; - }; - - class Pelvis_RightUpLeg_PX3 : RagDollD6Joint_PX3 { - name = "pelvis_rightUpLeg"; - bone1 = "pelvis"; - bone2 = "rightUpLeg"; - enableCollision = 1; - swingLimitY = 35; - swingLimitZ = 35; - twistLimitLower = -10; - twistLimitUpper = 60; - driveSpring = 30; - driveDamping = 30; - driveSpringWater = 3; - driveDampingWater = 3; - twistDamping = 30.0; - }; - - class RightUpLeg_RightLeg_PX3 : RagDollD6Joint_PX3 { - name = "rightUpLeg_rightLeg"; - bone1 = "rightUpLeg"; - bone2 = "rightLeg"; - axis[] = {1, 0, 0}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -5; - twistLimitUpper = 120; - driveSpring = 20; - driveDamping = 20; - driveSpringWater = 2; - driveDampingWater = 2; - }; - - class RightLeg_RightFoot_PX3 : RagDollD6Joint_PX3 { - name = "rightLeg_rightFoot"; - bone1 = "rightLeg"; - bone2 = "rightFoot"; - axis[] = {1, 0, 0}; - swingLimitY = 10; - swingLimitZ = 10; - twistLimitLower = -15; - twistLimitUpper = 45; - driveSpring = 20; - driveDamping = 20; - driveSpringWater = 2; - driveDampingWater = 2; - }; - }; - }; }; diff --git a/addons/ragdolls/script_component.hpp b/addons/ragdolls/script_component.hpp index f0306957b0..e2bcf10441 100644 --- a/addons/ragdolls/script_component.hpp +++ b/addons/ragdolls/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_RAGDOLLS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_RAGDOLLS - #define DEBUG_SETTINGS DEBUG_ENABLED_RAGDOLLS + #define DEBUG_SETTINGS DEBUG_ENABLED_RAGDOLLS #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/realisticnames/config.cpp b/addons/realisticnames/config.cpp index 51afc36eb2..347d0c1b2e 100644 --- a/addons/realisticnames/config.cpp +++ b/addons/realisticnames/config.cpp @@ -1,1449 +1,1447 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {ace_core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi", "TaoSensai", "commy2"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"KoffeinFlummi","TaoSensai","commy2"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; }; // VEHICLES class CfgVehicles { - // static weapons - class StaticMGWeapon; - class HMG_01_base_F: StaticMGWeapon { - displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; - }; - class HMG_01_A_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; - }; - class HMG_01_high_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; - }; - - class AT_01_base_F; - class B_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class O_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class I_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - - class AA_01_base_F; - class B_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class O_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class I_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - - class GMG_TriPod; - class GMG_01_base_F: GMG_TriPod { - displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; - }; - class GMG_01_A_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; - }; - class GMG_01_high_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; - }; - - // M-ATV - class MRAP_01_base_F; - class B_MRAP_01_F: MRAP_01_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; - }; - - class MRAP_01_gmg_base_F: MRAP_01_base_F {}; - class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; - }; - - class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; - class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; - }; - - // punisher - class MRAP_02_base_F; - class O_MRAP_02_F: MRAP_02_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; - }; - - class MRAP_02_hmg_base_F: MRAP_02_base_F {}; - class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; - }; - - class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; - class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; - }; - - // strider - class MRAP_03_base_F; - class I_MRAP_03_F: MRAP_03_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; - }; - - class MRAP_03_hmg_base_F: MRAP_03_base_F {}; - class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; - }; - - class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; - class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; - }; - - // merkava derivates - class MBT_01_base_F; - class B_MBT_01_base_F: MBT_01_base_F {}; - - class B_MBT_01_cannon_F: B_MBT_01_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; - }; - class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; - }; - - class MBT_01_arty_base_F: MBT_01_base_F {}; - class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; - - class B_MBT_01_arty_F: B_MBT_01_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; - }; - - class MBT_01_mlrs_base_F: MBT_01_base_F {}; - class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; - - class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. - }; - - // T100 derivates - class MBT_02_base_F; - class O_MBT_02_base_F: MBT_02_base_F {}; - - class O_MBT_02_cannon_F: O_MBT_02_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; - }; - - class MBT_02_arty_base_F: MBT_02_base_F {}; - class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; - - class O_MBT_02_arty_F: O_MBT_02_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; - }; - - // leopard sg - class I_MBT_03_base_F; - class I_MBT_03_cannon_F: I_MBT_03_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; - }; - - // tracked apcs - class B_APC_Tracked_01_base_F; - class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; - }; - - class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. - }; - - class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; - }; - - class O_APC_Tracked_02_base_F; - class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; - }; - - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; - }; - - class I_APC_tracked_03_base_F; - class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; - }; - - // wheeled apcs - class B_APC_Wheeled_01_base_F; - class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; - }; - - class O_APC_Wheeled_02_base_F; - class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; - }; - - class I_APC_Wheeled_03_base_F; - class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; - }; - - // trucks - class Truck_01_base_F; - class B_Truck_01_transport_F: Truck_01_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; - }; - class B_Truck_01_covered_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; - }; - class B_Truck_01_mover_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; - }; - class B_Truck_01_box_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; - }; - class B_Truck_01_medical_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; - }; - class B_Truck_01_ammo_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; - }; - class B_Truck_01_fuel_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; - }; - class B_Truck_01_Repair_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; - }; - - class Truck_02_base_F; - class O_Truck_02_transport_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class O_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class O_Truck_02_ammo_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class O_Truck_02_fuel_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class O_Truck_02_box_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class O_Truck_02_medical_F: O_Truck_02_box_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - - class I_Truck_02_transport_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class I_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class I_Truck_02_ammo_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class I_Truck_02_fuel_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class I_Truck_02_box_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class I_Truck_02_medical_F: I_Truck_02_box_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - - class Truck_03_base_F; - class O_Truck_03_transport_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; - }; - class O_Truck_03_covered_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; - }; - class O_Truck_03_device_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; - }; - class O_Truck_03_ammo_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; - }; - class O_Truck_03_fuel_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; - }; - class O_Truck_03_repair_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; - }; - class O_Truck_03_medical_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; - }; - - // helicopters - class Heli_Attack_01_base_F; - class B_Heli_Attack_01_F: Heli_Attack_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; - }; - - class Heli_Light_01_base_F; - class B_Heli_Light_01_F: Heli_Light_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; - }; - - class Heli_Light_01_armed_base_F; - class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; - }; - - class Heli_Light_01_civil_base_F: Heli_Light_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; - }; - - class B_Heli_Transport_03_base_F; - class B_Heli_Transport_03_F: B_Heli_Transport_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; - }; - - class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {}; - class B_Heli_Transport_03_unarmed_F: B_Heli_Transport_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; - }; - - class Heli_Light_02_base_F; - class O_Heli_Light_02_F: Heli_Light_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; - }; - class O_Heli_Light_02_unarmed_F: Heli_Light_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; - }; - - class I_Heli_light_03_base_F; - class I_Heli_light_03_F: I_Heli_light_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; - }; - - class I_Heli_light_03_unarmed_base_F; - class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; - }; - - class Heli_Transport_02_base_F; - class I_Heli_Transport_02_F: Heli_Transport_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; - }; - - // planes - class Plane_CAS_01_base_F; - class B_Plane_CAS_01_F: Plane_CAS_01_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; - }; - - class Plane_CAS_02_base_F; - class O_Plane_CAS_02_F: Plane_CAS_02_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; - }; - - class Plane_Fighter_03_base_F; - class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; - }; - - class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; - }; - - // uavs - class UAV_02_base_F; - class B_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class O_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class I_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - - class UAV_02_CAS_base_F: UAV_02_base_F {}; - class B_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class O_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class I_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - - // pistols - class Pistol_Base_F; - class Weapon_hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class Weapon_hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class Weapon_hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // rocket launchers - class Launcher_Base_F; - class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - class Weapon_launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class Weapon_launch_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - - class Weapon_launch_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class Weapon_launch_B_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; - //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - - class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - - // rifles - - // MX - class Weapon_Base_F; - class Weapon_arifle_MX_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - - class Weapon_arifle_MXC_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - - class Weapon_arifle_MX_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - - class Weapon_arifle_MX_SW_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - - class Weapon_arifle_MXM_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - - // Katiba - class Weapon_arifle_Katiba_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - - class Weapon_arifle_Katiba_C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - - // F2000 - class Weapon_arifle_Mk20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - - class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class Weapon_arifle_Mk20C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - - class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - - class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // TAR-21 - class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - - class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - - // sub machine guns - class Weapon_SMG_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - class Weapon_SMG_02_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - class Weapon_hgun_PDW2000_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // machine guns - class Weapon_LMG_Mk200_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class Weapon_LMG_Zafir_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class Weapon_srifle_EBR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class Weapon_srifle_GM6_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - - class Weapon_srifle_GM6_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - - class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; + // static weapons + class StaticMGWeapon; + class HMG_01_base_F: StaticMGWeapon { + displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; + }; + class HMG_01_A_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; + }; + class HMG_01_high_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; + }; + + class AT_01_base_F; + class B_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class O_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class I_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + + class AA_01_base_F; + class B_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class O_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class I_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + + class GMG_TriPod; + class GMG_01_base_F: GMG_TriPod { + displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; + }; + class GMG_01_A_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; + }; + class GMG_01_high_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; + }; + + // M-ATV + class MRAP_01_base_F; + class B_MRAP_01_F: MRAP_01_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; + }; + + class MRAP_01_gmg_base_F: MRAP_01_base_F {}; + class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; + }; + + class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; + class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; + }; + + // punisher + class MRAP_02_base_F; + class O_MRAP_02_F: MRAP_02_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; + }; + + class MRAP_02_hmg_base_F: MRAP_02_base_F {}; + class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; + }; + + class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; + class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; + }; + + // strider + class MRAP_03_base_F; + class I_MRAP_03_F: MRAP_03_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; + }; + + class MRAP_03_hmg_base_F: MRAP_03_base_F {}; + class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; + }; + + class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; + class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; + }; + + // merkava derivates + class MBT_01_base_F; + class B_MBT_01_base_F: MBT_01_base_F {}; + + class B_MBT_01_cannon_F: B_MBT_01_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; + }; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; + }; + + class MBT_01_arty_base_F: MBT_01_base_F {}; + class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; + + class B_MBT_01_arty_F: B_MBT_01_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; + }; + + class MBT_01_mlrs_base_F: MBT_01_base_F {}; + class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; + + class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. + }; + + // T100 derivates + class MBT_02_base_F; + class O_MBT_02_base_F: MBT_02_base_F {}; + + class O_MBT_02_cannon_F: O_MBT_02_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; + }; + + class MBT_02_arty_base_F: MBT_02_base_F {}; + class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; + + class O_MBT_02_arty_F: O_MBT_02_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; + }; + + // leopard sg + class I_MBT_03_base_F; + class I_MBT_03_cannon_F: I_MBT_03_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; + }; + + // tracked apcs + class B_APC_Tracked_01_base_F; + class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; + }; + + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. + }; + + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; + }; + + class O_APC_Tracked_02_base_F; + class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; + }; + + class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; + }; + + class I_APC_tracked_03_base_F; + class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; + }; + + // wheeled apcs + class B_APC_Wheeled_01_base_F; + class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; + }; + + class O_APC_Wheeled_02_base_F; + class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; + }; + + class I_APC_Wheeled_03_base_F; + class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; + }; + + // trucks + class Truck_01_base_F; + class B_Truck_01_transport_F: Truck_01_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; + }; + class B_Truck_01_covered_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; + }; + class B_Truck_01_mover_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; + }; + class B_Truck_01_box_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; + }; + class B_Truck_01_medical_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; + }; + class B_Truck_01_ammo_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; + }; + class B_Truck_01_fuel_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; + }; + class B_Truck_01_Repair_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; + }; + + class Truck_02_base_F; + class O_Truck_02_transport_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class O_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class O_Truck_02_ammo_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class O_Truck_02_fuel_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class O_Truck_02_box_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class O_Truck_02_medical_F: O_Truck_02_box_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + + class I_Truck_02_transport_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class I_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class I_Truck_02_ammo_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class I_Truck_02_fuel_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class I_Truck_02_box_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class I_Truck_02_medical_F: I_Truck_02_box_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + + class Truck_03_base_F; + class O_Truck_03_transport_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; + }; + class O_Truck_03_covered_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; + }; + class O_Truck_03_device_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; + }; + class O_Truck_03_ammo_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; + }; + class O_Truck_03_fuel_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; + }; + class O_Truck_03_repair_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; + }; + class O_Truck_03_medical_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; + }; + + // helicopters + class Heli_Attack_01_base_F; + class B_Heli_Attack_01_F: Heli_Attack_01_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; + }; + + class Heli_Light_01_base_F; + class B_Heli_Light_01_F: Heli_Light_01_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; + }; + + class Heli_Light_01_armed_base_F; + class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; + }; + + class Heli_Light_01_civil_base_F: Heli_Light_01_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; + }; + + class B_Heli_Transport_03_base_F; + class B_Heli_Transport_03_F: B_Heli_Transport_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; + }; + + class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F {}; + class B_Heli_Transport_03_unarmed_F: B_Heli_Transport_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; + }; + + class Heli_Light_02_base_F; + class O_Heli_Light_02_F: Heli_Light_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; + }; + class O_Heli_Light_02_unarmed_F: Heli_Light_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; + }; + + class I_Heli_light_03_base_F; + class I_Heli_light_03_F: I_Heli_light_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; + }; + + class I_Heli_light_03_unarmed_base_F; + class I_Heli_light_03_unarmed_F: I_Heli_light_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; + }; + + class Heli_Transport_02_base_F; + class I_Heli_Transport_02_F: Heli_Transport_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; + }; + + // planes + class Plane_CAS_01_base_F; + class B_Plane_CAS_01_F: Plane_CAS_01_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; + }; + + class Plane_CAS_02_base_F; + class O_Plane_CAS_02_F: Plane_CAS_02_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; + }; + + class Plane_Fighter_03_base_F; + class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; + }; + + class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; + }; + + // uavs + class UAV_02_base_F; + class B_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class O_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class I_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + + class UAV_02_CAS_base_F: UAV_02_base_F {}; + class B_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class O_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class I_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + + // pistols + class Pistol_Base_F; + class Weapon_hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class Weapon_hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class Weapon_hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // rocket launchers + class Launcher_Base_F; + class Weapon_launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + class Weapon_launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class Weapon_launch_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + + class Weapon_launch_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class Weapon_launch_B_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; + //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; + + class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + + // rifles + + // MX + class Weapon_Base_F; + class Weapon_arifle_MX_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + }; + + class Weapon_arifle_MXC_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + }; + + class Weapon_arifle_MX_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + }; + + class Weapon_arifle_MX_SW_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + + class Weapon_arifle_MXM_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + + // Katiba + class Weapon_arifle_Katiba_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + + class Weapon_arifle_Katiba_C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + + // F2000 + class Weapon_arifle_Mk20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + + class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class Weapon_arifle_Mk20C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + + class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + + class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // TAR-21 + class Weapon_arifle_TRG21_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + + class Weapon_arifle_TRG20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + + // sub machine guns + class Weapon_SMG_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + class Weapon_SMG_02_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + class Weapon_hgun_PDW2000_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + class Weapon_arifle_SDAR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // machine guns + class Weapon_LMG_Mk200_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class Weapon_LMG_Zafir_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class Weapon_srifle_EBR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class Weapon_srifle_GM6_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + + class Weapon_srifle_GM6_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class Weapon_srifle_LRR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + + class Weapon_srifle_LRR_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class Weapon_srifle_DMR_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; }; // WEAPONS class Mode_FullAuto; class CfgWeapons { - // assault rifles + // assault rifles - // MX - class arifle_MX_Base_F; - class arifle_MX_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - class arifle_MX_Black_F: arifle_MX_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; - }; - - class arifle_MXC_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - class arifle_MXC_Black_F: arifle_MXC_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; - }; - - class arifle_MX_GL_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - class arifle_MX_GL_Black_F: arifle_MX_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; - }; - - class arifle_MX_SW_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - class arifle_MX_SW_Black_F: arifle_MX_SW_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; - }; - - class arifle_MXM_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - class arifle_MXM_Black_F: arifle_MXM_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; - }; - - // Katiba - class arifle_katiba_Base_F; - class arifle_Katiba_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - class arifle_Katiba_GL_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - class arifle_Katiba_C_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - // SDAR - class SDAR_base_F; - class arifle_SDAR_F: SDAR_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // TAR-21 - class Tavor_base_F; - class arifle_TRG21_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - class arifle_TRG21_GL_F: arifle_TRG21_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - class arifle_TRG20_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - // F2000 - class mk20_base_F; - class arifle_Mk20_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - class arifle_Mk20_plain_F: arifle_Mk20_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class arifle_Mk20C_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - class arifle_Mk20C_plain_F: arifle_Mk20C_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class arifle_Mk20_GL_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // Vector - class SMG_01_Base; - class SMG_01_F: SMG_01_Base { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - // Scorpion - class SMG_02_base_F; - class SMG_02_F: SMG_02_base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - // PDW 2000 - class pdw2000_base_F; - class hgun_pdw2000_F: pdw2000_base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - // pistols - class Pistol_Base_F; - class hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // machine guns - class Rifle_Long_Base_F; - class LMG_Mk200_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class LMG_Zafir_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class EBR_base_F; - class srifle_EBR_F: EBR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class LRR_base_F; - class srifle_LRR_F: LRR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - class srifle_LRR_camo_F: srifle_LRR_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class GM6_base_F; - class srifle_GM6_F: GM6_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - class srifle_GM6_camo_F: srifle_GM6_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class DMR_01_base_F; - class srifle_DMR_01_F: DMR_01_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; - - // launchers - class Launcher_Base_F; - class launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class launch_Titan_base: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - class launch_Titan_short_base: launch_Titan_base { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - // vehicle weapons - - // gatlings - class CannonCore; - class gatling_20mm: CannonCore { - //displayName = ""; - class manual: CannonCore { - //displayName = ""; + // MX + class arifle_MX_Base_F; + class arifle_MX_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; }; - }; - class Twin_Cannon_20mm: gatling_20mm { - displayName = "Plamen PL-20"; - class manual: manual { - displayName = "Plamen PL-20"; - }; - }; - - class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels - displayName = "GSh-3-30"; - class LowROF: Mode_FullAuto { - displayName = "GSh-3-30"; - }; - }; - - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - displayName = "GAU-8"; - class LowROF: Mode_FullAuto { - displayName = "GAU-8"; - }; - }; - - class Cannon_30mm_Plane_CAS_02_F: CannonCore { - displayName = "GSh-301"; - class LowROF: Mode_FullAuto { - displayName = "GSh-301"; - }; - }; - - // missiles - class RocketPods; - class Missile_AA_04_Plane_CAS_01_F: RocketPods { - displayName = "AIM-9 Sidewinder"; - }; - class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { - displayName = "Wympel R-73"; - }; - - class MissileLauncher; - class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { - displayName = "AGM-65 Maverick"; - }; - class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { - displayName = "Kh-25MTP"; - }; - - // rockets - class Rocket_04_HE_Plane_CAS_01_F: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "Hydra 70"; - }; - - class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - - class rockets_Skyfire: RocketPods { - displayName = "Skyfire-70"; - class Burst: RocketPods { - displayName = "Skyfire-70"; - }; - }; - - // more missiles - class missiles_DAR: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - - class missiles_DAGR: RocketPods { - displayName = "DAGR"; - class Burst: RocketPods { - displayName = "DAGR"; - }; - }; - - class missiles_ASRAAM: MissileLauncher { - displayName = "AIM-132 ASRAAM"; - }; - - class missiles_Zephyr: MissileLauncher { - displayName = "AIM-120A AMRAAM"; - }; - - class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on - displayName = "9K121 Vikhr"; - }; - - // bomb - class Bomb_04_Plane_CAS_01_F: RocketPods { - //displayName = ""; - }; - class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { - displayName = "FAB-250M-54"; - }; - - // machine guns - class MGunCore; - class M134_minigun: MGunCore { - displayName = "2x M134 Minigun"; - }; - - class LMG_RCWS; - class MGun; - - class LMG_Minigun: LMG_RCWS { - displayName = "M134 Minigun"; - class manual: MGun { - displayName = "M134 Minigun"; - }; - }; - - class HMG_127: LMG_RCWS { - displayName = "M2"; - class manual: MGun { - displayName = "M2"; - }; - }; - - class HMG_01: HMG_127 { - displayName = "XM312"; - }; - class HMG_M2: HMG_01 { - displayName = "M2"; - }; - - class HMG_NSVT: HMG_127 { - displayName = "NSVT"; - class manual: manual { - displayName = "NSVT"; - }; - }; - - // grenade launchers - class GMG_F; - class GMG_20mm: GMG_F { - displayName = "XM307"; - class manual: GMG_F { - displayName = "XM307"; - }; - }; - - class GMG_40mm: GMG_F { - displayName = "Mk 19"; - class manual: GMG_F { - displayName = "Mk 19"; - }; - }; - - // autocannons - class autocannon_35mm: CannonCore { - displayName = "GDF-001"; - class manual: CannonCore { - displayName = "GDF-001"; - }; - }; - - // aa missiles - class missiles_titan: MissileLauncher { - displayName = "Mini-Spike"; - }; - - // mortar - class mortar_155mm_AMOS: CannonCore { - displayName = "L/52"; - }; - - // artillery rockets - class rockets_230mm_GAT: RocketPods { - displayName = "M269"; - }; - - // tank guns - class cannon_120mm: CannonCore { - class player; - displayName = "MG251"; - }; - - class cannon_120mm_long: cannon_120mm { - displayName = "L/55"; - class player: player {}; - }; - - class cannon_105mm: cannon_120mm { - displayName = "M68"; - class player: player { - displayName = "M68"; - }; - }; - - class cannon_125mm: cannon_120mm { - displayName = "2A46"; - }; - - // coax machine guns - class LMG_coax: LMG_RCWS { - displayName = "PKT"; - }; - - class ACE_LMG_coax_MBT_01: LMG_coax { - displayName = "MAG 58"; - }; - - class ACE_LMG_coax_APC_Tracked_03: LMG_coax { - displayName = "L94A1"; - }; - - // more autocannons - class autocannon_Base_F; - class autocannon_40mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; + class arifle_MX_Black_F: arifle_MX_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; }; - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; + class arifle_MXC_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; }; - }; - - class autocannon_30mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; + class arifle_MXC_Black_F: arifle_MXC_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; }; - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; + class arifle_MX_GL_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; }; - }; - - class autocannon_30mm: autocannon_30mm_CTWS { - displayName = "L21A1 RARDEN"; - class AP: AP { - displayName = "L21A1 RARDEN"; + class arifle_MX_GL_Black_F: arifle_MX_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; }; - class HE: HE { - displayName = "L21A1 RARDEN"; + class arifle_MX_SW_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + class arifle_MX_SW_Black_F: arifle_MX_SW_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; + }; + + class arifle_MXM_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + class arifle_MXM_Black_F: arifle_MXM_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; + }; + + // Katiba + class arifle_katiba_Base_F; + class arifle_Katiba_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + class arifle_Katiba_GL_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + class arifle_Katiba_C_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + // SDAR + class SDAR_base_F; + class arifle_SDAR_F: SDAR_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // TAR-21 + class Tavor_base_F; + class arifle_TRG21_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + class arifle_TRG21_GL_F: arifle_TRG21_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + class arifle_TRG20_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + // F2000 + class mk20_base_F; + class arifle_Mk20_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + class arifle_Mk20_plain_F: arifle_Mk20_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class arifle_Mk20C_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + class arifle_Mk20C_plain_F: arifle_Mk20C_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class arifle_Mk20_GL_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // Vector + class SMG_01_Base; + class SMG_01_F: SMG_01_Base { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + // Scorpion + class SMG_02_base_F; + class SMG_02_F: SMG_02_base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + // PDW 2000 + class pdw2000_base_F; + class hgun_pdw2000_F: pdw2000_base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + // pistols + class Pistol_Base_F; + class hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // machine guns + class Rifle_Long_Base_F; + class LMG_Mk200_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class LMG_Zafir_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class EBR_base_F; + class srifle_EBR_F: EBR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class LRR_base_F; + class srifle_LRR_F: LRR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + class srifle_LRR_camo_F: srifle_LRR_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class GM6_base_F; + class srifle_GM6_F: GM6_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + class srifle_GM6_camo_F: srifle_GM6_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class DMR_01_base_F; + class srifle_DMR_01_F: DMR_01_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; + + // launchers + class Launcher_Base_F; + class launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class launch_Titan_base: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + class launch_Titan_short_base: launch_Titan_base { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + // vehicle weapons + + // gatlings + class CannonCore; + class gatling_20mm: CannonCore { + //displayName = ""; + class manual: CannonCore { + //displayName = ""; + }; + }; + class Twin_Cannon_20mm: gatling_20mm { + displayName = "Plamen PL-20"; + class manual: manual { + displayName = "Plamen PL-20"; + }; + }; + + class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels + displayName = "GSh-3-30"; + class LowROF: Mode_FullAuto { + displayName = "GSh-3-30"; + }; + }; + + class Gatling_30mm_Plane_CAS_01_F: CannonCore { + displayName = "GAU-8"; + class LowROF: Mode_FullAuto { + displayName = "GAU-8"; + }; + }; + + class Cannon_30mm_Plane_CAS_02_F: CannonCore { + displayName = "GSh-301"; + class LowROF: Mode_FullAuto { + displayName = "GSh-301"; + }; + }; + + // missiles + class RocketPods; + class Missile_AA_04_Plane_CAS_01_F: RocketPods { + displayName = "AIM-9 Sidewinder"; + }; + class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { + displayName = "Wympel R-73"; + }; + + class MissileLauncher; + class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { + displayName = "AGM-65 Maverick"; + }; + class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { + displayName = "Kh-25MTP"; + }; + + // rockets + class Rocket_04_HE_Plane_CAS_01_F: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "Hydra 70"; + }; + + class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + + class rockets_Skyfire: RocketPods { + displayName = "Skyfire-70"; + class Burst: RocketPods { + displayName = "Skyfire-70"; + }; + }; + + // more missiles + class missiles_DAR: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + + class missiles_DAGR: RocketPods { + displayName = "DAGR"; + class Burst: RocketPods { + displayName = "DAGR"; + }; + }; + + class missiles_ASRAAM: MissileLauncher { + displayName = "AIM-132 ASRAAM"; + }; + + class missiles_Zephyr: MissileLauncher { + displayName = "AIM-120A AMRAAM"; + }; + + class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on + displayName = "9K121 Vikhr"; + }; + + // bomb + class Bomb_04_Plane_CAS_01_F: RocketPods { + //displayName = ""; + }; + class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { + displayName = "FAB-250M-54"; + }; + + // machine guns + class MGunCore; + class M134_minigun: MGunCore { + displayName = "2x M134 Minigun"; + }; + + class LMG_RCWS; + class MGun; + + class LMG_Minigun: LMG_RCWS { + displayName = "M134 Minigun"; + class manual: MGun { + displayName = "M134 Minigun"; + }; + }; + + class HMG_127: LMG_RCWS { + displayName = "M2"; + class manual: MGun { + displayName = "M2"; + }; + }; + + class HMG_01: HMG_127 { + displayName = "XM312"; + }; + class HMG_M2: HMG_01 { + displayName = "M2"; + }; + + class HMG_NSVT: HMG_127 { + displayName = "NSVT"; + class manual: manual { + displayName = "NSVT"; + }; + }; + + // grenade launchers + class GMG_F; + class GMG_20mm: GMG_F { + displayName = "XM307"; + class manual: GMG_F { + displayName = "XM307"; + }; + }; + + class GMG_40mm: GMG_F { + displayName = "Mk 19"; + class manual: GMG_F { + displayName = "Mk 19"; + }; + }; + + // autocannons + class autocannon_35mm: CannonCore { + displayName = "GDF-001"; + class manual: CannonCore { + displayName = "GDF-001"; + }; + }; + + // aa missiles + class missiles_titan: MissileLauncher { + displayName = "Mini-Spike"; + }; + + // mortar + class mortar_155mm_AMOS: CannonCore { + displayName = "L/52"; + }; + + // artillery rockets + class rockets_230mm_GAT: RocketPods { + displayName = "M269"; + }; + + // tank guns + class cannon_120mm: CannonCore { + class player; + displayName = "MG251"; + }; + + class cannon_120mm_long: cannon_120mm { + displayName = "L/55"; + class player: player {}; + }; + + class cannon_105mm: cannon_120mm { + displayName = "M68"; + class player: player { + displayName = "M68"; + }; + }; + + class cannon_125mm: cannon_120mm { + displayName = "2A46"; + }; + + // coax machine guns + class LMG_coax: LMG_RCWS { + displayName = "PKT"; + }; + + class ACE_LMG_coax_MBT_01: LMG_coax { + displayName = "MAG 58"; + }; + + class ACE_LMG_coax_APC_Tracked_03: LMG_coax { + displayName = "L94A1"; + }; + + // more autocannons + class autocannon_Base_F; + class autocannon_40mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm: autocannon_30mm_CTWS { + displayName = "L21A1 RARDEN"; + class AP: AP { + displayName = "L21A1 RARDEN"; + }; + + class HE: HE { + displayName = "L21A1 RARDEN"; + }; }; - }; }; class CfgMagazines { - class VehicleMagazine; - class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { - displayNameShort = "30mm HEI"; - }; + class VehicleMagazine; + class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { + displayNameShort = "30mm HEI"; + }; - class 7Rnd_Rocket_04_HE_F: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "70mm AP"; - }; + class 7Rnd_Rocket_04_HE_F: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "70mm AP"; + }; - class 24Rnd_PG_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 12Rnd_PG_missiles: 24Rnd_PG_missiles { - displayNameShort = "70mm HE"; - }; + class 24Rnd_PG_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 12Rnd_PG_missiles: 24Rnd_PG_missiles { + displayNameShort = "70mm HE"; + }; - class 2000Rnd_65x39_Belt; - class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { - displayNameShort = "7.62mm"; - }; - class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { - displayNameShort = "7.62mm"; - }; + class 2000Rnd_65x39_Belt; + class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { + displayNameShort = "7.62mm"; + }; + class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { + displayNameShort = "7.62mm"; + }; - class 500Rnd_127x99_mag: VehicleMagazine { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; + class 500Rnd_127x99_mag: VehicleMagazine { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; - class 200Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; + class 200Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; - class 100Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; + class 100Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; - class 200Rnd_40mm_G_belt: VehicleMagazine { - displayNameShort = "40mm HE"; - }; + class 200Rnd_40mm_G_belt: VehicleMagazine { + displayNameShort = "40mm HE"; + }; - class 24Rnd_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; + class 24Rnd_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; - class 300Rnd_20mm_shells: VehicleMagazine { - displayNameShort = "20mm HE"; - }; + class 300Rnd_20mm_shells: VehicleMagazine { + displayNameShort = "20mm HE"; + }; - class 14Rnd_80mm_rockets: VehicleMagazine { - displayNameShort = "70mm HE"; - }; + class 14Rnd_80mm_rockets: VehicleMagazine { + displayNameShort = "70mm HE"; + }; - class 250Rnd_30mm_HE_shells: VehicleMagazine { - displayNameShort = "30mm HE"; - }; - class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm APDS"; - }; + class 250Rnd_30mm_HE_shells: VehicleMagazine { + displayNameShort = "30mm HE"; + }; + class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm APDS"; + }; - class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "80mm HE"; - }; + class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "80mm HE"; + }; - class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { - displayNameShort = "80mm AP"; - }; + class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { + displayNameShort = "80mm AP"; + }; - class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { - displayNameShort = "30mm HEI-T"; - }; + class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { + displayNameShort = "30mm HEI-T"; + }; - class 680Rnd_35mm_AA_shells: VehicleMagazine { - displayNameShort = "35mm HEI"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; + class 680Rnd_35mm_AA_shells: VehicleMagazine { + displayNameShort = "35mm HEI"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; - class 32Rnd_155mm_Mo_shells: VehicleMagazine { - displayNameShort = "155mm HE"; - }; - class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { - displayNameShort = "155mm Smoke"; - }; - class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Mines"; - }; - class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm AT Mines"; - }; - class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Cluster"; - }; - class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Guided"; - }; - class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Laser Guided"; - }; + class 32Rnd_155mm_Mo_shells: VehicleMagazine { + displayNameShort = "155mm HE"; + }; + class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { + displayNameShort = "155mm Smoke"; + }; + class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Mines"; + }; + class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm AT Mines"; + }; + class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Cluster"; + }; + class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Guided"; + }; + class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Laser Guided"; + }; - class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { - displayName = "227mm HE Missile"; - displayNameShort = "227mm HE"; - }; + class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { + displayName = "227mm HE Missile"; + displayNameShort = "227mm HE"; + }; - class 30Rnd_120mm_HE_shells: VehicleMagazine { - displayNameShort = "120mm HE"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; + class 30Rnd_120mm_HE_shells: VehicleMagazine { + displayNameShort = "120mm HE"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; - class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm AP"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; + class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm AP"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; - class 200Rnd_762x51_Belt: VehicleMagazine { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; + class 200Rnd_762x51_Belt: VehicleMagazine { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; - class 2000Rnd_762x51_Belt_Red; - class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; + class 2000Rnd_762x51_Belt_Red; + class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; - class 2000Rnd_762x51_Belt_Green; - class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; + class 2000Rnd_762x51_Belt_Green; + class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; - class 2000Rnd_762x51_Belt_Yellow; - class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; + class 2000Rnd_762x51_Belt_Yellow; + class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; - class 1000Rnd_762x51_Belt_Red; - class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; + class 1000Rnd_762x51_Belt_Red; + class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; - class 1000Rnd_762x51_Belt_Green; - class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; + class 1000Rnd_762x51_Belt_Green; + class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; - class 1000Rnd_762x51_Belt_Yellow; - class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; + class 1000Rnd_762x51_Belt_Yellow; + class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; - class 16Rnd_120mm_HE_shells; - class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { - displayNameShort = "125mm HE"; - }; + class 16Rnd_120mm_HE_shells; + class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { + displayNameShort = "125mm HE"; + }; - class 16Rnd_120mm_HE_shells_Tracer_Red; - class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { - displayNameShort = "125mm HE-T"; - }; + class 16Rnd_120mm_HE_shells_Tracer_Red; + class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { + displayNameShort = "125mm HE-T"; + }; - class 16Rnd_120mm_HE_shells_Tracer_Green; - class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { - displayNameShort = "125mm HE-T"; - }; + class 16Rnd_120mm_HE_shells_Tracer_Green; + class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { + displayNameShort = "125mm HE-T"; + }; - class 16Rnd_120mm_HE_shells_Tracer_Yellow; - class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { - displayNameShort = "125mm HE-T"; - }; + class 16Rnd_120mm_HE_shells_Tracer_Yellow; + class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { + displayNameShort = "125mm HE-T"; + }; - class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { - displayNameShort = "125mm MP"; - }; - class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; + class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { + displayNameShort = "125mm MP"; + }; + class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; - class 32Rnd_120mm_APFSDS_shells; - class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { - displayNameShort = "125mm AP"; - }; + class 32Rnd_120mm_APFSDS_shells; + class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { + displayNameShort = "125mm AP"; + }; - class 32Rnd_120mm_APFSDS_shells_Tracer_Red; - class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { - displayNameShort = "125mm AP-T"; - }; + class 32Rnd_120mm_APFSDS_shells_Tracer_Red; + class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { + displayNameShort = "125mm AP-T"; + }; - class 32Rnd_120mm_APFSDS_shells_Tracer_Green; - class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { - displayNameShort = "125mm AP-T"; - }; + class 32Rnd_120mm_APFSDS_shells_Tracer_Green; + class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { + displayNameShort = "125mm AP-T"; + }; - class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; - class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { - displayNameShort = "125mm AP-T"; - }; + class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; + class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { + displayNameShort = "125mm AP-T"; + }; - class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { - displayNameShort = "105mm MP"; - }; - class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; + class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { + displayNameShort = "105mm MP"; + }; + class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; - class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { - displayNameShort = "105mm AP"; - }; - class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; + class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { + displayNameShort = "105mm AP"; + }; + class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; - class 60Rnd_40mm_GPR_shells: VehicleMagazine { - displayNameShort = "40mm GPR"; - }; - class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; + class 60Rnd_40mm_GPR_shells: VehicleMagazine { + displayNameShort = "40mm GPR"; + }; + class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; - class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm AP"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; + class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm AP"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; - class 450Rnd_127x108_Ball: VehicleMagazine { - displayNameShort = "12.7mm"; - }; + class 450Rnd_127x108_Ball: VehicleMagazine { + displayNameShort = "12.7mm"; + }; - class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm MP"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; + class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm MP"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; - class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm AP"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; + class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm AP"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; - class 200Rnd_20mm_G_belt: VehicleMagazine { - displayNameShort = "20mm HE"; - }; - class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { - displayNameShort = "20mm HE"; - }; + class 200Rnd_20mm_G_belt: VehicleMagazine { + displayNameShort = "20mm HE"; + }; + class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { + displayNameShort = "20mm HE"; + }; - // mines - class CA_Magazine; - // http://en.wikipedia.org/wiki/M15_mine - class ATMine_Range_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_ATMine_Name"; - }; - // http://en.wikipedia.org/wiki/VS-50_mine - class APERSMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; - }; - // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html - class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; - }; - // http://en.wikipedia.org/wiki/PMR-3_mine - class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; - }; - // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf - class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_SLAM_Name"; - }; + // mines + class CA_Magazine; + // http://en.wikipedia.org/wiki/M15_mine + class ATMine_Range_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_ATMine_Name"; + }; + // http://en.wikipedia.org/wiki/VS-50_mine + class APERSMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; + }; + // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html + class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; + }; + // http://en.wikipedia.org/wiki/PMR-3_mine + class APERSTripMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; + }; + // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf + class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_SLAM_Name"; + }; - // claymore - class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_Claymore_Name"; - }; + // claymore + class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_Claymore_Name"; + }; - // satchels - class SatchelCharge_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; - }; - class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; - }; + // satchels + class SatchelCharge_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; + }; + class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { + displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; + }; - // hand grenades - class HandGrenade: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; - }; - class SmokeShell: HandGrenade { - displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; - }; - class SmokeShellBlue: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; - }; - class SmokeShellGreen: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; - }; - class SmokeShellOrange: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; - }; - class SmokeShellPurple: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; - }; - class SmokeShellRed: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; - }; - class SmokeShellYellow: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; - }; + // hand grenades + class HandGrenade: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; + }; + class SmokeShell: HandGrenade { + displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; + }; + class SmokeShellBlue: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; + }; + class SmokeShellGreen: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; + }; + class SmokeShellOrange: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; + }; + class SmokeShellPurple: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; + }; + class SmokeShellRed: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; + }; + class SmokeShellYellow: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; + }; }; diff --git a/addons/realisticnames/script_component.hpp b/addons/realisticnames/script_component.hpp index 74a7dd413f..54b9cf4d7c 100644 --- a/addons/realisticnames/script_component.hpp +++ b/addons/realisticnames/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_REALISTICNAMES - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_REALISTICNAMES - #define DEBUG_SETTINGS DEBUG_ENABLED_REALISTICNAMES + #define DEBUG_SETTINGS DEBUG_ENABLED_REALISTICNAMES #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index ed70a3a00d..8c1483ead2 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1,1218 +1,1218 @@  - - - XM312 - XM312 - XM312 - XM312 - XM312 - XM312 - XM312 - XM312 - XM312 - XM312A - - - XM312A - XM312A - XM312 - XM312A - XM312A - XM312A - XM312A - XM312A - XM312A - XM312A - - - XM312 (High) - XM312 (Hoch) - XM312 (Alto) - XM312 (Haut) - XM312 (VysokĂ½) - XM312 (Wysoki) - XM312 (Đ’Ñ‹ÑĐ¾ĐºĐ¸Đ¹) - XM312 (Alta) - XM312 (MagasĂ­tott) - XM312 (Alta) - - - XM307 - XM307 - XM307 - XM307 - XM307 - XM307 - XM307 - XM307 - XM307 - XM307 - - - XM307A - XM307A - XM307A - XM307A - XM307A - XM307A - XM307A - XM307A - XM307A - XM307A - - - XM307 (High) - XM307 (Hoch) - XM307 (Alto) - XM307 (Haut) - XM307 (VysokĂ½) - XM307 (Wysoki) - XM307 (Đ’Ñ‹ÑĐ¾ĐºĐ¸Đ¹) - XM307 (Alta) - XM307 (MagasĂ­tott) - XM307 (Alta) - - - Mini-Spike Launcher (AT) - Mini-Spike Lenkflugkörper (AT) - Lanzador Mini-Spike (AT) - Poste de tir Mini-Spike (AC) - Mini-Spike OdpalovaÄ (AT) - Wyrzutnia Mini-Spike (AT) - Mini-Spike ĐŸÑƒÑĐºĐ¾Đ²Đ¾Đµ уÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ (ĐŸĐ¢Đ Đ) - Lança-mĂ­sseis Mini-Spike (AC) - Mini-Spike rakĂ©tarendszer (pĂ¡ncĂ©ltörÅ‘) - Lanciatore Mini-Spike (AC) - - - Mini-Spike Launcher (AA) - Mini-Spike Lenkflugkörper (AA) - Lanzador Mini-Spike (AA) - Poste de tir Mini-Spike (AA) - Mini-Spike OdpalovaÄ (AA) - Wyrzutnia Mini-Spike (AA) - Mini-Spike ĐŸÑƒÑĐºĐ¾Đ²Đ¾Đµ уÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ (Đ’Đ’) - Lança-mĂ­sseis Mini-Spike (AA) - Mini-Spike rakĂ©tarendszer (lĂ©gvĂ©delmi) - Lanciatore Mini-Spike (AA) - - - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - YABHON-R3 - - - YABHON-R3 (CAS) - YABHON-R3 (LuftnahunterstĂ¼tzung) - YABHON-R3 (CAS) - YABHON-R3 (CAS) - YABHON-R3 (CAS) - YABHON-R3 (ÑˆÑ‚ÑƒÑ€Đ¼Đ¾Đ²Đ¸Đº) - - - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - M-ATV - - - M-ATV (HMG) - M-ATV (SMG) - M-ATV (HMG) - M-ATV (CKM) - M-ATV (TK) - M-ATV (HMG) - M-ATV (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) - M-ATV (HMG) - M-ATV (HMG) - M-ATV (HMG) - - - M-ATV (GMG) - M-ATV (GMW) - M-ATV (GMG) - M-ATV (GMG) - M-ATV (GranĂ¡tomet) - M-ATV (GMG) - M-ATV (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) - M-ATV (GMG) - M-ATV (GMG) - M-ATV (GMG) - - - Merkava Mk IV M - Merkava Mk IV M - Merkava Mk IV M - Merkawa Mk IV M - Merkava Mk IV M - Merkava Mk IV M - ĐœĐµÑ€ĐºĐ°Đ²Đ° Mk IV M - Merkava Mk IV M - Merkava Mk IV M - Merkava Mk IV M - - - Merkava Mk IV LIC - Merkava Mk IV LIC - Merkava Mk IV LIC - Merkawa Mk IV LIC - Merkava Mk IV LIC - Merkava Mk IV LIC - ĐœĐµÑ€ĐºĐ°Đ²Đ° Mk IV LIC - Merkava Mk IV LIC - Merkava Mk IV LIC - Merkava Mk IV LIC - - - Sholef - Sholef - Sholef - Sholef - Sholef - Sholef - Đ¨Đ¾Đ»ĐµÑ„ - Sholef - Sholef - Sholef - - - Seara - Seara - Seara - Seara - Seara - Seara - Seara - Seara - Seara - Seara - - - Namer - Namer - Namer - Namer - Namer - Namer - ĐĐ°Đ¼ĐµÑ€ - Namer - Namer - Namer - - - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - Bardelas - - - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - Patria AMV - - - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - Nemmera - - - HEMTT Transport - HEMTT Transport - HEMTT de transporte - HEMTT Transportowy - HEMTT ValnĂ­k - HEMTT Transport - HEMTT Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ - HEMTT Transporte - HEMTT szĂ¡llĂ­tĂ³jĂ¡rmű - HEMTT da trasporto - - - HEMTT Transport (covered) - HEMTT Transport (bedeckt) - HEMTT de transporte (cubierto) - HEMTT Transportowy (zakryty) - HEMTT ValnĂ­k (krytĂ½) - HEMTT Transport (bĂ¢chĂ©) - HEMTT Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (ĐºÑ€Ñ‹Ñ‚Ñ‹Đ¹) - HEMTT Transporte (coberto) - HEMTT szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) - HEMTT da trasporto (coperto) - - - HEMTT - HEMTT - HEMTT - HEMTT - HEMTT - HEMTT Tracteur - HEMTT - HEMTT - HEMTT - HEMTT - - - HEMTT Container - HEMTT Container - HEMTT de contenedor - HEMTT Kontener - HEMTT SkÅ™Ă­ÅˆovĂ½ - HEMTT Conteneur - HEMTT ĐĐ¾Đ½Ñ‚ĐµĐ¹Đ½ĐµÑ€ - HEMTT ContĂªiner - HEMTT KontĂ©ner - HEMTT portacontainer - - - HEMTT Medical - HEMTT Sanitäter - HEMTT mĂ©dico - HEMTT Medyczny - HEMTT ZdravotnickĂ½ - HEMTT Sanitaire - HEMTT ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ - HEMTT MĂ©dico - HEMTT (egĂ©szsĂ©gĂ¼gyi) - HEMTT Medico - - - HEMTT Ammo - HEMTT Munition - HEMTT de municiĂ³n - HEMTT Amunicyjny - HEMTT MuniÄnĂ­ - HEMTT Munitions - HEMTT Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ - HEMTT Munições - HEMTT (lÅ‘szerszĂ¡llĂ­tĂ³) - HEMTT di rifornimento munizioni - - - HEMTT Fuel - HEMTT Treibstoff - HEMTT de combustible - HEMTT Cysterna - HEMTT Cisterna - HEMTT Citerne - HEMTT Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº - HEMTT CombustĂ­vel - HEMTT (Ă¼zemanyag-szĂ¡llĂ­tĂ³) - HEMTT di rifornimento carburante - - - HEMTT Repair - HEMTT Instandsetzung - HEMTT de reparaciĂ³n - HEMTT Naprawczy - HEMTT OpravĂ¡renskĂ½ - HEMTT RĂ©paration - HEMTT Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ - HEMTT Reparador - HEMTT (szerelÅ‘-jĂ¡rmű) - HEMTT Riparatore - - - Fennek - Fennek - Fennek - Fennek - Fennek - Fennek - Đ¤ĐµĐ½Đ½ĐµĐº - Fennek - Fennek - Fennek - - - Fennek (HMG) - Fennek (SMG) - Fennek (HMG) - Fennek (CKM) - Fennek (TK) - Fennek (HMG) - Đ¤ĐµĐ½Đ½ĐµĐº (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) - Fennek (HMG) - Fennek (HMG) - Fennek (HMG) - - - Fennek (GMG) - Fennek (GMW) - Fennek (GMG) - Fennek (GMG) - Fennek (granĂ¡tomet) - Fennek (GMG) - Đ¤ĐµĐ½Đ½ĐµĐº (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) - Fennek (GMG) - Fennek (GMG) - Fennek (GMG) - - - Leopard 2SG - Leopard 2SG - Leopard 2SG - Leopard 2SG - Leopard 2SG - Leopard 2SG - Đ›ĐµĐ¾Đ¿Đ°Ñ€Đ´ 2SG - Leopard 2SG - Leopard 2SG - Leopard 2SG - - - FV510 Warrior - FV510 Warrior - FV510 Warrior - FV510 Warrior - FV510 Warrior - FV510 Warrior - FV510 Đ£Đ¾Ñ€Ñ€Đ¸Đ¾Ñ€ - FV510 Warrior - FV510 Warrior - FV510 Warrior - - - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - Pandur II - - - KamAZ Transport - KamAZ Transport - KamAZ de transporte - KamAZ transportowy - KAMAZ ValnĂ­k - KamAZ Transport - ĐĐ°Đ¼ĐĐ— Đ¢Ñ€Đ°ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ - KamAZ Transporte - KamAZ szĂ¡llĂ­tĂ³jĂ¡rmű - KamAZ da trasporto - - - KamAZ Transport (covered) - KamAZ Transport (bedeckt) - KamAZ de transporte (cubierto) - KamAZ Transportowy (zakryty) - KAMAZ ValnĂ­k (krytĂ½) - KamAZ Transport (bĂ¢chĂ©) - ĐĐ°Đ¼ĐĐ— Đ¢Ñ€Đ°ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (ĐÑ€Ñ‹Ñ‚Ñ‹Đ¹) - KamAZ Transporte (coberto) - KamAZ szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) - KamAZ da trasporto (coperto) - - - KamAZ Ammo - KamAZ Munition - KamAZ de municiĂ³n - KamAZ Amunicyjny - KAMAZ MuniÄnĂ­ - KamAZ Munitions - ĐĐ°Đ¼ĐĐ— Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ - KamAZ Munições - KamAZ (lÅ‘szerszĂ¡llĂ­tĂ³) - KamAZ di rifornimento munizioni - - - KamAZ Fuel - KamAZ Treibstoff - KamAZ de combustible - KamAZ cysterna - KAMAZ Cisterna - KamAZ Citerne - ĐĐ°Đ¼ĐĐ— Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº - KamAZ CombustĂ­vel - KamAZ (Ă¼zemanyag-szĂ¡llĂ­tĂ³) - KamAZ di rifornimento carburante - - - KamAZ Repair - KamAZ Instandsetzung - KamAZ de reparaciĂ³n - KamAZ Naprawczy - KAMAZ OpravĂ¡renskĂ½ - KamAZ RĂ©paration - ĐĐ°Đ¼ĐĐ— Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ - KamAZ Reparador - KamAZ (szerelÅ‘-jĂ¡rmű) - KamAZ riparatore - - - KamAZ Medical - KamAZ Sanitäter - KamAZ mĂ©dico - KamAZ Medyczny - KAMAZ ZdravotnickĂ½ - KamAZ Sanitaire - ĐĐ°Đ¼ĐĐ— ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ - KamAZ MĂ©dico - KamAZ (egĂ©szsĂ©gĂ¼gyi) - KamAZ Medico - - - Punisher - Punisher - Punisher - Punisher - Punisher - Punisher - KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ - Punisher - Punisher - Punisher - - - Punisher (HMG) - Punisher (SMG) - Punisher (HMG) - Punisher (CKM) - Punisher (TK) - Punisher (HMG) - KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) - Punisher (HMG) - Punisher (HMG) - Punisher (HMG) - - - Punisher (GMG) - Punisher (GMW) - Punisher (GMG) - Punisher (CKM) - Punisher (granĂ¡tomet) - Punisher (GMG) - KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) - Punisher (GMG) - Punisher (GMG) - Punisher (GMG) - - - T100 Black Eagle - T100 Black Eagle - T100 Black Eagle - T100 Black Eagle - T100 Black Eagle - T100 Black Eagle - T100 Đ§ĐµÑ€Đ½Ñ‹Đ¹ ĐÑ€ĐµĐ» - T100 Black Eagle - T100 Black Eagle - T100 Black Eagle - - - 2S9 Sochor - 2S9 Sochor - 2S9 Sochor - 259 Sochor - 2S9 Sochor - 2S9 Sochor - 2S9 Đ¡Đ¾ĐºĐ¾Ñ€ - 2S9 Sochor - 2S9 Sochor - 2S9 Sochor - - - BM-2T Stalker - BM-2T Stalker - BM-2T Stalker - BM-2T Stalker - BM-2T Stalker - BM-2T Stalker - Đ‘Đœ-2Đ¢ Đ¡Ñ‚Đ°Đ»ĐºĐµÑ€ - BM-2T Stalker - BM-2T Stalker - BM-2T Stalker - - - ZSU-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - Đ—Đ¡Đ£-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - ZSU-35 Tigris - - - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - Otokar ARMA - - - Typhoon Transport - Typhoon Transport - Typhoon de transporte - Typhoon Transportowy - Typhoon ValnĂ­k - Typhoon Transport - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ - Typhoon Transporte - Typhoon szĂ¡llĂ­tĂ³jĂ¡rmű - Typhoon da trasporto - - - Typhoon Transport (covered) - Typhoon Transport (bedeckt) - Typhoon de transporte (cubierto) - Typhoon Transportowy (przykryty) - Typhoon ValnĂ­k (krytĂ½) - Typhoon Transport (bĂ¢chĂ©) - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (kÑ€Ñ‹Ñ‚Ñ‹Đ¹) - Typhoon Transporte (coberto) - Typhoon szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) - Typhoon da trasporto (coperto) - - - Typhoon Device - Typhoon Gerät - Typhoon de dispositivo - Typhoon UrzÄ…dzenie - Typhoon ZaÅ™Ă­zenĂ­ - Typhoon Dispositif - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ£ÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ - Typhoon Dispositivo - Typhoon (szerkezet) - Typhoon per dispositivo - - - Typhoon Ammo - Typhoon Munition - Typhoon de municiĂ³n - Typhoon Amunicyjny - Typhoon MuniÄnĂ­ - Typhoon Munitions - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ - Typhoon Munições - Typhoon (lÅ‘szerszĂ¡llĂ­tĂ³) - Typhoon di rifornimento munizioni - - - Typhoon Fuel - Typhoon Treibstoff - Typhoon de combustible - Typhoon Cysterna - Typhoon Cisterna - Typhoon Citerne - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº - Typhoon CombustĂ­vel - Typhoon (Ă¼zemanyag-szĂ¡llĂ­tĂ³) - Typhoon di rifornimento carburante - - - Typhoon Repair - Typhoon Instandsetzung - Typhoon de reparaciĂ³n - Typhoon Naprawczy - Typhoon OpravĂ¡renskĂ½ - Typhoon RĂ©paration - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ - Typhoon Reparador - Typhoon (szerelÅ‘-jĂ¡rmű) - Typhoon riparatore - - - Typhoon Medical - Typhoon Sanitäter - Typhoon mĂ©dico - Typhoon Medyczny - Typhoon ZdravotnickĂ½ - Typhoon Sanitaire - Đ¢Đ°Đ¹Ñ„ÑƒĐ½ ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ - Typhoon MĂ©dico - Typhoon (egĂ©szsĂ©gĂ¼gyi) - Typhoon medico - - - RAH-66 Comanche - RAH-66 Comanche - RAH-66 Comanche - RAH-66 Comanche - RAH-66 Comanche - RAH-66 Commanche - RAH-66 ĐĐ¾Đ¼Đ°Đ½Ñ‡ - RAH-66 Comanche - RAH-66 Comanche - RAH-66 Comanche - - - MH-6 Little Bird - MH-6 Little Bird - MH-6 Litte Bird - MH-6 Little Bird - MH-6 Little Bird - MH-6 Little Bird - MH-6 Little Bird - MH-6 Little Bird - MH-6 Little Bird - MH-6 Little Bird - - - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - AH-6 Little Bird - - - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - CH-47I Chinook - - - CH-47I Chinook (unarmed) - CH-47I Chinook (unbewaffnet) - CH-47I Chinnok (Desarmado) - CH-47I Chinook (nieuzbrojony) - CH-47I Chinook (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) - CH-47I Chinook (NeozbrojenĂ½) - - - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Đ¢Đ°Đ½Đ´ĐµÑ€Đ±Đ¾Đ»Ñ‚ II - A-10D Thunderbolt II - A-10D Thunderbolt II - A-10D Thunderbolt II - - - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - AW159 Wildcat - - - AW159 Wildcat (unarmed) - AW159 Wildcat (unbewaffnet) - AW159 Wildcat (desarmado) - AW159 Wildcat (nieuzbrojony) - AW159 Wildcat (neozbrojenĂ½) - AW159 Wildcat (non-armĂ©) - AW159 Wildcat (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) - AW159 Wildcat (desarmado) - AW159 Wildcat (fegyvertelen) - AW159 Wildcat (disarmato) - - - AW101 Merlin - AW101 Merlin - AW101 Merlin - AW101 Merlin - AW101 Merlin - AW101 Merlin - AW101 ĐœĐµÑ€Đ»Đ¸Đ½ - AW101 Merlin - AW101 Merlin - AW101 Merlin - - - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ĐĐ»ÑŒĐ±Đ°Ñ‚Ñ€Đ¾Ñ (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - L-159 ALCA (CAS) - - - L-159 ALCA (AA) - L-159 ALCA (AA) - L-159 ALCA (AA) - L-159 ALCA (AA) - L-159 ALCA (AA) - L-159 ALCA (AA) - L-159 ĐĐ»ÑŒĐ±Đ°Ñ‚Ñ€Đ¾Ñ (AA) - L-159 ALCA (Đ’Đ’) - L-159 ALCA (AA) - L-159 ALCA (AA) - - - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 ĐĐ°ÑĐ°Ñ‚ĐºĐ° - Ka-60 Kasatka - Ka-60 Kasatka - Ka-60 Kasatka - - - Ka-60 Kasatka (unarmed) - Ka-60 Kasatka (unbewaffnet) - Ka-60 Kasatka (desarmado) - Ka-60 Kasatka (nieuzbrojony) - Ka-60 Kasatka (neozbrojenĂ¡) - Ka-60 Kasatka (non-armĂ©) - Ka-60 ĐĐ°ÑĐ°Ñ‚ĐºĐ° (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) - Ka-60 Kasatka (desarmado) - Ka-60 Kasatka (fegyvertelen) - Ka-60 Kasatka (disarmato) - - - Yak-130 - Yak-130 - Yak-130 - Jak-130 - Jak-130 - Yak-130 - Đ¯Đº-130 - Yak-130 - Jak-130 - Yak-130 - - - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - MD 500 - - - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - M4A1 SLAM - - - M18A1 Claymore - M18A1 Claymore - M18A1 Claymore - Mina kierunkowa M18A1 Claymore - M18A1 Mina Claymore - M18A1 Claymore Mine antipersonnel Ă  effet dirigĂ© - M18A1 ĐĐ»ĐµĐ¹Đ¼Đ¾Ñ€ - M18A1 Claymore - M18A1 Claymore akna - M18A1 Claymore Mina antiuomo - - - M183 Demolition Charge Assembly - M183 Geballte Sprengladung - Conjunto de carga de demoliciĂ³n M183 - Åadunek burzÄ…cy M183 - M183 DemoliÄnĂ­ nĂ¡lož - M183 Charge de DĂ©molition - M183 ĐĐ¾Đ¼Đ¿Đ»ĐµĐºÑ‚Đ½Ñ‹Đ¹ Đ¿Đ¾Đ´Ñ€Ñ‹Đ²Đ½Đ¾Đ¹ Đ·Đ°Ñ€ÑĐ´ - M183 Sacola de DemoliĂ§Ă£o - M183 rombolĂ³ töltet - M183 Demolition Charge Assembly - - - M112 Demolition Block - M112 Sprengladung - Bloque de demoliciĂ³n M112 - Åadunek burzÄ…cy M112 - M112 VĂ½buÅ¡nĂ¡ nĂ¡lož - PĂ©tard M112 - M112 Đ¿Đ¾Đ´Ñ€Ñ‹Đ²Đ½Đ¾Đ¹ Đ·Đ°Ñ€ÑĐ´ - M112 Carga de DemoliĂ§Ă£o - M112 rombolĂ³ töltet - M112 Demolition Block - - - M67 Fragmentation Grenade - M67 Splittergranate - Granada de fragmentaciĂ³n M67 - Granat obronny M67 - M67 GranĂ¡t - M67 Grenade Ă  fragmentation - M67 Ñ€ÑƒÑ‡Đ½Đ°Ñ Đ¾ÑĐºĐ¾Đ»Đ¾Ñ‡Đ½Đ°Ñ Đ³Ñ€Đ°Đ½Đ°Ñ‚Đ° - M67 Granada de fragmentaĂ§Ă£o - M67 repeszgrĂ¡nĂ¡t - M67 Granata a frammentazione - - - M83 Smoke Grenade (White) - M83 Rauchgranate (Weiss) - Granada de humo M83 (Blanco) - Granat dymny M83 (BiaÅ‚y) - M83 KouÅ™ovĂ½ GranĂ¡t (BĂ­lĂ½) - M83 Grenade fumigène (Blanche) - M83 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ‘ĐµĐ»Ñ‹Đ¹) - M83 Granada de fumaça (Branca) - M83 fĂ¼stgrĂ¡nĂ¡t (FehĂ©r) - M83 Granata fumogena (Bianco) - - - M18 Smoke Grenade (Blue) - M18 Rauchgranate (Blau) - Granada de humo M18 (Azul) - Granat dymny M18 (Niebieski) - M18 KouÅ™ovĂ½ GranĂ¡t (ModrĂ½) - M18 Grenade fumigène (Bleue) - M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ¡Đ¸Đ½Đ¸Đ¹) - M18 Granada de fumaça (Azul) - M18 fĂ¼stgrĂ¡nĂ¡t (KĂ©k) - M18 Granata fumogena (Blu) - - - M18 Smoke Grenade (Green) - M18 Rauchgranate (GrĂ¼n) - Granada de humo M18 (Verde) - Granat dymny M18 (Zielony) - M18 KouÅ™ovĂ½ GranĂ¡t (ZelenĂ½) - M18 Grenade fumigène (Verte) - M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ—ĐµĐ»Ñ‘Đ½Ñ‹Đ¹) - M18 Granada de fumaça (Verde) - M18 fĂ¼stgrĂ¡nĂ¡t (Zöld) - M18 Granata fumogena (Verde) - - - M18 Smoke Grenade (Orange) - M18 Rauchgranate (Orange) - Granada de humo M18 (Naranja) - Granat dymny M18 (PomaraÅ„czowy) - M18 KouÅ™ovĂ½ GranĂ¡t (OranžovĂ½) - M18 Grenade fumigène (Orange) - M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐÑ€Đ°Đ½Đ¶ĐµĐ²Ñ‹Đ¹) - M18 Granada de fumaça (Laranja) - M18 fĂ¼stgrĂ¡nĂ¡t (NarancssĂ¡rga) - M18 Granata fumogena (Arancione) - - - M18 Smoke Grenade (Purple) - M18 Rauchgranate (Violett) - Granada de humo M18 (PĂºrpura) - Granat dymny M18 (Fioletowy) - M18 KouÅ™ovĂ½ GranĂ¡t (FialovĂ½) - M18 Grenade fumigène (Pourpre) - M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐŸÑƒÑ€Đ¿ÑƒÑ€Đ½Ñ‹Đ¹) - M18 Granada de fumaça (Roxa) - M18 fĂ¼stgrĂ¡nĂ¡t (Lila) - M18 Granata fumogena (Viola) - - - M18 Smoke Grenade (Red) - M18 Rauchgranate (Rot) - Granada de humo M18 (Rojo) - Granat dymny M18 (Czerwony) - M18 KouÅ™ovĂ½ GranĂ¡t (ÄŒervenĂ½) - M18 Grenade fumigène (Rouge) - M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐÑ€Đ°ÑĐ½Ñ‹Đ¹) - M18 Granada de fumaça (Vermelha) - M18 fĂ¼stgrĂ¡nĂ¡t (Piros) - M18 Granata fumogena (Rosso) - - - M18 Smoke Grenade (Yellow) - M18 Rauchgranate (Gelb) - Granada de humo M18 (Amarillo) - Granat dymny M18 (Å»Ă³Å‚ty) - M18 KouÅ™ovĂ½ GranĂ¡t (ŽlutĂ½) - M18 Grenade fumigène (Jaune) - M183 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ–Ñ‘Đ»Ñ‚Ñ‹Đµ) - M18 Granada de fumaça (Amarela) - M18 fĂ¼stgrĂ¡nĂ¡t (SĂ¡rga) - M18 Granata fumogena (Giallo) - - - M15 Anti-Tank Mine - M15 Panzerabwehrmine - Mina antitanque M15 - Mina przeciwpancerna M15 - M15 ProtitankovĂ¡ Mina - M15 Mine antichar - M15 Đ¿Ñ€Đ¾Ñ‚Đ¸Đ²Đ¾Ñ‚Đ°Đ½ĐºĐ¾Đ²Đ°Ñ Đ¼Đ¸Đ½Đ° - M15 Mina anticarro - M15 harckocsiakna - M15 Mine anticarro - - - VS-50 Anti-Personnel Mine - VS-50 Antipersonenmine - Mina antipersona VS-50 - Mina przeciwpiechotna VS-50 - VS-50 ProtipÄ›chotnĂ­ Mina - VS-50 Mine antipersonnel Ă  pression - VS-50 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° - VS-50 Mina antipessoal - VS-50 gyalogsĂ¡gi taposĂ³akna - VS-50 Mine antiuomo - - - M26 Anti-Personnel Bounding Mine - M26 Antipersonensprungmine - Mina antipersona M26 - Mina przeciwpiechotna M26 - M26 Å rapnelovĂ¡ Mina - M26 Mine antipersonnel bondissante - M26 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° - M26 Mina saltadora antipessoal - M26 gyalogsĂ¡gi ugrĂ³akna - M26 Mine saltanti antiuomo - - - PMR-3 Anti-Personnel Tripwire Mine - PMR-3 Antipersonenstolperdrahtmine - Mina antipersona de alambre PMR-3 - Mina przeciwpiechotna PMR-3 - PMR-3 NĂ¡stražnĂ¡ Mina - PMR-3 Mine antipersonnel Ă  traction - PMR-3 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° - PMR-3 Mina antipessoal (armadilha) - PMR-3 botlĂ³drĂ³tos gyalogsĂ¡gi akna - PMR-3 Mine antiuomo - - - P99 - P99 - - - MP-443 Grach - MP-443 Grach - - - ACP-C2 - ACP-C2 - - - FNX-45 Tactical - FNX-45 Tactical - - - Chiappa Rhino 60DS - Chiappa Rhino 60DS - - - Taurus Judge - Taurus Judge - - - NLAW - NLAW - - - RPG-32 - RPG-32 - - - Mini-Spike (AA) - Mini-Spike (AA) - - - Mini-Spike (AT) - Mini-Spike (AT) - - - MX - MX - - - MX (Black) - MX (Black) - - - MXC - MXC - - - MXC (Black) - MXC (Black) - - - MX 3GL - MX 3GL - - - MX 3GL (Black) - MX 3GL (Black) - - - MX LSW - MX LSW - - - MX LSW (Black) - MX LSW (Black) - - - MXM - MXM - - - MXM (Black) - MXM (Black) - - - KT2002 Katiba - KT2002 Katiba - - - KT2002C Katiba - KT2002C Katiba - - - KT2002 Katiba KGL - KT2002 Katiba KGL - - - F2000 (Camo) - F2000 (Camo) - - - F2000 - F2000 - - - F2000 Tactical (Camo) - F2000 Tactical (Camo) - - - F2000 Tactical - F2000 Tactical - - - F2000 EGLM (Camo) - F2000 EGLM (Camo) - - - F2000 EGLM - F2000 EGLM - - - TAR-21 - TAR-21 - - - CTAR-21 - CTAR-21 - - - TAR-21 EGLM - TAR-21 EGLM - - - Vector SMG - Vector SMG - - - Scorpion Evo 3 A1 - Scorpion Evo 3 A1 - - - CPW - CPW - - - RFB SDAR - RFB SDAR - - - Stoner 99 LMG - Stoner 99 LMG - - - Negev NG7 - Negev NG7 - - - Mk14 Mod 1 EBR - Mk14 Mod 1 EBR - - - GM6 Lynx - GM6 Lynx - - - GM6 Lynx (Camo) - GM6 Lynx (Camo) - - - M200 Intervention - M200 Intervention - - - M200 Intervention (Camo) - M200 Intervention (Camo) - - - VS-121 - VS-121 - - + + + XM312 + XM312 + XM312 + XM312 + XM312 + XM312 + XM312 + XM312 + XM312 + XM312A + + + XM312A + XM312A + XM312 + XM312A + XM312A + XM312A + XM312A + XM312A + XM312A + XM312A + + + XM312 (High) + XM312 (Hoch) + XM312 (Alto) + XM312 (Haut) + XM312 (VysokĂ½) + XM312 (Wysoki) + XM312 (Đ’Ñ‹ÑĐ¾ĐºĐ¸Đ¹) + XM312 (Alta) + XM312 (MagasĂ­tott) + XM312 (Alta) + + + XM307 + XM307 + XM307 + XM307 + XM307 + XM307 + XM307 + XM307 + XM307 + XM307 + + + XM307A + XM307A + XM307A + XM307A + XM307A + XM307A + XM307A + XM307A + XM307A + XM307A + + + XM307 (High) + XM307 (Hoch) + XM307 (Alto) + XM307 (Haut) + XM307 (VysokĂ½) + XM307 (Wysoki) + XM307 (Đ’Ñ‹ÑĐ¾ĐºĐ¸Đ¹) + XM307 (Alta) + XM307 (MagasĂ­tott) + XM307 (Alta) + + + Mini-Spike Launcher (AT) + Mini-Spike Lenkflugkörper (AT) + Lanzador Mini-Spike (AT) + Poste de tir Mini-Spike (AC) + Mini-Spike OdpalovaÄ (AT) + Wyrzutnia Mini-Spike (AT) + Mini-Spike ĐŸÑƒÑĐºĐ¾Đ²Đ¾Đµ уÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ (ĐŸĐ¢Đ Đ) + Lança-mĂ­sseis Mini-Spike (AC) + Mini-Spike rakĂ©tarendszer (pĂ¡ncĂ©ltörÅ‘) + Lanciatore Mini-Spike (AC) + + + Mini-Spike Launcher (AA) + Mini-Spike Lenkflugkörper (AA) + Lanzador Mini-Spike (AA) + Poste de tir Mini-Spike (AA) + Mini-Spike OdpalovaÄ (AA) + Wyrzutnia Mini-Spike (AA) + Mini-Spike ĐŸÑƒÑĐºĐ¾Đ²Đ¾Đµ уÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ (Đ’Đ’) + Lança-mĂ­sseis Mini-Spike (AA) + Mini-Spike rakĂ©tarendszer (lĂ©gvĂ©delmi) + Lanciatore Mini-Spike (AA) + + + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + YABHON-R3 + + + YABHON-R3 (CAS) + YABHON-R3 (LuftnahunterstĂ¼tzung) + YABHON-R3 (CAS) + YABHON-R3 (CAS) + YABHON-R3 (CAS) + YABHON-R3 (ÑˆÑ‚ÑƒÑ€Đ¼Đ¾Đ²Đ¸Đº) + + + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + M-ATV + + + M-ATV (HMG) + M-ATV (SMG) + M-ATV (HMG) + M-ATV (CKM) + M-ATV (TK) + M-ATV (HMG) + M-ATV (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) + M-ATV (HMG) + M-ATV (HMG) + M-ATV (HMG) + + + M-ATV (GMG) + M-ATV (GMW) + M-ATV (GMG) + M-ATV (GMG) + M-ATV (GranĂ¡tomet) + M-ATV (GMG) + M-ATV (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) + M-ATV (GMG) + M-ATV (GMG) + M-ATV (GMG) + + + Merkava Mk IV M + Merkava Mk IV M + Merkava Mk IV M + Merkawa Mk IV M + Merkava Mk IV M + Merkava Mk IV M + ĐœĐµÑ€ĐºĐ°Đ²Đ° Mk IV M + Merkava Mk IV M + Merkava Mk IV M + Merkava Mk IV M + + + Merkava Mk IV LIC + Merkava Mk IV LIC + Merkava Mk IV LIC + Merkawa Mk IV LIC + Merkava Mk IV LIC + Merkava Mk IV LIC + ĐœĐµÑ€ĐºĐ°Đ²Đ° Mk IV LIC + Merkava Mk IV LIC + Merkava Mk IV LIC + Merkava Mk IV LIC + + + Sholef + Sholef + Sholef + Sholef + Sholef + Sholef + Đ¨Đ¾Đ»ĐµÑ„ + Sholef + Sholef + Sholef + + + Seara + Seara + Seara + Seara + Seara + Seara + Seara + Seara + Seara + Seara + + + Namer + Namer + Namer + Namer + Namer + Namer + ĐĐ°Đ¼ĐµÑ€ + Namer + Namer + Namer + + + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + Bardelas + + + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + Patria AMV + + + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + Nemmera + + + HEMTT Transport + HEMTT Transport + HEMTT de transporte + HEMTT Transportowy + HEMTT ValnĂ­k + HEMTT Transport + HEMTT Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ + HEMTT Transporte + HEMTT szĂ¡llĂ­tĂ³jĂ¡rmű + HEMTT da trasporto + + + HEMTT Transport (covered) + HEMTT Transport (bedeckt) + HEMTT de transporte (cubierto) + HEMTT Transportowy (zakryty) + HEMTT ValnĂ­k (krytĂ½) + HEMTT Transport (bĂ¢chĂ©) + HEMTT Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (ĐºÑ€Ñ‹Ñ‚Ñ‹Đ¹) + HEMTT Transporte (coberto) + HEMTT szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) + HEMTT da trasporto (coperto) + + + HEMTT + HEMTT + HEMTT + HEMTT + HEMTT + HEMTT Tracteur + HEMTT + HEMTT + HEMTT + HEMTT + + + HEMTT Container + HEMTT Container + HEMTT de contenedor + HEMTT Kontener + HEMTT SkÅ™Ă­ÅˆovĂ½ + HEMTT Conteneur + HEMTT ĐĐ¾Đ½Ñ‚ĐµĐ¹Đ½ĐµÑ€ + HEMTT ContĂªiner + HEMTT KontĂ©ner + HEMTT portacontainer + + + HEMTT Medical + HEMTT Sanitäter + HEMTT mĂ©dico + HEMTT Medyczny + HEMTT ZdravotnickĂ½ + HEMTT Sanitaire + HEMTT ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ + HEMTT MĂ©dico + HEMTT (egĂ©szsĂ©gĂ¼gyi) + HEMTT Medico + + + HEMTT Ammo + HEMTT Munition + HEMTT de municiĂ³n + HEMTT Amunicyjny + HEMTT MuniÄnĂ­ + HEMTT Munitions + HEMTT Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ + HEMTT Munições + HEMTT (lÅ‘szerszĂ¡llĂ­tĂ³) + HEMTT di rifornimento munizioni + + + HEMTT Fuel + HEMTT Treibstoff + HEMTT de combustible + HEMTT Cysterna + HEMTT Cisterna + HEMTT Citerne + HEMTT Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº + HEMTT CombustĂ­vel + HEMTT (Ă¼zemanyag-szĂ¡llĂ­tĂ³) + HEMTT di rifornimento carburante + + + HEMTT Repair + HEMTT Instandsetzung + HEMTT de reparaciĂ³n + HEMTT Naprawczy + HEMTT OpravĂ¡renskĂ½ + HEMTT RĂ©paration + HEMTT Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ + HEMTT Reparador + HEMTT (szerelÅ‘-jĂ¡rmű) + HEMTT Riparatore + + + Fennek + Fennek + Fennek + Fennek + Fennek + Fennek + Đ¤ĐµĐ½Đ½ĐµĐº + Fennek + Fennek + Fennek + + + Fennek (HMG) + Fennek (SMG) + Fennek (HMG) + Fennek (CKM) + Fennek (TK) + Fennek (HMG) + Đ¤ĐµĐ½Đ½ĐµĐº (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) + Fennek (HMG) + Fennek (HMG) + Fennek (HMG) + + + Fennek (GMG) + Fennek (GMW) + Fennek (GMG) + Fennek (GMG) + Fennek (granĂ¡tomet) + Fennek (GMG) + Đ¤ĐµĐ½Đ½ĐµĐº (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) + Fennek (GMG) + Fennek (GMG) + Fennek (GMG) + + + Leopard 2SG + Leopard 2SG + Leopard 2SG + Leopard 2SG + Leopard 2SG + Leopard 2SG + Đ›ĐµĐ¾Đ¿Đ°Ñ€Đ´ 2SG + Leopard 2SG + Leopard 2SG + Leopard 2SG + + + FV510 Warrior + FV510 Warrior + FV510 Warrior + FV510 Warrior + FV510 Warrior + FV510 Warrior + FV510 Đ£Đ¾Ñ€Ñ€Đ¸Đ¾Ñ€ + FV510 Warrior + FV510 Warrior + FV510 Warrior + + + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + Pandur II + + + KamAZ Transport + KamAZ Transport + KamAZ de transporte + KamAZ transportowy + KAMAZ ValnĂ­k + KamAZ Transport + ĐĐ°Đ¼ĐĐ— Đ¢Ñ€Đ°ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ + KamAZ Transporte + KamAZ szĂ¡llĂ­tĂ³jĂ¡rmű + KamAZ da trasporto + + + KamAZ Transport (covered) + KamAZ Transport (bedeckt) + KamAZ de transporte (cubierto) + KamAZ Transportowy (zakryty) + KAMAZ ValnĂ­k (krytĂ½) + KamAZ Transport (bĂ¢chĂ©) + ĐĐ°Đ¼ĐĐ— Đ¢Ñ€Đ°ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (ĐÑ€Ñ‹Ñ‚Ñ‹Đ¹) + KamAZ Transporte (coberto) + KamAZ szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) + KamAZ da trasporto (coperto) + + + KamAZ Ammo + KamAZ Munition + KamAZ de municiĂ³n + KamAZ Amunicyjny + KAMAZ MuniÄnĂ­ + KamAZ Munitions + ĐĐ°Đ¼ĐĐ— Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ + KamAZ Munições + KamAZ (lÅ‘szerszĂ¡llĂ­tĂ³) + KamAZ di rifornimento munizioni + + + KamAZ Fuel + KamAZ Treibstoff + KamAZ de combustible + KamAZ cysterna + KAMAZ Cisterna + KamAZ Citerne + ĐĐ°Đ¼ĐĐ— Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº + KamAZ CombustĂ­vel + KamAZ (Ă¼zemanyag-szĂ¡llĂ­tĂ³) + KamAZ di rifornimento carburante + + + KamAZ Repair + KamAZ Instandsetzung + KamAZ de reparaciĂ³n + KamAZ Naprawczy + KAMAZ OpravĂ¡renskĂ½ + KamAZ RĂ©paration + ĐĐ°Đ¼ĐĐ— Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ + KamAZ Reparador + KamAZ (szerelÅ‘-jĂ¡rmű) + KamAZ riparatore + + + KamAZ Medical + KamAZ Sanitäter + KamAZ mĂ©dico + KamAZ Medyczny + KAMAZ ZdravotnickĂ½ + KamAZ Sanitaire + ĐĐ°Đ¼ĐĐ— ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ + KamAZ MĂ©dico + KamAZ (egĂ©szsĂ©gĂ¼gyi) + KamAZ Medico + + + Punisher + Punisher + Punisher + Punisher + Punisher + Punisher + KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ + Punisher + Punisher + Punisher + + + Punisher (HMG) + Punisher (SMG) + Punisher (HMG) + Punisher (CKM) + Punisher (TK) + Punisher (HMG) + KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ (ĐŸÑƒĐ»ĐµĐ¼ĐµÑ‚) + Punisher (HMG) + Punisher (HMG) + Punisher (HMG) + + + Punisher (GMG) + Punisher (GMW) + Punisher (GMG) + Punisher (CKM) + Punisher (granĂ¡tomet) + Punisher (GMG) + KĐ°Ñ€Đ°Ñ‚ĐµĐ»ÑŒ (Đ“Ñ€Đ°Đ½Đ°Ñ‚Đ¾Đ¼ĐµÑ‚) + Punisher (GMG) + Punisher (GMG) + Punisher (GMG) + + + T100 Black Eagle + T100 Black Eagle + T100 Black Eagle + T100 Black Eagle + T100 Black Eagle + T100 Black Eagle + T100 Đ§ĐµÑ€Đ½Ñ‹Đ¹ ĐÑ€ĐµĐ» + T100 Black Eagle + T100 Black Eagle + T100 Black Eagle + + + 2S9 Sochor + 2S9 Sochor + 2S9 Sochor + 259 Sochor + 2S9 Sochor + 2S9 Sochor + 2S9 Đ¡Đ¾ĐºĐ¾Ñ€ + 2S9 Sochor + 2S9 Sochor + 2S9 Sochor + + + BM-2T Stalker + BM-2T Stalker + BM-2T Stalker + BM-2T Stalker + BM-2T Stalker + BM-2T Stalker + Đ‘Đœ-2Đ¢ Đ¡Ñ‚Đ°Đ»ĐºĐµÑ€ + BM-2T Stalker + BM-2T Stalker + BM-2T Stalker + + + ZSU-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + Đ—Đ¡Đ£-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + ZSU-35 Tigris + + + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + Otokar ARMA + + + Typhoon Transport + Typhoon Transport + Typhoon de transporte + Typhoon Transportowy + Typhoon ValnĂ­k + Typhoon Transport + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ + Typhoon Transporte + Typhoon szĂ¡llĂ­tĂ³jĂ¡rmű + Typhoon da trasporto + + + Typhoon Transport (covered) + Typhoon Transport (bedeckt) + Typhoon de transporte (cubierto) + Typhoon Transportowy (przykryty) + Typhoon ValnĂ­k (krytĂ½) + Typhoon Transport (bĂ¢chĂ©) + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ¢Ñ€Đ°Đ½ÑĐ¿Đ¾Ñ€Ñ‚Đ½Ñ‹Đ¹ (kÑ€Ñ‹Ñ‚Ñ‹Đ¹) + Typhoon Transporte (coberto) + Typhoon szĂ¡llĂ­tĂ³jĂ¡rmű (ponyvĂ¡s) + Typhoon da trasporto (coperto) + + + Typhoon Device + Typhoon Gerät + Typhoon de dispositivo + Typhoon UrzÄ…dzenie + Typhoon ZaÅ™Ă­zenĂ­ + Typhoon Dispositif + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ£ÑÑ‚Ñ€Đ¾Đ¹ÑÑ‚Đ²Đ¾ + Typhoon Dispositivo + Typhoon (szerkezet) + Typhoon per dispositivo + + + Typhoon Ammo + Typhoon Munition + Typhoon de municiĂ³n + Typhoon Amunicyjny + Typhoon MuniÄnĂ­ + Typhoon Munitions + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ‘Đ¾ĐµĐ¿Ñ€Đ¸Đ¿Đ°ÑÑ‹ + Typhoon Munições + Typhoon (lÅ‘szerszĂ¡llĂ­tĂ³) + Typhoon di rifornimento munizioni + + + Typhoon Fuel + Typhoon Treibstoff + Typhoon de combustible + Typhoon Cysterna + Typhoon Cisterna + Typhoon Citerne + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ—Đ°Đ¿Ñ€Đ°Đ²Ñ‰Đ¸Đº + Typhoon CombustĂ­vel + Typhoon (Ă¼zemanyag-szĂ¡llĂ­tĂ³) + Typhoon di rifornimento carburante + + + Typhoon Repair + Typhoon Instandsetzung + Typhoon de reparaciĂ³n + Typhoon Naprawczy + Typhoon OpravĂ¡renskĂ½ + Typhoon RĂ©paration + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ Đ ĐµĐ¼Đ¾Đ½Ñ‚Đ½Ñ‹Đ¹ + Typhoon Reparador + Typhoon (szerelÅ‘-jĂ¡rmű) + Typhoon riparatore + + + Typhoon Medical + Typhoon Sanitäter + Typhoon mĂ©dico + Typhoon Medyczny + Typhoon ZdravotnickĂ½ + Typhoon Sanitaire + Đ¢Đ°Đ¹Ñ„ÑƒĐ½ ĐœĐµĐ´Đ¸Ñ†Đ¸Đ½ÑĐºĐ¸Đ¹ + Typhoon MĂ©dico + Typhoon (egĂ©szsĂ©gĂ¼gyi) + Typhoon medico + + + RAH-66 Comanche + RAH-66 Comanche + RAH-66 Comanche + RAH-66 Comanche + RAH-66 Comanche + RAH-66 Commanche + RAH-66 ĐĐ¾Đ¼Đ°Đ½Ñ‡ + RAH-66 Comanche + RAH-66 Comanche + RAH-66 Comanche + + + MH-6 Little Bird + MH-6 Little Bird + MH-6 Litte Bird + MH-6 Little Bird + MH-6 Little Bird + MH-6 Little Bird + MH-6 Little Bird + MH-6 Little Bird + MH-6 Little Bird + MH-6 Little Bird + + + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + AH-6 Little Bird + + + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + CH-47I Chinook + + + CH-47I Chinook (unarmed) + CH-47I Chinook (unbewaffnet) + CH-47I Chinnok (Desarmado) + CH-47I Chinook (nieuzbrojony) + CH-47I Chinook (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) + CH-47I Chinook (NeozbrojenĂ½) + + + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Đ¢Đ°Đ½Đ´ĐµÑ€Đ±Đ¾Đ»Ñ‚ II + A-10D Thunderbolt II + A-10D Thunderbolt II + A-10D Thunderbolt II + + + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + AW159 Wildcat + + + AW159 Wildcat (unarmed) + AW159 Wildcat (unbewaffnet) + AW159 Wildcat (desarmado) + AW159 Wildcat (nieuzbrojony) + AW159 Wildcat (neozbrojenĂ½) + AW159 Wildcat (non-armĂ©) + AW159 Wildcat (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) + AW159 Wildcat (desarmado) + AW159 Wildcat (fegyvertelen) + AW159 Wildcat (disarmato) + + + AW101 Merlin + AW101 Merlin + AW101 Merlin + AW101 Merlin + AW101 Merlin + AW101 Merlin + AW101 ĐœĐµÑ€Đ»Đ¸Đ½ + AW101 Merlin + AW101 Merlin + AW101 Merlin + + + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ĐĐ»ÑŒĐ±Đ°Ñ‚Ñ€Đ¾Ñ (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + L-159 ALCA (CAS) + + + L-159 ALCA (AA) + L-159 ALCA (AA) + L-159 ALCA (AA) + L-159 ALCA (AA) + L-159 ALCA (AA) + L-159 ALCA (AA) + L-159 ĐĐ»ÑŒĐ±Đ°Ñ‚Ñ€Đ¾Ñ (AA) + L-159 ALCA (Đ’Đ’) + L-159 ALCA (AA) + L-159 ALCA (AA) + + + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 ĐĐ°ÑĐ°Ñ‚ĐºĐ° + Ka-60 Kasatka + Ka-60 Kasatka + Ka-60 Kasatka + + + Ka-60 Kasatka (unarmed) + Ka-60 Kasatka (unbewaffnet) + Ka-60 Kasatka (desarmado) + Ka-60 Kasatka (nieuzbrojony) + Ka-60 Kasatka (neozbrojenĂ¡) + Ka-60 Kasatka (non-armĂ©) + Ka-60 ĐĐ°ÑĐ°Ñ‚ĐºĐ° (Đ½ĐµĐ²Đ¾Đ¾Ñ€ÑƒĐ¶ĐµĐ½Đ½Ñ‹Đ¹) + Ka-60 Kasatka (desarmado) + Ka-60 Kasatka (fegyvertelen) + Ka-60 Kasatka (disarmato) + + + Yak-130 + Yak-130 + Yak-130 + Jak-130 + Jak-130 + Yak-130 + Đ¯Đº-130 + Yak-130 + Jak-130 + Yak-130 + + + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + MD 500 + + + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + M4A1 SLAM + + + M18A1 Claymore + M18A1 Claymore + M18A1 Claymore + Mina kierunkowa M18A1 Claymore + M18A1 Mina Claymore + M18A1 Claymore Mine antipersonnel Ă  effet dirigĂ© + M18A1 ĐĐ»ĐµĐ¹Đ¼Đ¾Ñ€ + M18A1 Claymore + M18A1 Claymore akna + M18A1 Claymore Mina antiuomo + + + M183 Demolition Charge Assembly + M183 Geballte Sprengladung + Conjunto de carga de demoliciĂ³n M183 + Åadunek burzÄ…cy M183 + M183 DemoliÄnĂ­ nĂ¡lož + M183 Charge de DĂ©molition + M183 ĐĐ¾Đ¼Đ¿Đ»ĐµĐºÑ‚Đ½Ñ‹Đ¹ Đ¿Đ¾Đ´Ñ€Ñ‹Đ²Đ½Đ¾Đ¹ Đ·Đ°Ñ€ÑĐ´ + M183 Sacola de DemoliĂ§Ă£o + M183 rombolĂ³ töltet + M183 Demolition Charge Assembly + + + M112 Demolition Block + M112 Sprengladung + Bloque de demoliciĂ³n M112 + Åadunek burzÄ…cy M112 + M112 VĂ½buÅ¡nĂ¡ nĂ¡lož + PĂ©tard M112 + M112 Đ¿Đ¾Đ´Ñ€Ñ‹Đ²Đ½Đ¾Đ¹ Đ·Đ°Ñ€ÑĐ´ + M112 Carga de DemoliĂ§Ă£o + M112 rombolĂ³ töltet + M112 Demolition Block + + + M67 Fragmentation Grenade + M67 Splittergranate + Granada de fragmentaciĂ³n M67 + Granat obronny M67 + M67 GranĂ¡t + M67 Grenade Ă  fragmentation + M67 Ñ€ÑƒÑ‡Đ½Đ°Ñ Đ¾ÑĐºĐ¾Đ»Đ¾Ñ‡Đ½Đ°Ñ Đ³Ñ€Đ°Đ½Đ°Ñ‚Đ° + M67 Granada de fragmentaĂ§Ă£o + M67 repeszgrĂ¡nĂ¡t + M67 Granata a frammentazione + + + M83 Smoke Grenade (White) + M83 Rauchgranate (Weiss) + Granada de humo M83 (Blanco) + Granat dymny M83 (BiaÅ‚y) + M83 KouÅ™ovĂ½ GranĂ¡t (BĂ­lĂ½) + M83 Grenade fumigène (Blanche) + M83 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ‘ĐµĐ»Ñ‹Đ¹) + M83 Granada de fumaça (Branca) + M83 fĂ¼stgrĂ¡nĂ¡t (FehĂ©r) + M83 Granata fumogena (Bianco) + + + M18 Smoke Grenade (Blue) + M18 Rauchgranate (Blau) + Granada de humo M18 (Azul) + Granat dymny M18 (Niebieski) + M18 KouÅ™ovĂ½ GranĂ¡t (ModrĂ½) + M18 Grenade fumigène (Bleue) + M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ¡Đ¸Đ½Đ¸Đ¹) + M18 Granada de fumaça (Azul) + M18 fĂ¼stgrĂ¡nĂ¡t (KĂ©k) + M18 Granata fumogena (Blu) + + + M18 Smoke Grenade (Green) + M18 Rauchgranate (GrĂ¼n) + Granada de humo M18 (Verde) + Granat dymny M18 (Zielony) + M18 KouÅ™ovĂ½ GranĂ¡t (ZelenĂ½) + M18 Grenade fumigène (Verte) + M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ—ĐµĐ»Ñ‘Đ½Ñ‹Đ¹) + M18 Granada de fumaça (Verde) + M18 fĂ¼stgrĂ¡nĂ¡t (Zöld) + M18 Granata fumogena (Verde) + + + M18 Smoke Grenade (Orange) + M18 Rauchgranate (Orange) + Granada de humo M18 (Naranja) + Granat dymny M18 (PomaraÅ„czowy) + M18 KouÅ™ovĂ½ GranĂ¡t (OranžovĂ½) + M18 Grenade fumigène (Orange) + M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐÑ€Đ°Đ½Đ¶ĐµĐ²Ñ‹Đ¹) + M18 Granada de fumaça (Laranja) + M18 fĂ¼stgrĂ¡nĂ¡t (NarancssĂ¡rga) + M18 Granata fumogena (Arancione) + + + M18 Smoke Grenade (Purple) + M18 Rauchgranate (Violett) + Granada de humo M18 (PĂºrpura) + Granat dymny M18 (Fioletowy) + M18 KouÅ™ovĂ½ GranĂ¡t (FialovĂ½) + M18 Grenade fumigène (Pourpre) + M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐŸÑƒÑ€Đ¿ÑƒÑ€Đ½Ñ‹Đ¹) + M18 Granada de fumaça (Roxa) + M18 fĂ¼stgrĂ¡nĂ¡t (Lila) + M18 Granata fumogena (Viola) + + + M18 Smoke Grenade (Red) + M18 Rauchgranate (Rot) + Granada de humo M18 (Rojo) + Granat dymny M18 (Czerwony) + M18 KouÅ™ovĂ½ GranĂ¡t (ÄŒervenĂ½) + M18 Grenade fumigène (Rouge) + M18 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (ĐÑ€Đ°ÑĐ½Ñ‹Đ¹) + M18 Granada de fumaça (Vermelha) + M18 fĂ¼stgrĂ¡nĂ¡t (Piros) + M18 Granata fumogena (Rosso) + + + M18 Smoke Grenade (Yellow) + M18 Rauchgranate (Gelb) + Granada de humo M18 (Amarillo) + Granat dymny M18 (Å»Ă³Å‚ty) + M18 KouÅ™ovĂ½ GranĂ¡t (ŽlutĂ½) + M18 Grenade fumigène (Jaune) + M183 Đ´Ñ‹Đ¼Đ¾Đ²Đ¾Đ¹ Đ³Ñ€Đ°Đ½Đ°Ñ‚Ñ‹ (Đ–Ñ‘Đ»Ñ‚Ñ‹Đµ) + M18 Granada de fumaça (Amarela) + M18 fĂ¼stgrĂ¡nĂ¡t (SĂ¡rga) + M18 Granata fumogena (Giallo) + + + M15 Anti-Tank Mine + M15 Panzerabwehrmine + Mina antitanque M15 + Mina przeciwpancerna M15 + M15 ProtitankovĂ¡ Mina + M15 Mine antichar + M15 Đ¿Ñ€Đ¾Ñ‚Đ¸Đ²Đ¾Ñ‚Đ°Đ½ĐºĐ¾Đ²Đ°Ñ Đ¼Đ¸Đ½Đ° + M15 Mina anticarro + M15 harckocsiakna + M15 Mine anticarro + + + VS-50 Anti-Personnel Mine + VS-50 Antipersonenmine + Mina antipersona VS-50 + Mina przeciwpiechotna VS-50 + VS-50 ProtipÄ›chotnĂ­ Mina + VS-50 Mine antipersonnel Ă  pression + VS-50 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° + VS-50 Mina antipessoal + VS-50 gyalogsĂ¡gi taposĂ³akna + VS-50 Mine antiuomo + + + M26 Anti-Personnel Bounding Mine + M26 Antipersonensprungmine + Mina antipersona M26 + Mina przeciwpiechotna M26 + M26 Å rapnelovĂ¡ Mina + M26 Mine antipersonnel bondissante + M26 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° + M26 Mina saltadora antipessoal + M26 gyalogsĂ¡gi ugrĂ³akna + M26 Mine saltanti antiuomo + + + PMR-3 Anti-Personnel Tripwire Mine + PMR-3 Antipersonenstolperdrahtmine + Mina antipersona de alambre PMR-3 + Mina przeciwpiechotna PMR-3 + PMR-3 NĂ¡stražnĂ¡ Mina + PMR-3 Mine antipersonnel Ă  traction + PMR-3 ĐŸÑ€Đ¾Ñ‚Đ¸Đ²Đ¾Đ¿ĐµÑ…Đ¾Ñ‚Đ½Đ°Ñ Đ¼Đ¸Đ½Đ° + PMR-3 Mina antipessoal (armadilha) + PMR-3 botlĂ³drĂ³tos gyalogsĂ¡gi akna + PMR-3 Mine antiuomo + + + P99 + P99 + + + MP-443 Grach + MP-443 Grach + + + ACP-C2 + ACP-C2 + + + FNX-45 Tactical + FNX-45 Tactical + + + Chiappa Rhino 60DS + Chiappa Rhino 60DS + + + Taurus Judge + Taurus Judge + + + NLAW + NLAW + + + RPG-32 + RPG-32 + + + Mini-Spike (AA) + Mini-Spike (AA) + + + Mini-Spike (AT) + Mini-Spike (AT) + + + MX + MX + + + MX (Black) + MX (Black) + + + MXC + MXC + + + MXC (Black) + MXC (Black) + + + MX 3GL + MX 3GL + + + MX 3GL (Black) + MX 3GL (Black) + + + MX LSW + MX LSW + + + MX LSW (Black) + MX LSW (Black) + + + MXM + MXM + + + MXM (Black) + MXM (Black) + + + KT2002 Katiba + KT2002 Katiba + + + KT2002C Katiba + KT2002C Katiba + + + KT2002 Katiba KGL + KT2002 Katiba KGL + + + F2000 (Camo) + F2000 (Camo) + + + F2000 + F2000 + + + F2000 Tactical (Camo) + F2000 Tactical (Camo) + + + F2000 Tactical + F2000 Tactical + + + F2000 EGLM (Camo) + F2000 EGLM (Camo) + + + F2000 EGLM + F2000 EGLM + + + TAR-21 + TAR-21 + + + CTAR-21 + CTAR-21 + + + TAR-21 EGLM + TAR-21 EGLM + + + Vector SMG + Vector SMG + + + Scorpion Evo 3 A1 + Scorpion Evo 3 A1 + + + CPW + CPW + + + RFB SDAR + RFB SDAR + + + Stoner 99 LMG + Stoner 99 LMG + + + Negev NG7 + Negev NG7 + + + Mk14 Mod 1 EBR + Mk14 Mod 1 EBR + + + GM6 Lynx + GM6 Lynx + + + GM6 Lynx (Camo) + GM6 Lynx (Camo) + + + M200 Intervention + M200 Intervention + + + M200 Intervention (Camo) + M200 Intervention (Camo) + + + VS-121 + VS-121 + + \ No newline at end of file diff --git a/addons/switchunits/CfgEventHandlers.hpp b/addons/switchunits/CfgEventHandlers.hpp new file mode 100644 index 0000000000..47dcd984d1 --- /dev/null +++ b/addons/switchunits/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + postInit = QUOTE(call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp new file mode 100644 index 0000000000..1a4a45d832 --- /dev/null +++ b/addons/switchunits/CfgVehicles.hpp @@ -0,0 +1,65 @@ +class CfgVehicles { + class Module_F; + class ACE_ModuleSwitchUnits: Module_F { + author = "$STR_ACE_Core_ACETeam"; + category = "ACE"; + displayName = "SwitchUnits System"; + function = FUNC(module); + scope = 2; + isGlobal = 1; + icon = QUOTE(PATHTOF(UI\IconSwitchUnits_ca.paa)); + class Arguments { + class SwitchToWest { + displayName = "Switch to West?"; + description = "Allow switching to west units?"; + typeName = "BOOL"; + class values { + class Yes {name = "Yes"; value = 1;}; + class No {default = 1; name = "No"; value = 0;}; + }; + }; + class SwitchToEast { + displayName = "Switch to East?"; + description = "Allow switching to east units?"; + typeName = "BOOL"; + class values { + class Yes {name = "Yes"; value = 1;}; + class No {default = 1; name = "No"; value = 0;}; + }; + }; + class SwitchToIndependent { + displayName = "Switch to Independent?"; + description = "Allow switching to independent units?"; + typeName = "BOOL"; + class values { + class Yes {name = "Yes"; value = 1;}; + class No {default = 1; name = "No"; value = 0;}; + }; + }; + class SwitchToCivilian { + displayName = "Switch to Civilian?"; + description = "Allow switching to civilian units?"; + typeName = "BOOL"; + class values { + class Yes {name = "Yes"; value = 1;}; + class No {default = 1; name = "No"; value = 0;}; + }; + }; + class EnableSafeZone { + displayName = "Enable Safe Zone?"; + description = "Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone."; + typeName = "BOOL"; + class values { + class Yes {default = 1; name = "Yes"; value = 1;}; + class No {name = "No"; value = 0;}; + }; + }; + class SafeZoneRadius { + displayName = "Safe Zone Radius"; + description = "The safe zone around players from a different team. Default: 200"; + typeName = "NUMBER"; + defaultValue = 100; + }; + }; + }; +}; diff --git a/TO_MERGE/agm/SwitchUnits/UI/IconSwitchUnits_ca.paa b/addons/switchunits/UI/IconSwitchUnits_ca.paa similarity index 100% rename from TO_MERGE/agm/SwitchUnits/UI/IconSwitchUnits_ca.paa rename to addons/switchunits/UI/IconSwitchUnits_ca.paa diff --git a/addons/switchunits/XEH_postInit.sqf b/addons/switchunits/XEH_postInit.sqf new file mode 100644 index 0000000000..3ce84ef838 --- /dev/null +++ b/addons/switchunits/XEH_postInit.sqf @@ -0,0 +1,27 @@ +/* + Author(s): + bux578 +*/ + +#include "script_component.hpp" + +//0 spawn { + +private ["_sides"]; + +//waitUntil {sleep 0.5; AGM_SwitchUnits_EnableSwitchUnits}; + +//_side = [west, east, independent, civilian] select AGM_SwitchUnits_SwitchUnitsAllowedForSide; + +_sides = []; + +if(GVAR(SwitchToWest)) then {_sides pushBack west}; +if(GVAR(SwitchToEast)) then {_sides pushBack east}; +if(GVAR(SwitchToIndependent)) then {_sides pushBack independent}; +if(GVAR(SwitchToCivilian)) then {_sides pushBack civilian}; + +if (player getVariable ["ACE_CanSwitchUnits", false]) then { +[player, _sides] call FUNC(initPlayer); +}; + +//}; diff --git a/addons/switchunits/XEH_preInit.sqf b/addons/switchunits/XEH_preInit.sqf new file mode 100644 index 0000000000..7443b79565 --- /dev/null +++ b/addons/switchunits/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +PREP(addMapFunction); +PREP(handleMapClick); +PREP(initPlayer); +PREP(isValidAi); +PREP(markAiOnMap); +PREP(module); +PREP(nearestPlayers); +PREP(switchBack); +PREP(switchUnit); diff --git a/addons/switchunits/config.cpp b/addons/switchunits/config.cpp new file mode 100644 index 0000000000..1f60ca83ac --- /dev/null +++ b/addons/switchunits/config.cpp @@ -0,0 +1,31 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.60; + requiredAddons[] = {"ace_main", "ace_common"}; + version = QUOTE(VERSION); + versionStr = QUOTE(VERSION); + versionAr[] = {VERSION_AR}; + author[] = {"bux578"}; + authorUrl = "https://github.com/bux578/"; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" + +class ACE_Parameters_Numeric { + GVAR(SafeZoneRadius) = 100; +}; + +class ACE_Parameters_Boolean { + GVAR(EnableSwitchUnits) = 0; + GVAR(SwitchToWest) = 0; + GVAR(SwitchToEast) = 0; + GVAR(SwitchToIndependent) = 0; + GVAR(SwitchToCivilian) = 0; + GVAR(EnableSafeZone) = 1; +}; diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf new file mode 100644 index 0000000000..0607d00fd3 --- /dev/null +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -0,0 +1,25 @@ +/* + Name: AGM_SwitchUnits_fnc_addMapFunction + + Author(s): + bux578 + + Description: + Adds a mapClick Eventhandler + + Parameters: + 0: OBJECT - unit + 1: ARRAY - sided + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_unit"]; +_unit = _this select 0; + +["theMapClick", "onMapSingleClick", { + [_this, _pos, _shift, _alt] call FUNC(handleMapClick); +}, [_unit, _sides]] call BIS_fnc_addStackedEventHandler; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf new file mode 100644 index 0000000000..eb5da3ad10 --- /dev/null +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -0,0 +1,43 @@ +/* + Name: AGM_SwitchUnits_fnc_handleMapClick + + Author(s): + bux578 + + Description: + Finds the clicked unit + + Parameters: + 0: OBJECT - MapClickEventHandlerArgs + 0: OBJECT - unit to switch to + 1: ARRAY - sides + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_args", "_currentPlayerUnit", "_sides", "_pos", "_sideNearest"]; + +_currentPlayerUnit = (_this select 0) select 0; +_sides = (_this select 0) select 1; +_pos = _this select 1; + +_sideNearest = []; + +{ + if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then { + _sideNearest pushBack _x; + }; +} forEach (nearestObjects [_pos, ["Man"], 20]); + + +if (count _sideNearest > 0) then { + private ["_switchUnit"]; + + _switchUnit = _sideNearest select 0; + [_currentPlayerUnit, _switchUnit] call FUNC(switchUnit); + + openMap false; +}; diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf new file mode 100644 index 0000000000..27dd95a8e3 --- /dev/null +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -0,0 +1,50 @@ +/* + Name: AGM_SwitchUnits_fnc_initPlayer + + Author(s): + bux578 + + Description: + Initializes the player + + Parameters: + 0: OBJECT - player + 1: ARRAY - Array containing selected sides + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_playerUnit", "_sides"]; + +_playerUnit = _this select 0; +_sides = _this select 1; + +if (vehicle _playerUnit == _playerUnit) then { + + [_sides] call FUNC(markAiOnMap); + + _playerUnit setVariable [QGVAR(IsPlayerUnit), true]; + _playerUnit allowDamage false; + + GVAR(OriginalUnit) = _playerUnit; + GVAR(OriginalName) = [_playerUnit] call EFUNC(common,getName); + GVAR(OriginalGroup) = group _playerUnit; + + // remove all starting gear of a player + removeAllWeapons _playerUnit; + removeGoggles _playerUnit; + removeHeadgear _playerUnit; + removeVest _playerUnit; + removeAllAssignedItems _playerUnit; + clearAllItemsFromBackpack _playerUnit; + removeBackpack _playerUnit; + _playerUnit linkItem "ItemMap"; + removeUniform _playerUnit; + + [_playerUnit, "ACE_SwitchUnits", true] call EFUNC(common,setForceWalkStatus); + + [_playerUnit, _sides] call FUNC(addMapFunction); +}; diff --git a/addons/switchunits/functions/fnc_isValidAi.sqf b/addons/switchunits/functions/fnc_isValidAi.sqf new file mode 100644 index 0000000000..99d8889563 --- /dev/null +++ b/addons/switchunits/functions/fnc_isValidAi.sqf @@ -0,0 +1,27 @@ +/* + Name: AGM_SwitchUnits_fnc_isValidAi + + Author(s): + bux578 + + Description: + Checks if AI is a valid target for switching + + Parameters: + 0: OBJECT - unit + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_unit"]; + +_unit = _this select 0; + +!([_unit] call EFUNC(common,isPlayer) +|| {_unit in playableUnits} +|| {vehicle _unit != _unit} +|| {_unit getVariable [QGVAR(IsPlayerUnit), false]} +|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf new file mode 100644 index 0000000000..dbf4fda7ab --- /dev/null +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -0,0 +1,66 @@ +/* + Name: AGM_SwitchUnits_fnc_markAiOnMap + + Author(s): + bux578 + + Description: + Creates markers for AI units for given sides + Marks players in a different color + + Parameters: + 0: OBJECT - side + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_sidesToShow"]; +_sidesToShow = _this select 0; + +_sidesToShow spawn { + + private ["_sides", "_allMarkerNames"]; + _sides = _this; + _allMarkerNames = []; + + while { true } do { + sleep 1.5; + + // delete markers + { + deleteMarkerLocal _x; + } forEach _allMarkerNames; + + // create markers + { + if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then { + private ["_markerName", "_marker", "_markerColor"]; + + //_markerName = format ["%1", [_x] call EFUNC(common,getName)]; + _markerName = str _x; + + _marker = createMarkerLocal [_markerName, position _x]; + _markerName setMarkerTypeLocal "mil_triangle"; + _markerName setMarkerShapeLocal "ICON"; + _markerName setMarkerSizeLocal [0.5,0.7]; + _markerName setMarkerDirLocal getDir _x; + + // commy's one liner magic + _markerColor = format ["Color%1", side group _x]; + + if ((_x getVariable [QGVAR(IsPlayerControlled), false])) then { + _markerName setMarkerColorLocal "ColorOrange"; + _markerName setMarkerTextLocal (_x getVariable [QGVAR(PlayerControlledName),""]); + } else { + _markerName setMarkerColorLocal _markerColor; + _markerName setMarkerTextLocal (getText (configFile >> "CfgVehicles" >> typeOf _x >> "displayName")); + }; + + _allMarkerNames pushBack _markerName; + }; + } forEach allUnits; + }; +}; diff --git a/addons/switchunits/functions/fnc_module.sqf b/addons/switchunits/functions/fnc_module.sqf new file mode 100644 index 0000000000..7776caf645 --- /dev/null +++ b/addons/switchunits/functions/fnc_module.sqf @@ -0,0 +1,40 @@ +/* + Name: AGM_SwitchUnits_fnc_module + + Author(s): + bux578 + + Description: + Initializes the SwitchUnits module + + Parameters: + 0: OBJECT - module logic + 1: ARRAY - list of affected units + 2: BOOLEAN - isActivated + + Returns: + BOOLEAN (Good practice to include one) +*/ + +#include "script_component.hpp" + +if !(isServer) exitWith {}; + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +GVAR(Module) = true; + +[QGVAR(EnableSwitchUnits), true] call EFUNC(common,setParameter); + +[_logic, QGVAR(SwitchToWest), "SwitchToWest"] call EFUNC(common,readBooleanParameterFromModule); +[_logic, QGVAR(SwitchToEast), "SwitchToEast"] call EFUNC(common,readBooleanParameterFromModule); +[_logic, QGVAR(SwitchToIndependent), "SwitchToIndependent"] call EFUNC(common,readBooleanParameterFromModule); +[_logic, QGVAR(SwitchToCivilian), "SwitchToCivilian"] call EFUNC(common,readBooleanParameterFromModule); + +[_logic, QGVAR(EnableSafeZone), "EnableSafeZone"] call EFUNC(common,readBooleanParameterFromModule); +[_logic, QGVAR(SafeZoneRadius), "SafeZoneRadius"] call EFUNC(common,readNumericParameterFromModule); + +diag_log text "[ACE]: SwitchUnits Module Initialized."; diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf new file mode 100644 index 0000000000..1fade9e07a --- /dev/null +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -0,0 +1,33 @@ +/* + Name: AGM_SwitchUnits_fnc_nearestPlayers + + Author(s): + bux578 + + Description: + Returns an array of alive players in a given radius around a given location + + Parameters: + 0: POSTION - Center position + 1: NUMBER - Radius + + Returns: + ARRAY - Player units +*/ + +#include "script_component.hpp" + +private ["_position", "_radius", "_nearestPlayers"]; + +_position = _this select 0; +_radius = _this select 1; + +_nearestPlayers = []; + +{ + if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { + _nearestPlayers pushBack _x; + }; +} forEach (nearestObjects [_position, ["Man"], _radius]); + + _nearestPlayers diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf new file mode 100644 index 0000000000..e9425c4fa4 --- /dev/null +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -0,0 +1,31 @@ +/* + Name: AGM_SwitchUnits_fnc_switchBack + + Author(s): + bux578 + + Description: + Switches back to the original player unit + This method needs to be "spawn"ed + + Parameters: + 0: OBJECT - original player unit + 1: OBJECT - respawned unit + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_originalPlayerUnit", "_currentUnit"]; +_originalPlayerUnit = _this select 0; +_currentUnit = _this select 1; + +[_originalPlayerUnit] joinSilent GVAR(OriginalGroup); + +waitUntil {local _originalPlayerUnit}; + +selectPlayer _originalPlayerUnit; + +deleteVehicle _currentUnit; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf new file mode 100644 index 0000000000..606fdccf22 --- /dev/null +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -0,0 +1,81 @@ +/* + Name: AGM_SwitchUnits_fnc_switchUnit + + Author(s): + bux578 + + Description: + Selects the new given player unit + + Parameters: + 0: OBJECT - the unit to switch to + + Returns: + VOID +*/ + +#include "script_component.hpp" + +private ["_newUnit"]; + +_newUnit = _this select 1; + +// don't switch to original player units +if (!([_newUnit] call FUNC(isValidAi))) exitWith {}; + +_newUnit spawn { + private ["_unit", "_allNearestPlayers", "_oldUnit", "_respawnEhId", "_oldOwner", "_leave"]; + + _unit = _this; + + _leave = false; + + if (GVAR(EnableSafeZone)) then { + + _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers); + _nearestEnemyPlayers = [_allNearestPlayers, {((side GVAR(OriginalGroup)) getFriend (side _this) < 0.6) && !(_this getVariable [QGVAR(IsPlayerControlled), false])}] call EFUNC(common,filter); + + if (count _nearestEnemyPlayers > 0) exitWith { + _leave = true; + }; + }; + + // exitWith doesn't exit past the "if(EnableSafeZone)" block + if (_leave) exitWith { + [localize "STR_ACE_SwitchUnits_TooCloseToEnemy"] call EFUNC(common,displayTextStructured); + }; + + // should switch locality + // This doesn't work anymore, because one's now able to switch to units from a different side + //[_unit] joinSilent group player; + [[_unit, player], QUOTE({(_this select 0) setVariable [QGVAR(OriginalOwner), owner (_this select 0), true]; (_this select 0) setOwner owner (_this select 1)}), 1] call EFUNC(common,execRemoteFnc); + + _oldUnit = player; + waitUntil {sleep 0.2; local _unit}; + + _oldUnit setVariable [QGVAR(IsPlayerControlled), false, true]; + _oldUnit setVariable [QGVAR(PlayerControlledName), "", true]; + + _respawnEhId = _unit getVariable [QGVAR(RespawnEhId), -1]; + if (_respawnEhId != -1) then { + _oldUnit removeEventHandler ["Respawn", _respawnEhId]; + }; + + selectPlayer _unit; + + _unit setVariable [QGVAR(IsPlayerControlled), true, true]; + _unit setVariable [QGVAR(PlayerControlledName), GVAR(OriginalName), true]; + + _respawnEhId = _unit addEventHandler ["Respawn", { + [GVAR(OriginalUnit), _this select 0] spawn FUNC(switchBack); + }]; + _unit setVariable [QGVAR(RespawnEhId), _respawnEhId, true]; + + // set owner back to original owner + _oldOwner = _oldUnit getVariable[QGVAR(OriginalOwner), -1]; + if (_oldOwner > -1) then { + [[_oldUnit, _oldOwner], QUOTE({(_this select 0) setOwner (_this select 1)}), 1] call EFUNC(common,execRemoteFnc); + }; + + [localize "STR_ACE_SwitchUnits_SwitchedUnit"] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/switchunits/functions/script_component.hpp b/addons/switchunits/functions/script_component.hpp new file mode 100644 index 0000000000..df5c7a0d96 --- /dev/null +++ b/addons/switchunits/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\switchunits\script_component.hpp" \ No newline at end of file diff --git a/addons/switchunits/script_component.hpp b/addons/switchunits/script_component.hpp new file mode 100644 index 0000000000..3c4c77c007 --- /dev/null +++ b/addons/switchunits/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT SwitchUnits +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SwitchUnits + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SwitchUnits + #define DEBUG_SETTINGS DEBUG_SETTINGS_SwitchUnits +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/TO_MERGE/agm/SwitchUnits/stringtable.xml b/addons/switchunits/stringtable.xml similarity index 100% rename from TO_MERGE/agm/SwitchUnits/stringtable.xml rename to addons/switchunits/stringtable.xml diff --git a/addons/thermals/config.cpp b/addons/thermals/config.cpp index fdb00bb0f9..252a440535 100644 --- a/addons/thermals/config.cpp +++ b/addons/thermals/config.cpp @@ -1,42 +1,40 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {ace_core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"[TF]Nkey"}; - authorUrl = "https://github.com/michail-nikolaev/"; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {ace_common}; + author[] = {"[TF]Nkey"}; + authorUrl = "https://github.com/michail-nikolaev/"; + VERSION_CONFIG; + }; }; class CfgVehicles { - class Land; - class Man: Land { - mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) - tBody = 32; // Metabolism temperature of the model (in celsius) - }; + class Land; + class Man: Land { + mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) + tBody = 32; // Metabolism temperature of the model (in celsius) + }; - class All; - // Up to this point, the thermal properties apply to the entire model, - // so if a vehicle's engine starts, the entire model will begin to warm up at the rate of htMax up to a temperature of afMax, - // likewise if it begins driving, the entire model will heat up at the rate specified by htMax to a maximum temperature of mfMax. - class AllVehicles: All { - htMin=60; // Minimum half-cooling time (in seconds) - htMax=1800; // Maximum half-cooling time (in seconds) - afMax=70; // Maximum temperature in case the model is alive (in celsius) - mfMax=50; // Maximum temperature when the model is moving (in celsius) - mFact=0.0; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) - tBody=0; // Metabolism temperature of the model (in celsius) - }; + class All; + // Up to this point, the thermal properties apply to the entire model, + // so if a vehicle's engine starts, the entire model will begin to warm up at the rate of htMax up to a temperature of afMax, + // likewise if it begins driving, the entire model will heat up at the rate specified by htMax to a maximum temperature of mfMax. + class AllVehicles: All { + htMin=60; // Minimum half-cooling time (in seconds) + htMax=1800; // Maximum half-cooling time (in seconds) + afMax=70; // Maximum temperature in case the model is alive (in celsius) + mfMax=50; // Maximum temperature when the model is moving (in celsius) + mFact=0.0; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) + tBody=0; // Metabolism temperature of the model (in celsius) + }; - class Animal; - class Animal_Base_F: Animal { - mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) - tBody = 32; // Metabolism temperature of the model (in celsius) - }; + class Animal; + class Animal_Base_F: Animal { + mFact = 1; // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)) + tBody = 32; // Metabolism temperature of the model (in celsius) + }; }; diff --git a/addons/thermals/script_component.hpp b/addons/thermals/script_component.hpp index 5daf18e62d..eee052b91e 100644 --- a/addons/thermals/script_component.hpp +++ b/addons/thermals/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_THERMALS - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_ENABLED_THERMALS - #define DEBUG_SETTINGS DEBUG_ENABLED_THERMALS + #define DEBUG_SETTINGS DEBUG_ENABLED_THERMALS #endif #include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/wep_dragon/CfgAmmo.hpp b/addons/wep_dragon/CfgAmmo.hpp index e51ea122b9..62769fec2b 100644 --- a/addons/wep_dragon/CfgAmmo.hpp +++ b/addons/wep_dragon/CfgAmmo.hpp @@ -48,7 +48,7 @@ class CfgAmmo { }; class ace_missile_dragon : M_47_AT_EP1 { - model = PATHTOF(models\dragon.p3d); + model = QUOTE(PATHTOF(models\dragon.p3d)); maxSpeed = 120; thrust = 0; initTime = 0; diff --git a/addons/wep_dragon/CfgMagazines.hpp b/addons/wep_dragon/CfgMagazines.hpp index 904f53a0c9..8b00f7b2fb 100644 --- a/addons/wep_dragon/CfgMagazines.hpp +++ b/addons/wep_dragon/CfgMagazines.hpp @@ -2,6 +2,6 @@ class CfgMagazines { class CA_LauncherMagazine; class Dragon_EP1: CA_LauncherMagazine { - model = PATHTOF(models\ace_m47_magazine.p3d); + model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d)); }; }; \ No newline at end of file diff --git a/addons/wep_dragon/CfgVehicles.hpp b/addons/wep_dragon/CfgVehicles.hpp index ec8e60a23f..1d7d3841a7 100644 --- a/addons/wep_dragon/CfgVehicles.hpp +++ b/addons/wep_dragon/CfgVehicles.hpp @@ -17,11 +17,11 @@ class CfgVehicles { class ViewOptics; }; }; - } + }; class ACE_M47_Static: ACE_M47_Static_Base { scope = 1; // Hide it for now - model = PATHTOF(models\ace_m47_static.p3d); + model = QUOTE(PATHTOF(models\ace_m47_static.p3d)); displayName = "M47 Dragon"; class Turrets: Turrets { class MainTurret: MainTurret { diff --git a/addons/wep_dragon/CfgWeapons.hpp b/addons/wep_dragon/CfgWeapons.hpp index 851796b260..b873219e04 100644 --- a/addons/wep_dragon/CfgWeapons.hpp +++ b/addons/wep_dragon/CfgWeapons.hpp @@ -20,13 +20,13 @@ class CfgWeapons { class M47Launcher_EP1: Launcher { displayName = "M47 Dragon"; canlock = 0; - model = PATHTOF(models\ace_m47_magazine.p3d); - picture = PATHTOF(textures\m47_dragon_item_ca.paa); + model = QUOTE(PATHTOF(models\ace_m47_magazine.p3d)); + picture = QUOTE(PATHTOF(textures\m47_dragon_item_ca.paa)); }; class ACE_M47_Daysight: M47Launcher_EP1 { displayName = $STR_DN_ACE_DRAGONSUP36; // Stay next to tubes in gear dialogs - model = PATHTOF(models\ace_m47_optic.p3d); - picture = PATHTOF(textures\m47_daysight_item_ca.paa); + model = QUOTE(PATHTOF(models\ace_m47_optic.p3d)); + picture = QUOTE(PATHTOF(textures\m47_daysight_item_ca.paa)); optics = 1; weaponInfoType = "RscWeaponEmpty"; modelOptics = "\ca\Weapons_e\optics_m47"; diff --git a/addons/wep_dragon/config.cpp b/addons/wep_dragon/config.cpp index 775fd26357..235e643b18 100644 --- a/addons/wep_dragon/config.cpp +++ b/addons/wep_dragon/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = { "ACE_M47_Static" }; weapons[] = { "ACE_M47StaticLauncher", "M47Launcher_EP1", "ACE_M47_Daysight" }; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "uo_main", "a3_data_f", "a3_static_f"}; + requiredAddons[] = { "ace_main", "ace_common" }; version = VERSION; }; }; diff --git a/addons/wep_dragon/fnc_dragon_fired.sqf b/addons/wep_dragon/functions/fnc_dragon_fired.sqf similarity index 100% rename from addons/wep_dragon/fnc_dragon_fired.sqf rename to addons/wep_dragon/functions/fnc_dragon_fired.sqf diff --git a/addons/wep_dragon/functions/script_component.hpp b/addons/wep_dragon/functions/script_component.hpp new file mode 100644 index 0000000000..0aae3f8cee --- /dev/null +++ b/addons/wep_dragon/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\wep_dragon\script_component.hpp" \ No newline at end of file diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index c47e95b44c..07a1e33d41 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = { "uo_main", "ace__laser", "a3_ui_f", "a3_weapons_f" }; + requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; version = VERSION; }; }; diff --git a/addons/wep_javelin/fnc_fired.sqf b/addons/wep_javelin/functions/fnc_fired.sqf similarity index 100% rename from addons/wep_javelin/fnc_fired.sqf rename to addons/wep_javelin/functions/fnc_fired.sqf diff --git a/addons/wep_javelin/fnc_onGetLockedTarget.sqf b/addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf similarity index 100% rename from addons/wep_javelin/fnc_onGetLockedTarget.sqf rename to addons/wep_javelin/functions/fnc_onGetLockedTarget.sqf diff --git a/addons/wep_javelin/functions/script_component.hpp b/addons/wep_javelin/functions/script_component.hpp new file mode 100644 index 0000000000..fdc194ff7b --- /dev/null +++ b/addons/wep_javelin/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\wep_javelin\script_component.hpp" \ No newline at end of file diff --git a/extras/blank_module/CfgEventHandlers.hpp b/extras/blank_module/CfgEventHandlers.hpp index 8af0265fe2..51c0e909d7 100644 --- a/extras/blank_module/CfgEventHandlers.hpp +++ b/extras/blank_module/CfgEventHandlers.hpp @@ -1,5 +1,5 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); - }; + class ADDON { + init = QUOTE( call compile preprocessFileLineNumbers PATHTOF(XEH_preInit.sqf) ); + }; }; \ No newline at end of file diff --git a/extras/blank_module/config.cpp b/extras/blank_module/config.cpp index 628865c703..6c8d8ca938 100644 --- a/extras/blank_module/config.cpp +++ b/extras/blank_module/config.cpp @@ -1,17 +1,17 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {"ace_core"}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {""}; - authorUrl = ""; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.60; + requiredAddons[] = {"ace_core"}; + version = "0.95"; + versionStr = "0.95"; + versionAr[] = {0,95,0}; + author[] = {""}; + authorUrl = ""; + }; }; #include "CfgEventHandlers.hpp" \ No newline at end of file diff --git a/extras/blank_module/script_component.hpp b/extras/blank_module/script_component.hpp index 40058509c2..efce15f539 100644 --- a/extras/blank_module/script_component.hpp +++ b/extras/blank_module/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_BLANK - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_BLANK - #define DEBUG_SETTINGS DEBUG_SETTINGS_BLANK + #define DEBUG_SETTINGS DEBUG_SETTINGS_BLANK #endif #include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/tools/ace_build_tool/make.cfg b/tools/ace_build_tool/make.cfg new file mode 100644 index 0000000000..1eb02b826f --- /dev/null +++ b/tools/ace_build_tool/make.cfg @@ -0,0 +1,73 @@ +# EXAMPLE MAKE.CFG FILE +# Please see the comments for each option. Most options can be left +# off for sane defaults. + +################################################################# +# Default make target +################################################################# +[DEFAULT] + +# Project name (with @ symbol) +# This is used for naming the release files. +# Default: Current folder name +project = @ace + +# Path to project secret key for signing +# Make sure this isn't in your public repository! +# Default: None +# key = D:\Program Files (x86)\Bohemia Interactive\Tools\DSSignFile Tools\keys\ace_preAlpha.biprivatekey + +# If set to True, the make system will attempt to autodetect addons in the +# current folder by looking for directories with 'config.cpp' in them. +# Default: True +# module_autodetect = True + +# List of directories to ignore when autodetecting addons. +# Default: release +# ignore = release, my_unfinished_module + +# If autodetect is set to False, only folders whose names are in this list +# will be built as modules. +# Default: None +# modules = my_module, my_supporting_module + +# This is the folder hierarchy that will be used as prefix inside the PBO. +# Default: None +prefix = z\ace\addons + +# Set the location where the addon source folders (i.e. P:\z\ace\addons) +# Default: \\addons +module_root = P:\z\ace\addons + +# Directory where the built addon will be saved. +# Default: release +release_dir = P:\z\ace\release + +# This string will be prefixed to all build PBO file names. +# Default: None +pbo_name_prefix = ace_ + +# Which build tool will be used? Options: pboproject, addonbuilder +# Default: addonbuilder +build_tool = pboproject + +################################################################## +# Alternate build target using a different key +################################################################### +# [DifferentKey] +# key = C:\Keys\different.biprivatekey + +################################################################## +# Alternate build target ignoring some modules when detecting +################################################################### +# [IgnoreSome] +# key = C:\Keys\different.biprivatekey +# ignore = release, my_server_module, my_private_module + +################################################################## +# Alternate build target with fixed build list +################################################################### +# [Fixed] +# module_autodetect = False +# modules = my_module, my_other_module + diff --git a/tools/ace_build_tool/make.py b/tools/ace_build_tool/make.py new file mode 100644 index 0000000000..5354e90b1c --- /dev/null +++ b/tools/ace_build_tool/make.py @@ -0,0 +1,763 @@ +#!/usr/bin/env python +# vim: set fileencoding=utf-8 : + +# make.py +# An Arma 3 addon build system + +############################################################################### + +# The MIT License (MIT) + +# Copyright (c) 2013-2014 Ryan Schultz + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +############################################################################### + +__version__ = "0.3dev" + +import sys + +if sys.version_info[0] == 2: + print("Python 3 is required.") + sys.exit(1) + +import os +import os.path +import shutil +import platform +import glob +import subprocess +import hashlib +import configparser +import json +import traceback + +if sys.platform == "win32": + import winreg + +############################################################################### +# http://akiscode.com/articles/sha-1directoryhash.shtml +# Copyright (c) 2009 Stephen Akiki +# MIT License (Means you can do whatever you want with this) +# See http://www.opensource.org/licenses/mit-license.php +# Error Codes: +# -1 -> Directory does not exist +# -2 -> General error (see stack traceback) +def get_directory_hash(directory): + directory_hash = hashlib.sha1() + if not os.path.exists (directory): + return -1 + + try: + for root, dirs, files in os.walk(directory): + for names in files: + path = os.path.join(root, names) + try: + f = open(path, 'rb') + except: + # You can't open the file for some reason + f.close() + continue + + while 1: + # Read file in as little chunks + buf = f.read(4096) + if not buf: break + new = hashlib.sha1(buf) + directory_hash.update(new.digest()) + f.close() + + except: + # Print the stack traceback + traceback.print_exc() + return -2 + + return directory_hash.hexdigest() + +# Copyright (c) AndrĂ© Burgaud +# http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ +if sys.platform == "win32": + from ctypes import windll, Structure, c_short, c_ushort, byref + + SHORT = c_short + WORD = c_ushort + + class COORD(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("X", SHORT), + ("Y", SHORT)] + + class SMALL_RECT(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("Left", SHORT), + ("Top", SHORT), + ("Right", SHORT), + ("Bottom", SHORT)] + + class CONSOLE_SCREEN_BUFFER_INFO(Structure): + """struct in wincon.h.""" + _fields_ = [ + ("dwSize", COORD), + ("dwCursorPosition", COORD), + ("wAttributes", WORD), + ("srWindow", SMALL_RECT), + ("dwMaximumWindowSize", COORD)] + + # winbase.h + STD_INPUT_HANDLE = -10 + STD_OUTPUT_HANDLE = -11 + STD_ERROR_HANDLE = -12 + + # wincon.h + FOREGROUND_BLACK = 0x0000 + FOREGROUND_BLUE = 0x0001 + FOREGROUND_GREEN = 0x0002 + FOREGROUND_CYAN = 0x0003 + FOREGROUND_RED = 0x0004 + FOREGROUND_MAGENTA = 0x0005 + FOREGROUND_YELLOW = 0x0006 + FOREGROUND_GREY = 0x0007 + FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified. + + BACKGROUND_BLACK = 0x0000 + BACKGROUND_BLUE = 0x0010 + BACKGROUND_GREEN = 0x0020 + BACKGROUND_CYAN = 0x0030 + BACKGROUND_RED = 0x0040 + BACKGROUND_MAGENTA = 0x0050 + BACKGROUND_YELLOW = 0x0060 + BACKGROUND_GREY = 0x0070 + BACKGROUND_INTENSITY = 0x0080 # background color is intensified. + + stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) + SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute + GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo + + def get_text_attr(): + """Returns the character attributes (colors) of the console screen + buffer.""" + csbi = CONSOLE_SCREEN_BUFFER_INFO() + GetConsoleScreenBufferInfo(stdout_handle, byref(csbi)) + return csbi.wAttributes + + def set_text_attr(color): + """Sets the character attributes (colors) of the console screen + buffer. Color is a combination of foreground and background color, + foreground and background intensity.""" + SetConsoleTextAttribute(stdout_handle, color) +############################################################################### + +def find_bi_tools(work_drive): + """Find BI tools.""" + + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + try: + k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") + arma3tools_path = winreg.QueryValueEx(k, "path")[0] + winreg.CloseKey(k) + except: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + + addonbuilder_path = os.path.join(arma3tools_path, "AddonBuilder", "AddonBuilder.exe") + dssignfile_path = os.path.join(arma3tools_path, "DSSignFile", "DSSignFile.exe") + dscreatekey_path = os.path.join(arma3tools_path, "DSSignFile", "DSCreateKey.exe") + + if os.path.isfile(addonbuilder_path) and os.path.isfile(dssignfile_path) and os.path.isfile(dscreatekey_path): + return [addonbuilder_path, dssignfile_path, dscreatekey_path] + else: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + +def find_depbo_tools(): + """Use registry entries to find DePBO-based tools.""" + + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + try: + k = winreg.OpenKey(reg, r"Software\Mikero\pboProject") + try: + pboproject_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found pboproject.") + except: + print_error("ERROR: Could not find pboProject.") + + k = winreg.OpenKey(reg, r"Software\Mikero\rapify") + try: + rapify_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found rapify.") + except: + print_error("Could not find rapify.") + + k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo") + try: + makepbo_path = winreg.QueryValueEx(k, "exe")[0] + winreg.CloseKey(k) + print("Found makepbo.") + except: + print_error("Could not find makepbo.") + except: + raise Exception("BadDePBO", "DePBO tools not installed correctly") + + #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. + return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] + +def color(color): + """Set the color. Works on Win32 and normal terminals.""" + if sys.platform == "win32": + if color == "green": + set_text_attr(FOREGROUND_GREEN | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "red": + set_text_attr(FOREGROUND_RED | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "blue": + set_text_attr(FOREGROUND_BLUE | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) + elif color == "reset": + set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) + elif color == "grey": + set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) + else : + if color == "green": + sys.stdout.write('\033[92m') + elif color == "red": + sys.stdout.write('\033[91m') + elif color == "blue": + sys.stdout.write('\033[94m') + elif color == "reset": + sys.stdout.write('\033[0m') + +def print_error(msg): + color("red") + print ("ERROR: " + msg) + color("reset") + +def print_green(msg): + color("green") + print(msg) + color("reset") + +def print_blue(msg): + color("blue") + print(msg) + color("reset") + +def print_yellow(msg): + color("yellow") + print(msg) + color("reset") + +############################################################################### + +def main(argv): + """Build an Arma addon suite in a directory from rules in a make.cfg file.""" + print_blue(("\nmake.py for Arma, v" + __version__)) + + if sys.platform != "win32": + print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") + sys.exit(1) + + reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) + try: + k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") + arma3tools_path = winreg.QueryValueEx(k, "path")[0] + winreg.CloseKey(k) + except: + raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") + + # Default behaviors + test = False # Copy to Arma 3 directory? + arg_modules = False # Only build modules on command line? + make_release = False # Make zip file from the release? + release_version = 0 # Version of release + use_pboproject = True # Default to pboProject build tool + make_target = "DEFAULT" # Which section in make.cfg to use for the build + new_key = False # Make a new key and use it to sign? + quiet = False # Suppress output from build tool? + + # Parse arguments + if "help" in argv or "-h" in argv or "--help" in argv: + print (""" +make.py [help] [test] [force] [key ] [target ] [release ] + [module name] [module name] [...] + +test -- Copy result to Arma 3. +release -- Make archive with . +force -- Ignore cache and build all. +target -- Use rules in make.cfg under heading [] rather than + default [Make] +key -- Use key in working directory with to sign. If it does not + exist, create key. +quiet -- Suppress command line output from build tool. + +If module names are specified, only those modules will be built. + +Examples: + make.py force test + Build all modules (ignoring cache) and copy the mod folder to the Arma 3 + directory. + make.py mymodule_gun + Only build the module named 'mymodule_gun'. + make.py force key MyNewKey release 1.0 + Build all modules (ignoring cache), sign them with NewKey, and pack them + into a zip file for release with version 1.0. + + +If a file called $NOBIN$ is found in the module directory, that module will not be binarized. + +See the make.cfg file for additional build options. +""") + sys.exit(0) + + if "force" in argv: + argv.remove("force") + force_build = True + else: + force_build = False + + if "test" in argv: + test = True + argv.remove("test") + + if "release" in argv: + make_release = True + release_version = argv[argv.index("release") + 1] + argv.remove(release_version) + argv.remove("release") + + if "target" in argv: + make_target = argv[argv.index("target") + 1] + argv.remove("target") + argv.remove(make_target) + force_build = True + + if "key" in argv: + new_key = True + key_name = argv[argv.index("key") + 1] + argv.remove("key") + argv.remove(key_name) + + if "quiet" in argv: + quiet = True + argv.remove("quiet") + + # Get the directory the make script is in. + make_root = os.path.dirname(os.path.realpath(__file__)) + make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) + os.chdir(make_root) + + cfg = configparser.ConfigParser(); + try: + cfg.read(os.path.join(make_root, "make.cfg")) + + # Project name (with @ symbol) + project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) + + # Private key path + key = cfg.get(make_target, "key", fallback=None) + + # Project prefix (folder path) + prefix = cfg.get(make_target, "prefix", fallback="") + + # Should we autodetect modules on a complete build? + module_autodetect = cfg.getboolean(make_target, "module_autodetect", fallback=True) + + # Manual list of modules to build for a complete build + modules = cfg.get(make_target, "modules", fallback=None) + # Parse it out + if modules: + modules = [x.strip() for x in modules.split(',')] + else: + modules = [] + + # List of directories to ignore when detecting + ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] + + # BI Tools work drive on Windows + work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") + + # Which build tool should we use? + build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() + + # Release/build directory, relative to script dir + release_dir = cfg.get(make_target, "release_dir", fallback="release") + + # Project PBO file prefix (files are renamed to prefix_name.pbo) + pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None) + + # Project module Root + module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) + module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) + print_green ("module_root: " + module_root) + if (os.path.isdir(module_root)): + os.chdir(module_root) + else: + print_error ("Directory " + module_root + " does not exist.") + sys.exit() + + except: + raise + print_error("Could not parse make.cfg.") + sys.exit(1) + + + + # See if we have been given specific modules to build from command line. + if len(argv) > 1 and not make_release: + arg_modules = True + modules = argv[1:] + + # Find the tools we need. + try: + tools = find_bi_tools(work_drive) + addonbuilder = tools[0] + dssignfile = tools[1] + dscreatekey = tools[2] + + except: + print_error("Arma 3 Tools are not installed correctly or the P: drive has not been created.") + sys.exit(1) + + if build_tool == "pboproject": + try: + depbo_tools = find_depbo_tools() + pboproject = depbo_tools[0] + rapifyTool = depbo_tools[1] + makepboTool = depbo_tools[2] + except: + raise + print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") + sys.exit(1) + + # Try to open and deserialize build cache file. + try: + cache = {} + with open(os.path.join(make_root, "make.cache"), 'r') as f: + cache_raw = f.read() + + cache = json.loads(cache_raw) + + except: + print ("No cache found.") + cache = {} + + # Get list of subdirs in make root. + dirs = next(os.walk(module_root))[1] + + # Autodetect what directories to build. + if module_autodetect and not arg_modules: + modules = [] + for path in dirs: + # Any dir that has a config.cpp in its root is an addon to build. + config_path = os.path.join(path, 'config.cpp') + if os.path.isfile(config_path) and not path in ignore: + modules.append(path) + + # Make the key specified from command line if necessary. + if new_key: + if not os.path.isfile(os.path.join(module_root, key_name + ".biprivatekey")): + print_green("\nRequested key does not exist.") + ret = subprocess.call([dscreatekey, key_name]) # Created in make_root + if ret == 0: + print_blue("Created: " + os.path.join(module_root, key_name + ".biprivatekey")) + else: + print_error("Failed to create key!") + + try: + print_blue("Copying public key to release directory.") + + try: + os.makedirs(os.path.join(module_root, release_dir, "Keys")) + except: + pass + + shutil.copyfile(os.path.join(module_root, key_name + ".bikey"), os.path.join(module_root, release_dir, "Keys", key_name + ".bikey")) + + except: + raise + print_error("Could not copy key to release directory.") + + else: + print_green("\nNOTE: Using key " + os.path.join(module_root, key_name + ".biprivatekey")) + + key = os.path.join(module_root, key_name + ".biprivatekey") + + + # For each module, prep files and then build. + for module in modules: + print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) + + # Cache check + if module in cache: + old_sha = cache[module] + else: + old_sha = "" + + # Hash the module + new_sha = get_directory_hash(os.path.join(module_root, module)) + + # Check if it needs rebuilt + # print ("Hash:", new_sha) + if old_sha == new_sha: + if not force_build: + print("Module has not changed.") + # Skip everything else + continue + + # Only do this if the project isn't stored directly on the work drive. + # Split the path at the drive name and see if they are on the same drive (usually P:) + if os.path.splitdrive(module_root)[0] != os.path.splitdrive(work_drive)[0]: + try: + # Remove old work drive version (ignore errors) + shutil.rmtree(os.path.join(work_drive, prefix, module), True) + + # Copy module to the work drive + shutil.copytree(module, os.path.join(work_drive, prefix, module)) + + except: + raise + print_error("ERROR: Could not copy module to work drive. Does the module exist?") + input("Press Enter to continue...") + print("Resuming build...") + continue + else: + print("WARNING: Module is stored on work drive (" + work_drive + ").") + + try: + # Remove the old pbo, key, and log + old = os.path.join(module_root, release_dir, project, "Addons", module) + "*" + files = glob.glob(old) + for f in files: + os.remove(f) + + if pbo_name_prefix: + old = os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module) + "*" + files = glob.glob(old) + for f in files: + os.remove(f) + except: + raise + print_error("ERROR: Could not copy module to work drive. Does the module exist?") + input("Press Enter to continue...") + print("Resuming build...") + continue + + # Build the module into a pbo + print_blue("Building: " + os.path.join(work_drive, prefix, module)) + print_blue("Destination: " + os.path.join(module_root, release_dir, project, "Addons")) + + # Make destination folder (if needed) + try: + os.makedirs(os.path.join(module_root, release_dir, project, "Addons")) + except: + pass + + # Run build tool + build_successful = False + if build_tool == "pboproject": + try: + # Call pboProject + os.chdir("P:\\") + + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): + print_green("$NOBIN$ Found. Proceeding with non-binarizing!") + cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] + + else: + cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] + + color("grey") + if quiet: + devnull = open(os.devnull, 'w') + ret = subprocess.call(cmd, stdout=devnull) + devnull.close() + else: + ret = subprocess.call(cmd) + color("reset") + + if ret == 0: + print_green("pboProject return code == " + str(ret)) + # Prettyprefix rename the PBO if requested. + if pbo_name_prefix: + try: + os.rename(os.path.join(module_root, release_dir, project, "Addons", module+".pbo"), os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) + except: + raise + print_error("Could not rename built PBO with prefix.") + # Sign result + if key: + print("Signing with " + key + ".") + if pbo_name_prefix: + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) + else: + ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", module + ".pbo")]) + + if ret == 0: + build_successful = True + else: + build_successful = True + + if not build_successful: + print_error("pboProject return code == " + str(ret)) + print_error("Module not successfully built/signed.") + #input("Press Enter to continue...") + print ("Resuming build...") + continue + + # Back to the root + os.chdir(module_root) + + except: + raise + print_error("Could not run Addon Builder.") + input("Press Enter to continue...") + print ("Resuming build...") + continue + + elif build_tool== "addonbuilder": + # Detect $NOBIN$ and do not binarize if found. + if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): + do_binarize = False + print("$NOBIN$ file found in module, packing only.") + else: + do_binarize = True + try: + # Call AddonBuilder + os.chdir("P:\\") + + cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "Addons"), "-clear", "-project="+work_drive] + if not do_binarize: + cmd.append("-packonly") + + if quiet: + previousDirectory = os.getcwd() + os.chdir(arma3tools_path) + devnull = open(os.devnull, 'w') + ret = subprocess.call(cmd, stdout=devnull) + devnull.close() + os.chdir(previousDirectory) + else: + previousDirectory = os.getcwd() + os.chdir(arma3tools_path) + print_error("Current directory - " + os.getcwd()) + ret = subprocess.call(cmd) + os.chdir(previousDirectory) + print_error("Current directory - " + os.getcwd()) + color("reset") + print_green("completed") + # Prettyprefix rename the PBO if requested. + if pbo_name_prefix: + try: + os.rename(os.path.join(make_root, release_dir, project, "Addons", module+".pbo"), os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) + except: + raise + print_error("Could not rename built PBO with prefix.") + + if ret == 0: + # Sign result + if key: + print("Signing with " + key + ".") + if pbo_name_prefix: + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) + else: + ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", module + ".pbo")]) + + if ret == 0: + build_successful = True + else: + build_successful = True + + if not build_successful: + print_error("Module not successfully built.") + + # Back to the root + os.chdir(make_root) + + except: + raise + print_error("Could not run Addon Builder.") + input("Press Enter to continue...") + print ("Resuming build...") + continue + + else: + print_error("Unknown build_tool " + build_tool + "!") + + # Update the hash for a successfully built module + if build_successful: + cache[module] = new_sha + + # Done building all modules! + + # Write out the cache state + cache_out = json.dumps(cache) + with open(os.path.join(make_root, "make.cache"), 'w') as f: + f.write(cache_out) + + # Delete the pboproject temp files if building a release. + if make_release and build_tool == "pboproject": + try: + shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True) + except: + print_error("ERROR: Could not delete pboProject temp files.") + + print_green("\nDone.") + + # Make release + if make_release: + print_blue("\nMaking release: " + project + "-" + release_version + ".zip") + + try: + # Delete all log files + for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "Addons")): + for currentFile in files: + if currentFile.lower().endswith("log"): + os.remove(os.path.join(root, currentFile)) + + # Create a zip with the contents of release/ in it + shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir)) + except: + raise + print_error("Could not make release.") + + # Copy to Arma 3 folder for testing + if test: + print_blue("\nCopying to Arma 3.") + + if sys.platform == "win32": + reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) + try: + k = winreg.OpenKey(reg, r"SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3") + a3_path = winreg.EnumValue(k, 1)[1] + winreg.CloseKey(k) + except: + print_error("Could not find Arma 3's directory in the registry.") + else: + a3_path = cygwin_a3path + + if os.path.exists(a3_path): + try: + shutil.rmtree(os.path.join(a3_path, project), True) + shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project)) + except: + print_error("Could not copy files. Is Arma 3 running?") + +if __name__ == "__main__": + main(sys.argv) +input("Press Enter to continue...") \ No newline at end of file diff --git a/tools/build.bat b/tools/build.bat index 837aee5490..32973803dc 100644 --- a/tools/build.bat +++ b/tools/build.bat @@ -1,4 +1,6 @@ pushd ..\addons\ for /D %%i in (*.*) do ( makepbo -NUP -@=z\addons\ace\%%i %%i ace_%%i.pbo + if %errorlevel% neq 0 exit /b %errorlevel% ) +popd diff --git a/tools/rename_fn.py b/tools/rename_fn.py new file mode 100644 index 0000000000..a6ebfa5056 --- /dev/null +++ b/tools/rename_fn.py @@ -0,0 +1,13 @@ +import os + +for root, dirs, files in os.walk(os.getcwd()): + for filename in files: + oldname = filename + newname = filename.replace('fn_', 'fnc_') + + print os.path.join(root,oldname) + print newname + if newname != oldname: + print os.path.join(root,oldname) + print oldname + ' -> ' + newname + os.rename(os.path.join(root,oldname), os.path.join(root,newname)) \ No newline at end of file diff --git a/tools/stringtablediag.py b/tools/stringtablediag.py new file mode 100755 index 0000000000..3e4d906158 --- /dev/null +++ b/tools/stringtablediag.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python3 + +import os +import sys + +from xml.dom import minidom + +# STRINGTABLE DIAG TOOL +# Author: KoffeinFlummi +# --------------------- +# Checks for missing translations and all that jazz. + +def get_all_languages(projectpath): + """ Checks what languages exist in the repo. """ + languages = [] + + for module in os.listdir(projectpath): + if module[0] == ".": + continue + + stringtablepath = os.path.join(projectpath, module, "stringtable.xml") + try: + xmldoc = minidom.parse(stringtablepath) + except: + continue + + keys = xmldoc.getElementsByTagName("Key") + for key in keys: + for child in key.childNodes: + try: + if not child.tagName in languages: + languages.append(child.tagName) + except: + continue + + return languages + +def check_module(projectpath, module, languages): + """ Checks the given module for all the different languages. """ + localized = [] + + stringtablepath = os.path.join(projectpath, module, "stringtable.xml") + try: + xmldoc = minidom.parse(stringtablepath) + except: + return 0, localized + + keynumber = len(xmldoc.getElementsByTagName("Key")) + + for language in languages: + localized.append(len(xmldoc.getElementsByTagName(language))) + + return keynumber, localized + +def main(): + scriptpath = os.path.realpath(__file__) + projectpath = os.path.dirname(os.path.dirname(scriptpath)) + projectpath = os.path.join(projectpath, "addons") + + print("#########################") + print("# Stringtable Diag Tool #") + print("#########################") + + languages = get_all_languages(projectpath) + + print("\nLanguages present in the repo:") + print(", ".join(languages)) + + keysum = 0 + localizedsum = list(map(lambda x: 0, languages)) + missing = list(map(lambda x: [], languages)) + + for module in os.listdir(projectpath): + keynumber, localized = check_module(projectpath, module, languages) + + if keynumber == 0: + continue + + print("\n# " + module) + + keysum += keynumber + for i in range(len(localized)): + print(" %s %s / %i" % ((languages[i]+":").ljust(10), str(localized[i]).ljust(3), keynumber)) + localizedsum[i] += localized[i] + if localized[i] < keynumber: + missing[i].append(module) + + print("\n###########") + print("# RESULTS #") + print("###########") + + print("\nTotal number of keys: %i\n" % (keysum)) + + for i in range(len(languages)): + if localizedsum[i] == keysum: + print("%s No missing stringtable entries." % ((languages[i] + ":").ljust(12))) + else: + print("%s %s missing stringtable entry/entries." % ((languages[i] + ":").ljust(12), str(keysum - localizedsum[i]).rjust(4)), end="") + print(" ("+", ".join(missing[i])+")") + + print("\n\n### MARKDOWN ###") + + print("\nTotal number of keys: %i\n" % (keysum)) + + print("| Language | Missing Entries | Relevant Modules | % done |") + print("|----------|----------------:|------------------|--------|") + + for i, language in enumerate(languages): + if localizedsum[i] == keysum: + print("| {} | 0 | - | 100% |".format(language)) + else: + print("| {} | {} | {} | {}% |".format( + language, + keysum - localizedsum[i], + ", ".join(missing[i]), + round(100 * localizedsum[i] / keysum))) + +if __name__ == "__main__": + main() diff --git a/tools/stringtableduplicates.py b/tools/stringtableduplicates.py new file mode 100644 index 0000000000..d72cc3e6f6 --- /dev/null +++ b/tools/stringtableduplicates.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 + +import os +import sys +from xml.dom import minidom + +# STRINGTABLE DUPLICATE FINDER +# Author: KoffeinFlummi +# ---------------------------- +# Counts duplicate stringtable entries + +def main(): + scriptpath = os.path.realpath(__file__) + projectpath = os.path.dirname(os.path.dirname(scriptpath)) + projectpath = os.path.join(projectpath, "addons") + + entries = {} + + for module in os.listdir(projectpath): + if module[0] == ".": + continue + stringtablepath = os.path.join(projectpath, module, "stringtable.xml") + try: + xmldoc = minidom.parse(stringtablepath) + except: + continue + + keys = xmldoc.getElementsByTagName("English") + for key in keys: + text = key.firstChild.wholeText + parentid = key.parentNode.getAttribute("ID") + if text in entries: + entries[text].append(parentid) + else: + entries[text] = [parentid] + + entries = {k: v for k, v in entries.items() if len(v) > 1} + output = list([[k, v] for k, v in entries.items()]) + output = sorted(output, key=lambda x: len(x[1])*-1) + + print("Potential duplicate stringtable entries:\n") + for l in output: + k, v = l + print(k.ljust(50), end=" ") + print("Listed %i times in: %s" % (len(v), ", ".join(v))) + + print("\n# MARKDOWN\n") + + print("| Text | # Occurences | Containing Entries |") + print("|------|-------------:|--------------------|") + + for l in output: + print("| %s | %i | %s |" % (l[0], len(l[1]), ", ".join(l[1]))) + +if __name__ == "__main__": + main() diff --git a/tools/stringtablemerger.py b/tools/stringtablemerger.py new file mode 100755 index 0000000000..9558ec081b --- /dev/null +++ b/tools/stringtablemerger.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python3 + +import os +import sys +import re + +from xml.dom import minidom + +# STRINGTABLE MERGER TOOL +# Author: KoffeinFlummi +# -------------------------- +# Automatically merges all stringtable entries +# in the given language from the given dir. + +def get_modules(projectpath): + """ Get all the modules of the project. """ + modules = [] + + for i in os.listdir(projectpath): + path = os.path.join(projectpath, i) + if not os.path.isdir(path): + continue + if i[0] == ".": + continue + modules.append(i) + + return modules + +def contains_language(key, language): + """ Checks whether a given key contains a certain language. """ + for child in key.childNodes: + try: + assert(child.tagName == language) + return True + except: + pass + + return False + +def get_entry_by_id(keys, keyid): + """ Returns the first child of keys with ID='keyid'. """ + for key in keys: + if key.getAttribute("ID") == keyid: + return key + + return False + +def replace_entries(oldpath, newpath, language, breakdown): + """ Replaces all new entries of the given language in the given module. """ + oldfile = minidom.parse(oldpath) + newfile = minidom.parse(newpath) + + oldkeys = oldfile.getElementsByTagName("Key") + newkeys = newfile.getElementsByTagName("Key") + newkeys = list(filter(lambda x: contains_language(x, language), newkeys)) + + for newkey in newkeys: + keyid = newkey.getAttribute("ID") + oldkey = get_entry_by_id(oldkeys, keyid) + + if not oldkey: + continue + + if breakdown: + print(" Merging %s translation for %s" % (language, keyid)) + + newentry = newkey.getElementsByTagName(language)[0].firstChild + + try: + # An entry for this language already exists, overwrite it + oldentry = oldkey.getElementsByTagName(language)[0].firstChild + oldentry.replaceWholeText(newentry.wholeText) + except: + # There is no entry for this language yet, make one + oldentry = oldfile.createElement(language) + oldentry.appendChild(oldfile.createTextNode(newentry.wholeText)) + # Some whitespace tetris to maintain file structure + oldkey.insertBefore(oldfile.createTextNode("\n "), oldkey.lastChild) + oldkey.insertBefore(oldentry, oldkey.lastChild) + + # Make a nice string + xmlstring = oldfile.toxml() + xmlstring = xmlstring.replace('" ?>', '" encoding="utf-8"?>') + + # Replace the newlines that minidom swallows + xmlstring = xmlstring.replace("><", ">\n<") + xmlstring += "\n" + + fhandle = open(oldpath, "w") + fhandle.write(xmlstring) + fhandle.close() + + return len(newkeys) + +def main(sourcepath, language, breakdown): + scriptpath = os.path.realpath(__file__) + projectpath = os.path.dirname(os.path.dirname(scriptpath)) + projectpath = os.path.join(projectpath, "addons") + + modules = get_modules(projectpath) + modulecounter = 0 + keycounter = 0 + + for module in modules: + oldpath = os.path.join(projectpath, module, "stringtable.xml") + newpath = os.path.join(sourcepath, module, "stringtable.xml") + + # Some translators extract the lowercase PBOs, so the module name might + # be lowercase (obviously only matters on Linux) + if not os.path.exists(newpath): + newpath = os.path.join(sourcepath, module.lower(), "stringtable.xml") + + # Translator didn't include this module, skip + if not os.path.exists(newpath): + continue + + keynum = replace_entries(oldpath, newpath, language, breakdown) + modulecounter += 1 + keycounter += keynum + + print("# Merged %i entry/entries in %s" % (keynum, module)) + if breakdown: + print("") + + print("") + print("# Merged %i entry/entries in %i modules" % (keycounter, modulecounter)) + +if __name__ == "__main__": + try: + sourcepath = os.path.normpath(os.path.join(os.getcwd(), sys.argv[1])) + language = sys.argv[2] + + assert(os.path.exists(sourcepath)) + except: + print("ERROR: Missing arguments of invalid path.") + print("\nUsage:") + print("[script] [path to new project] [language]") + sys.exit(1) + + main(sourcepath, language, "--breakdown" in sys.argv)